aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-06-15 22:57:38 +0000
committerKenneth Russel <[email protected]>2009-06-15 22:57:38 +0000
commita959c53b7ac91e489bf0959391e892790b9ff248 (patch)
tree4664742a4f9f6daa694364292e376ad2e6ee97d1
parent506b634b780dcd23aa61015c2ceba3e687196abf (diff)
Copied JOGL_2_SANDBOX r1957 on to trunk; JOGL_2_SANDBOX branch is now closed
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1959 232f8b59-042b-4e1e-8c03-345bb8c30851
-rwxr-xr-xCHANGELOG.txt101
-rwxr-xr-xCOPYRIGHT.txt31
-rwxr-xr-xLICENSE.txt152
-rwxr-xr-xREADME.txt70
-rw-r--r--doxygen/doxygen-all-dev.cfg1260
-rw-r--r--doxygen/doxygen-all-pub.cfg1257
-rw-r--r--doxygen/doxygen-jogl-spec.cfg1254
-rwxr-xr-xetc/profile.jogl105
-rwxr-xr-xmake/142-packages/package-list135
-rwxr-xr-xmake/README-zip-bundles.txt45
-rw-r--r--make/build-gluegen.xml179
-rw-r--r--make/build-jogl.xml2374
-rw-r--r--make/build-nativewindow.xml1348
-rw-r--r--make/build-newt.xml1029
-rw-r--r--make/build-staticglgen.xml91
-rw-r--r--make/build.xml145
-rwxr-xr-xmake/config/intptr.cfg17
-rwxr-xr-xmake/config/jogl/cg-common-CustomJavaCode.java29
-rw-r--r--make/config/jogl/cg-common.cfg118
-rw-r--r--make/config/jogl/cgl-macosx.cfg41
-rwxr-xr-xmake/config/jogl/cglext.cfg44
-rwxr-xr-xmake/config/jogl/egl.cfg70
-rwxr-xr-xmake/config/jogl/eglext.cfg126
-rw-r--r--make/config/jogl/gl-common-extensions.cfg127
-rw-r--r--make/config/jogl/gl-common-gl2.cfg8
-rw-r--r--make/config/jogl/gl-common.cfg641
-rw-r--r--make/config/jogl/gl-desktop-tracker.cfg38
-rwxr-xr-xmake/config/jogl/gl-desktop.cfg67
-rwxr-xr-xmake/config/jogl/gl-es1.cfg88
-rwxr-xr-xmake/config/jogl/gl-es2.cfg72
-rw-r--r--make/config/jogl/gl-gl2.cfg70
-rw-r--r--make/config/jogl/gl-gl2es12.cfg74
-rw-r--r--make/config/jogl/gl-gl3.cfg51
-rwxr-xr-xmake/config/jogl/gl-headers.cfg41
-rw-r--r--make/config/jogl/gl-if-CustomJavaCode-gl.java12
-rw-r--r--make/config/jogl/gl-if-CustomJavaCode-gles2.java3
-rw-r--r--make/config/jogl/gl-if-gl-ignores.cfg523
-rwxr-xr-xmake/config/jogl/gl-if-gl.cfg40
-rwxr-xr-xmake/config/jogl/gl-if-gl2_es1.cfg96
-rwxr-xr-xmake/config/jogl/gl-if-gl2_es2.cfg47
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl2.c24
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl2es12.c24
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gl3.c24
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gles1.c25
-rw-r--r--make/config/jogl/gl-impl-CustomCCode-gles2.c25
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-common.java16
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-desktop.java74
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-embedded.java37
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl2.java474
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java60
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java424
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gl3.java429
-rwxr-xr-xmake/config/jogl/gl-impl-CustomJavaCode-gles1.java355
-rwxr-xr-xmake/config/jogl/gl-impl-CustomJavaCode-gles2.java336
-rwxr-xr-xmake/config/jogl/gl-macosx-nsig.cfg2
-rwxr-xr-xmake/config/jogl/gl-win32-nsig.cfg2
-rwxr-xr-xmake/config/jogl/gl-x11-nsig.cfg2
-rw-r--r--make/config/jogl/gl3-desktop-tracker.cfg38
-rwxr-xr-xmake/config/jogl/gl3-desktop.cfg67
-rwxr-xr-xmake/config/jogl/gl3-headers.cfg29
-rwxr-xr-xmake/config/jogl/glu-CustomJavaCode-base.java1469
-rw-r--r--make/config/jogl/glu-CustomJavaCode-gl2.java562
-rwxr-xr-xmake/config/jogl/glu-CustomJavaCode-gl2es1.java254
-rwxr-xr-xmake/config/jogl/glu-base.cfg28
-rw-r--r--make/config/jogl/glu-common.cfg177
-rwxr-xr-xmake/config/jogl/glu-gl2.cfg80
-rwxr-xr-xmake/config/jogl/glu-gl2es1.cfg26
-rwxr-xr-xmake/config/jogl/glx-CustomCCode.c151
-rw-r--r--make/config/jogl/glx-CustomJavaCode.java46
-rw-r--r--make/config/jogl/glx-x11.cfg83
-rwxr-xr-xmake/config/jogl/glxext.cfg132
-rwxr-xr-xmake/config/jogl/nsig.cfg22
-rwxr-xr-xmake/config/jogl/wgl-CustomCCode.c48
-rw-r--r--make/config/jogl/wgl-win32.cfg44
-rw-r--r--make/config/jogl/wglext.cfg51
-rwxr-xr-xmake/config/nativewindow/jawt-CustomJavaCode.java27
-rwxr-xr-xmake/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java38
-rw-r--r--make/config/nativewindow/jawt-macosx.cfg30
-rw-r--r--make/config/nativewindow/jawt-win32.cfg30
-rw-r--r--make/config/nativewindow/jawt-x11.cfg30
-rwxr-xr-xmake/config/nativewindow/x11-CustomCCode.c165
-rw-r--r--make/config/nativewindow/x11-CustomJavaCode.java26
-rw-r--r--make/config/nativewindow/x11-lib.cfg43
-rw-r--r--make/doc/jogl/spec-overview.html509
-rw-r--r--make/jogl.compiler.xml15
-rw-r--r--make/jogl.properties21
-rw-r--r--make/joglRIversion8
-rwxr-xr-xmake/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj1307
-rwxr-xr-xmake/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj1319
-rwxr-xr-xmake/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj1329
-rwxr-xr-xmake/jogl_wince6_vs9/jogl_wince6.sln202
-rwxr-xr-xmake/jogl_wince6_vs9/jogl_wince6.suobin0 -> 18944 bytes
-rwxr-xr-xmake/jogl_wince6_vs9/newt/newt.vcproj1331
-rw-r--r--make/joglversion8
-rwxr-xr-xmake/lib/wince/arm/nvap/libEGL.libbin0 -> 9314 bytes
-rwxr-xr-xmake/lib/wince/arm/nvap/libGLESv1_CM.libbin0 -> 32500 bytes
-rwxr-xr-xmake/lib/wince/arm/nvap/libGLESv2.libbin0 -> 30670 bytes
-rwxr-xr-xmake/lib/wince/arm/nvap/libKD.libbin0 -> 34346 bytes
-rwxr-xr-xmake/lib/wince/arm/nvap/libnvkdmain.libbin0 -> 3036 bytes
-rwxr-xr-xmake/lib/wince/arm/nvap/libnvomx.libbin0 -> 5962 bytes
-rw-r--r--make/lsGL2toGL3_commons.sh16
-rw-r--r--make/lsGLES2toGL3_commons.sh16
-rw-r--r--make/lsGLtoES1ES2_commons.sh16
-rw-r--r--make/lsGLtoES1_commons.sh17
-rw-r--r--make/lsGLtoES2_commons.sh16
-rw-r--r--make/lsGLtoGL3_commons.sh16
-rw-r--r--make/lstjars.sh105
-rw-r--r--make/make.jogl.all.linux-x86.sh16
-rw-r--r--make/make.jogl.all.linux-x86_64.sh14
-rw-r--r--make/make.jogl.all.macosx.sh9
-rw-r--r--make/make.jogl.all.win32.bat11
-rw-r--r--make/make.jogl.cdcfp.linux-x86.sh22
-rw-r--r--make/make.jogl.doc.all.x86.sh8
-rw-r--r--make/make.jogl.doc.all.x86_64.sh7
-rw-r--r--make/make.jogl.doc.x86_64.sh7
-rwxr-xr-xmake/native-taglet.properties355
-rw-r--r--make/nativewindow.compiler.xml15
-rw-r--r--make/nativewindowRIversion8
-rw-r--r--make/nativewindowversion8
-rw-r--r--make/newt.compiler.xml15
-rw-r--r--make/newtRIversion8
-rw-r--r--make/newtversion8
-rw-r--r--make/nwiRIversion8
-rwxr-xr-xmake/setvc9-jogl.bat9
-rw-r--r--make/stub_includes/cg/CG/cg.h542
-rw-r--r--make/stub_includes/cg/CG/cgGL.h378
-rw-r--r--make/stub_includes/cg/CG/cgGL_profiles.h64
-rw-r--r--make/stub_includes/cg/CG/cg_bindlocations.h339
-rw-r--r--make/stub_includes/cg/CG/cg_datatypes.h192
-rwxr-xr-xmake/stub_includes/cg/CG/cg_enums.h97
-rw-r--r--make/stub_includes/cg/CG/cg_errors.h352
-rw-r--r--make/stub_includes/cg/CG/cg_profiles.h97
-rw-r--r--make/stub_includes/common/stddef.h7
-rw-r--r--make/stub_includes/common/stdint.h17
-rwxr-xr-xmake/stub_includes/egl/EGL/egl.h307
-rwxr-xr-xmake/stub_includes/egl/EGL/eglext.h338
-rwxr-xr-xmake/stub_includes/egl/EGL/eglplatform.h72
-rwxr-xr-xmake/stub_includes/egl/KD/NV_extwindowprops.h32
-rwxr-xr-xmake/stub_includes/egl/KD/NV_multitouch.h70
-rwxr-xr-xmake/stub_includes/egl/KD/kd.h1014
-rwxr-xr-xmake/stub_includes/egl/KD/kdplatform.h83
-rwxr-xr-xmake/stub_includes/egl/window-system-ext.c7
-rwxr-xr-xmake/stub_includes/egl/window-system.c2
-rwxr-xr-xmake/stub_includes/jni/classfile_constants.h523
-rwxr-xr-xmake/stub_includes/jni/jawt.h278
-rwxr-xr-xmake/stub_includes/jni/jdwpTransport.h237
-rwxr-xr-xmake/stub_includes/jni/jni.h1944
-rwxr-xr-xmake/stub_includes/jni/jvmti.h2504
-rw-r--r--make/stub_includes/jni/macosx/AWTCocoaComponent.h15
-rw-r--r--make/stub_includes/jni/macosx/JDWP.h53
-rw-r--r--make/stub_includes/jni/macosx/JDWPCommands.h238
-rw-r--r--make/stub_includes/jni/macosx/jawt_md.h27
-rw-r--r--make/stub_includes/jni/macosx/jni_md.h23
-rw-r--r--make/stub_includes/jni/macosx/jvmdi.h1012
-rw-r--r--make/stub_includes/jni/macosx/jvmpi.h642
-rwxr-xr-xmake/stub_includes/jni/win32/jawt_md.h41
-rwxr-xr-xmake/stub_includes/jni/win32/jni_md.h19
-rw-r--r--make/stub_includes/jni/x11/jawt_md.h43
-rw-r--r--make/stub_includes/jni/x11/jni_md.h24
-rw-r--r--make/stub_includes/macosx/AppKit/NSView.h1
-rw-r--r--make/stub_includes/macosx/OpenGL/OpenGL.h101
-rwxr-xr-xmake/stub_includes/macosx/cglext.c1
-rw-r--r--make/stub_includes/macosx/jni.h78
-rw-r--r--make/stub_includes/macosx/jni_md.h15
-rw-r--r--make/stub_includes/macosx/window-system.c47
-rw-r--r--make/stub_includes/opengl/GL/cglext.h13
-rw-r--r--make/stub_includes/opengl/GL/gl.h1407
-rw-r--r--make/stub_includes/opengl/GL/glext.h8116
-rw-r--r--make/stub_includes/opengl/GL/glu.h408
-rw-r--r--make/stub_includes/opengl/GL/glx.h461
-rw-r--r--make/stub_includes/opengl/GL/glxext.h895
-rw-r--r--make/stub_includes/opengl/GL/wglext.h742
-rwxr-xr-xmake/stub_includes/opengl/GL3/gl3.h1774
-rw-r--r--make/stub_includes/opengl/GL3/gl3ext.h6
-rwxr-xr-xmake/stub_includes/opengl/GLES/gl.h801
-rwxr-xr-xmake/stub_includes/opengl/GLES/glext.h662
-rwxr-xr-xmake/stub_includes/opengl/GLES/glplatform.h74
-rwxr-xr-xmake/stub_includes/opengl/GLES/glu.h1
-rwxr-xr-xmake/stub_includes/opengl/GLES2/gl2.h687
-rwxr-xr-xmake/stub_includes/opengl/GLES2/gl2ext.h251
-rw-r--r--make/stub_includes/opengl/cg.c26
-rw-r--r--make/stub_includes/opengl/gl2.c7
-rw-r--r--make/stub_includes/opengl/gl3.c7
-rwxr-xr-xmake/stub_includes/opengl/gles1.c9
-rwxr-xr-xmake/stub_includes/opengl/gles2.c8
-rw-r--r--make/stub_includes/opengl/glext-64bit-types.h46
-rw-r--r--make/stub_includes/opengl/glu-impl.c3
-rw-r--r--make/stub_includes/opengl/glu.c2
-rw-r--r--make/stub_includes/opengl/macosx-window-system.h50
-rwxr-xr-xmake/stub_includes/openmax/NVOMX_ComponentBase.h342
-rwxr-xr-xmake/stub_includes/openmax/NVOMX_ComponentRegister.h76
-rwxr-xr-xmake/stub_includes/openmax/NVOMX_IndexExtensions.h397
-rwxr-xr-xmake/stub_includes/openmax/OMX_Audio.h1263
-rwxr-xr-xmake/stub_includes/openmax/OMX_Component.h567
-rwxr-xr-xmake/stub_includes/openmax/OMX_ContentPipe.h202
-rwxr-xr-xmake/stub_includes/openmax/OMX_Core.h1390
-rwxr-xr-xmake/stub_includes/openmax/OMX_IVCommon.h896
-rwxr-xr-xmake/stub_includes/openmax/OMX_Image.h318
-rwxr-xr-xmake/stub_includes/openmax/OMX_Index.h256
-rwxr-xr-xmake/stub_includes/openmax/OMX_Other.h325
-rwxr-xr-xmake/stub_includes/openmax/OMX_Types.h359
-rwxr-xr-xmake/stub_includes/openmax/OMX_Video.h1025
-rw-r--r--make/stub_includes/win32/jni.h78
-rw-r--r--make/stub_includes/win32/jni_md.h10
-rwxr-xr-xmake/stub_includes/win32/wglext.c13
-rw-r--r--make/stub_includes/win32/window-system.c2
-rw-r--r--make/stub_includes/win32/windows.h49
-rw-r--r--make/stub_includes/win32/wingdi.h216
-rw-r--r--make/stub_includes/x11/X11/Intrinsic.h1
-rw-r--r--make/stub_includes/x11/X11/X.h35
-rw-r--r--make/stub_includes/x11/X11/Xlib.h1
-rw-r--r--make/stub_includes/x11/X11/Xutil.h37
-rw-r--r--make/stub_includes/x11/glxext.c14
-rw-r--r--make/stub_includes/x11/jni.h78
-rw-r--r--make/stub_includes/x11/jni_md.h15
-rw-r--r--make/stub_includes/x11/window-lib.c62
-rw-r--r--make/stub_includes/x11/window-system.c14
-rw-r--r--make/validate-properties.xml52
-rwxr-xr-xsrc/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java66
-rwxr-xr-xsrc/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java362
-rwxr-xr-xsrc/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java124
-rwxr-xr-xsrc/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java88
-rwxr-xr-xsrc/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java206
-rwxr-xr-xsrc/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java212
-rw-r--r--src/jogl/classes/com/sun/opengl/cg/CgException.java67
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/DRIHack.java127
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/Debug.java93
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java277
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/GLBufferSizeTracker.java188
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java173
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java521
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLContextLock.java126
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java293
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java261
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java180
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java156
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java309
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java275
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp131
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase195
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java192
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/ProjectFloat.java1057
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp10
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase18
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java234
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java62
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java129
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java123
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/awt/Java2D.java570
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java52
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java281
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java195
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java117
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java249
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java73
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java73
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java98
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java260
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java214
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java90
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java90
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java62
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java124
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java1041
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/gl2/Util.java244
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java835
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java1212
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/Glue.java114
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java100
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java49
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java205
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java217
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java862
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java1598
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java56
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java85
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java84
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java96
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java92
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java92
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java97
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java74
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java56
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java69
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java76
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java76
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java70
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java76
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java76
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java1533
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java1413
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java867
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java426
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java2447
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java224
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java258
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java63
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java60
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java90
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java217
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java44
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java155
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java59
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java194
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java130
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java195
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java160
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java238
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java86
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java121
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java56
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java130
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java557
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java179
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java442
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java122
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java184
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java63
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java80
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java79
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java44
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java52
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java44
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java54
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java145
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java75
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java47
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java71
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java282
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java85
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt59
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java128
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java204
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java1167
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java111
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java56
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java79
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java69
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java58
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java140
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java59
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java65
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java71
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java60
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java646
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java65
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java338
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java734
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java288
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java100
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java262
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java278
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java557
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java1353
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java241
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java59
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java396
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java111
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java174
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java57
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java84
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java124
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java64
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java60
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java130
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java100
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java353
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java237
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java64
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java111
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java159
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java101
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java103
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java78
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java64
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java129
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java88
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java111
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java155
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java336
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java392
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java83
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java297
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java443
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java353
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java114
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java103
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java132
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java234
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java439
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java81
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java311
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java442
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java296
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java85
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java142
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java99
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java83
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java100
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java152
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java146
-rw-r--r--src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java163
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/Animator.java208
-rw-r--r--src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java66
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp449
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase499
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/FBObject.java259
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/FPSAnimator.java123
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/FileUtil.java89
-rw-r--r--src/jogl/classes/com/sun/opengl/util/FixedPoint.java61
-rw-r--r--src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java353
-rw-r--r--src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java110
-rw-r--r--src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java209
-rw-r--r--src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java215
-rw-r--r--src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java11
-rw-r--r--src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java65
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/Gamma.java107
-rw-r--r--src/jogl/classes/com/sun/opengl/util/ImmModeSink.java974
-rw-r--r--src/jogl/classes/com/sun/opengl/util/Locator.java137
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/PMVMatrix.java685
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/StreamUtil.java98
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/TGAWriter.java118
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java127
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/awt/Overlay.java214
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/awt/Screenshot.java432
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java1951
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java699
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java69
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java63
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java56
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java1342
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java2078
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java2079
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java1798
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java1808
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java1917
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java1797
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java2080
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java2491
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java2491
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java63
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java66
-rw-r--r--src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java57
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java601
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java60
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java367
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java212
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java648
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java398
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java81
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java331
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java554
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp16
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp22
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp70
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp47
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfpbin0 -> 1108 bytes
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvpbin0 -> 2344 bytes
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvpbin0 -> 8787 bytes
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfpbin0 -> 2392 bytes
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl14
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl19
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl10
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl26
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp35
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl18
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl15
-rw-r--r--src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl12
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat9
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat9
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java184
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java53
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java99
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/Level.java275
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java213
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/Rect.java170
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java47
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java306
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/packrect/package.html7
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/Texture.java1109
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java79
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/TextureData.java342
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp1232
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase1234
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java493
-rw-r--r--src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java119
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp890
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase919
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java223
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java165
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java670
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp417
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase420
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java165
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java57
-rw-r--r--src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java100
-rw-r--r--src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureWriter.java119
-rw-r--r--src/jogl/classes/com/sun/openmax/OMXEventListener.java14
-rw-r--r--src/jogl/classes/com/sun/openmax/OMXInstance.java509
-rw-r--r--src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java239
-rw-r--r--src/jogl/classes/javax/media/opengl/GLArrayData.java114
-rw-r--r--src/jogl/classes/javax/media/opengl/GLAutoDrawable.java211
-rw-r--r--src/jogl/classes/javax/media/opengl/GLBase.java129
-rw-r--r--src/jogl/classes/javax/media/opengl/GLCapabilities.java329
-rw-r--r--src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java55
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java261
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawable.java160
-rw-r--r--src/jogl/classes/javax/media/opengl/GLDrawableFactory.java291
-rw-r--r--src/jogl/classes/javax/media/opengl/GLEventListener.java92
-rw-r--r--src/jogl/classes/javax/media/opengl/GLException.java68
-rw-r--r--src/jogl/classes/javax/media/opengl/GLPbuffer.java91
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java836
-rw-r--r--src/jogl/classes/javax/media/opengl/GLUniformData.java156
-rwxr-xr-xsrc/jogl/classes/javax/media/opengl/Threading.java166
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java52
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java75
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java710
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java1582
-rw-r--r--src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java49
-rw-r--r--src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java76
-rw-r--r--src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java38
-rwxr-xr-xsrc/jogl/classes/javax/media/opengl/glu/GLUnurbs.java8
-rwxr-xr-xsrc/jogl/classes/javax/media/opengl/glu/GLUquadric.java33
-rwxr-xr-xsrc/jogl/classes/javax/media/opengl/glu/GLUtessellator.java66
-rwxr-xr-xsrc/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java356
-rwxr-xr-xsrc/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java84
-rw-r--r--src/jogl/native/GLXGetProcAddressARB.c53
-rwxr-xr-xsrc/jogl/native/audio/Mixer.cpp199
-rw-r--r--src/jogl/native/macosx/ContextUpdater.h40
-rw-r--r--src/jogl/native/macosx/ContextUpdater.m83
-rw-r--r--src/jogl/native/macosx/MacOSXWindowSystemInterface.m702
-rw-r--r--src/jogl/native/openmax/com_sun_openmax_OMXInstance.c255
-rw-r--r--src/jogl/native/openmax/omx_tool.c1713
-rw-r--r--src/jogl/native/openmax/omx_tool.h165
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java93
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java43
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java124
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java149
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java138
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java114
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java131
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java71
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java100
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java168
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java47
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java152
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java170
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java136
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java132
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java105
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11NativeWindowFactory.java77
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java125
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java87
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java77
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java58
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java55
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/Capabilities.java259
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java68
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java153
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java103
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java68
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java71
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java208
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java176
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java68
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java352
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java73
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java132
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java86
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java95
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java50
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/macosx/MacOSXGraphicsDevice.java50
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/package.html111
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java50
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java76
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java55
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java91
-rw-r--r--src/nativewindow/native/JAWT_DrawingSurfaceInfo.c65
-rw-r--r--src/nativewindow/native/x11/Xinerama.c316
-rw-r--r--src/nativewindow/native/x11/Xinerama.h76
-rw-r--r--src/nativewindow/native/x11/XineramaHelper.c126
-rw-r--r--src/nativewindow/native/x11/extutil.h222
-rw-r--r--src/nativewindow/native/x11/panoramiXext.h54
-rw-r--r--src/nativewindow/native/x11/panoramiXproto.h196
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Display.java109
-rw-r--r--src/newt/classes/com/sun/javafx/newt/Event.java77
-rw-r--r--src/newt/classes/com/sun/javafx/newt/EventListener.java43
-rw-r--r--src/newt/classes/com/sun/javafx/newt/InputEvent.java97
-rw-r--r--src/newt/classes/com/sun/javafx/newt/KeyEvent.java738
-rw-r--r--src/newt/classes/com/sun/javafx/newt/KeyListener.java42
-rw-r--r--src/newt/classes/com/sun/javafx/newt/MouseEvent.java110
-rw-r--r--src/newt/classes/com/sun/javafx/newt/MouseListener.java47
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/NewtFactory.java140
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Screen.java139
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Window.java664
-rw-r--r--src/newt/classes/com/sun/javafx/newt/WindowEvent.java67
-rw-r--r--src/newt/classes/com/sun/javafx/newt/WindowListener.java42
-rw-r--r--src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java264
-rw-r--r--src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java54
-rw-r--r--src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java65
-rw-r--r--src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java437
-rw-r--r--src/newt/classes/com/sun/javafx/newt/impl/Debug.java93
-rw-r--r--src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java143
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java49
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java50
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java514
-rw-r--r--src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java652
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java68
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java53
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java154
-rw-r--r--src/newt/classes/com/sun/javafx/newt/util/MainThread.java305
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java49
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java57
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java286
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/x11/X11Display.java64
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/x11/X11Screen.java69
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/x11/X11Window.java178
-rw-r--r--src/newt/native/EventListener.h9
-rw-r--r--src/newt/native/InputEvent.h46
-rwxr-xr-xsrc/newt/native/KDWindow.c334
-rw-r--r--src/newt/native/KeyEvent.h200
-rw-r--r--src/newt/native/MacWindow.m430
-rw-r--r--src/newt/native/MouseEvent.h15
-rw-r--r--src/newt/native/NewtMacWindow.h69
-rw-r--r--src/newt/native/NewtMacWindow.m391
-rwxr-xr-xsrc/newt/native/WindowsWindow.c1197
-rwxr-xr-xsrc/newt/native/X11Window.c642
-rwxr-xr-xtest/Issue326Test1.java91
-rwxr-xr-xtest/Issue326Test2.java66
-rwxr-xr-xtest/Issue344Base.java107
-rwxr-xr-xtest/Issue344Test1.java10
-rwxr-xr-xtest/Issue344Test2.java10
-rwxr-xr-xtest/Issue344Test3.java10
-rwxr-xr-xtest/Issue344Test4.java10
640 files changed, 172999 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
new file mode 100755
index 000000000..1455bec55
--- /dev/null
+++ b/CHANGELOG.txt
@@ -0,0 +1,101 @@
+Changes between JOGL 1.1.0 and 1.1.1:
+
+ - Fixed a bug in the checking of incoming buffers' sizes to
+ glTexImage1D, glTexImage2D, and glTexImage3D.
+
+Changes between JOGL 1.0.0 and 1.1.0:
+
+ - The glext.h and associated header files JOGL uses have been updated
+ to OpenGL 2.1 with NVidia's GeForce 8 series extensions. The new
+ functions are available as methods in the GL interface.
+
+ - The developer build bundles have been changed to zip archives, so
+ instead of having to download multiple jars, you can now just
+ download the zip archive for your particular platform. The new zip
+ archives are versioned with the build date.
+
+ - The source distribution now contains the generated sources like
+ GL.java, GLU.java, etc. for more convenient use in IDEs.
+
+ - The chosen GLCapabilities are now exposed from the GLDrawable via
+ GLDrawable.getChosenGLCapabilities(); this functionality works on
+ all platforms even in cases where the GLCapabilitiesChooser is not
+ supported, and attempts to provide correct answers so programs can
+ make decisions based on the results.
+
+ - The native code for the "DRI hack" (to support the open-source DRI
+ drivers on Linux and other X11 platforms) has been removed; JOGL
+ now uses the GlueGen NativeLibrary class for this purpose.
+ Reliability improvements have been made to the implementation of
+ this class; it has been confirmed as working again with ATI's
+ proprietary drivers on Linux and should also work better with
+ NVidia's drivers.
+
+ - The GlueGen runtime classes have been removed from jogl.jar. These
+ have been factored out into gluegen-rt.jar and are referenced by
+ both the JOGL and JOAL projects.
+
+ - Thanks to John Burkey some optimizations have been made to the
+ buffer object-related validity checks in glVertexPointer, etc. as
+ well as a buffer size query that was being made in the glMapBuffer
+ implementation. This improves performance for applications
+ performing a lot of VBO- or vertex array-based rendering, in
+ particular with the multithreaded OpenGL implementation on Mac OS
+ X.
+
+ - The JOGL applet launcher now supports deployment of applets which
+ use both OpenGL for 3D graphics via JOGL as well as OpenAL for
+ spatialized audio via JOAL. It now prompts the user on Windows
+ platforms to allow it to enable the -Dsun.java2d.noddraw=true
+ system property for best robustness. It has been updated for the
+ changes in the GlueGen runtime classes and native library
+ structure. Some bugs have been fixed, some of which were preventing
+ different JOGL-based applets from being deployed from the same
+ codebase. The documentation and on-line examples have been updated
+ as well.
+
+ - The TextureIO implementation has been changed to no longer copy the
+ data associated with BufferedImage TextureData objects. Instead,
+ the necessary vertical flip is now implemented by flipping the
+ texture coordinates vertically.
+
+ - An API for updating a sub-image of a Texture object from a
+ sub-portion of a TextureData object has been added.
+
+ - A GLContext.copy() operation has been added based on community
+ feedback.
+
+ - Three helper classes have been added to the com.sun.opengl.util.j2d
+ package to improve interoperability between JOGL and Java 2D:
+ TextureRenderer, Overlay and TextRenderer. The TextureRenderer
+ supports drawing into an OpenGL texture using Java 2D. The Overlay
+ class provides a convenient Java 2D-based overlay on top of an
+ arbitrary GLDrawable. The TextRenderer class supports drawing of
+ Java 2D text into an OpenGL context. Thanks to Chris Campbell of
+ the Java 2D team for collaboration and to the JOGL community for
+ extensive feedback and testing assistance.
+
+ - Various bug fixes and robustness improvements were made to the
+ GlueGen runtime, JOGL and GLU implementations.
+
+ - Fixes to the DDSImage class were contributed by the community: a
+ bug fix to mipmap handling and support for cubemap textures. Thanks
+ to java.net user bandures.
+
+ - TextureIO.setTexRectEnabled() and isTexRectEnabled() were added
+ based on feedback from Chris Campbell, in order to simplify the
+ writing of pixel shaders which have different samplers for
+ GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE_ARB targets.
+
+ - Thanks to Erik Tollerud, the links to the OpenGL documentation in
+ the JOGL javadoc were revised to point to the new on-line man pages
+ in the OpenGL SDK.
+
+ - Support for automatic mipmap generation via GL_GENERATE_MIPMAP was
+ added to the TextureIO, TextureRenderer and TextRenderer classes.
+
+ - Windows/AMD64 binaries, including the JOGL Cg binding, are now
+ supplied.
+
+ - Worked around breakage of JOGL with 5.0u10; see Sun bug IDs 6504460
+ and 6333613.
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
new file mode 100755
index 000000000..360d3748b
--- /dev/null
+++ b/COPYRIGHT.txt
@@ -0,0 +1,31 @@
+
+Copyright 2007 Sun Microsystems, Inc., 4150 Network
+Circle, Santa Clara, California 95054, U.S.A. All rights
+reserved.
+
+U.S. Government Rights - Commercial software. Government
+users are subject to the Sun Microsystems, Inc.
+standard license agreement and applicable provisions of
+the FAR and its supplements.
+
+Use is subject to license terms.
+
+This distribution may include materials developed by third
+parties.
+
+Sun, Sun Microsystems, the Sun logo and Java are trademarks
+or registered trademarks of Sun Microsystems, Inc. in the
+U.S. and other countries.
+
+OpenGL is a registered trademark of Silicon Graphics, Inc.
+
+This product is covered and controlled by U.S. Export
+Control laws and may be subject to the export or import
+laws in other countries. Nuclear, missile, chemical
+biological weapons or nuclear maritime end uses or end
+users, whether direct or indirect, are strictly prohibited.
+Export or reexport to countries subject to U.S. embargo or
+to entities identified on U.S. export exclusion lists,
+including, but not limited to, the denied persons and
+specially designated nationals lists is strictly prohibited.
+
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100755
index 000000000..cd35e8827
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,152 @@
+JOGL is released under the BSD license. The full license terms follow:
+
+ Copyright (c) 2003-2007 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.
+
+The JOGL source tree contains code ported from the OpenGL sample
+implementation by Silicon Graphics, Inc. This code is licensed under
+the SGI Free Software License B (Sun is redistributing the modified code
+under a slightly modified, alternative license, which is described two
+paragraphs below after "NOTE:"):
+
+ License Applicability. Except 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
+ file are subject only to the provisions of the License. You may not use
+ this file except in compliance with the License. You may obtain a copy
+ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+
+ http://oss.sgi.com/projects/FreeB
+
+ Note that, as provided in the License, the Software is distributed on an
+ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+
+ NOTE: The Original Code (as defined below) has been licensed to Sun
+ Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ you under an alternative license ("Alternative License"). This
+ Alternative License includes all of the provisions of the SGI License
+ except that Section 2.2 and 11 are omitted. Any differences between
+ the Alternative License and the SGI License are offered solely by Sun
+ and not by SGI.
+
+ Original Code. The Original Code is: OpenGL Sample Implementation,
+ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ Copyright in any portions created by third parties is as indicated
+ elsewhere herein. All Rights Reserved.
+
+ Additional Notice Provisions: The application programming interfaces
+ established by SGI in conjunction with the Original Code are The
+ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ Window System(R) (Version 1.3), released October 19, 1998. This software
+ was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ published by SGI, but has not been independently verified as being
+ compliant with the OpenGL(R) version 1.2.1 Specification.
+
+
+The JOGL source tree contains code from the LWJGL project which is
+similarly covered by the BSD license:
+
+ Copyright (c) 2002-2004 LWJGL Project
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of 'LWJGL' nor the names of
+ its contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The JOGL source tree also contains a Java port of Brian Paul's Tile
+Rendering library, used with permission of the author under the BSD
+license instead of the original LGPL:
+
+ Copyright (c) 1997-2005 Brian Paul. All Rights Reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ - Redistribution of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistribution in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ Neither the name of Brian Paul or the names of contributors may be
+ used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ This software is provided "AS IS," without a warranty of any
+ kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
+ WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
+ EXCLUDED. THE COPYRIGHT HOLDERS AND CONTRIBUTORS SHALL NOT BE
+ LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
+ MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO
+ EVENT WILL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY
+ LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL,
+ CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND
+ REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR
+ INABILITY TO USE THIS SOFTWARE, EVEN IF THE COPYRIGHT HOLDERS OR
+ CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
diff --git a/README.txt b/README.txt
new file mode 100755
index 000000000..af17d6c20
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,70 @@
+Organization of the JOGL source tree
+------------------------------------
+
+doc/ Build and user documentation
+make/ Ant build scripts
+ Configuration files for glue code generation
+ Header files for glue code generation
+ See top of build.xml for brief invocation instructions
+src/ Java and native source code for JOGL
+ (Currently also contains source code for GlueGen tool; in
+ process of being split into its own project)
+www/ Web pages and older Java Web Start binaries for JOGL
+
+Acknowledgments
+---------------
+
+Sun Microsystems, Inc. gratefully acknowledges that the initial
+version of JOGL was authored and developed by Kenneth Bradley Russell
+and Christopher John Kline.
+
+Sun and the JOGL development team are grateful for the contributions
+of all of the individuals who have advanced the project. Please
+contact the project owners if your name is missing from this list.
+
+Gerard Ziemski contributed the original port of JOGL to Mac OS X.
+
+Rob Grzywinski and Artur Biesiadowski contributed the Ant build
+support. Alex Radeski contributed the cpptasks support in the build
+process.
+
+Pepijn Van Eeckhoudt and Nathan Parker Burg contributed the Java port
+of the GLU tessellator. Pepijn also contributed the initial version of
+the FPSAnimator utility class.
+
+User GKW on the javagaming.org forums contributed the substantial port
+of the GLU mipmap generation code to Java, as well as robustness fixes
+in the Windows implementation and other areas.
+
+The JSR-231 expert group as a whole provided valuable discussions and
+guidance in the design of the current APIs. In particular, Kevin
+Rushforth, Daniel Rice and Travis Bryson were instrumental in the
+design of the current APIs.
+
+Travis Bryson did extensive work on the GlueGen tool to make it
+conform to the desired API design. He also shepherded JSR-231 through
+the standardization process, doing extensive cross-validation of the
+APIs and implementation along the way, and authored JOGL's nightly
+build system.
+
+Lilian Chamontin contributed the JOGLAppletLauncher, opening new ways
+of deploying 3D over the web.
+
+Christopher Campbell collaborated closely with the JOGL development
+team to enable interoperability between Sun's OpenGL pipeline for
+Java2D and JOGL in Java SE 6, and also co-authored the TextureIO
+subsystem.
+
+The following individuals made significant contributions to various
+areas of the project:
+
+Alban Cousini�
+Athomas Goldberg
+Yuri Vladimir Gushchin
+Gregory Pierce
+Carsten Weisse
+
+Sun and the JOGL development team are grateful for the support of the
+javagaming.org community, from where dozens, if not hundreds, of
+individuals have contributed discussions, bug reports, bug fixes, and
+other forms of support.
diff --git a/doxygen/doxygen-all-dev.cfg b/doxygen/doxygen-all-dev.cfg
new file mode 100644
index 000000000..2425ff403
--- /dev/null
+++ b/doxygen/doxygen-all-dev.cfg
@@ -0,0 +1,1260 @@
+# Doxyfile 1.5.0
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "JOGL - Developer Documentation incl. Nativewindow & Newt"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 2
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = doc-jogl-dev
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = /usr/local/projects/SUN/JOGL2 /export/usr/local/projects/SUN/JOGL2
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH = /usr/local/projects/SUN/JOGL2 /export/usr/local/projects/SUN/JOGL2
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = YES
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ../src/jogl/classes
+INPUT = ../src/nativewindow/classes
+INPUT = ../src/newt/classes
+INPUT += ../build/jogl/gensrc/classes
+INPUT += ../build/nativewindow/gensrc/classes
+INPUT += ../build/newt/gensrc/classes
+INPUT += ../../gluegen/src/java/com/sun/gluegen/runtime
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */SCCS/* s.* p.*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+#EXAMPLE_PATH = ../../jogl-demos/src
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = NO
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+INCLUDE_PATH =
+
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = NO
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.:w
+
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/doxygen/doxygen-all-pub.cfg b/doxygen/doxygen-all-pub.cfg
new file mode 100644
index 000000000..cd8dfb6a0
--- /dev/null
+++ b/doxygen/doxygen-all-pub.cfg
@@ -0,0 +1,1257 @@
+# Doxyfile 1.5.0
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "JOGL - Public Documentation incl. Nativewindow & Newt"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 2
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = doc-jogl-pub
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = /usr/local/projects/SUN/JOGL2 /export/usr/local/projects/SUN/JOGL2
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH = /usr/local/projects/SUN/JOGL2 /export/usr/local/projects/SUN/JOGL2
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = YES
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ../src/jogl/classes/javax
+INPUT += ../build/jogl/gensrc/classes/javax
+INPUT += ../src/jogl/classes/com/sun/opengl/util
+INPUT += ../src/newt/classes/com/sun/javafx/newt
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */SCCS/* s.* p.*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+#EXAMPLE_PATH = ../../jogl-demos/src
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = NO
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+INCLUDE_PATH =
+
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = NO
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.:w
+
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/doxygen/doxygen-jogl-spec.cfg b/doxygen/doxygen-jogl-spec.cfg
new file mode 100644
index 000000000..d0b416204
--- /dev/null
+++ b/doxygen/doxygen-jogl-spec.cfg
@@ -0,0 +1,1254 @@
+# Doxyfile 1.5.0
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = "JOGL - Specification"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 2
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = doc-jogl-spec
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = /usr/local/projects/SUN/JOGL2 /export/usr/local/projects/SUN/JOGL2
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH = /usr/local/projects/SUN/JOGL2 /export/usr/local/projects/SUN/JOGL2
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = YES
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ../src/jogl/classes/javax
+INPUT += ../build/jogl/gensrc/classes/javax
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */SCCS/* s.* p.*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+#EXAMPLE_PATH = ../../jogl-demos/src
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = YES
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = NO
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = NO
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.:w
+
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/etc/profile.jogl b/etc/profile.jogl
new file mode 100755
index 000000000..517e39b65
--- /dev/null
+++ b/etc/profile.jogl
@@ -0,0 +1,105 @@
+#! /bin/sh
+
+function concat_jogl_list()
+{
+ ITEMDIR=$1
+ shift
+ for j in $ITEMDIR/nativewindow $ITEMDIR/jogl $ITEMDIR/newt ; do
+ for i in $* ; do
+ if [ -e $j/$i ] ; then
+ if [ -z "$JOGL_LIST" ] ; then
+ JOGL_LIST=$j/$i
+ else
+ JOGL_LIST=$JOGL_LIST:$j/$i
+ fi
+ fi
+ done
+ done
+ echo $JOGL_LIST
+}
+
+uname -a | grep -i LINUX && OSS=x11
+uname -a | grep -i Darwin && OSS=osx
+
+JOGL_AWT="jogl.awt.jar jogl.util.awt.jar newt.awt.jar nativewindow.awt.jar"
+
+JOGL_CORE="nativewindow.core.jar jogl.core.jar newt.core.jar newt.ogl.jar jogl.util.jar"
+
+JOGL_JAR_ALL="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.gles2.jar jogl.gles2.dbg.jar jogl.egl.jar jogl.gl2es12.$OSS.jar jogl.gl2es12.dbg.jar jogl.gl2.$OSS.jar jogl.gl2.dbg.jar jogl.util.gl2.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gl2.jar jogl.util.gl2.jar jogl.util.fixedfuncemu.jar $JOGL_AWT"
+JOGL_LIB_ALL="libjogl_gl2.so libjogl_es1.so libjogl_es2.so libnewt.so libjogl_awt.so"
+
+JOGL_JAR_ES1_MIN="$JOGL_CORE jogl.gles1.jar jogl.egl.jar"
+JOGL_JAR_ES1_MAX="$JOGL_CORE jogl.gles1.jar jogl.gles1.dbg.jar jogl.egl.jar jogl.glu.tess.jar jogl.glu.mipmap.jar $JOGL_AWT"
+JOGL_LIB_ES1_MIN="libjogl_es1.so libnewt.so"
+JOGL_LIB_ES1_MAX="libjogl_es1.so libnewt.so libjogl_awt.so libnativewindow_x11.so libnativewindow_awt.so"
+
+JOGL_JAR_ES2_MIN="$JOGL_CORE jogl.gles2.jar jogl.egl.jar jogl.util.fixedfuncemu.jar"
+JOGL_JAR_ES2_MAX="$JOGL_CORE jogl.gles2.jar jogl.egl.jar jogl.util.fixedfuncemu.jar jogl.glu.tess.jar $JOGL_AWT"
+JOGL_LIB_ES2_MIN="libjogl_es2.so libnewt.so"
+JOGL_LIB_ES2_MAX="libjogl_es2.so libnewt.so libjogl_awt.so libnativewindow_x11.so libnativewindow_awt.so"
+
+JOGL_JAR_GL2ES12_MIN="$JOGL_CORE jogl.gl2es12.$OSS.jar jogl.util.fixedfuncemu.jar"
+JOGL_JAR_GL2ES12_MAX="$JOGL_CORE jogl.gl2es12.$OSS.jar jogl.util.fixedfuncemu.jar jogl.gl2es12.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar $JOGL_AWT"
+JOGL_LIB_GL2ES12_MIN="libjogl_gl2es12.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so"
+JOGL_LIB_GL2ES12_MAX="libjogl_gl2es12.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so"
+
+JOGL_JAR_GL2_MIN="$JOGL_CORE jogl.gl2.$OSS.jar"
+JOGL_JAR_GL2_MAX="$JOGL_CORE jogl.gl2.$OSS.jar jogl.gl2.dbg.jar jogl.glu.tess.jar jogl.glu.mipmap.jar jogl.glu.gl2.jar jogl.util.gl2.jar $JOGL_AWT"
+JOGL_LIB_GL2_MIN="libjogl_gl2.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so"
+JOGL_LIB_GL2_MAX="libjogl_gl2.so libnewt.so libnativewindow_x11.so libnativewindow_awt.so"
+
+export JOGL_JAR_ALL JOGL_JAR_ES1_MIN JOGL_JAR_ES1_MAX JOGL_JAR_ES2_MIN JOGL_JAR_ES2_MAX JOGL_JAR_GL2ES12_MIN JOGL_JAR_GL2ES12_MAX JOGL_JAR_GL2_MIN JOGL_JAR_GL2_MAX
+export JOGL_LIB_ALL JOGL_LIB_ES1_MIN JOGL_LIB_ES1_MAX JOGL_LIB_ES2_MIN JOGL_LIB_ES2_MAX JOGL_LIB_GL2ES12_MIN JOGL_LIB_GL2ES12_MAX JOGL_LIB_GL2_MIN JOGL_LIB_GL2_MAX
+
+JOGL_JAR_DIR=""
+if [ ! -z "$1" ] ; then
+ JOGL_JAR_DIR="$1"
+ shift
+fi
+export JOGL_JAR_DIR
+
+JOGL_LIB_DIR=$JOGL_JAR_DIR/nativewindow/obj:$JOGL_JAR_DIR/jogl/obj:$JOGL_JAR_DIR/newt/obj
+export JOGL_LIB_DIR
+
+if [ ! -z "$1" ] ; then
+ case "$1" in
+ JOGL_ALL)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_ALL)
+ ;;
+ JOGL_ES1_MIN)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_ES1_MIN)
+ JOGL_VBO_BUG=true ; export JOGL_VBO_BUG # ES emulation has buggy VBO impl.
+ ;;
+ JOGL_ES1_MAX)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_ES1_MAX)
+ JOGL_VBO_BUG=true ; export JOGL_VBO_BUG # ES emulation has buggy VBO impl.
+ ;;
+ JOGL_ES2_MIN)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_ES2_MIN)
+ JOGL_VBO_BUG=true ; export JOGL_VBO_BUG # ES emulation has buggy VBO impl.
+ ;;
+ JOGL_ES2_MAX)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_ES2_MAX)
+ JOGL_VBO_BUG=true ; export JOGL_VBO_BUG # ES emulation has buggy VBO impl.
+ ;;
+ JOGL_GL2ES12_MIN)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_GL2ES12_MIN)
+ ;;
+ JOGL_GL2ES12_MAX)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_GL2ES12_MAX)
+ ;;
+ JOGL_GL2_MIN)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_GL2_MIN)
+ ;;
+ JOGL_GL2_MAX)
+ JOGL_CLASSPATH=$(concat_jogl_list $JOGL_JAR_DIR $JOGL_JAR_GL2_MAX)
+ ;;
+ esac
+
+ export JOGL_CLASSPATH
+fi
+
+if [ -z "$JOGL_CLASSPATH" ] ; then
+ echo "Usage: $0 <jogl-jar-dir> <jogl-lib-dir> {JOGL_ALL|JOGL_ES1_MIN|JOGL_ES1_MAX|JOGL_ES2_MIN|JOGL_ES2_MAX|JOGL_GL2ES12_MIN|JOGL_GL2ES12_MAX|JOGL_GL2_MIN|JOGL_GL2_MAX}"
+fi
+
diff --git a/make/142-packages/package-list b/make/142-packages/package-list
new file mode 100755
index 000000000..fecd4d4ff
--- /dev/null
+++ b/make/142-packages/package-list
@@ -0,0 +1,135 @@
+java.applet
+java.awt
+java.awt.color
+java.awt.datatransfer
+java.awt.dnd
+java.awt.event
+java.awt.font
+java.awt.geom
+java.awt.im
+java.awt.im.spi
+java.awt.image
+java.awt.image.renderable
+java.awt.print
+java.beans
+java.beans.beancontext
+java.io
+java.lang
+java.lang.ref
+java.lang.reflect
+java.math
+java.net
+java.nio
+java.nio.channels
+java.nio.channels.spi
+java.nio.charset
+java.nio.charset.spi
+java.rmi
+java.rmi.activation
+java.rmi.dgc
+java.rmi.registry
+java.rmi.server
+java.security
+java.security.acl
+java.security.cert
+java.security.interfaces
+java.security.spec
+java.sql
+java.text
+java.util
+java.util.jar
+java.util.logging
+java.util.prefs
+java.util.regex
+java.util.zip
+javax.accessibility
+javax.crypto
+javax.crypto.interfaces
+javax.crypto.spec
+javax.imageio
+javax.imageio.event
+javax.imageio.metadata
+javax.imageio.plugins.jpeg
+javax.imageio.spi
+javax.imageio.stream
+javax.naming
+javax.naming.directory
+javax.naming.event
+javax.naming.ldap
+javax.naming.spi
+javax.net
+javax.net.ssl
+javax.print
+javax.print.attribute
+javax.print.attribute.standard
+javax.print.event
+javax.rmi
+javax.rmi.CORBA
+javax.security.auth
+javax.security.auth.callback
+javax.security.auth.kerberos
+javax.security.auth.login
+javax.security.auth.spi
+javax.security.auth.x500
+javax.security.cert
+javax.sound.midi
+javax.sound.midi.spi
+javax.sound.sampled
+javax.sound.sampled.spi
+javax.sql
+javax.swing
+javax.swing.border
+javax.swing.colorchooser
+javax.swing.event
+javax.swing.filechooser
+javax.swing.plaf
+javax.swing.plaf.basic
+javax.swing.plaf.metal
+javax.swing.plaf.multi
+javax.swing.table
+javax.swing.text
+javax.swing.text.html
+javax.swing.text.html.parser
+javax.swing.text.rtf
+javax.swing.tree
+javax.swing.undo
+javax.transaction
+javax.transaction.xa
+javax.xml.parsers
+javax.xml.transform
+javax.xml.transform.dom
+javax.xml.transform.sax
+javax.xml.transform.stream
+org.ietf.jgss
+org.omg.CORBA
+org.omg.CORBA.DynAnyPackage
+org.omg.CORBA.ORBPackage
+org.omg.CORBA.TypeCodePackage
+org.omg.CORBA.portable
+org.omg.CORBA_2_3
+org.omg.CORBA_2_3.portable
+org.omg.CosNaming
+org.omg.CosNaming.NamingContextExtPackage
+org.omg.CosNaming.NamingContextPackage
+org.omg.Dynamic
+org.omg.DynamicAny
+org.omg.DynamicAny.DynAnyFactoryPackage
+org.omg.DynamicAny.DynAnyPackage
+org.omg.IOP
+org.omg.IOP.CodecFactoryPackage
+org.omg.IOP.CodecPackage
+org.omg.Messaging
+org.omg.PortableInterceptor
+org.omg.PortableInterceptor.ORBInitInfoPackage
+org.omg.PortableServer
+org.omg.PortableServer.CurrentPackage
+org.omg.PortableServer.POAManagerPackage
+org.omg.PortableServer.POAPackage
+org.omg.PortableServer.ServantLocatorPackage
+org.omg.PortableServer.portable
+org.omg.SendingContext
+org.omg.stub.java.rmi
+org.w3c.dom
+org.xml.sax
+org.xml.sax.ext
+org.xml.sax.helpers
diff --git a/make/README-zip-bundles.txt b/make/README-zip-bundles.txt
new file mode 100755
index 000000000..2e5899990
--- /dev/null
+++ b/make/README-zip-bundles.txt
@@ -0,0 +1,45 @@
+
+Java (TM) Binding for the OpenGL (r) API, version @VERSION@
+-------------------------------------------------------
+
+This software is licensed by Sun Microsystems, as specified
+in the LICENSE-JOGL-@[email protected] file. You must use this software
+in accordance with the terms under which the code is licensed.
+
+
+
+Instructions for unzipping Java Binding for the OpenGL API, version @VERSION@
+--------------------------------------------------------------------
+
+After downloading and unzipping the zip file containing the
+JOGL release for your target platform, you will see the
+following files in the top directory:
+
+ COPYRIGHT.txt
+ LICENSE-JOGL-@[email protected]
+ Userguide.html
+ README.txt README file (you are reading it now)
+
+and the following subdirectory:
+
+ lib contains JOGL implementation
+
+All of the JOGL implementation files (jar files and native
+libraries) are in the lib subdirectory. For instructions on
+how to use these implementation files to build or run a JOGL
+program see the enclosed JOGL user guide (Userguide.html).
+
+
+
+Project source code and getting assistance
+------------------------------------------
+
+JOGL source code and project information can be found at:
+
+ https://jogl.dev.java.net/
+
+
+Numerous answers to common questions can be found on the JOGL
+forum:
+
+ http://www.javagaming.org/forums/index.php?board=25.0
diff --git a/make/build-gluegen.xml b/make/build-gluegen.xml
new file mode 100644
index 000000000..992599cdb
--- /dev/null
+++ b/make/build-gluegen.xml
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Ant build for JOGL's GlueGen and corresponding ANT task. This build
+ - should not be called directly. It is invoked from the main "build.xml"
+ - file and relies on the properties set therein.
+ -
+ - The optional.jar that contains the optional ANT tasks must be in the ANT
+ - classpath (typically the ant/lib directory).
+ -
+ - This build has been tested with ANT 1.5.3 and JOGL 1.1.1.1.
+ -
+ - Public targets:
+ - all: clean and build GlueGen and GlueGen Ant task
+ - clean: clean all built
+ -->
+<project name="JOGL.GlueGen" default="all">
+ <!-- ================================================================== -->
+ <!--
+ - Declare all paths and user defined variables.
+ -->
+ <target name="declare" description="Declare properties">
+
+ <!-- Create the classpath for ANTLR. This requires the user-defined
+ - "antlr.jar" property. -->
+ <path id="antlr.classpath">
+ <pathelement location="${antlr.jar}" />
+ </path>
+
+ <!-- The location of the GlueGen source and the C grammar files. -->
+ <property name="gluegen" value="${src.java}/com/sun/gluegen" />
+ <property name="c.grammar" value="${gluegen}/cgram" />
+
+ <!-- The resulting location of the generated Java files from the
+ - C grammar via ANTLR. -->
+ <property name="gluegen.build" value="${src.generated.java}/com/sun/gluegen" />
+ <property name="generated.java.from.grammar" value="${gluegen.build}/cgram" />
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build GlueGen.
+ -->
+ <target name="build.gluegen" depends="declare">
+
+ <!-- Because ANTLR looks for importVocab files in the current
+ working directory, it likes to have all of its files,
+ including supergrammars, in one place, so copy all of the
+ grammars to the output directory up front so we don't put
+ temporary files into the source tree -->
+ <mkdir dir="${generated.java.from.grammar}" />
+ <copy todir="${generated.java.from.grammar}">
+ <fileset dir="${c.grammar}">
+ <include name="*.g" />
+ </fileset>
+ </copy>
+
+ <!-- Generate the Java files from the C grammar using ANTLR. -->
+ <antcall target="generate.c.grammar">
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ <param name="target" value="StdCParser.g" />
+ </antcall>
+ <antcall target="generate.c.grammar.glib">
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ <param name="target" value="GnuCParser.g" />
+ <param name="glib" value="StdCParser.g" />
+ </antcall>
+ <antcall target="generate.c.grammar">
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ <param name="target" value="GnuCTreeParser.g" />
+ </antcall>
+ <antcall target="generate.c.grammar.glib">
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ <param name="target" value="GnuCEmitter.g" />
+ <param name="glib" value="GnuCTreeParser.g" />
+ </antcall>
+ <antcall target="generate.c.grammar.glib">
+ <param name="output.dir" value="${generated.java.from.grammar}" />
+ <param name="target" value="HeaderParser.g" />
+ <param name="glib" value="GnuCTreeParser.g" />
+ </antcall>
+
+ <!-- Ensure that the output classes directory exists. -->
+ <mkdir dir="${classes}" />
+
+ <!-- Build GlueGen using the generated Java files along with the
+ - original source.
+ - NOTE: GlueGenTask is NOT built at this time. It is done in
+ - a separate task. -->
+ <javac destdir="${classes}" includes="**/gluegen/**" excludes="**/GlueGenTask.java"
+ source="1.4" debug="true" debuglevel="source,lines">
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ <classpath refid="antlr.classpath" />
+ </javac>
+
+ <!-- Inform the user that GlueGen has been successfully built. -->
+ <echo message="" />
+ <echo message="GlueGen has been built successfully." />
+ </target>
+
+ <!--
+ - Using ANTLR generate the specified Java files.
+ -
+ - @param target the grammar file to process
+ - @param output.dir the directory to write the generated files to. If
+ - the directory does not exist, it will be created.
+ -->
+ <target name="generate.c.grammar" depends="declare">
+ <!-- Generate the Java files -->
+ <antlr target="${output.dir}/${target}" outputdirectory="${output.dir}">
+ <classpath refid="antlr.classpath" />
+ </antlr>
+ </target>
+
+ <!--
+ - Using ANTLR generate the specified Java files with an overridden
+ - grammar file.
+ -
+ - @param target the grammar file to process
+ - @param glib the overridding grammar file
+ - @param output.dir the directory to write the generated files to. If
+ - the directory does not exist, it will be created.
+ -->
+ <target name="generate.c.grammar.glib" depends="declare">
+ <!-- Generate the Java files -->
+ <antlr target="${output.dir}/${target}" glib="${output.dir}/${glib}" outputdirectory="${output.dir}">
+ <classpath refid="antlr.classpath" />
+ </antlr>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the GlueGen ANT task.
+ -->
+ <target name="build.gluegen.task" depends="declare">
+ <!-- Ensure that the output classes directory exists. -->
+ <mkdir dir="${classes}" />
+
+ <!-- Build the GlueGen ANT task.
+ - NOTE: ONLY the GlueGenTask is built at this time. GlueGen
+ - itself is built in a separate task. -->
+ <javac destdir="${classes}" includes="**/GlueGenTask.java" source="1.4" debug="true" debuglevel="source,lines">
+ <src path="${src.java}" />
+ <classpath refid="antlr.classpath" />
+ </javac>
+
+ <!-- Inform the user that the GlueGen ANT task has been successfully
+ built. -->
+ <echo message="" />
+ <echo message="GlueGen ANT task has been built successfully." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Clean up all that is built.
+ - NOTE: this is a bit heavy-handed as it may delete more than just
+ - what is built with this build.
+ -->
+ <target name="clean" depends="declare">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${src.generated.java}" />
+ <fileset dir="${classes}" />
+ </delete>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build GlueGen and the GlueGen ANT task.
+ -->
+ <target name="all" depends="declare">
+ <!-- Build GlueGen -->
+ <antcall target="build.gluegen" />
+
+ <!-- Build the GlueGen ANT task -->
+ <antcall target="build.gluegen.task" />
+ </target>
+
+</project>
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
new file mode 100644
index 000000000..e4d1daab2
--- /dev/null
+++ b/make/build-jogl.xml
@@ -0,0 +1,2374 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Ant build for JOGL. This build has been tested with ANT 1.7.0. The
+ - optional.jar that contains the optional ANT tasks must be in the ANT
+ - classpath (typically the ant/lib directory).
+ -
+ - A clean download of JOGL is required for this build.
+ -
+ - This build has no dependence on environment variables; the needed
+ - ones (e.g. java.home, ANT_HOME) are all set by the Ant wrapper shell
+ - script, by the virtual machine, or elsewhere. However, on all platforms,
+ - the C compiler and linker should be in the path. All other paths that
+ - need to be set are in host.properties.
+ -
+ - NOTE: because the GlueGen config files have their own relative paths
+ - which cannot be overridden by GlueGen, GlueGen MUST be run from
+ - the "make" directory. This also means that this build-jogl.xml MUST
+ - be run from the "make" directory.
+ -
+ - Public targets:
+ - all: (default; autodetects OS and chooses C compiler from jogl.properties)
+ - clean: clean all built
+ - javadoc: create the standard developer Javadoc (recommended)
+ - (Note: should build all first - may be dependence in the future)
+ - javadoc.spec: create the standard developer Javadoc but exclude com.sun.* classes
+ - javadoc.dev.all: create the internal developer Javadoc. This includes the
+ - Java and C file generators. Note that it is only supported
+ - to create the Javadoc for the platform on which you are
+ - currently running.
+ -
+ - Note: on Windows the "win32.c.compiler" property in jogl.properties
+ - is required to select the appropriate C compiler. See the example
+ - jogl.properties in this directory for valid values. On Mac OS X
+ - universal binaries may also be built by setting the "macosxfat"
+ - property in jogl.properties; again see the example file in this
+ - directory.
+ -
+ - Optional properties:
+ - -Djogl.cg=1 when combined with the build or javadoc targets will cause
+ - the experimental binding to NVidia's Cg language to be built.
+ -
+ - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the
+ - ANT build, including the GlueGen and StaticGLInfo tasks, the building of
+ - the Java generated sources, the first and second phase Java compiles, and
+ - the building of the jar file. Thanks to Alex Radeski for the bulk of the
+ - port to the ant-contrib CPPTask framework. Thanks to Athomas Goldberg for
+ - the original OS detection code.
+ -
+ - Some environment defs affecting compilation
+
+ setup.cdcfp - Using the CDC Java runtime library
+ - no DoubleBuffer
+ - no LongBuffer
+
+ This will set
+ -> setup.noAWT
+ -> setup.nogl2
+ -> setup.nogl3
+
+ - Internal settings, may not be necessary to set them manually,
+ since all JAR archives are orthogonal.
+ setup.noes1
+ setup.noes2
+ setup.nogl2
+ setup.nogl3
+ setup.noAWT
+ setup.noutil - no com.sun.opengl.util.*
+ setup.noX11WindowsMacOsX, which implies:
+ setup.noX11
+ setup.noWindows
+ setup.noMacOsX
+ -->
+<project name="JOGL" basedir="." default="all">
+
+ <!-- This is the version of JOGL you are building -->
+ <property name="base_version" value="1.2.0-rc1"/>
+
+ <!-- Uncomment this property definition to cause a full release build to be done -->
+ <!-- without needing to specify the RI target on the command line -->
+ <property name="RImanifestfile" value="joglRIversion" />
+
+ <!-- Pull in GlueGen cpptasks build file -->
+ <property name="gluegen.root" value="../../gluegen" />
+ <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
+
+ <available file="${user.home}/jogl.compiler.xml" property="jogl.compiler.present"/>
+ <import file="${user.home}/jogl.compiler.xml" optional="true" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Base initialization and detection of operating system.
+ -->
+ <target name="base.init">
+
+ <condition property="setup.noes">
+ <and>
+ <isset property="setup.noes1"/>
+ <isset property="setup.noes2"/>
+ </and>
+ </condition>
+
+ <condition property="setup.nogl3">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="setup.nogl2">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="setup.noAWT">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="isCDCFP">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="javac.bootclasspath.jar"
+ value="../../gluegen/make/lib/cdc_fp.jar">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <echo message="setup.cdcfp: ${setup.cdcfp}" />
+ <echo message="setup.noAWT: ${setup.noAWT}" />
+ <echo message="javac.bootclasspath.jar: ${javac.bootclasspath.jar}" />
+ <echo message="setup.noes : ${setup.noes}" />
+ <echo message="setup.noes1: ${setup.noes1}" />
+ <echo message="setup.noes2: ${setup.noes2}" />
+ <echo message="setup.nogl2: ${setup.nogl2}" />
+ <echo message="setup.nogl3: ${setup.nogl3}" />
+
+ <condition property="setup.noX11WindowsMacOsX">
+ <and>
+ <isset property="setup.noX11"/>
+ <isset property="setup.noWindows"/>
+ <isset property="setup.noMacOsX"/>
+ </and>
+ </condition>
+
+ <condition property="setup.noX11">
+ <isset property="setup.noX11WindowsMacOsX"/>
+ </condition>
+
+ <condition property="setup.noWindows">
+ <isset property="setup.noX11WindowsMacOsX" />
+ </condition>
+
+ <condition property="setup.noMacOsX">
+ <isset property="setup.noX11WindowsMacOsX" />
+ </condition>
+
+ <echo message="setup.noX11WindowsMacOsX: ${setup.noX11WindowsMacOsX}" />
+ <echo message="setup.noX11: ${setup.noX11}" />
+ <echo message="setup.noWindows: ${setup.noWindows}" />
+ <echo message="setup.noMacOsX: ${setup.noMacOsX}" />
+
+ <!-- partitioning -->
+
+ <property name="java.part.egl"
+ value="com/sun/opengl/impl/egl/*"/>
+
+ <property name="java.part.glutess"
+ value="com/sun/opengl/impl/glu/tessellator/**"/>
+
+ <property name="java.part.glumipmap"
+ value="com/sun/opengl/impl/glu/mipmap/**"/>
+
+ <property name="java.part.glugl2"
+ value="com/sun/opengl/impl/glu/gl2/**, com/sun/opengl/impl/glu/nurbs/**, com/sun/opengl/impl/glu/registry/**, javax/media/opengl/glu/gl2/**"/>
+ <property name="java.part.openmax"
+ value="com/sun/openmax/**"/>
+
+ <property name="java.part.sdk"
+ value="javax/media/opengl/sdk/**"/>
+
+ <property name="java.part.gl2es12.x11"
+ value="com/sun/opengl/impl/gl2es12/**, com/sun/opengl/impl/x11/glx/*"/>
+
+ <property name="java.part.gl2es12.win"
+ value="com/sun/opengl/impl/gl2es12/**, com/sun/opengl/impl/windows/wgl/*"/>
+
+ <property name="java.part.gl2es12.osx"
+ value="com/sun/opengl/impl/gl2es12/**, com/sun/opengl/impl/macosx/cgl/*"/>
+
+ <property name="java.part.gl2es12.dbg"
+ value="javax/media/opengl/TraceGL2ES12.*, javax/media/opengl/DebugGL2ES12.*"/>
+
+ <property name="java.part.gl3"
+ value="com/sun/opengl/impl/**/gl3/**"/>
+
+ <property name="java.part.gl2.x11"
+ value="com/sun/opengl/impl/**/gl2/**, ${java.part.gl3}, com/sun/opengl/impl/x11/glx/*"/>
+
+ <property name="java.part.gl2.win"
+ value="com/sun/opengl/impl/**/gl2/**, ${java.part.gl3}, com/sun/opengl/impl/windows/wgl/*"/>
+
+ <property name="java.part.gl2.osx"
+ value="com/sun/opengl/impl/**/gl2/**, ${java.part.gl3}, com/sun/opengl/impl/macosx/cgl/*"/>
+
+ <property name="java.part.gl2.dbg"
+ value="javax/media/opengl/TraceGL2.*, javax/media/opengl/DebugGL2.*, javax/media/opengl/TraceGL3.*, javax/media/opengl/DebugGL3.*,"/>
+
+ <property name="java.part.es1"
+ value="javax/media/opengl/**/es1/**, com/sun/opengl/**/es1/**"/>
+
+ <property name="java.part.es1.dbg"
+ value="javax/media/opengl/TraceGLES1.*, javax/media/opengl/DebugGLES1.*"/>
+
+ <property name="java.part.es2"
+ value="javax/media/opengl/**/es2/**, com/sun/opengl/**/es2/**"/>
+
+ <property name="java.part.es2.dbg"
+ value="javax/media/opengl/TraceGLES2.*, javax/media/opengl/DebugGLES2.*"/>
+
+ <property name="java.part.awt"
+ value="javax/media/opengl/awt/**, com/sun/opengl/impl/**/awt/**"/>
+
+ <property name="java.part.util"
+ value="com/sun/opengl/util/*, com/sun/opengl/util/texture/**, com/sun/opengl/util/packrect/**"/>
+
+ <property name="java.part.util.awt"
+ value="com/sun/opengl/util/**/awt/**"/>
+
+ <property name="java.part.util.gl2"
+ value="com/sun/opengl/util/**/gl2/**"/>
+
+ <property name="java.part.util.glsl"
+ value="com/sun/opengl/util/glsl/*, com/sun/opengl/util/glsl/fixedfunc/*, com/sun/opengl/util/glsl/sdk/*"/>
+
+ <property name="java.part.util.fixedfuncemu"
+ value="com/sun/opengl/util/glsl/fixedfunc/impl/**"/>
+
+ <property name="java.part.util.fixedfuncemu.shadercode"
+ value="com/sun/opengl/util/glsl/fixedfunc/impl/shaders/*, com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/**"/>
+
+ <!-- condition excludes -->
+
+ <condition property="java.excludes.egl"
+ value="${java.part.egl}">
+ <and>
+ <isset property="setup.noes1"/>
+ <isset property="setup.noes2"/>
+ </and>
+ </condition>
+
+ <condition property="java.excludes.gl3"
+ value="${java.part.gl3}">
+ <isset property="setup.nogl3"/>
+ </condition>
+
+ <condition property="java.excludes.gl2"
+ value="${java.part.gl2es12.x11}, ${java.part.gl2es12.win}, ${java.part.gl2es12.osx}, ${java.part.gl2es12.dbg}, ${java.part.gl2.x11}, ${java.part.gl2.win}, ${java.part.gl2.osx}, ${java.part.gl2.dbg}, ${java.part.util.gl2}, ${java.part.glugl2}">
+ <isset property="setup.nogl2"/>
+ </condition>
+
+ <condition property="java.excludes.es1"
+ value="${java.part.es1}, ${java.part.es1.dbg}">
+ <isset property="setup.noes1"/>
+ </condition>
+
+ <condition property="java.excludes.es2"
+ value="${java.part.es2}, ${java.part.es2.dbg}">
+ <isset property="setup.noes2"/>
+ </condition>
+
+ <condition property="java.excludes.awt"
+ value="${java.part.awt}, ${java.part.util.awt}">
+ <isset property="setup.noAWT"/>
+ </condition>
+
+ <condition property="java.excludes.util"
+ value="${java.part.util} ${java.part.util.awt} ${java.part.util.gl2}">
+ <isset property="setup.noutil"/>
+ </condition>
+
+ <condition property="java.excludes.x11"
+ value="${java.part.x11}">
+ <isset property="setup.noX11"/>
+ </condition>
+
+ <condition property="java.excludes.win"
+ value="${java.part.win}">
+ <isset property="setup.noWindows"/>
+ </condition>
+
+ <condition property="java.excludes.macosx"
+ value="${java.part.macosx}">
+ <isset property="setup.noMacOsX"/>
+ </condition>
+
+ <condition property="java.excludes.cdcfp"
+ value="com/sun/opengl/util/AWTAnimatorImpl*, com/sun/opengl/util/TGAWriter*, com/sun/opengl/util/texture/spi/awt/**">
+ <isset property="setup.cdcfp"/>
+ </condition>
+
+ <property name="java.excludes.javadoc.packagenames"
+ value="com.sun.opengl.impl.gl2.fixme.*,com.sun.javafx.audio.windows.waveout.TestSpatialization"/>
+
+ <property name="java.excludes.fixme"
+ value="com/sun/opengl/impl/gl2/fixme/** com/sun/javafx/audio/windows/waveout/TestSpatialization.java" />
+
+ <property name="java.excludes.all" value="${java.excludes.fixme} ${java.excludes.egl}, ${java.excludes.gl2}, ${java.excludes.gl3}, ${java.excludes.es1}, ${java.excludes.es2}, ${java.excludes.awt}, ${java.excludes.glugl2}, ${java.excludes.util}, ${java.excludes.x11}, ${java.excludes.win}, ${java.excludes.macosx}, ${java.excludes.cdcfp}" />
+ <echo message="java.excludes.all: ${java.excludes.all}" />
+
+
+ <!-- Set the project root directory to be up one directory. -->
+ <property name="project.root" value=".." />
+
+ <!-- Set the configuration and build files to this directory. -->
+ <property name="make" value="." />
+ </target>
+
+ <target name="base.init.sourcelevel.1">
+ <property name="jogl.sourcelevel" value="1.4" />
+ </target>
+
+ <!--target name="base.init.sourcelevel.2" if="gluegen.nsig">
+ <property name="jogl.sourcelevel" value="1.5" />
+ </target-->
+
+ <!-- ================================================================== -->
+ <!--
+ - Load user properties which override build defaults.
+ -->
+ <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file">
+ <!-- Load the user specified properties file that defines various host
+ - specific paths. The user will be notified if this is does not
+ - exist. -->
+ <property name="user.properties.file" value="${user.home}/jogl.properties" />
+ <property file="${user.properties.file}" />
+ <echo message="Loaded ${user.properties.file}." />
+ <property file="${user.home}/gluegen.properties" />
+ <echo message="Loaded ${user.home}/gluegen.properties." />
+ <fail message="antlr.jar was not specified in jogl.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/>
+ <echo message="antlr.jar=${antlr.jar}" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Declare all paths and user defined variables.
+ -->
+ <target name="declare.common" description="Declare properties" depends="load.user.properties">
+ <!-- The location and name of the configuration ANT file that will
+ - validate to ensure that all user-define variables are set. -->
+ <property name="validate.user.properties" value="${make}/validate-properties.xml" />
+
+ <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
+ <property name="javacdebug" value="true" />
+ <property name="javacdebuglevel" value="source,lines" />
+ <!-- property name="javac.memorymax" value="128m" /--> <!-- I ran out of memory with these .. linux x86_64 6u14 -->
+ <property name="javac.memorymax" value="512m" />
+
+ <!-- Names of directories relative to the project root.
+ Some of these are used in FileMappers later for dependence information
+ and need exact string matching, which is why they use file.separator
+ instead of "/". -->
+ <condition property="rootrel.build" value="build">
+ <not>
+ <isset property="rootrel.build"/>
+ </not>
+ </condition>
+ <property name="rootrel.build.jogl" value="${rootrel.build}/jogl" />
+ <property name="rootrel.src.java" value="src/jogl/classes" />
+ <property name="rootrel.src.c" value="src/jogl/native" />
+ <property name="rootrel.src.c.openmax" value="src/jogl/native/openmax" />
+
+ <property name="rootrel.src.generated" value="${rootrel.build.jogl}/gensrc" />
+ <property name="rootrel.generated.c.jogl" value="${rootrel.src.generated}/native/jogl" />
+ <property name="rootrel.generated.c.cg" value="${rootrel.src.generated}/native/jogl_cg" />
+ <property name="rootrel.obj" value="${rootrel.build.jogl}/obj" />
+ <property name="rootrel.obj.jogl" value="${rootrel.obj}/jogl" />
+ <property name="rootrel.obj.cg" value="${rootrel.obj}/jogl_cg" />
+
+ <!-- GlueGen properties. -->
+ <!-- NOTE that these require a checked-out GlueGen workspace as a -->
+ <!-- sibling of the JOGL workspace. -->
+ <property name="gluegen.make.dir" value="../../gluegen/make" />
+ <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" />
+ <property name="gluegen.jar" value="../../gluegen/${rootrel.build}/gluegen.jar" />
+ <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" />
+ <property name="nativewindow.all.jar" value="../${rootrel.build}/nativewindow/nativewindow.all.jar" />
+
+ <!-- The source directories. -->
+ <property name="src.java" value="${project.root}/${rootrel.src.java}" />
+ <property name="src.c" value="${project.root}/${rootrel.src.c}" />
+ <property name="build" value="${project.root}/${rootrel.build.jogl}" />
+ <property name="tempdir" value="${project.root}/build-temp" />
+
+ <!-- The generated source directories. -->
+ <property name="src.generated" value="${build}/gensrc" />
+ <property name="src.generated.java" value="${src.generated}/classes" />
+ <property name="src.generated.java.cg" value="${src.generated}/classes/com/sun/opengl/cg" />
+ <property name="src.generated.c" value="${src.generated}/native/jogl" />
+ <property name="src.generated.c.openmax" value="${src.generated}/native/openmax" />
+ <property name="src.generated.c.cg" value="${src.generated}/native/jogl_cg" />
+
+ <!-- The compiler output directories. -->
+ <property name="classes" value="${build}/classes" />
+ <property name="obj" value="${project.root}/${rootrel.obj}" />
+ <property name="obj.jogl" value="${project.root}/${rootrel.obj.jogl}" />
+ <property name="obj.cg" value="${project.root}/${rootrel.obj.cg}" />
+
+ <!-- The GL headers from which Java files are generated -->
+ <property name="config" value="${make}/config/jogl" />
+ <property name="stub.includes" value="${make}/stub_includes" />
+ <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet -->
+ <property name="stub.includes.opengl" value="${stub.includes}/opengl" />
+ <property name="stub.includes.common" value="${stub.includes}/common" />
+ <dirset id="stub.includes.fileset.all.gl2" dir=".">
+ <include name="${stub.includes.dir}/opengl/**" />
+ <include name="${stub.includes.dir}/macosx/**" />
+ <include name="${stub.includes.dir}/win32/**" />
+ <include name="${stub.includes.dir}/x11/**" />
+ <include name="${stub.includes.dir}/common/**" />
+ <include name="${stub.includes.dir}/jni/**" />
+ </dirset>
+ <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}">
+ <include name="opengl/**" />
+ <include name="macosx/**" />
+ <include name="win32/**" />
+ <include name="x11/**" />
+ <include name="common/**" />
+ <include name="jni/**" />
+ </fileset>
+ <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" />
+ <fileset id="stub.includes.dependencies.fileset.3" dir="${config}">
+ <include name="*.cfg" />
+ <include name="gl*.java" />
+ <include name="*.c" />
+ <exclude name="cg-common.cfg" />
+ </fileset>
+ <dirset id="stub.includes.cg.fileset.all" dir=".">
+ <include name="${stub.includes.dir}/opengl/**" />
+ <include name="${stub.includes.dir}/cg/**" />
+ <include name="${stub.includes.dir}/macosx/**" />
+ <include name="${stub.includes.dir}/win32/**" />
+ <include name="${stub.includes.dir}/x11/**" />
+ <include name="${stub.includes.dir}/common/**" />
+ </dirset>
+ <fileset id="stub.includes.cg.dependencies.fileset" dir=".">
+ <include name="${stub.includes.dir}/cg/**" />
+ <include name="${config}/cg-common.cfg" />
+ <include name="${config}/cg-common-CustomJavaCode.java" />
+ </fileset>
+
+ <!-- Create the classpath that includes GlueGen and
+ - ANTLR. This requires the user-defined "antlr.jar"
+ - property. -->
+ <path id="gluegen.classpath">
+ <pathelement location="${gluegen.jar}" />
+ <pathelement location="${antlr.jar}" />
+ </path>
+
+ <path id="nativewindow_gluegen.classpath">
+ <pathelement location="${nativewindow.all.jar}" />
+ <pathelement location="${gluegen-rt.jar}" />
+ </path>
+
+ <!-- Create the classpath that includes GlueGen and
+ - the current classes for building the composable pipelines.
+ -->
+ <path id="pipeline.classpath">
+ <pathelement location="${gluegen.jar}" />
+ <pathelement location="${classes}" />
+ </path>
+
+ <!-- The resulting jogl.jar. -->
+ <property name="jogl.core.jar" value="${build}/jogl.core.jar" />
+ <property name="jogl.gles1.jar" value="${build}/jogl.gles1.jar" />
+ <property name="jogl.gles1.dbg.jar" value="${build}/jogl.gles1.dbg.jar" />
+ <property name="jogl.gles2.jar" value="${build}/jogl.gles2.jar" />
+ <property name="jogl.gles2.dbg.jar" value="${build}/jogl.gles2.dbg.jar" />
+ <property name="jogl.egl.jar" value="${build}/jogl.egl.jar" />
+ <property name="jogl.glutess.jar" value="${build}/jogl.glu.tess.jar" />
+ <property name="jogl.glumipmap.jar" value="${build}/jogl.glu.mipmap.jar" />
+ <property name="jogl.glugl2.jar" value="${build}/jogl.glu.gl2.jar" />
+ <property name="jogl.gl2es12.x11.jar" value="${build}/jogl.gl2es12.x11.jar" />
+ <property name="jogl.gl2es12.win.jar" value="${build}/jogl.gl2es12.win.jar" />
+ <property name="jogl.gl2es12.osx.jar" value="${build}/jogl.gl2es12.osx.jar" />
+ <property name="jogl.gl2es12.dbg.jar" value="${build}/jogl.gl2es12.dbg.jar" />
+ <property name="jogl.gl2.x11.jar" value="${build}/jogl.gl2.x11.jar" />
+ <property name="jogl.gl2.win.jar" value="${build}/jogl.gl2.win.jar" />
+ <property name="jogl.gl2.osx.jar" value="${build}/jogl.gl2.osx.jar" />
+ <property name="jogl.gl2.dbg.jar" value="${build}/jogl.gl2.dbg.jar" />
+ <property name="jogl.awt.jar" value="${build}/jogl.awt.jar" />
+ <property name="jogl.util.jar" value="${build}/jogl.util.jar" />
+ <property name="jogl.util.gl2.jar" value="${build}/jogl.util.gl2.jar" />
+ <property name="jogl.util.awt.jar" value="${build}/jogl.util.awt.jar" />
+ <property name="jogl.util.fixedfuncemu.jar" value="${build}/jogl.util.fixedfuncemu.jar" />
+ <property name="jogl.sdk.jar" value="${build}/jogl.sdk.jar" />
+ <property name="jogl.all.jar" value="${build}/jogl.all.jar" />
+
+ <!-- The javadoc dirs. -->
+ <property name="javadoc" value="${project.root}/javadoc_jogl_public" />
+ <property name="javadoc.spec" value="${project.root}/javadoc_jogl_spec" />
+ <property name="javadoc.dev" value="${project.root}/javadoc_jogl_dev" />
+ <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
+ <property name="javadoc.windowtitle" value="JOGL API -- JSR-231 ${base_version} Specification" />
+ <property name="javadoc.overview" value="doc/jogl/spec-overview.html" />
+ <property name="javadoc.spec.packagenames" value="javax.media.opengl.*" />
+
+ <property name="javadoc.packagenames" value="${javadoc.spec.packagenames},com.sun.opengl.util.*" />
+
+ <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.opengl.impl.*,com.sun.gluegen,com.sun.gluegen.runtime" />
+ <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=231&quot;&gt;license terms&lt;/a&gt;." />
+ </target>
+
+ <target name="declare.gl.gles1" unless="setup.noes1">
+ <property name="gles1.headers" value="${stub.includes.dir}/opengl/GLES/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform -->
+ </target>
+
+ <target name="declare.gl.gles2" unless="setup.noes2">
+ <property name="gles2.headers" value="${stub.includes.dir}/opengl/GLES2/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform -->
+ </target>
+
+ <target name="declare.gl.gles" unless="setup.noes" depends="declare.gl.gles1, declare.gl.gles2">
+ <!-- Prepare to build the EGL interface -->
+ <property name="window.es.cfg" value="${config}/egl.cfg" />
+ <property name="window.es.ext.cfg" value="${config}/eglext.cfg" />
+ <property name="window.es.system" value="egl"/>
+ </target>
+
+ <target name="declare.gl.gl2" unless="setup.nogl2">
+ <property name="gl2.headers" value="${stub.includes.dir}/opengl/GL/*.h" /> <!-- NOTE: this MUST be relative for FileSet --> <!-- CHECK: this may need to be pruned for each platform -->
+ </target>
+
+ <!-- Declarations that have to come after both the common setup and the GLES tests -->
+ <target name="declare.common.2">
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Initialize all parameters required for the build and create any
+ - required directories.
+ -->
+ <target name="init" depends="declare.common, declare.gl.gles, declare.gl.gl2, declare.common.2">
+ <!-- Call the external config validator script to make sure the config is ok and consistent -->
+ <ant antfile="${validate.user.properties}" inheritall="true"/>
+
+ <!-- Create the required output directories. -->
+ <mkdir dir="${src.generated.java}" />
+ <mkdir dir="${src.generated.c}" />
+ <mkdir dir="${src.generated.c}/MacOSX" />
+ <mkdir dir="${src.generated.c}/Windows" />
+ <mkdir dir="${src.generated.c}/X11" />
+ <mkdir dir="${src.generated.c.openmax}" />
+ <mkdir dir="${classes}" />
+ <mkdir dir="${obj}" />
+ <mkdir dir="${obj.jogl}" />
+ <mkdir dir="${obj.cg}" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation -->
+ <!--
+ - Build GlueGen
+ -->
+ <target name="build.gluegen" depends="init">
+ <!-- Run the GlueGen build to ensure that the GlueGen ANT task
+ - has been built. -->
+ <!-- FIXME: remove passing down of antlr.jar when gluegen.properties is on all
+ nightly build machines -->
+ <ant antfile="${gluegen.build.xml}" dir="${gluegen.make.dir}" target="all" inheritAll="false">
+ <propertyset>
+ <propertyref name="antlr.jar" />
+ <!--propertyref name="gluegen.nsig" /-->
+ <propertyref name="isCDCFP" />
+ </propertyset>
+ </ant>
+ </target>
+
+ <!--
+ - Check to see whether we need to rebuild the generated sources.
+ -->
+ <target name="java.generate.check">
+ <!-- Blow away all target files if any dependencies are violated
+ (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
+ <!--
+ <dependset>
+ <srcfileset refid="stub.includes.dependencies.fileset.1" />
+ <srcfileset refid="stub.includes.dependencies.fileset.2" />
+ <srcfileset refid="stub.includes.dependencies.fileset.3" />
+ <targetfileset dir="${src.generated}">
+ <include name="**/*.java" />
+ <include name="**/*.c" />
+ </targetfileset>
+ </dependset>
+ -->
+
+ <!-- Now check for the presence of one well-known file -->
+ <uptodate property="java.generate.skip.es1"
+ targetfile="${src.generated.java}/javax/media/opengl/GLES1.java">
+ <srcfiles refid="stub.includes.dependencies.fileset.1" />
+ <srcfiles refid="stub.includes.dependencies.fileset.2" />
+ <srcfiles refid="stub.includes.dependencies.fileset.3" />
+ </uptodate>
+ <uptodate property="java.generate.skip.es2"
+ targetfile="${src.generated.java}/javax/media/opengl/GLES2.java">
+ <srcfiles refid="stub.includes.dependencies.fileset.1" />
+ <srcfiles refid="stub.includes.dependencies.fileset.2" />
+ <srcfiles refid="stub.includes.dependencies.fileset.3" />
+ </uptodate>
+ <uptodate property="java.generate.skip.gl2"
+ targetfile="${src.generated.java}/javax/media/opengl/GL2.java">
+ <srcfiles refid="stub.includes.dependencies.fileset.1" />
+ <srcfiles refid="stub.includes.dependencies.fileset.2" />
+ <srcfiles refid="stub.includes.dependencies.fileset.3" />
+ </uptodate>
+ <uptodate property="java.generate.skip.glu"
+ targetfile="${src.generated.java}/javax/media/opengl/glu/GLU.java">
+ <srcfiles refid="stub.includes.dependencies.fileset.1" />
+ <srcfiles refid="stub.includes.dependencies.fileset.2" />
+ <srcfiles refid="stub.includes.dependencies.fileset.3" />
+ </uptodate>
+
+ <condition property="java.generate.skip">
+ <and>
+ <isset property="java.generate.skip.es1"/>
+ <isset property="java.generate.skip.es2"/>
+ <!--isset property="java.generate.skip.gl2"/-->
+ <isset property="java.generate.skip.glu"/>
+ </and>
+ </condition>
+
+ <!--property name="java.generate.skip" value="true"/-->
+ </target>
+
+ <target name="java.generate.cleantemp">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${tempdir}/gensrc" />
+ </delete>
+ </target>
+
+ <target name="java.generate.copy2temp">
+ <copy todir="${tempdir}">
+ <fileset dir="../${rootrel.build.jogl}"
+ includes="gensrc/classes/**" />
+ </copy>
+ </target>
+
+ <target name="java.generate.gl_if">
+ <echo message="Generating GL interface" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gles2.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-if-gl.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gl2_es1_if">
+ <echo message="Generating GL2_ES1 interface" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gles1.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-if-gl2_es1.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gl2_es2_if">
+ <echo message="Generating GL2_ES2 interface" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gles2.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-if-gl2_es2.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gl2">
+ <echo message="Generating GL2 interface and implementation" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gl2.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-gl2.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gl3">
+ <echo message="Generating GL3 interface and implementation" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gl3.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-gl3.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gl2es12">
+ <echo message="Generating GL2ES12 interface and implementation" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gl2.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-gl2es12.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gles1">
+ <echo message="Generating GLES1 interface and implementation" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gles1.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-es1.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gles2">
+ <echo message="Generating GLES2 interface and implementation" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gles2.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/gl-es2.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gl.all" depends="java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gl2_es2_if, java.generate.gl2, java.generate.gl3, java.generate.gl2es12, java.generate.gles1, java.generate.gles2"/>
+
+ <!-- target name="java.generate.gl.nsig" if="gluegen.nsig">
+ <echo message="Generating GL interface and implementation" />
+ <gluegen src="${gl.c}"
+ config="${gl.cfg.nsig}"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.nativesig.NativeSignatureEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target> -->
+
+ <target name="java.generate.glu.base">
+ <echo message="Generating GLU class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/glu.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/glu-base.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.glu.GL2ES1">
+ <echo message="Generating GLU class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/glu.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/glu-gl2es1.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.glu.GL2" unless="setup.nogl2">
+ <echo message="Generating GLU class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/glu.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/glu-gl2.cfg"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.platform.glext" unless="setup.nogl2">
+ <echo message="Generating platform-specific OpenGL extension class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${glext.platform.header}"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${glext.platform.cfg}"
+ includeRefid="stub.includes.fileset.all.gl2"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.window.system.es" if="window.es.cfg" unless="setup.noes">
+ <echo message="Generating EGL implementation class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/**" />
+ <gluegen src="${stub.includes.dir}/${window.es.system}/window-system.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${window.es.cfg}"
+ includeRefid="stub.includes.fileset.platform"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.window.system.es.ext" if="window.es.ext.cfg" unless="setup.noes">
+ <echo message="Generating EGLExt implementation class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/**" />
+ <gluegen src="${stub.includes.dir}/${window.es.system}/window-system-ext.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${window.es.ext.cfg}"
+ includeRefid="stub.includes.fileset.platform"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.window.system.os" if="window.os.cfg" unless="setup.nogl2">
+ <echo message="Generating WGL/GLX/CGL/EGL implementation class" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.dir}/${window.os.system}/window-system.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${window.os.cfg}"
+ includeRefid="stub.includes.fileset.platform"
+ emitter="com.sun.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.SystemUtil.javame_cdc_fp" if="setup.cdcfp">
+ <copy file="../src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/impl/SystemUtil.java" />
+ </target>
+
+ <target name="java.generate.SystemUtil.javase" unless="setup.cdcfp">
+ <copy file="../src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/impl/SystemUtil.java" />
+ </target>
+
+ <!-- Generate the SystemUtil class for this particular profile -->
+ <target name="java.generate.SystemUtil" depends="java.generate.SystemUtil.javase, java.generate.SystemUtil.javame_cdc_fp" />
+
+ <target name="java.generate.BufferUtil.javame_cdc_fp" if="setup.cdcfp">
+ <copy file="../src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/BufferUtil.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/impl/InternalBufferUtil.java" />
+ </target>
+
+ <target name="java.generate.BufferUtil.javase" unless="setup.cdcfp">
+ <copy file="../src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/BufferUtil.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/impl/InternalBufferUtil.java" />
+ </target>
+
+ <!-- Generate the BufferUtil classes for this particular profile -->
+ <target name="java.generate.BufferUtil" depends="java.generate.BufferUtil.javase, java.generate.BufferUtil.javame_cdc_fp" />
+
+ <target name="java.generate.TextureIO.javame_cdc_fp" if="setup.cdcfp">
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/TextureIO.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/spi/DDSImage.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/spi/TGAImage.java" />
+ </target>
+
+ <target name="java.generate.TextureIO.javase" unless="setup.cdcfp">
+ <!-- For debugging -->
+<!--
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/TextureIO.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/spi/DDSImage.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/spi/TGAImage.java" />
+-->
+
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/TextureIO.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/spi/DDSImage.java" />
+ <copy file="../src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase" tofile="../${rootrel.build.jogl}/gensrc/classes/com/sun/opengl/util/texture/spi/TGAImage.java" />
+
+ </target>
+
+ <!-- Generate the TextureIO classes for this particular profile -->
+ <target name="java.generate.TextureIO" depends="java.generate.TextureIO.javase, java.generate.TextureIO.javame_cdc_fp" />
+
+ <target name="java.generate.gl.platforms" >
+ <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.os.system}/** ${stub.includes.dir}/${window.es.system}/** ${stub.includes.dir}/common/** ${stub.includes.dir}/opengl/**" />
+
+ <antcall target="java.generate.window.system.os" inheritRefs="true" />
+ <antcall target="java.generate.platform.glext" inheritRefs="true" />
+ </target>
+
+ <!--
+ - Setup the generating ANT tasks and use it to generate the Java files
+ - from the C GL headers. This involves setting the taskdef and creating
+ - the classpath reference id then running the task on each header.
+ -->
+ <target name="java.generate" depends="build.gluegen, java.generate.SystemUtil, java.generate.BufferUtil, java.generate.TextureIO, java.generate.check" unless="java.generate.skip">
+
+ <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT -->
+ <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask"
+ classpathref="gluegen.classpath" />
+ <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask"
+ classpathref="gluegen.classpath" />
+
+ <!-- Use the GlueGen and BuildStaticGLInfo tasks to generate the
+ - Java files -->
+
+ <echo message="Generating GL interface and implementation" />
+ <antcall target="java.generate.gl.all" inheritRefs="true" />
+ <!--antcall target="java.generate.gl.nsig" inheritRefs="true" /-->
+
+ <antcall target="java.generate.window.system.es" inheritRefs="true" />
+ <antcall target="java.generate.window.system.es.ext" inheritRefs="true" />
+
+ <echo message="Generating platform-specifics: X11" />
+ <antcall target="java.generate.gl.platforms" inheritRefs="true">
+ <param name="window.os.system" value="x11"/>
+ <param name="window.os.cfg" value="${config}/glx-x11.cfg" />
+ <param name="glext.platform.cfg" value="${config}/glxext.cfg" />
+ <param name="glext.platform.header" value="${stub.includes.dir}/x11/glxext.c" />
+ </antcall>
+
+ <echo message="Generating platform-specifics: Win32" />
+ <antcall target="java.generate.gl.platforms" inheritRefs="true">
+ <param name="window.os.system" value="win32"/>
+ <param name="window.os.cfg" value="${config}/wgl-win32.cfg" />
+ <param name="glext.platform.cfg" value="${config}/wglext.cfg" />
+ <param name="glext.platform.header" value="${stub.includes.dir}/win32/wglext.c" />
+ </antcall>
+
+ <echo message="Generating platform-specifics: MaxOsX" />
+ <antcall target="java.generate.gl.platforms" inheritRefs="true">
+ <param name="window.os.system" value="macosx"/>
+ <param name="window.os.cfg" value="${config}/cgl-macosx.cfg" />
+ <param name="glext.platform.cfg" value="${config}/cglext.cfg" />
+ <param name="glext.platform.header" value="${stub.includes.dir}/macosx/cglext.c" />
+ </antcall>
+
+ <!-- Generate GLU class -->
+ <antcall target="java.generate.glu.base" inheritrefs="true" />
+ <antcall target="java.generate.glu.GL2ES1" inheritrefs="true" />
+ <antcall target="java.generate.glu.GL2" inheritrefs="true" />
+
+ <!-- Inform the user that the generators have successfully created
+ - the necessary Java files -->
+ <echo message="" />
+ <echo message="GlueGen and BuildStaticGLInfo have successfully generated files." />
+
+ </target>
+
+ <target name="java.generate.cg.check">
+ <!-- Blow away all target files if any dependencies are violated
+ (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
+ <dependset>
+ <srcfileset refid="stub.includes.cg.dependencies.fileset" />
+ <targetfileset dir=".">
+ <include name="${src.generated.java.cg}/**/*.java" />
+ <include name="${src.generated.c.cg}/**/*.c" />
+ </targetfileset>
+ </dependset>
+
+ <!-- Now check for the presence of one well-known file -->
+ <uptodate property="java.generate.cg.skip">
+ <srcfiles refid="stub.includes.cg.dependencies.fileset" />
+ <mapper type="merge" to="${src.generated.java}/com/sun/opengl/cg/CgGL.java" />
+ </uptodate>
+ </target>
+
+ <!--
+ - Setup the generating ANT tasks and use it to generate the Java files
+ - from the C GL headers. This involves setting the taskdef and creating
+ - the classpath reference id then running the task on each header.
+ -->
+ <target name="java.generate.cg" depends="java.generate.cg.check" if="jogl.cg" unless="java.generate.cg.skip">
+ <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT -->
+ <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask"
+ classpathref="gluegen.classpath" />
+ <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask"
+ classpathref="gluegen.classpath" />
+
+ <!-- Generate CgGL interface class -->
+ <gluegen src="${stub.includes.opengl}/cg.c"
+ outputRootDir="../${rootrel.build.jogl}"
+ config="${config}/cg-common.cfg"
+ includeRefid="stub.includes.cg.fileset.all"
+ emitter="com.sun.gluegen.JavaEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build and dependency rules for the composable pipeline
+ -->
+ <target name="java.generate.composable.pipeline.check.es1" unless="setup.noes1">
+ <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
+ (the uptodate element doesn't support arbitrary source and destination files) -->
+ <dependset>
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GLES1.class" />
+ <targetfileset dir="${src.generated.java}/javax/media/opengl"
+ includes="DebugGLES1.java,TraceGLES1.java" />
+ </dependset>
+
+ <!-- Now choose one of the two to test to see if we have to regenerate -->
+ <uptodate property="java.generate.composable.pipeline.skip.es1"
+ srcfile="${classes}/javax/media/opengl/GLES1.class"
+ targetfile="${src.generated.java}/javax/media/opengl/DebugGLES1.java" />
+
+ </target>
+
+ <target name="java.generate.composable.pipeline.check.es2" unless="setup.noes2">
+ <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
+ (the uptodate element doesn't support arbitrary source and destination files) -->
+ <dependset>
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GLES2.class" />
+ <targetfileset dir="${src.generated.java}/javax/media/opengl"
+ includes="DebugGLES2.java,TraceGLES2.java" />
+ </dependset>
+
+ <!-- Now choose one of the two to test to see if we have to regenerate -->
+ <uptodate property="java.generate.composable.pipeline.skip.es2"
+ srcfile="${classes}/javax/media/opengl/GLES2.class"
+ targetfile="${src.generated.java}/javax/media/opengl/DebugGLES2.java" />
+
+ </target>
+
+ <target name="java.generate.composable.pipeline.check.gl2es12" unless="setup.nogl2">
+ <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
+ (the uptodate element doesn't support arbitrary source and destination files) -->
+ <dependset>
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES12.class" />
+ <targetfileset dir="${src.generated.java}/javax/media/opengl"
+ includes="DebugGL2ES12.java,TraceGL2ES12.java" />
+ </dependset>
+
+ <!-- Now choose one of the two to test to see if we have to regenerate -->
+ <uptodate property="java.generate.composable.pipeline.skip.gl2es12"
+ srcfile="${classes}/javax/media/opengl/GL2ES12.class"
+ targetfile="${src.generated.java}/javax/media/opengl/DebugGL2ES12.java" />
+ </target>
+
+ <target name="java.generate.composable.pipeline.check.gl2" unless="setup.nogl2">
+ <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
+ (the uptodate element doesn't support arbitrary source and destination files) -->
+ <dependset>
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GL2.class" />
+ <targetfileset dir="${src.generated.java}/javax/media/opengl"
+ includes="DebugGL2.java,TraceGL2.java" />
+ </dependset>
+
+ <!-- Now choose one of the two to test to see if we have to regenerate -->
+ <uptodate property="java.generate.composable.pipeline.skip.gl2"
+ srcfile="${classes}/javax/media/opengl/GL2.class"
+ targetfile="${src.generated.java}/javax/media/opengl/DebugGL2.java" />
+ </target>
+
+ <target name="java.generate.composable.pipeline.check.gl3" unless="setup.nogl3">
+ <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
+ (the uptodate element doesn't support arbitrary source and destination files) -->
+ <dependset>
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GL3.class" />
+ <targetfileset dir="${src.generated.java}/javax/media/opengl"
+ includes="DebugGL3.java,TraceGL3.java" />
+ </dependset>
+
+ <!-- Now choose one of the two to test to see if we have to regenerate -->
+ <uptodate property="java.generate.composable.pipeline.skip.gl3"
+ srcfile="${classes}/javax/media/opengl/GL3.class"
+ targetfile="${src.generated.java}/javax/media/opengl/DebugGL3.java" />
+ </target>
+
+ <target name="java.generate.composable.pipeline.es1" depends="java.generate.composable.pipeline.check.es1" unless="java.generate.composable.pipeline.skip.es1">
+ <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
+ <arg value="javax.media.opengl.GLES1" />
+ <arg value="${src.generated.java}/javax/media/opengl" />
+ <classpath refid="pipeline.classpath" />
+ </java>
+ </target>
+
+ <target name="java.generate.composable.pipeline.es2" depends="java.generate.composable.pipeline.check.es2" unless="java.generate.composable.pipeline.skip.es2">
+ <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
+ <arg value="javax.media.opengl.GLES2" />
+ <arg value="${src.generated.java}/javax/media/opengl" />
+ <classpath refid="pipeline.classpath" />
+ </java>
+ </target>
+
+ <target name="java.generate.composable.pipeline.gl2es12" depends="java.generate.composable.pipeline.check.gl2es12" unless="java.generate.composable.pipeline.skip.gl2es12">
+ <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
+ <arg value="javax.media.opengl.GL2ES12" />
+ <arg value="${src.generated.java}/javax/media/opengl" />
+ <classpath refid="pipeline.classpath" />
+ </java>
+ </target>
+
+ <target name="java.generate.composable.pipeline.gl2" depends="java.generate.composable.pipeline.check.gl2" unless="java.generate.composable.pipeline.skip.gl2">
+ <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
+ <arg value="javax.media.opengl.GL2" />
+ <arg value="${src.generated.java}/javax/media/opengl" />
+ <classpath refid="pipeline.classpath" />
+ </java>
+ </target>
+
+ <target name="java.generate.composable.pipeline.gl3" depends="java.generate.composable.pipeline.check.gl3" unless="java.generate.composable.pipeline.skip.gl3">
+ <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
+ <arg value="javax.media.opengl.GL3" />
+ <arg value="${src.generated.java}/javax/media/opengl" />
+ <classpath refid="pipeline.classpath" />
+ </java>
+ </target>
+
+ <target name="java.generate.composable.pipeline.check">
+ <condition property="java.generate.composable.pipeline.skip.es1">
+ <isset property="setup.noes1"/>
+ </condition>
+ <condition property="java.generate.composable.pipeline.skip.es2">
+ <isset property="setup.noes2"/>
+ </condition>
+ <condition property="java.generate.composable.pipeline.skip.gl2">
+ <isset property="setup.nogl2"/>
+ </condition>
+ <condition property="java.generate.composable.pipeline.skip.gl3">
+ <isset property="setup.nogl3"/>
+ </condition>
+ </target>
+ <target name="java.generate.composable.pipeline" depends="java.generate.composable.pipeline.check, java.generate.composable.pipeline.es1, java.generate.composable.pipeline.es2, java.generate.composable.pipeline.gl2, java.generate.composable.pipeline.gl3">
+ </target>
+
+ <target name="java.generate.composable.pipeline.custom.check.glfixfunc">
+ <!-- Blow away the DebugGL*.java and TraceGL*.java sources if GL*.class has changed
+ (the uptodate element doesn't support arbitrary source and destination files) -->
+ <dependset>
+ <srcfilelist dir="${classes}/com/sun/opengl/util/glsl/fixedfunc" files="FixedFuncHook.class" />
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES1.class" />
+ <srcfilelist dir="${classes}/javax/media/opengl" files="GL2ES2.class" />
+ <targetfileset dir="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl"
+ includes="FixedFuncImpl.java" />
+ </dependset>
+
+ <!-- Now choose one of the two to test to see if we have to regenerate -->
+ <uptodate property="java.generate.composable.pipeline.custom.skip.glfixfunc"
+ srcfile="${classes}/javax/media/opengl/GL2ES1.class"
+ targetfile="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncImpl.java" />
+ </target>
+ <target name="java.generate.composable.pipeline.custom.glfixfunc" depends="java.generate.composable.pipeline.custom.check.glfixfunc" unless="java.generate.composable.pipeline.custom.skip.glfixfunc">
+ <java classname="com.sun.gluegen.opengl.BuildComposablePipeline" fork="yes" failonerror="true">
+ <arg value="javax.media.opengl.GL2ES1" />
+ <arg value="${src.generated.java}/com/sun/opengl/util/glsl/fixedfunc/impl" />
+ <arg value="com.sun.opengl.util.glsl.fixedfunc.impl.FixedFuncImpl" />
+ <arg value="com.sun.opengl.util.glsl.fixedfunc.impl.FixedFuncHook" />
+ <arg value="javax.media.opengl.GL2ES2" />
+ <arg value="prolog_xor_downstream" />
+ <classpath refid="pipeline.classpath" />
+ </java>
+ </target>
+ <target name="java.generate.composable.pipeline.custom" depends="init, build.gluegen, java.generate.composable.pipeline.check, java.generate.composable.pipeline.custom.glfixfunc">
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Compile the original and generated source. The composable pipelines
+ - will be generated.
+ -->
+ <target name="java.compile.firstpass" depends="java.generate,java.generate.cg">
+ <antcall target="java.generate.cleantemp" inheritRefs="true" />
+
+ <!-- Perform the first pass Java compile. -->
+ <javac destdir="${classes}"
+ includes="javax/media/opengl/fixedfunc/** javax/media/opengl/GLDrawableFactory.java javax/media/opengl/GLDrawable.java javax/media/opengl/GLContext.java javax/media/opengl/GL.java javax/media/opengl/GL2ES1.java javax/media/opengl/GL2ES2.java javax/media/opengl/GL2.java javax/media/opengl/GLES1.java javax/media/opengl/GLES2.java javax/media/opengl/GL3.java"
+ fork="yes"
+ memoryMaximumSize="${javac.memorymax}"
+ source="1.4" debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.secondpass.1" if="javac.bootclasspath.jar">
+ <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. -->
+ <javac destdir="${classes}"
+ excludes="com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}"
+ source="${jogl.sourcelevel}"
+ bootclasspath="${javac.bootclasspath.jar}"
+ fork="yes"
+ memoryMaximumSize="${javac.memorymax}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.secondpass.2" unless="javac.bootclasspath.jar">
+ <!-- Perform the second pass Java compile; everything except portion of fixed function emulation depending on generated code. -->
+ <javac destdir="${classes}"
+ excludes="com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java,${java.excludes.all}"
+ source="${jogl.sourcelevel}"
+ fork="yes"
+ memoryMaximumSize="${javac.memorymax}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.secondpass" depends="java.generate.composable.pipeline,java.compile.secondpass.1,java.compile.secondpass.2" />
+
+ <target name="java.compile.thirdpass.1" if="javac.bootclasspath.jar">
+ <!-- Perform the third pass Java compile; everything including fixed function emulation. -->
+ <javac destdir="${classes}"
+ excludes="${java.excludes.all}"
+ source="${jogl.sourcelevel}"
+ bootclasspath="${javac.bootclasspath.jar}"
+ fork="yes"
+ memoryMaximumSize="${javac.memorymax}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.thirdpass.2" unless="javac.bootclasspath.jar">
+ <!-- Perform the third pass Java compile; everything including fixed function emulation. -->
+ <javac destdir="${classes}"
+ excludes="${java.excludes.all}"
+ source="${jogl.sourcelevel}"
+ fork="yes"
+ memoryMaximumSize="${javac.memorymax}"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.thirdpass" depends="java.generate.composable.pipeline.custom,java.compile.thirdpass.1,java.compile.thirdpass.2" />
+
+ <target name="java.compile" depends="java.compile.firstpass,java.compile.secondpass,java.compile.thirdpass" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Compile the native C code for JOGL (and optionally the Cg binding).
+ -->
+
+ <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler" unless="jogl.compiler.present">
+ <!-- compiler configuration -->
+ <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
+
+ <compiler id="compiler.cfg.freebsd.jogl" extends="compiler.cfg.freebsd">
+ <!-- Need to force X11R6 headers on to include path after stub_includes -->
+ <includepath path="stub_includes/opengl"/>
+ <includepath path="/usr/X11R6/include" />
+ </compiler>
+
+ <!-- linker configuration -->
+
+ <linker id="linker.cfg.linux.jogl.x11" extends="linker.cfg.linux">
+ <syslibset dir="/usr/X11R6/lib" libs="X11"/>
+ <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
+ </linker>
+
+ <linker id="linker.cfg.linux.jogl.gl2" extends="linker.cfg.linux.jogl.x11">
+ <syslibset dir="/usr/X11R6/lib" libs="GL"/>
+ <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/>
+ </linker>
+
+ <linker id="linker.cfg.linux.amd64.jogl.x11" extends="linker.cfg.linux.amd64">
+ <syslibset dir="/usr/X11R6/lib64" libs="X11"/>
+ <syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" />
+ </linker>
+
+ <linker id="linker.cfg.linux.amd64.jogl.gl2" extends="linker.cfg.linux.amd64.jogl.x11">
+ <syslibset dir="/usr/X11R6/lib64" libs="GL"/>
+ <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/>
+ </linker>
+
+ <linker id="linker.cfg.solaris.jogl.x11" extends="linker.cfg.solaris">
+ <syslibset libs="X11"/>
+ </linker>
+
+ <linker id="linker.cfg.solaris.jogl.gl2" extends="linker.cfg.solaris">
+ <syslibset libs="GL"/>
+ <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/>
+ </linker>
+
+ <linker id="linker.cfg.solaris.sparcv9.jogl.gl2" extends="linker.cfg.solaris.sparcv9">
+ <linkerarg value="-xarch=v9a" />
+ <syslibset dir="/usr/openwin/lib/sparcv9" libs="GL"/>
+ <syslibset dir="/usr/lib/sparcv9" libs="X11"/>
+ </linker>
+
+ <linker id="linker.cfg.solaris.amd64.jogl.gl2" extends="linker.cfg.solaris.amd64">
+ <linkerarg value="-xarch=amd64" />
+ <syslibset dir="/usr/lib/amd64" libs="GL"/>
+ <syslibset dir="/usr/lib/amd64" libs="X11"/>
+ </linker>
+
+ <linker id="linker.cfg.win32.mingw.jogl" extends="linker.cfg.win32.mingw">
+ <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
+ <syslibset libs="opengl32, glu32, gdi32, kernel32"/>
+ <syslibset dir="${windows.cg.lib}" libs="cg, cgGL" if="c.compiler.use-cglib"/>
+ </linker>
+
+ <linker id="linker.cfg.win32.msvc.jogl" extends="linker.cfg.win32.msvc">
+ <syslibset libs="opengl32, gdi32, user32, kernel32" />
+ <syslibset dir="${windows.cg.lib}" libs="cg, cgGL" if="c.compiler.use-cglib"/>
+ <!-- This is temporary -->
+ <syslibset libs="winmm" />
+ </linker>
+
+ <linker id="linker.cfg.macosx.jogl" extends="linker.cfg.macosx">
+ <linkerarg value="-framework" />
+ <linkerarg value="Cocoa" />
+ <linkerarg value="-framework" />
+ <linkerarg value="OpenGL" />
+ <linkerarg value="-framework" if="c.compiler.use-cglib" />
+ <linkerarg value="Cg" if="c.compiler.use-cglib" />
+ </linker>
+
+ <linker id="linker.cfg.hpux.jogl" extends="linker.cfg.hpux">
+ <syslibset dir="/opt/graphics/OpenGL/lib" libs="GL, GLU"/>
+ <syslibset dir="/usr/lib" libs="X11"/>
+ </linker>
+ </target>
+
+ <target name="c.configure.win32.vc" if="isVCFamily">
+ <echo message="Win32.VC" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" />
+ <property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.jogl" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.win32.msvc.jogl" />
+ </target>
+
+ <target name="c.configure.win32.mingw" if="isMingW">
+ <echo message="Win32.MingW" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
+ <property name="linker.cfg.id.core" value="linker.cfg.win32.mingw" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.jogl" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.win32.mingw.jogl" />
+ </target>
+
+ <target name="c.configure.linux.x86" if="isLinuxX86">
+ <echo message="Linux.x86" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.linux.jogl.gl2" />
+ </target>
+
+ <target name="c.configure.linux.amd64" if="isLinuxAMD64">
+ <echo message="Linux.AMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux.amd64" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.linux.amd64.jogl.gl2" />
+ </target>
+
+ <target name="c.configure.linux.ia64" if="isLinuxIA64">
+ <echo message="Linux.IA64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.linux.jogl.gl2" />
+ </target>
+
+ <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
+
+ <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
+ <echo message="Solaris" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.solaris.jogl.gl2" />
+ </target>
+
+
+ <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
+ <echo message="SolarisSparcv9" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.solaris.sparcv9.jogl.gl2" />
+ </target>
+
+
+ <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
+ <echo message="SolarisAMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.solaris.amd64.jogl.gl2" />
+ </target>
+
+ <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD">
+ <echo message="FreeBSD" />
+ <property name="compiler.cfg.id" value="compiler.cfg.freebsd.jogl" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.linux.jogl.gl2" />
+ </target>
+
+ <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
+ <echo message="HP-UX" />
+ <property name="compiler.cfg.id" value="compiler.cfg.hpux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.hpux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.hpux.jogl.x11" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.hpux.jogl.gl2" />
+ </target>
+
+ <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" />
+
+ <target name="c.configure.x11" if="isX11" />
+
+ <target name="c.configure.macosx" if="isOSX">
+ <property name="compiler.cfg.id" value="compiler.cfg.macosx" />
+ <property name="linker.cfg.id.core" value="linker.cfg.macosx" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.jogl" />
+ <property name="linker.cfg.id.gl2" value="linker.cfg.macosx.jogl" />
+ </target>
+
+ <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" />
+
+ <target name="c.configure" depends="c.configure.1,c.configure.2" />
+
+ <target name="rename.mingw.dll" if="isMingW">
+ <move file="${src}" tofile="${dest}" />
+ </target>
+
+ <target name="rename.dylib" if="isOSX">
+ <move file="${src}" tofile="${dest}" />
+ </target>
+
+ <macrodef name="c.build">
+ <attribute name="c.compiler.src.files" />
+ <attribute name="compiler.cfg.id" />
+ <attribute name="linker.cfg.id" />
+ <attribute name="output.lib.name" />
+ <attribute name="c.compiler.use-jawt" default="false"/>
+ <sequential>
+ <echo message="Output lib name = @{output.lib.name}" />
+
+ <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
+ <property name="c.compiler.debug" value="false" />
+ <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } -->
+ <property name="c.compiler.optimise" value="none" />
+
+ <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
+
+ <patternset id="c.src.files.jogl.gl2">
+ <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/>
+ <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/>
+ <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
+ <!-- FIXME: the Mixer should be moved to another library -->
+ <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/-->
+ <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/>
+ <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/>
+
+ <include name="${rootrel.generated.c.jogl}/gl2/GL2Impl_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/gl3/GL3Impl_JNI.c"/>
+ <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
+ <include name="${rootrel.generated.c.jogl}/gl2/GLUgl2_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/>
+ <include name="${rootrel.generated.c.jogl}/MacOSX/CGL*.c" if="isOSX"/>
+ <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/>
+ </patternset>
+
+ <patternset id="c.src.files.jogl.gl2es12">
+ <include name="${rootrel.src.c}/macosx/MacOSXWindowSystemInterface.m" if="isOSX"/>
+ <include name="${rootrel.src.c}/macosx/ContextUpdater.m" if="isOSX"/>
+ <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
+ <!-- FIXME: the Mixer should be moved to another library -->
+ <!--include name="${rootrel.src.c}/Mixer.cpp" if="isWindows"/-->
+ <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/>
+ <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/>
+
+ <include name="${rootrel.generated.c.jogl}/gl2es12/GL2ES12Impl_JNI.c"/>
+ <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
+ <!--include name="${rootrel.generated.c.jogl}/gl2es12/GLUgl2es12_JNI.c"/ SKIPPED -->
+ <include name="${rootrel.generated.c.jogl}/X11/GLX*.c" if="isX11"/>
+ <include name="${rootrel.generated.c.jogl}/MacOSX/CGL*.c" if="isOSX"/>
+ <include name="${rootrel.generated.c.jogl}/Windows/WGL*.c" if="isWindows"/>
+ </patternset>
+
+ <patternset id="c.src.files.jogl.es2">
+ <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
+ <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/>
+ <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/>
+
+ <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/es2/GLES2Impl_JNI.c"/>
+ </patternset>
+
+ <patternset id="c.src.files.jogl.es1">
+ <include name="${rootrel.src.c}/GLXGetProcAddressARB.c" if="isX11"/>
+ <include name="${rootrel.src.c.openmax}/omx_tool.c" if="useOpenMAX"/>
+ <include name="${rootrel.src.c.openmax}/com_sun_openmax_OMXInstance.c" if="useOpenMAX"/>
+
+ <include name="${rootrel.generated.c.jogl}/egl/EGL_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/egl/EGLExtImpl_JNI.c"/>
+ <include name="${rootrel.generated.c.jogl}/es1/GLES1Impl_JNI.c"/>
+ <!--include name="${rootrel.generated.c.jogl}/GLU_JNI.c"/ EMPTY -->
+ <!--include name="${rootrel.generated.c.jogl}/es1/GLUes1_JNI.c" EMPTY /-->
+ </patternset>
+
+ <patternset id="c.src.files.cg">
+ <include name="${rootrel.generated.c.cg}/*.c"/>
+ </patternset>
+
+ <echo message="Compiling @{output.lib.name}" />
+
+ <cc outtype="shared"
+ objdir="${obj.jogl}"
+ outfile="${obj}/@{output.lib.name}"
+ optimize="${c.compiler.optimise}"
+ debug="${c.compiler.debug}"
+ multithreaded="true"
+ exceptions="false"
+ rtti="false">
+
+ <!-- TODO: versioninfo companyname="java.net"
+ legalcopyright="Copyright"
+ productname="JOGL"
+ productversion="x.y.z"
+ description="Description"
+ fileversion="x.y.z"
+ filecomments="File Comment" /-->
+
+ <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+
+ <compiler extends="@{compiler.cfg.id}" >
+ <sysincludepath path="${java.includes.dir}"/>
+ <sysincludepath path="${java.includes.dir.platform}"/>
+ <includepath path="stub_includes/opengl"/>
+ <includepath path="stub_includes/egl"/>
+ <includepath path="stub_includes/openmax" if="useOpenMAX"/>
+ <includepath path="stub_includes/cg" if="c.compiler.use-cglib"/>
+
+ <!-- This is for the generated headers for handwritten C code -->
+ <includepath path="${src.generated.c}" />
+ <includepath path="${src.generated.c}/X11" if="isX11"/>
+ <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
+ <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+ <includepath path="${src.generated.c.openmax}" if="useOpenMAX"/>
+
+ <!-- This must come last to not override real include paths -->
+ <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
+ </compiler>
+
+ <linker extends="@{linker.cfg.id}">
+ <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+ <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
+ </linker>
+ </cc>
+
+ <!-- FIXME: this is a hack; the cpptask should have an option to change the
+ suffix or at least understand the override from dylib to jnilib -->
+ <antcall target="rename.dylib" inheritRefs="true">
+ <param name="src" value="${build}/obj/lib@{output.lib.name}.dylib" />
+ <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" />
+ </antcall>
+
+ <!-- FIXME: this is a hack; the cpptask should have an option to change the
+ suffix or at least understand the override from dylib to jnilib -->
+ <antcall target="rename.mingw.dll" inheritRefs="true">
+ <param name="src" value="${build}/obj/lib@{output.lib.name}.so" />
+ <param name="dest" value="${build}/obj/@{output.lib.name}.dll" />
+ </antcall>
+ </sequential>
+ </macrodef>
+
+ <target name="c.build.jogl.prepare">
+ <!-- Generate the waveout Mixer header -->
+ <!-- FIXME: this is temporary until we move this to another workspace -->
+ <javah destdir="../${rootrel.build.jogl}/gensrc/native/jogl" classpath="${jogl.all.jar}" class="com.sun.javafx.audio.windows.waveout.Mixer" />
+ <javah destdir="../${rootrel.build.jogl}/gensrc/native/openmax" classpath="${jogl.all.jar}" class="com.sun.openmax.OMXInstance" />
+ </target>
+
+ <target name="c.build.jogl.gl2" unless="setup.nogl2">
+ <c.build c.compiler.src.files="c.src.files.jogl.gl2"
+ output.lib.name="jogl_gl2"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.gl2}"/>
+ </target>
+
+ <target name="c.build.jogl.gl2es12" unless="setup.nogl2">
+ <c.build c.compiler.src.files="c.src.files.jogl.gl2es12"
+ output.lib.name="jogl_gl2es12"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.gl2}"/>
+ </target>
+
+ <target name="c.build.jogl.es2" unless="setup.noes1">
+ <c.build c.compiler.src.files="c.src.files.jogl.es2"
+ output.lib.name="jogl_es2"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.base}"/>
+ </target>
+
+ <target name="c.build.jogl.es1" unless="setup.noes2">
+ <c.build c.compiler.src.files="c.src.files.jogl.es1"
+ output.lib.name="jogl_es1"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.base}"/>
+ </target>
+
+ <target name="c.build.jogl.cg" if="jogl.cg">
+ <c.build c.compiler.src.files="c.src.files.cg"
+ output.lib.name="jogl_cg"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.gl2}"/>
+ </target>
+
+ <target name="c.manifest.cg" if="jogl.cg">
+ <msvc.manifest objdir="${obj}" dllname="jogl_cg" />
+ </target>
+
+ <target name="c.manifest" if="isVC8Family">
+ <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll -->
+ <msvc.manifest objdir="${obj}" dllname="jogl_es1" />
+ <msvc.manifest objdir="${obj}" dllname="jogl_es2" />
+ <msvc.manifest objdir="${obj}" dllname="jogl_gl2" />
+ <msvc.manifest objdir="${obj}" dllname="jogl_gl2es12" />
+ <antcall target="c.manifest.cg" inheritRefs="true" />
+ </target>
+
+ <target name="c.build.jogl" depends="c.configure,c.build.jogl.prepare,c.build.jogl.gl2es12,c.build.jogl.gl2,c.build.jogl.es2,c.build.jogl.es1,c.build.jogl.cg">
+ <antcall target="c.manifest" inheritRefs="true" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the jogl.jar files.
+ -->
+ <target name="jar" depends="java.compile,cond-if-RImanifest,cond-else-RImanifest"/>
+
+ <target name="check-RIcond">
+ <condition property="RIcond-is-true">
+ <isset property="RImanifestfile"/>
+ </condition>
+ </target>
+
+ <target name="cond-if-RImanifest" depends="check-RIcond" if="RIcond-is-true">
+ <copy file="joglRIversion"
+ tofile="tempversion"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
+ <filter token="BASEVERSION" value="${base_version}"/>
+ </filterset>
+ </copy>
+
+ <jar manifest="tempversion" destfile="${jogl.core.jar}">
+ <fileset dir="${classes}"
+ includes="javax/media/opengl/**, com/sun/gluegen/runtime/**, com/sun/opengl/**"
+ excludes="${java.excludes.fixme} ${java.part.egl}, ${java.part.sdk}, ${java.part.openmax}, ${java.part.gl2es12.x11}, ${java.part.gl2es12.win}, ${java.part.gl2es12.osx}, ${java.part.gl2es12.dbg}, ${java.part.gl2.x11}, ${java.part.gl2.win}, ${java.part.gl2.osx}, ${java.part.gl2.dbg}, ${java.part.es1}, ${java.part.es1.dbg}, ${java.part.es2}, ${java.part.es2.dbg}, ${java.part.awt}, ${java.part.glutess}, ${java.part.glumipmap}, ${java.part.glugl2}, ${java.part.util} ${java.part.util.awt} ${java.part.util.gl2} ${java.part.util.glsl} ${java.part.util.fixedfuncemu}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gles1.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.es1}"
+ excludes="${java.part.es1.dbg}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gles1.dbg.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.es1.dbg}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gles2.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.es2}, ${java.part.openmax}"
+ excludes="${java.part.es2.dbg}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gles2.dbg.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.es2.dbg}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.egl.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.egl}"
+ excludes="${java.part.awt}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2es12.x11.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2es12.x11}, ${java.part.openmax}"
+ excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2es12.win.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2es12.win}, ${java.part.openmax}"
+ excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2es12.osx.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2es12.osx}, ${java.part.openmax}"
+ excludes="${java.part.gl2es12.dbg}, ${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2es12.dbg.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2es12.dbg}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2.x11.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2.x11}, ${java.part.gl3}, ${java.part.openmax}"
+ excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2.win.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2.win}, $${java.part.gl3}, {java.part.openmax}"
+ excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2.osx.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2.osx}, $${java.part.gl3}, {java.part.openmax}"
+ excludes="${java.part.gl2.dbg}, ${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.gl2.dbg.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.gl2.dbg}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.sdk.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.sdk}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.glutess.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.glutess}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.glumipmap.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.glumipmap}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.glugl2.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.glugl2}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.awt.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.awt}" />
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.util.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.util}, ${java.part.util.glsl}"
+ excludes="${java.part.util.awt}, ${java.part.util.gl2}, ${java.part.gl3}, ${java.part.util.fixedfuncemu}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.util.gl2.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.util.gl2}"
+ excludes="com/sun/opengl/**/awt/**"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.util.awt.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.util.awt}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.util.fixedfuncemu.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.util.fixedfuncemu}"/>
+ <fileset dir="${src.java}"
+ includes="${java.part.util.fixedfuncemu.shadercode}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${jogl.all.jar}">
+ <fileset dir="${classes}">
+ <include name="javax/media/opengl/**" />
+ <include name="com/sun/gluegen/runtime/**" />
+ <include name="com/sun/opengl/**" />
+ <include name="${java.part.openmax}" />
+ <!-- FIXME: this is temporary until we move these classes to another workspace -->
+ <include name="com/sun/javafx/**" />
+ </fileset>
+ <fileset dir="${src.java}"
+ includes="${java.part.util.fixedfunc.shaders}"/>
+ </jar>
+ <delete file="tempversion"/>
+ </target>
+
+
+ <target name="cond-else-RImanifest" depends="check-RIcond" unless="RIcond-is-true">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
+ </tstamp>
+ <copy file="joglversion"
+ tofile="tempversion"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
+ <filter token="BASEVERSION" value="${base_version}"/>
+ </filterset>
+ </copy>
+ <jar manifest="tempversion" destfile="${jogl.jar}">
+ <fileset dir="${classes}">
+ <include name="javax/media/opengl/**" />
+ <include name="com/sun/gluegen/runtime/**" />
+ <include name="com/sun/opengl/**" />
+ <include name="com/sun/javafx/**" />
+ </fileset>
+ </jar>
+ <delete file="tempversion"/>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the Javadocs for the sources.
+ - NOTE: these are not entirely correct as the javadocs targets depend
+ - on the platform specific build targets. To circumvent any
+ - errors, ensure that the source is built first.
+ -->
+ <target name="javadoc.nocg" depends="load.user.properties,init" unless="jogl.cg">
+ <!-- Build the general public Javadoc -->
+ <javadoc packagenames="${javadoc.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+ </javadoc>
+ </target>
+
+ <!-- Same as above but with Cg directories added -->
+ <target name="javadoc.cg" depends="load.user.properties,init" if="jogl.cg">
+ <!-- Build the general public Javadoc with CG -->
+ <javadoc packagenames="${javadoc.packagenames},com.sun.opengl.cg"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc" depends="javadoc.nocg,javadoc.cg" />
+
+ <target name="javadoc.spec.nocg" depends="load.user.properties,init" unless="jogl.cg">
+ <!-- Build the specification Javadoc -->
+ <javadoc packagenames="${javadoc.spec.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+ </javadoc>
+ </target>
+
+ <!-- Same as above since Cg directories are not part of spec -->
+ <target name="javadoc.spec.cg" depends="load.user.properties,init" if="jogl.cg">
+ <!-- Build the specification Javadoc with CG -->
+ <javadoc packagenames="${javadoc.spec.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc.spec" depends="javadoc.spec.nocg,javadoc.spec.cg" />
+
+ <target name="javadoc.dev.nocg" unless="jogl.cg">
+ <!-- Build the internal developer Javadoc -->
+ <javadoc packagenames="${javadoc.dev.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+ </javadoc>
+ </target>
+
+ <!-- Same as above but with Cg directories added -->
+ <target name="javadoc.dev.cg" if="jogl.cg">
+ <!-- Build the internal developer Javadoc -->
+ <javadoc packagenames="${javadoc.dev.packagenames},com.sun.opengl.cg"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen.classpath"/>
+ <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc.dev.all" depends="load.user.properties,init,javadoc.dev.nocg,javadoc.dev.cg" />
+
+ <target name="all.doc" description="Build JOGL docs" depends="init,javadoc,javadoc.spec,javadoc.dev.all" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the platform-independent distribution out of jars built for
+ - Windows, Linux and Mac OS X; the Java sources for Jogl can't be
+ - fully cross-compiled at this time. To run this target, you need to
+ - specify the property jogl.dist.dir as a System property (i.e.,
+ - "ant -Djogl.dist.dir=../dist dist"); directories named jogl-linux,
+ - jogl-win, and jogl-macosx need to be inside that directory and each
+ - of those directories needs to contain both the jogl.jar for that
+ - platform as well as the native code (libjogl.so, jogl.dll, or
+ - libjogl.jnilib). Also builds jars containing the native code for
+ - Windows, Linux, Mac OS X, Solaris/SPARC and Solaris/x86.
+ -->
+ <target name="dist.dir.check" unless="jogl.dist.dir">
+ <fail>
+
+ ******************************************************************
+ ** To build the Jogl distribution out of the platform-specific **
+ ** component jars and native code, the property jogl.dist.dir **
+ ** needs to be specified on the command line. Please read the **
+ ** comments associated with the "dist" target in the build.xml. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.windows" if="jogl.dist.dir">
+ <condition property="windows.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-win/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-win/32/jogl.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/32/jogl_awt.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/32/jogl_cg.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/32/gluegen-rt.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/32/gluegen-rt-natives-windows-i586.jar" />
+ </and>
+ </condition>
+ <fail unless="windows.complete">
+ ******************************************************************
+ ** Files are missing from the Windows build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Windows build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.windows-amd64" if="jogl.dist.dir">
+ <condition property="windows-amd64.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-win/64/jogl.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/64/jogl_awt.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/64/jogl_cg.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/64/gluegen-rt.dll" />
+ <available file="${jogl.dist.dir}/jogl-win/64/gluegen-rt-natives-windows-amd64.jar" />
+ </and>
+ </condition>
+ <fail unless="windows-amd64.complete">
+ *********************************************************************
+ ** Files are missing from the Windows/AMD64 build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Windows/AMD64 build and try again. **
+ *********************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.linux" if="jogl.dist.dir">
+ <condition property="linux.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-linux/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-linux/32/libjogl.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/32/libjogl_awt.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/32/libjogl_cg.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/32/libgluegen-rt.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/32/gluegen-rt-natives-linux-i586.jar" />
+ <!-- Assume we also copy over these generated files in the Linux build -->
+ <!-- in order to satisfy requests from end users that we provide these -->
+ <!-- files for easier source browsing in IDEs -->
+ <available file="${jogl.dist.dir}/jogl-linux/DebugGL2.java" />
+ <available file="${jogl.dist.dir}/jogl-linux/TraceGL2.java" />
+ <available file="${jogl.dist.dir}/jogl-linux/GL.java" />
+ <available file="${jogl.dist.dir}/jogl-linux/GLU.java" />
+ </and>
+ </condition>
+ <fail unless="linux.complete">
+ ******************************************************************
+ ** Files are missing from the Linux build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Linux build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.linux-amd64" if="jogl.dist.dir">
+ <condition property="linux-amd64.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-linux/64/libjogl.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/64/libjogl_awt.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/64/libjogl_cg.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/64/libgluegen-rt.so" />
+ <available file="${jogl.dist.dir}/jogl-linux/64/gluegen-rt-natives-linux-amd64.jar" />
+ </and>
+ </condition>
+ <fail unless="linux-amd64.complete">
+ *******************************************************************
+ ** Files are missing from the Linux/AMD64 build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Linux/AMD64 build and try again. **
+ *******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.macosx" if="jogl.dist.dir">
+ <condition property="macosx.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-macosx/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-macosx/ppc/libjogl.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/ppc/libjogl_awt.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/ppc/libjogl_cg.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/ppc/libgluegen-rt.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/ppc/gluegen-rt-natives-macosx-ppc.jar" />
+ </and>
+ </condition>
+ <fail unless="macosx.complete">
+ ******************************************************************
+ ** Files are missing from the Mac OS X build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Mac OS X build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+
+ <target name="dist.check.macosxfat" if="jogl.dist.dir">
+ <condition property="macosxfat.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-macosx/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-macosx/fat/libjogl.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/fat/libjogl_awt.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/fat/libjogl_cg.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/fat/libgluegen-rt.jnilib" />
+ <available file="${jogl.dist.dir}/jogl-macosx/fat/gluegen-rt-natives-macosx-universal.jar" />
+ </and>
+ </condition>
+ <fail unless="macosxfat.complete">
+ ******************************************************************
+ ** Files are missing from the Mac OS X build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Mac OS X build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+
+
+ <target name="dist.check.solsparc" if="jogl.dist.dir">
+ <condition property="solsparc.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-solsparc/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/32/libjogl.so" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/32/libjogl_awt.so" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/32/libgluegen-rt.so" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/32/gluegen-rt-natives-solaris-sparc.jar" />
+ </and>
+ </condition>
+ <fail unless="solsparc.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/SPARC build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/SPARC build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solsparcv9" if="jogl.dist.dir">
+ <condition property="solsparcv9.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-solsparc/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/64/libjogl.so" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/64/libjogl_awt.so" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/64/libgluegen-rt.so" />
+ <available file="${jogl.dist.dir}/jogl-solsparc/64/gluegen-rt-natives-solaris-sparcv9.jar" />
+ </and>
+ </condition>
+ <fail unless="solsparcv9.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/SPARCv9 build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/SPARCv9 build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solx86" if="jogl.dist.dir">
+ <condition property="solx86.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-solx86/jogl.jar" />
+ <available file="${jogl.dist.dir}/jogl-solx86/32/libjogl.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/32/libjogl_awt.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/32/libjogl_cg.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/32/libgluegen-rt.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/32/gluegen-rt-natives-solaris-i586.jar" />
+ </and>
+ </condition>
+ <fail unless="solx86.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/x86 build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/x86 build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solamd64" if="jogl.dist.dir">
+ <condition property="solamd64.complete">
+ <and>
+ <available file="${jogl.dist.dir}/jogl-solx86/64/libjogl.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/64/libjogl_awt.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/64/libgluegen-rt.so" />
+ <available file="${jogl.dist.dir}/jogl-solx86/64/gluegen-rt-natives-solaris-amd64.jar" />
+ </and>
+ </condition>
+ <fail unless="solamd64.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/x86/64 (amd64) build. This *
+ ** will cause the distribution **
+ ** to be incomplete. Please check the **
+ ** status of the Solaris/x86 (amd64) build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <!-- Helper task for dist target below -->
+ <!-- Required parameters: -->
+ <!-- zip.os.arch = the os/arch combination for this zip file (i.e., "windows-i586") -->
+ <!-- zip.src.so.dir = the directory containing the .so's / .dll's / .jnilib's for this platform-->
+ <target name="dist.build.zip">
+ <property name="jogl.tmp.version" value="jogl-${tmp.version}-${zip.os.arch}" />
+ <!-- Create all needed directories -->
+ <delete dir="${jogl.dist.dir}/tmp" failonerror="false" />
+ <mkdir dir="${jogl.dist.dir}/tmp/${jogl.tmp.version}/lib" />
+ <!-- Copy in files -->
+ <copy todir="${jogl.dist.dir}/tmp/${jogl.tmp.version}/lib">
+ <fileset dir="${zip.src.so.dir}" includes="*${zip.so.suffix}" />
+ </copy>
+ <copy file="${jogl.dist.dir}/jogl.jar" todir="${jogl.dist.dir}/tmp/${jogl.tmp.version}/lib" />
+ <copy file="${jogl.dist.dir}/gluegen-rt.jar" todir="${jogl.dist.dir}/tmp/${jogl.tmp.version}/lib" />
+ <copy file="../CHANGELOG.txt" todir="${jogl.dist.dir}/tmp/${jogl.tmp.version}" />
+ <copy file="../COPYRIGHT.txt" todir="${jogl.dist.dir}/tmp/${jogl.tmp.version}" />
+ <copy file="../LICENSE.txt" tofile="${jogl.dist.dir}/tmp/${jogl.tmp.version}/LICENSE-JOGL-${tmp.version}.txt" />
+ <copy file="README-zip-bundles.txt"
+ tofile="${jogl.dist.dir}/tmp/${jogl.tmp.version}/README.txt"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${tmp.version}"/>
+ </filterset>
+ </copy>
+ <copy file="../doc/userguide/index.html" tofile="${jogl.dist.dir}/tmp/${jogl.tmp.version}/Userguide.html" />
+ <!-- zip it up -->
+ <zip destfile="${jogl.dist.dir}/${jogl.tmp.version}.zip"
+ basedir="${jogl.dist.dir}/tmp"
+ includes="${jogl.tmp.version}/**" />
+ </target>
+
+ <target name="setup-version-RI" if="RImanifestfile">
+ <property name="tmp.version" value="${base_version}" />
+ </target>
+
+ <target name="setup-version-non-RI" unless="RImanifestfile">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMdd"/>
+ </tstamp>
+ <property name="tmp.version" value="${base_version}-pre-${timestamp}" />
+ </target>
+
+ <target name="dist" depends="dist.dir.check,dist.check.windows,dist.check.windows-amd64,dist.check.linux,dist.check.linux-amd64,dist.check.macosx,dist.check.macosxfat,dist.check.solsparc,dist.check.solsparcv9,dist.check.solx86,dist.check.solamd64,setup-version-RI,setup-version-non-RI">
+ <delete>
+ <fileset dir="${jogl.dist.dir}" includes="*.jar" />
+ </delete>
+ <delete>
+ <fileset dir="${jogl.dist.dir}" includes="*.zip" />
+ </delete>
+ <delete dir="${jogl.dist.dir}/tmp" failonerror="false" />
+ <delete dir="${jogl.dist.dir}/META-INF" failonerror="false" />
+ <!-- Extract manifest from one of the jars to re-use it in the dist jar -->
+ <unjar src="${jogl.dist.dir}/jogl-win/jogl.jar" dest="${jogl.dist.dir}" >
+ <patternset>
+ <include name="META-INF/MANIFEST.MF" />
+ </patternset>
+ </unjar>
+ <!-- Build jar files suitable for Java Web Start -->
+ <jar manifest="${jogl.dist.dir}/META-INF/MANIFEST.MF" destfile="${jogl.dist.dir}/jogl.jar" duplicate="preserve">
+ <zipgroupfileset dir="${jogl.dist.dir}"
+ includes="jogl-win/jogl.jar, jogl-linux/jogl.jar, jogl-macosx/jogl.jar" />
+ </jar>
+ <!-- Apply Pack200 repacking to allow later compression by that mechanism -->
+ <apply executable="pack200" verbose="true" >
+ <arg value="--repack" />
+ <fileset file="${jogl.dist.dir}/jogl.jar" />
+ </apply>
+ <jar destfile="${jogl.dist.dir}/jogl-natives-windows-i586.jar"
+ basedir="${jogl.dist.dir}/jogl-win/32"
+ includes="jogl.dll,jogl_awt.dll,jogl_cg.dll" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-windows-amd64.jar"
+ basedir="${jogl.dist.dir}/jogl-win/64"
+ includes="jogl.dll,jogl_awt.dll,jogl_cg.dll" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-linux-i586.jar"
+ basedir="${jogl.dist.dir}/jogl-linux/32"
+ includes="libjogl.so,libjogl_awt.so,libjogl_cg.so" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-linux-amd64.jar"
+ basedir="${jogl.dist.dir}/jogl-linux/64"
+ includes="libjogl.so,libjogl_awt.so,libjogl_cg.so" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-macosx-ppc.jar"
+ basedir="${jogl.dist.dir}/jogl-macosx/ppc"
+ includes="libjogl.jnilib,libjogl_awt.jnilib,libjogl_cg.jnilib" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-macosx-universal.jar"
+ basedir="${jogl.dist.dir}/jogl-macosx/fat"
+ includes="libjogl.jnilib,libjogl_awt.jnilib,libjogl_cg.jnilib" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-solaris-sparc.jar"
+ basedir="${jogl.dist.dir}/jogl-solsparc/32"
+ includes="libjogl.so,libjogl_awt.so" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-solaris-sparcv9.jar"
+ basedir="${jogl.dist.dir}/jogl-solsparc/64"
+ includes="libjogl.so,libjogl_awt.so" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-solaris-i586.jar"
+ basedir="${jogl.dist.dir}/jogl-solx86/32"
+ includes="libjogl.so,libjogl_awt.so,libjogl_cg.so" />
+ <jar destfile="${jogl.dist.dir}/jogl-natives-solaris-amd64.jar"
+ basedir="${jogl.dist.dir}/jogl-solx86/64"
+ includes="libjogl.so,libjogl_awt.so" />
+ <!-- Copy gluegen-rt.jar from Linux build (arbitrary; this jar is platform-independent) -->
+ <copy file="${jogl.dist.dir}/jogl-linux/gluegen-rt.jar" todir="${jogl.dist.dir}" />
+ <!-- Copy gluegen-rt native jars out of platform-specific subdirectories -->
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-win/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-win/64" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-linux/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-linux/64" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-macosx/ppc" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-macosx/fat" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-solsparc/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-solsparc/64" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-solx86/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${jogl.dist.dir}">
+ <fileset dir="${jogl.dist.dir}/jogl-solx86/64" includes="gluegen-natives-*.jar" />
+ </copy>
+
+ <!-- Build a source archive as well -->
+ <!-- First copy the generated files out of the Linux build results into the appropriate -->
+ <!-- directory of this source tree (so that they'll be blown away properly with an -->
+ <!-- "ant clean") -->
+ <mkdir dir="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl/glu" />
+ <copy file="${jogl.dist.dir}/jogl-linux/DebugGL2.java" todir="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl" />
+ <copy file="${jogl.dist.dir}/jogl-linux/TraceGL2.java" todir="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl" />
+ <copy file="${jogl.dist.dir}/jogl-linux/GL.java" todir="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl" />
+ <copy file="${jogl.dist.dir}/jogl-linux/GLU.java" todir="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl/glu" />
+ <copy file="${jogl.dist.dir}/jogl-linux/GLUquadric.java" todir="../${rootrel.build.jogl}/gensrc/classes/javax/media/opengl/glu" />
+ <zip destfile="${jogl.dist.dir}/jogl-${tmp.version}-src.zip"
+ basedir="../.."
+ includes="gluegen/LICENSE.txt,gluegen/doc/**,gluegen/make/**,gluegen/src/**,jogl/*.txt,jogl/${rootrel.build.jogl}/gensrc/classes/javax/media/opengl/**,jogl/doc/**,jogl/make/**,jogl/src/jogl/**"
+ excludes="**/*.class,**/*~"
+ />
+ <!-- Create zip archives suitable for developers -->
+ <!-- Unfortunately, we have to replicate the os/arch name combinations from
+ gluegen-cpptasks.xml. The reason for this is that we can't generate these
+ zip archives on the platform where the builds run; we have to run the dist
+ target in order to get the platform-independent jogl.jar. -->
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="linux-i586" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-linux/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="linux-amd64" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-linux/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="macosx-ppc" />
+ <param name="zip.so.suffix" value=".jnilib" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-macosx/ppc" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="macosx-universal" />
+ <param name="zip.so.suffix" value=".jnilib" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-macosx/fat" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-i586" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-solx86/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-amd64" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-solx86/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-sparc" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-solsparc/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-sparcv9" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-solsparc/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="windows-i586" />
+ <param name="zip.so.suffix" value=".dll" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-win/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="windows-amd64" />
+ <param name="zip.so.suffix" value=".dll" />
+ <param name="zip.src.so.dir" value="${jogl.dist.dir}/jogl-win/64" />
+ </antcall>
+ <!-- Create one last zip archive by hand, this one containing all of the -->
+ <!-- Java Web Start jar files (for easier redistribution) -->
+ <zip destfile="${jogl.dist.dir}/jogl-${tmp.version}-webstart.zip"
+ basedir="${jogl.dist.dir}"
+ includes="*.jar" />
+ <!-- Create a version.txt file indicating which version we just built -->
+ <echo message="${tmp.version}" file="${jogl.dist.dir}/version.txt" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Clean up all that is built.
+ -->
+ <target name="clean" description="Remove all build products" depends="declare.common">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${tempdir}" />
+ <fileset dir="${build}" />
+ <fileset dir="${javadoc}" />
+ <fileset dir="${javadoc.spec}" />
+ <fileset dir="${javadoc.dev}" />
+ </delete>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build everything.
+ -->
+ <target name="all" description="Build JOGL JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.jogl" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Build everything and use Sun's Implementation tag in the manifest to
+ - indicate this is the Reference Implementation.
+ -->
+ <target name="RI">
+ <!-- Set property for using the RI manifest file so jogl.jar is versioned
+ - properly
+ -->
+ <property name="RImanifestfile" value="joglRIversion" />
+ <antcall target="all" inheritRefs="true" />
+ </target>
+</project>
diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml
new file mode 100644
index 000000000..496382113
--- /dev/null
+++ b/make/build-nativewindow.xml
@@ -0,0 +1,1348 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Ant build for the NativeWindow package. This build has been tested with ANT 1.7.0. The
+ - optional.jar that contains the optional ANT tasks must be in the ANT
+ - classpath (typically the ant/lib directory).
+ -
+ - A clean download of the NativeWindow sources is required for this build.
+ -
+ - This build has no dependence on environment variables; the needed
+ - ones (e.g. java.home, ANT_HOME) are all set by the Ant wrapper shell
+ - script, by the virtual machine, or elsewhere. However, on all platforms,
+ - the C compiler and linker should be in the path. All other paths that
+ - need to be set are in host.properties.
+ -
+ - NOTE: because the GlueGen config files have their own relative paths
+ - which cannot be overridden by GlueGen, GlueGen MUST be run from
+ - the "make" directory. This also means that this build.xml MUST
+ - be run from the "make" directory.
+ -
+ - Public targets:
+ - all: (default; autodetects OS and chooses C compiler from gluegen.properties)
+ - clean: clean all built
+ - javadoc: create the standard developer Javadoc (recommended)
+ - (Note: should build all first - may be dependence in the future)
+ - javadoc.spec: create the standard developer Javadoc but exclude com.sun.* classes
+ - javadoc.dev: create the internal developer Javadoc. This includes the
+ - Java and C file generators. Note that it is only supported
+ - to create the Javadoc for the platform on which you are
+ - currently running.
+ -
+ - Note: on Windows the "win32.c.compiler" property in gluegen.properties
+ - is required to select the appropriate C compiler. See the example
+ - gluegen.properties in the gluegen workspace for valid values. On Mac OS X
+ - universal binaries may also be built by setting the "macosxfat"
+ - property in gluegen.properties; again see the example file in this
+ - directory.
+ -
+ - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the
+ - ANT build, including the GlueGen and StaticGLInfo tasks, the building of
+ - the Java generated sources, the first and second phase Java compiles, and
+ - the building of the jar file. Thanks to Alex Radeski for the bulk of the
+ - port to the ant-contrib CPPTask framework. Thanks to Athomas Goldberg for
+ - the original OS detection code.
+ -
+ - Some environment defs affecting compilation
+
+ setup.cdcfp - Using the CDC Java runtime library
+ - no DoubleBuffer
+ - no LongBuffer
+
+ This will set
+ -> setup.noAWT
+
+ - Internal settings, may not be necessary to set them manually,
+ since all JAR archives are orthogonal.
+ setup.noAWT
+ setup.noX11WindowsMacOsX, which implies:
+ setup.noX11
+ setup.noWindows
+ setup.noMacOsX
+ -->
+<project name="NativeWindow" basedir="." default="all">
+
+ <!-- This is the version of JOGL you are building -->
+ <property name="base_version" value="1.0.0-rc1"/>
+
+ <!-- Uncomment this property definition to cause a full release build to be done -->
+ <!-- without needing to specify the RI target on the command line -->
+ <property name="RImanifestfile" value="nativewindowRIversion" />
+
+ <!-- Pull in GlueGen cpptasks build file -->
+ <property name="gluegen.root" value="../../gluegen" />
+ <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
+
+ <available file="${user.home}/nativewindow.compiler.xml" property="nwi.compiler.present"/>
+ <import file="${user.home}/nativewindow.compiler.xml" optional="true" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Base initialization and detection of operating system.
+ -->
+ <target name="base.init">
+
+ <condition property="setup.noAWT">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="isCDCFP">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="javac.bootclasspath.jar"
+ value="../../gluegen/make/lib/cdc_fp.jar">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <echo message="setup.cdcfp: ${setup.cdcfp}" />
+ <echo message="setup.noAWT: ${setup.noAWT}" />
+ <echo message="javac.bootclasspath.jar: ${javac.bootclasspath.jar}" />
+
+ <condition property="setup.noX11WindowsMacOsX">
+ <and>
+ <isset property="setup.noX11"/>
+ <isset property="setup.noWindows"/>
+ <isset property="setup.noMacOsX"/>
+ </and>
+ </condition>
+
+ <condition property="setup.noX11">
+ <isset property="setup.noX11WindowsMacOsX"/>
+ </condition>
+
+ <condition property="setup.noWindows">
+ <isset property="setup.noX11WindowsMacOsX" />
+ </condition>
+
+ <condition property="setup.noMacOsX">
+ <isset property="setup.noX11WindowsMacOsX" />
+ </condition>
+
+ <echo message="setup.noX11WindowsMacOsX: ${setup.noX11WindowsMacOsX}" />
+ <echo message="setup.noX11: ${setup.noX11}" />
+ <echo message="setup.noWindows: ${setup.noWindows}" />
+ <echo message="setup.noMacOsX: ${setup.noMacOsX}" />
+
+ <!-- partitioning -->
+
+ <property name="java.part.core"
+ value="javax/media/nativewindow/*, javax/media/nativewindow/egl/*, javax/media/nativewindow/x11/*, javax/media/nativewindow/macosx/*, javax/media/nativewindow/windows/*, com/sun/nativewindow/impl/*, com/sun/nativewindow/impl/x11/*"/>
+
+ <!-- property name="java.part.win"
+ value="com/sun/nativewindow/impl/win/**"/ NOTHING TO DO HERE -->
+
+ <!-- property name="java.part.macosx"
+ value="com/sun/nativewindow/impl/macosx/**"/ NOTHING TO DO HERE -->
+
+ <property name="java.part.awt"
+ value="javax/media/nativewindow/awt/*, com/sun/nativewindow/impl/jawt/**, com/sun/nativewindow/impl/**/awt/**"/>
+
+ <!-- condition excludes -->
+
+ <condition property="java.excludes.awt"
+ value="${java.part.awt}">
+ <isset property="setup.noAWT"/>
+ </condition>
+
+ <condition property="java.excludes.win"
+ value="${java.part.win}">
+ <isset property="setup.noWindows"/>
+ </condition>
+
+ <condition property="java.excludes.macosx"
+ value="${java.part.macosx}">
+ <isset property="setup.noMacOsX"/>
+ </condition>
+
+ <condition property="java.excludes.cdcfp"
+ value="">
+ <isset property="setup.cdcfp"/>
+ </condition>
+
+ <property name="java.excludes.all" value="${java.excludes.awt}, ${java.excludes.win}, ${java.excludes.macosx}, ${java.excludes.cdcfp}" />
+ <echo message="java.excludes.all: ${java.excludes.all}" />
+
+
+ <!-- Set the project root directory to be up one directory. -->
+ <property name="project.root" value=".." />
+
+ <!-- Set the configuration and build files to this directory. -->
+ <property name="make" value="." />
+ </target>
+
+ <target name="base.init.sourcelevel.1">
+ <property name="nativewindow.sourcelevel" value="1.4" />
+ </target>
+
+ <!--target name="base.init.sourcelevel.2" if="gluegen.nsig">
+ <property name="nativewindow.sourcelevel" value="1.5" />
+ </target-->
+
+ <!-- ================================================================== -->
+ <!--
+ - Load user properties which override build defaults.
+ -->
+ <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file">
+ <!-- Load the user specified properties file that defines various host
+ - specific paths. The user will be notified if this is does not
+ - exist. -->
+ <property name="user.properties.file" value="${user.home}/nativewindow.properties" />
+ <property file="${user.properties.file}" />
+ <echo message="Loaded ${user.properties.file}." />
+ <property file="${user.home}/gluegen.properties" />
+ <echo message="Loaded ${user.home}/gluegen.properties." />
+ <fail message="antlr.jar was not specified in nativewindow.properties or gluegen.properties. Please see README.txt for instructions" unless="antlr.jar"/>
+ <echo message="antlr.jar=${antlr.jar}" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Declare all paths and user defined variables.
+ -->
+ <target name="declare.common" description="Declare properties" depends="load.user.properties">
+ <!-- The location and name of the configuration ANT file that will
+ - validate to ensure that all user-define variables are set. -->
+ <property name="validate.user.properties" value="${make}/validate-properties.xml" />
+
+ <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
+ <property name="javacdebug" value="true" />
+ <property name="javacdebuglevel" value="source,lines" />
+
+ <!-- Names of directories relative to the project root.
+ Some of these are used in FileMappers later for dependence information
+ and need exact string matching, which is why they use file.separator
+ instead of "/". -->
+ <condition property="rootrel.build" value="build">
+ <not>
+ <isset property="rootrel.build"/>
+ </not>
+ </condition>
+ <property name="rootrel.build.nativewindow" value="${rootrel.build}/nativewindow" />
+ <property name="rootrel.src" value="src/nativewindow" />
+ <property name="rootrel.src.java" value="${rootrel.src}/classes" />
+ <property name="rootrel.src.c" value="${rootrel.src}/native" />
+
+ <property name="rootrel.src.generated" value="${rootrel.build.nativewindow}/gensrc" />
+ <property name="rootrel.generated.c" value="${rootrel.src.generated}/native" />
+ <property name="rootrel.obj" value="${rootrel.build.nativewindow}/obj" />
+
+ <!-- GlueGen properties. -->
+ <!-- NOTE that these require a checked-out GlueGen workspace as a -->
+ <!-- sibling of the NativeWindow workspace. -->
+ <property name="gluegen.make.dir" value="../../gluegen/make" />
+ <property name="gluegen.build.xml" value="${gluegen.make.dir}/build.xml" />
+ <property name="gluegen.jar" value="../../gluegen/${rootrel.build}/gluegen.jar" />
+ <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" />
+
+ <!-- The source directories. -->
+ <property name="src.java" value="${project.root}/${rootrel.src.java}" />
+ <property name="src.c" value="${project.root}/${rootrel.src.c}" />
+ <property name="build" value="${project.root}/${rootrel.build.nativewindow}" />
+
+ <!-- The generated source directories. -->
+ <property name="src.generated" value="${build}/gensrc" />
+ <property name="src.generated.java" value="${src.generated}/classes" />
+ <property name="src.generated.c" value="${src.generated}/native" />
+
+ <!-- The compiler output directories. -->
+ <property name="classes" value="${build}/classes" />
+ <property name="obj" value="${project.root}/${rootrel.obj}" />
+
+ <!-- The headers from which Java files are generated -->
+ <property name="config" value="${make}/config/nativewindow" />
+ <property name="stub.includes" value="${make}/stub_includes" />
+ <property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet -->
+ <property name="stub.includes.common" value="${stub.includes}/common" />
+ <dirset id="stub.includes.fileset.all" dir=".">
+ <include name="${stub.includes.dir}/macosx/**" />
+ <include name="${stub.includes.dir}/win32/**" />
+ <include name="${stub.includes.dir}/x11/**" />
+ <include name="${stub.includes.dir}/common/**" />
+ <include name="${stub.includes.dir}/jni/**" />
+ </dirset>
+ <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}">
+ <include name="macosx/**" />
+ <include name="win32/**" />
+ <include name="x11/**" />
+ <include name="common/**" />
+ <include name="jni/**" />
+ </fileset>
+ <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" />
+ <fileset id="stub.includes.dependencies.fileset.3" dir="${config}">
+ <include name="*.cfg" />
+ <include name="*.java" />
+ <include name="*.c" />
+ </fileset>
+
+ <!-- Create the classpath that includes GlueGen and
+ - ANTLR. This requires the user-defined "antlr.jar"
+ - property. -->
+ <path id="gluegen.classpath">
+ <pathelement location="${gluegen.jar}" />
+ <pathelement location="${antlr.jar}" />
+ </path>
+
+ <!-- The resulting nativewindow.jar. -->
+ <property name="nativewindow.core.jar" value="${build}/nativewindow.core.jar" />
+ <property name="nativewindow.awt.jar" value="${build}/nativewindow.awt.jar" />
+ <property name="nativewindow.all.jar" value="${build}/nativewindow.all.jar" />
+
+ <!-- The javadoc dirs. -->
+ <property name="javadoc" value="${project.root}/javadoc_nativewindow_public" />
+ <property name="javadoc.spec" value="${project.root}/javadoc_nativewindow_spec" />
+ <property name="javadoc.dev" value="${project.root}/javadoc_nativewindow_dev" />
+ <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
+ <property name="javadoc.windowtitle" value="Native Windowing Interface (NativeWindow) API -- ${base_version} Specification" />
+ <property name="javadoc.overview" value="../src/nativewindow/classes/javax/media/nativewindow/package.html" />
+ <property name="javadoc.spec.packagenames" value="javax.media.nativewindow.*" />
+
+ <property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" />
+
+ <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.nativewindow.impl.*,com.sun.gluegen,com.sun.gluegen.runtime" />
+ <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=231&quot;&gt;license terms&lt;/a&gt;." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Initialize all parameters required for the build and create any
+ - required directories.
+ -->
+ <target name="init" depends="declare.common">
+ <!-- Call the external config validator script to make sure the config is ok and consistent -->
+ <ant antfile="${validate.user.properties}" inheritall="true"/>
+
+ <!-- Create the required output directories. -->
+ <mkdir dir="${src.generated.java}" />
+ <mkdir dir="${src.generated.c}" />
+ <mkdir dir="${src.generated.c}/MacOSX" />
+ <mkdir dir="${src.generated.c}/Windows" />
+ <mkdir dir="${src.generated.c}/X11" />
+ <mkdir dir="${classes}" />
+ <mkdir dir="${obj}" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- GlueGen and BuildStaticGLInfo creation, task setup and Java file generation -->
+ <!--
+ - Build GlueGen
+ -->
+ <target name="build.gluegen" depends="init">
+ <!-- Run the GlueGen build to ensure that the GlueGen ANT task
+ - has been built. -->
+ <!-- FIXME: remove passing down of antlr.jar when gluegen.properties is on all
+ nightly build machines -->
+ <ant antfile="${gluegen.build.xml}" dir="${gluegen.make.dir}" target="all" inheritAll="false">
+ <propertyset>
+ <propertyref name="antlr.jar" />
+ <!--propertyref name="gluegen.nsig" /-->
+ <propertyref name="isCDCFP" />
+ </propertyset>
+ </ant>
+ </target>
+
+ <!--
+ - Check to see whether we need to rebuild the generated sources.
+ -->
+ <target name="java.generate.check">
+ <!-- Blow away all target files if any dependencies are violated
+ (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
+ <!--
+ <dependset>
+ <srcfileset refid="stub.includes.dependencies.fileset.1" />
+ <srcfileset refid="stub.includes.dependencies.fileset.2" />
+ <srcfileset refid="stub.includes.dependencies.fileset.3" />
+ <targetfileset dir="${src.generated}">
+ <include name="**/*.java" />
+ <include name="**/*.c" />
+ </targetfileset>
+ </dependset>
+ -->
+
+ <!-- Now check for the presence of one well-known file -->
+ <uptodate property="java.generate.skip.x11windowlib"
+ targetfile="${src.generated.java}/com/sun/nativewindow/impl/x11/X11Lib.java">
+ <srcfiles refid="stub.includes.dependencies.fileset.1" />
+ <srcfiles refid="stub.includes.dependencies.fileset.2" />
+ <srcfiles refid="stub.includes.dependencies.fileset.3" />
+ </uptodate>
+ <uptodate property="java.generate.skip.jawt"
+ targetfile="${src.generated.java}/com/sun/nativewindow/impl/jawt/JAWT.java">
+ <srcfiles refid="stub.includes.dependencies.fileset.1" />
+ <srcfiles refid="stub.includes.dependencies.fileset.2" />
+ <srcfiles refid="stub.includes.dependencies.fileset.3" />
+ </uptodate>
+
+ <condition property="java.generate.skip">
+ <and>
+ <isset property="java.generate.skip.x11windowlib"/>
+ <isset property="java.generate.skip.jawt"/>
+ </and>
+ </condition>
+
+ <!--property name="java.generate.skip" value="true"/-->
+ </target>
+
+ <target name="java.generate.windowlib" if="windowlib.os.cfg">
+ <echo message="Generating Windowing Lib implementation class" />
+ <gluegen src="${stub.includes.dir}/${window.os.system}/window-lib.c"
+ outputRootDir="../${rootrel.build.nativewindow}"
+ config="${windowlib.os.cfg}"
+ includeRefid="stub.includes.fileset.platform"
+ emitter="com.sun.gluegen.JavaEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.jawt" unless="setup.noAWT">
+ <!-- NOTE: the "literalInclude" in this GlueGen call is simply to
+ - get around the fact that neither FileSet nor DirSet can
+ - handle different drives in an effective manner. -->
+ <echo message="Generating JAWT interface class" />
+ <echo message="java.home.dir=${java.home.dir}" />
+ <gluegen src="${jawt.platform.header}"
+ outputRootDir="../${rootrel.build.nativewindow}"
+ config="${jawt.cfg}"
+ literalInclude="${stub.includes.dir}/jni"
+ includeRefid="stub.includes.fileset.platform"
+ emitter="com.sun.gluegen.JavaEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.platforms" >
+ <echo message="Generating platform-specifics: os: ${window.os.system}, cfgs: ${windowlib.os.cfg}, ${jawt.cfg}" />
+ <dirset id="stub.includes.fileset.platform" dir="." includes="${stub.includes.dir}/${window.os.system}/** ${stub.includes.dir}/common/**" />
+ <antcall target="java.generate.windowlib" inheritRefs="true" />
+ <antcall target="java.generate.jawt" inheritRefs="true" />
+ </target>
+
+ <!--
+ - Setup the generating ANT tasks and use it to generate the Java files
+ - from the C GL headers. This involves setting the taskdef and creating
+ - the classpath reference id then running the task on each header.
+ -->
+ <target name="java.generate" depends="build.gluegen, java.generate.check" unless="java.generate.skip">
+
+ <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT -->
+ <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask"
+ classpathref="gluegen.classpath" />
+ <taskdef name="staticglgen" classname="com.sun.gluegen.ant.StaticGLGenTask"
+ classpathref="gluegen.classpath" />
+
+ <!-- Use the GlueGen and BuildStaticGLInfo tasks to generate the
+ - Java files -->
+
+ <echo message="Generating platform-specifics: X11" />
+ <antcall target="java.generate.platforms" inheritRefs="true">
+ <param name="window.os.system" value="x11"/>
+ <param name="windowlib.os.cfg" value="${config}/x11-lib.cfg" />
+ <param name="jawt.cfg" value="${config}/jawt-x11.cfg" />
+ <param name="jawt.platform.header" value="${stub.includes.dir}/jni/x11/jawt_md.h" />
+ </antcall>
+
+ <echo message="Generating platform-specifics: Win32" />
+ <antcall target="java.generate.platforms" inheritRefs="true">
+ <param name="window.os.system" value="win32"/>
+ <param name="jawt.cfg" value="${config}/jawt-win32.cfg" />
+ <param name="jawt.platform.header" value="${stub.includes.dir}/jni/win32/jawt_md.h" />
+ </antcall>
+
+ <echo message="Generating platform-specifics: MaxOsX" />
+ <antcall target="java.generate.platforms" inheritRefs="true">
+ <param name="window.os.system" value="macosx"/>
+ <param name="jawt.cfg" value="${config}/jawt-macosx.cfg" />
+ <param name="jawt.platform.header" value="${stub.includes.dir}/jni/macosx/jawt_md.h" />
+ </antcall>
+
+ <!-- Inform the user that the generators have successfully created
+ - the necessary Java files -->
+ <echo message="" />
+ <echo message="GlueGen and BuildStaticGLInfo have successfully generated files." />
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Compile the original and generated source. The composable pipelines
+ - will be generated.
+ -->
+ <target name="java.compile.1" depends="java.generate" if="javac.bootclasspath.jar">
+ <!-- Perform the first pass Java compile; everything -->
+ <javac destdir="${classes}"
+ excludes="${java.excludes.all}"
+ source="${nativewindow.sourcelevel}"
+ classpath="${gluegen-rt.jar}"
+ bootclasspath="${javac.bootclasspath.jar}"
+ fork="yes"
+ memoryMaximumSize="128m"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.2" depends="java.generate" unless="javac.bootclasspath.jar">
+ <!-- Perform the second pass Java compile; everything. -->
+ <javac destdir="${classes}"
+ excludes="${java.excludes.all}"
+ source="${nativewindow.sourcelevel}"
+ classpath="${gluegen-rt.jar}"
+ fork="yes"
+ memoryMaximumSize="128m"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <src path="${src.java}" />
+ <src path="${src.generated.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile" depends="java.compile.1,java.compile.2" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Compile the native C code for JOGL (and optionally the Cg binding).
+ -->
+
+ <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler" unless="nativewindow.compiler.present">
+ <!-- compiler configuration -->
+ <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
+
+ <compiler id="compiler.cfg.freebsd.nativewindow" extends="compiler.cfg.freebsd">
+ <!-- Need to force X11R6 headers on to include path after stub_includes -->
+ <includepath path="/usr/X11R6/include" />
+ </compiler>
+
+ <!-- linker configuration -->
+
+ <linker id="linker.cfg.linux.nativewindow.x11" extends="linker.cfg.linux">
+ <syslibset dir="/usr/X11R6/lib" libs="X11"/>
+ <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
+ </linker>
+
+ <linker id="linker.cfg.linux.amd64.nativewindow.x11" extends="linker.cfg.linux.amd64">
+ <syslibset dir="/usr/X11R6/lib64" libs="X11"/>
+ <syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" />
+ </linker>
+
+ <linker id="linker.cfg.solaris.nativewindow.x11" extends="linker.cfg.solaris">
+ <syslibset libs="X11"/>
+ </linker>
+
+ <linker id="linker.cfg.win32.mingw.nativewindow" extends="linker.cfg.win32.mingw">
+ <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
+ <syslibset libs="gdi32, kernel32"/>
+ </linker>
+
+ <linker id="linker.cfg.win32.msvc.nativewindow" extends="linker.cfg.win32.msvc">
+ <syslibset libs="gdi32, user32, kernel32" />
+ </linker>
+
+ <linker id="linker.cfg.macosx.nativewindow" extends="linker.cfg.macosx">
+ <linkerarg value="-framework" />
+ <linkerarg value="Cocoa" />
+ </linker>
+
+ <linker id="linker.cfg.hpux.nativewindow" extends="linker.cfg.hpux">
+ <syslibset dir="/usr/lib" libs="X11"/>
+ </linker>
+ </target>
+
+ <target name="c.configure.win32.vc" if="isVCFamily">
+ <echo message="Win32.VC" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" />
+ <property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.nativewindow" />
+ </target>
+
+ <target name="c.configure.win32.mingw" if="isMingW">
+ <echo message="Win32.MingW" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
+ <property name="linker.cfg.id.core" value="linker.cfg.win32.mingw" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.nativewindow" />
+ </target>
+
+ <target name="c.configure.linux.x86" if="isLinuxX86">
+ <echo message="Linux.x86" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.nativewindow.x11" />
+ </target>
+
+ <target name="c.configure.linux.amd64" if="isLinuxAMD64">
+ <echo message="Linux.AMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux.amd64" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.nativewindow.x11" />
+ </target>
+
+ <target name="c.configure.linux.ia64" if="isLinuxIA64">
+ <echo message="Linux.IA64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.nativewindow.x11" />
+ </target>
+
+ <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
+
+ <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
+ <echo message="Solaris" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.nativewindow.x11" />
+ </target>
+
+
+ <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
+ <echo message="SolarisSparcv9" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.nativewindow.x11" />
+ </target>
+
+
+ <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
+ <echo message="SolarisAMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.nativewindow.x11" />
+ </target>
+
+ <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD">
+ <echo message="FreeBSD" />
+ <property name="compiler.cfg.id" value="compiler.cfg.freebsd.nativewindow" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.nativewindow.x11" />
+ </target>
+
+ <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
+ <echo message="HP-UX" />
+ <property name="compiler.cfg.id" value="compiler.cfg.hpux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.hpux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.hpux.nativewindow.x11" />
+ </target>
+
+ <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" />
+
+ <target name="c.configure.x11" if="isX11" />
+
+ <target name="c.configure.macosx" if="isOSX">
+ <property name="compiler.cfg.id" value="compiler.cfg.macosx" />
+ <property name="linker.cfg.id.core" value="linker.cfg.macosx" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.nativewindow" />
+ </target>
+
+ <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" />
+
+ <target name="c.configure" depends="c.configure.1,c.configure.2" />
+
+ <target name="rename.mingw.dll" if="isMingW">
+ <move file="${src}" tofile="${dest}" />
+ </target>
+
+ <target name="rename.dylib" if="isOSX">
+ <move file="${src}" tofile="${dest}" />
+ </target>
+
+ <macrodef name="c.build">
+ <attribute name="c.compiler.src.files" />
+ <attribute name="compiler.cfg.id" />
+ <attribute name="linker.cfg.id" />
+ <attribute name="output.lib.name" />
+ <attribute name="c.compiler.use-jawt" default="false"/>
+ <sequential>
+ <echo message="Output lib name = @{output.lib.name}" />
+
+ <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
+ <property name="c.compiler.debug" value="false" />
+ <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } -->
+ <property name="c.compiler.optimise" value="none" />
+
+ <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
+
+ <!-- since properties are immutable, we need one for each target -->
+ <condition property="@{output.lib.name}.useLibJAWT">
+ <istrue value="@{c.compiler.use-jawt}" />
+ </condition>
+ <echo message="c.compiler.use-jawt @{c.compiler.use-jawt}"/>
+ <echo message="@{output.lib.name}.useLibJAWT ${@{output.lib.name}.useLibJAWT}"/>
+
+ <condition property="@{output.lib.name}.useLibJVM">
+ <and>
+ <isset property="isHPUX"/>
+ <isset property="@{output.lib.name}.useLibJAWT"/>
+ </and>
+ </condition>
+
+ <patternset id="c.src.files.awt">
+ <include name="${rootrel.src.c}/JAWT*.c"/>
+ <include name="${rootrel.generated.c}/X11/JAWT*.c" if="isX11"/>
+ <include name="${rootrel.generated.c}/MacOSX/JAWT*.c" if="isOSX"/>
+ <include name="${rootrel.generated.c}/Windows/JAWT*.c" if="isWindows"/>
+ </patternset>
+
+ <patternset id="c.src.files.x11">
+ <include name="${rootrel.generated.c}/X11/X11*.c" if="isX11"/>
+ <include name="${rootrel.src.c}/x11/XineramaHelper.c" if="isX11"/>
+ <!-- Xinerama supporting functions for Linux only (for now) -->
+ <!-- Also supported on Solaris, but works differently -->
+ <include name="${rootrel.src.c}/x11/Xinerama.c" if="isLinux"/>
+ </patternset>
+
+ <echo message="Compiling @{output.lib.name}" />
+
+ <cc outtype="shared"
+ objdir="${obj}"
+ outfile="${obj}/@{output.lib.name}"
+ optimize="${c.compiler.optimise}"
+ debug="${c.compiler.debug}"
+ multithreaded="true"
+ exceptions="false"
+ rtti="false">
+
+ <!-- TODO: versioninfo companyname="java.net"
+ legalcopyright="Copyright"
+ productname="JOGL"
+ productversion="x.y.z"
+ description="Description"
+ fileversion="x.y.z"
+ filecomments="File Comment" /-->
+
+ <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+
+ <compiler extends="@{compiler.cfg.id}" >
+ <sysincludepath path="${java.includes.dir}"/>
+ <sysincludepath path="${java.includes.dir.platform}"/>
+ <!-- This is for the generated headers for handwritten C code -->
+ <includepath path="${src.generated.c}" />
+ <includepath path="${src.generated.c}/X11" if="isX11"/>
+ <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
+ <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+
+ <!-- This must come last to not override real include paths -->
+ <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
+ </compiler>
+
+ <linker extends="@{linker.cfg.id}">
+ <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+ <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
+ </linker>
+ </cc>
+
+ <!-- FIXME: this is a hack; the cpptask should have an option to change the
+ suffix or at least understand the override from dylib to jnilib -->
+ <antcall target="rename.dylib" inheritRefs="true">
+ <param name="src" value="${build}/obj/lib@{output.lib.name}.dylib" />
+ <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" />
+ </antcall>
+
+ <!-- FIXME: this is a hack; the cpptask should have an option to change the
+ suffix or at least understand the override from dylib to jnilib -->
+ <antcall target="rename.mingw.dll" inheritRefs="true">
+ <param name="src" value="${build}/obj/lib@{output.lib.name}.so" />
+ <param name="dest" value="${build}/obj/@{output.lib.name}.dll" />
+ </antcall>
+ </sequential>
+ </macrodef>
+
+ <target name="c.fixup.jawt.version.macosx" if="isOSX">
+ <!-- Edit the link to the JAWT version in the resulting jnilib
+ file; this isn't strictly needed but seems to allow the
+ universal binaries to work on 10.3 machines as well, which
+ is desirable for some end users -->
+ <apply executable="install_name_tool">
+ <arg value="-change" />
+ <arg value="/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Libraries/libjawt.dylib" />
+ <arg value="/System/Library/Frameworks/JavaVM.framework/Libraries/libjawt.dylib" />
+ <srcfile />
+ <fileset dir="${obj}" includes="libnativewindow_awt.jnilib" />
+ </apply>
+ </target>
+
+ <target name="c.build.nativewindow.awt">
+ <c.build c.compiler.src.files="c.src.files.awt"
+ c.compiler.use-jawt="true"
+ output.lib.name="nativewindow_awt"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.oswin}"/>
+ </target>
+
+ <target name="c.build.nativewindow.windowlib.x11" if="isX11">
+ <c.build c.compiler.src.files="c.src.files.x11"
+ output.lib.name="nativewindow_x11"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.oswin}"/>
+ </target>
+
+ <target name="c.build.nativewindow.windowlib" depends="c.build.nativewindow.windowlib.x11"/>
+
+ <target name="c.manifest" if="isVC8Family">
+ <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll -->
+ <msvc.manifest objdir="${obj}" dllname="nativewindow" />
+ <msvc.manifest objdir="${obj}" dllname="nativewindow_awt" />
+ </target>
+
+ <target name="c.build.nativewindow" depends="c.configure,c.build.nativewindow.windowlib,c.build.nativewindow.awt">
+ <antcall target="c.fixup.jawt.version.macosx" inheritrefs="true" />
+ <antcall target="c.manifest" inheritRefs="true" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the nativewindow.jar files.
+ -->
+ <target name="jar" depends="java.compile,cond-if-RImanifest,cond-else-RImanifest"/>
+
+ <target name="check-RIcond">
+ <condition property="RIcond-is-true">
+ <isset property="RImanifestfile"/>
+ </condition>
+ </target>
+
+ <target name="cond-if-RImanifest" depends="check-RIcond" if="RIcond-is-true">
+ <copy file="nativewindowRIversion"
+ tofile="tempversion"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
+ <filter token="BASEVERSION" value="${base_version}"/>
+ </filterset>
+ </copy>
+
+ <jar manifest="tempversion" destfile="${nativewindow.core.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.core}"
+ excludes="${java.part.awt}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${nativewindow.awt.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.awt}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${nativewindow.all.jar}">
+ <fileset dir="${classes}">
+ <include name="javax/media/nativewindow/**" />
+ <include name="com/sun/nativewindow/**" />
+ <include name="com/sun/gluegen/runtime/**" />
+ </fileset>
+ </jar>
+ <delete file="tempversion"/>
+ </target>
+
+
+ <target name="cond-else-RImanifest" depends="check-RIcond" unless="RIcond-is-true">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
+ </tstamp>
+ <copy file="nativewindowversion"
+ tofile="tempversion"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
+ <filter token="BASEVERSION" value="${base_version}"/>
+ </filterset>
+ </copy>
+ <jar manifest="tempversion" destfile="${nativewindow.jar}">
+ <fileset dir="${classes}">
+ <include name="javax/media/nativewindow/**" />
+ <include name="com/sun/gluegen/runtime/**" />
+ <include name="com/sun/nativewindow/**" />
+ </fileset>
+ </jar>
+ <delete file="tempversion"/>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the Javadocs for the sources.
+ - NOTE: these are not entirely correct as the javadocs targets depend
+ - on the platform specific build targets. To circumvent any
+ - errors, ensure that the source is built first.
+ -->
+ <target name="javadoc" depends="load.user.properties,init">
+ <!-- Build the general public Javadoc -->
+ <javadoc packagenames="${javadoc.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ classpath="${gluegen-rt.jar}"
+ destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ </javadoc>
+ </target>
+
+ <target name="javadoc.spec" depends="load.user.properties,init">
+ <!-- Build the specification Javadoc -->
+ <javadoc packagenames="${javadoc.spec.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ classpath="${gluegen-rt.jar}"
+ destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ </javadoc>
+ </target>
+
+ <target name="javadoc.dev" depends="load.user.properties,init">
+ <!-- Build the internal developer Javadoc -->
+ <javadoc packagenames="${javadoc.dev.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ classpath="${gluegen-rt.jar}"
+ destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ </javadoc>
+ </target>
+
+ <target name="all.doc" description="Build NativeWindow docs" depends="init,javadoc,javadoc.spec,javadoc.dev" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the platform-independent distribution out of jars built for
+ - Windows, Linux and Mac OS X; the Java sources for Jogl can't be
+ - fully cross-compiled at this time. To run this target, you need to
+ - specify the property nativewindow.dist.dir as a System property (i.e.,
+ - "ant -Dnativewindow.dist.dir=../dist dist"); directories named nativewindow-linux,
+ - nativewindow-win, and nativewindow-macosx need to be inside that directory and each
+ - of those directories needs to contain both the nativewindow.jar for that
+ - platform as well as the native code (libnativewindow.so, nativewindow.dll, or
+ - libnativewindow.jnilib). Also builds jars containing the native code for
+ - Windows, Linux, Mac OS X, Solaris/SPARC and Solaris/x86.
+ -->
+ <target name="dist.dir.check" unless="nativewindow.dist.dir">
+ <fail>
+
+ ******************************************************************
+ ** To build the Jogl distribution out of the platform-specific **
+ ** component jars and native code, the property nativewindow.dist.dir **
+ ** needs to be specified on the command line. Please read the **
+ ** comments associated with the "dist" target in the build.xml. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.windows" if="nativewindow.dist.dir">
+ <condition property="windows.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-win/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/32/nativewindow.dll" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/32/nativewindow_awt.dll" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/32/gluegen-rt.dll" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/32/gluegen-rt-natives-windows-i586.jar" />
+ </and>
+ </condition>
+ <fail unless="windows.complete">
+ ******************************************************************
+ ** Files are missing from the Windows build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Windows build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.windows-amd64" if="nativewindow.dist.dir">
+ <condition property="windows-amd64.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-win/64/nativewindow.dll" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/64/nativewindow_awt.dll" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/64/gluegen-rt.dll" />
+ <available file="${nativewindow.dist.dir}/nativewindow-win/64/gluegen-rt-natives-windows-amd64.jar" />
+ </and>
+ </condition>
+ <fail unless="windows-amd64.complete">
+ *********************************************************************
+ ** Files are missing from the Windows/AMD64 build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Windows/AMD64 build and try again. **
+ *********************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.linux" if="nativewindow.dist.dir">
+ <condition property="linux.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/32/libnativewindow.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/32/libnativewindow_awt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/32/libgluegen-rt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/32/gluegen-rt-natives-linux-i586.jar" />
+ </and>
+ </condition>
+ <fail unless="linux.complete">
+ ******************************************************************
+ ** Files are missing from the Linux build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Linux build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.linux-amd64" if="nativewindow.dist.dir">
+ <condition property="linux-amd64.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/64/libnativewindow.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/64/libnativewindow_awt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/64/libgluegen-rt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-linux/64/gluegen-rt-natives-linux-amd64.jar" />
+ </and>
+ </condition>
+ <fail unless="linux-amd64.complete">
+ *******************************************************************
+ ** Files are missing from the Linux/AMD64 build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Linux/AMD64 build and try again. **
+ *******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.macosx" if="nativewindow.dist.dir">
+ <condition property="macosx.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/ppc/libnativewindow.jnilib" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/ppc/libnativewindow_awt.jnilib" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/ppc/libgluegen-rt.jnilib" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/ppc/gluegen-rt-natives-macosx-ppc.jar" />
+ </and>
+ </condition>
+ <fail unless="macosx.complete">
+ ******************************************************************
+ ** Files are missing from the Mac OS X build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Mac OS X build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+
+ <target name="dist.check.macosxfat" if="nativewindow.dist.dir">
+ <condition property="macosxfat.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/fat/libnativewindow.jnilib" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/fat/libnativewindow_awt.jnilib" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/fat/libgluegen-rt.jnilib" />
+ <available file="${nativewindow.dist.dir}/nativewindow-macosx/fat/gluegen-rt-natives-macosx-universal.jar" />
+ </and>
+ </condition>
+ <fail unless="macosxfat.complete">
+ ******************************************************************
+ ** Files are missing from the Mac OS X build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Mac OS X build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+
+
+ <target name="dist.check.solsparc" if="nativewindow.dist.dir">
+ <condition property="solsparc.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/32/libnativewindow.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/32/libnativewindow_awt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/32/libgluegen-rt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/32/gluegen-rt-natives-solaris-sparc.jar" />
+ </and>
+ </condition>
+ <fail unless="solsparc.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/SPARC build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/SPARC build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solsparcv9" if="nativewindow.dist.dir">
+ <condition property="solsparcv9.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/64/libnativewindow.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/64/libnativewindow_awt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/64/libgluegen-rt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solsparc/64/gluegen-rt-natives-solaris-sparcv9.jar" />
+ </and>
+ </condition>
+ <fail unless="solsparcv9.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/SPARCv9 build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/SPARCv9 build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solx86" if="nativewindow.dist.dir">
+ <condition property="solx86.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/nativewindow.jar" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/32/libnativewindow.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/32/libnativewindow_awt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/32/libgluegen-rt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/32/gluegen-rt-natives-solaris-i586.jar" />
+ </and>
+ </condition>
+ <fail unless="solx86.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/x86 build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/x86 build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solamd64" if="nativewindow.dist.dir">
+ <condition property="solamd64.complete">
+ <and>
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/64/libnativewindow.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/64/libnativewindow_awt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/64/libgluegen-rt.so" />
+ <available file="${nativewindow.dist.dir}/nativewindow-solx86/64/gluegen-rt-natives-solaris-amd64.jar" />
+ </and>
+ </condition>
+ <fail unless="solamd64.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/x86/64 (amd64) build. This *
+ ** will cause the distribution **
+ ** to be incomplete. Please check the **
+ ** status of the Solaris/x86 (amd64) build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <!-- Helper task for dist target below -->
+ <!-- Required parameters: -->
+ <!-- zip.os.arch = the os/arch combination for this zip file (i.e., "windows-i586") -->
+ <!-- zip.src.so.dir = the directory containing the .so's / .dll's / .jnilib's for this platform-->
+ <target name="dist.build.zip">
+ <property name="nativewindow.tmp.version" value="nativewindow-${tmp.version}-${zip.os.arch}" />
+ <!-- Create all needed directories -->
+ <delete dir="${nativewindow.dist.dir}/tmp" failonerror="false" />
+ <mkdir dir="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/lib" />
+ <!-- Copy in files -->
+ <copy todir="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/lib">
+ <fileset dir="${zip.src.so.dir}" includes="*${zip.so.suffix}" />
+ </copy>
+ <copy file="${nativewindow.dist.dir}/nativewindow.jar" todir="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/lib" />
+ <copy file="${nativewindow.dist.dir}/gluegen-rt.jar" todir="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/lib" />
+ <copy file="../CHANGELOG.txt" todir="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}" />
+ <copy file="../COPYRIGHT.txt" todir="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}" />
+ <copy file="../LICENSE.txt" tofile="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/LICENSE-NATIVEWINDOW-${tmp.version}.txt" />
+ <copy file="README-zip-bundles.txt"
+ tofile="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/README.txt"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${tmp.version}"/>
+ </filterset>
+ </copy>
+ <copy file="../doc/userguide/index.html" tofile="${nativewindow.dist.dir}/tmp/${nativewindow.tmp.version}/Userguide.html" />
+ <!-- zip it up -->
+ <zip destfile="${nativewindow.dist.dir}/${nativewindow.tmp.version}.zip"
+ basedir="${nativewindow.dist.dir}/tmp"
+ includes="${nativewindow.tmp.version}/**" />
+ </target>
+
+ <target name="setup-version-RI" if="RImanifestfile">
+ <property name="tmp.version" value="${base_version}" />
+ </target>
+
+ <target name="setup-version-non-RI" unless="RImanifestfile">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMdd"/>
+ </tstamp>
+ <property name="tmp.version" value="${base_version}-pre-${timestamp}" />
+ </target>
+
+ <target name="dist" depends="dist.dir.check,dist.check.windows,dist.check.windows-amd64,dist.check.linux,dist.check.linux-amd64,dist.check.macosx,dist.check.macosxfat,dist.check.solsparc,dist.check.solsparcv9,dist.check.solx86,dist.check.solamd64,setup-version-RI,setup-version-non-RI">
+ <delete>
+ <fileset dir="${nativewindow.dist.dir}" includes="*.jar" />
+ </delete>
+ <delete>
+ <fileset dir="${nativewindow.dist.dir}" includes="*.zip" />
+ </delete>
+ <delete dir="${nativewindow.dist.dir}/tmp" failonerror="false" />
+ <delete dir="${nativewindow.dist.dir}/META-INF" failonerror="false" />
+ <!-- Extract manifest from one of the jars to re-use it in the dist jar -->
+ <unjar src="${nativewindow.dist.dir}/nativewindow-win/nativewindow.jar" dest="${nativewindow.dist.dir}" >
+ <patternset>
+ <include name="META-INF/MANIFEST.MF" />
+ </patternset>
+ </unjar>
+ <!-- Build jar files suitable for Java Web Start -->
+ <jar manifest="${nativewindow.dist.dir}/META-INF/MANIFEST.MF" destfile="${nativewindow.dist.dir}/nativewindow.jar" duplicate="preserve">
+ <zipgroupfileset dir="${nativewindow.dist.dir}"
+ includes="nativewindow-win/nativewindow.jar, nativewindow-linux/nativewindow.jar, nativewindow-macosx/nativewindow.jar" />
+ </jar>
+ <!-- Apply Pack200 repacking to allow later compression by that mechanism -->
+ <apply executable="pack200" verbose="true" >
+ <arg value="--repack" />
+ <fileset file="${nativewindow.dist.dir}/nativewindow.jar" />
+ </apply>
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-windows-i586.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-win/32"
+ includes="nativewindow.dll,nativewindow_awt.dll" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-windows-amd64.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-win/64"
+ includes="nativewindow.dll,nativewindow_awt.dll" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-linux-i586.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-linux/32"
+ includes="libnativewindow.so,libnativewindow_awt.so" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-linux-amd64.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-linux/64"
+ includes="libnativewindow.so,libnativewindow_awt.so" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-macosx-ppc.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-macosx/ppc"
+ includes="libnativewindow.jnilib,libnativewindow_awt.jnilib" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-macosx-universal.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-macosx/fat"
+ includes="libnativewindow.jnilib,libnativewindow_awt.jnilib" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-solaris-sparc.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-solsparc/32"
+ includes="libnativewindow.so,libnativewindow_awt.so" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-solaris-sparcv9.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-solsparc/64"
+ includes="libnativewindow.so,libnativewindow_awt.so" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-solaris-i586.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-solx86/32"
+ includes="libnativewindow.so,libnativewindow_awt.so" />
+ <jar destfile="${nativewindow.dist.dir}/nativewindow-natives-solaris-amd64.jar"
+ basedir="${nativewindow.dist.dir}/nativewindow-solx86/64"
+ includes="libnativewindow.so,libnativewindow_awt.so" />
+ <!-- Copy gluegen-rt.jar from Linux build (arbitrary; this jar is platform-independent) -->
+ <copy file="${nativewindow.dist.dir}/nativewindow-linux/gluegen-rt.jar" todir="${nativewindow.dist.dir}" />
+ <!-- Copy gluegen-rt native jars out of platform-specific subdirectories -->
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-win/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-win/64" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-linux/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-linux/64" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-macosx/ppc" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-macosx/fat" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-solsparc/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-solsparc/64" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-solx86/32" includes="gluegen-natives-*.jar" />
+ </copy>
+ <copy todir="${nativewindow.dist.dir}">
+ <fileset dir="${nativewindow.dist.dir}/nativewindow-solx86/64" includes="gluegen-natives-*.jar" />
+ </copy>
+
+ <zip destfile="${nativewindow.dist.dir}/nativewindow-${tmp.version}-src.zip"
+ basedir="../.."
+ includes="jogl/*.txt,jogl/${rootrel.build.nativewindow}/gensrc/classes/javax/media/nativewindow/**,jogl/doc/**,jogl/make/**,jogl/src/nativewindow/**"
+ excludes="**/*.class,**/*~"
+ />
+ <!-- Create zip archives suitable for developers -->
+ <!-- Unfortunately, we have to replicate the os/arch name combinations from
+ gluegen-cpptasks.xml. The reason for this is that we can't generate these
+ zip archives on the platform where the builds run; we have to run the dist
+ target in order to get the platform-independent nativewindow.jar. -->
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="linux-i586" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-linux/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="linux-amd64" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-linux/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="macosx-ppc" />
+ <param name="zip.so.suffix" value=".jnilib" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-macosx/ppc" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="macosx-universal" />
+ <param name="zip.so.suffix" value=".jnilib" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-macosx/fat" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-i586" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-solx86/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-amd64" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-solx86/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-sparc" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-solsparc/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-sparcv9" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-solsparc/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="windows-i586" />
+ <param name="zip.so.suffix" value=".dll" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-win/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="windows-amd64" />
+ <param name="zip.so.suffix" value=".dll" />
+ <param name="zip.src.so.dir" value="${nativewindow.dist.dir}/nativewindow-win/64" />
+ </antcall>
+ <!-- Create one last zip archive by hand, this one containing all of the -->
+ <!-- Java Web Start jar files (for easier redistribution) -->
+ <zip destfile="${nativewindow.dist.dir}/nativewindow-${tmp.version}-webstart.zip"
+ basedir="${nativewindow.dist.dir}"
+ includes="*.jar" />
+ <!-- Create a version.txt file indicating which version we just built -->
+ <echo message="${tmp.version}" file="${nativewindow.dist.dir}/version.txt" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Clean up all that is built.
+ -->
+ <target name="clean" description="Remove all build products" depends="declare.common">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${build}" />
+ <fileset dir="${javadoc}" />
+ <fileset dir="${javadoc.spec}" />
+ <fileset dir="${javadoc.dev}" />
+ </delete>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build everything.
+ -->
+ <target name="all" description="Build NativeWindow JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.nativewindow" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Build everything and use Sun's Implementation tag in the manifest to
+ - indicate this is the Reference Implementation.
+ -->
+ <target name="RI">
+ <!-- Set property for using the RI manifest file so nativewindow.jar is versioned
+ - properly
+ -->
+ <property name="RImanifestfile" value="nativewindowRIversion" />
+ <antcall target="all" inheritRefs="true" />
+ </target>
+</project>
diff --git a/make/build-newt.xml b/make/build-newt.xml
new file mode 100644
index 000000000..a1b1baaea
--- /dev/null
+++ b/make/build-newt.xml
@@ -0,0 +1,1029 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Ant build for NEWT. This build has been tested with ANT 1.7.0. The
+ - optional.jar that contains the optional ANT tasks must be in the ANT
+ - classpath (typically the ant/lib directory).
+ -
+ - A clean download of NEWT is required for this build.
+ -
+ - This build has no dependence on environment variables; the needed
+ - ones (e.g. java.home, ANT_HOME) are all set by the Ant wrapper shell
+ - script, by the virtual machine, or elsewhere. However, on all platforms,
+ - the C compiler and linker should be in the path. All other paths that
+ - need to be set are in host.properties.
+ -
+ - NOTE: because the GlueGen config files have their own relative paths
+ - which cannot be overridden by GlueGen, GlueGen MUST be run from
+ - the "make" directory. This also means that this build.xml MUST
+ - be run from the "make" directory.
+ -
+ - Public targets:
+ - all: (default; autodetects OS and chooses C compiler from newt.properties)
+ - clean: clean all built
+ - javadoc: create the standard developer Javadoc (recommended)
+ - (Note: should build all first - may be dependence in the future)
+ - javadoc.spec: create the standard developer Javadoc but exclude com.sun.* classes
+ - javadoc.dev: create the internal developer Javadoc. This includes the
+ - Java and C file generators. Note that it is only supported
+ - to create the Javadoc for the platform on which you are
+ - currently running.
+ -
+ - Note: on Windows the "win32.c.compiler" property in newt.properties
+ - is required to select the appropriate C compiler. See the example
+ - newt.properties in this directory for valid values. On Mac OS X
+ - universal binaries may also be built by setting the "macosxfat"
+ - property in newt.properties; again see the example file in this
+ - directory.
+ -
+ - Thanks to Rob Grzywinski and Artur Biesiadowski for the bulk of the
+ - ANT build, including the GlueGen and StaticGLInfo tasks, the building of
+ - the Java generated sources, the first and second phase Java compiles, and
+ - the building of the jar file. Thanks to Alex Radeski for the bulk of the
+ - port to the ant-contrib CPPTask framework. Thanks to Athomas Goldberg for
+ - the original OS detection code.
+ -
+ - Some environment defs affecting compilation
+
+ setup.cdcfp - Using the CDC Java runtime library
+ - no DoubleBuffer
+ - no LongBuffer
+
+ This will set
+ -> setup.noAWT
+
+ - Internal settings, may not be necessary to set them manually,
+ since all JAR archives are orthogonal.
+ setup.noAWT
+ setup.noOpenGL
+ -->
+<project name="NEWT" basedir="." default="all">
+
+ <!-- This is the version of JOGL you are building -->
+ <property name="base_version" value="0.0.0-rc0"/>
+
+ <!-- Uncomment this property definition to cause a full release build to be done -->
+ <!-- without needing to specify the RI target on the command line -->
+ <property name="RImanifestfile" value="newtRIversion" />
+
+ <!-- Pull in GlueGen cpptasks build file -->
+ <property name="gluegen.root" value="../../gluegen" />
+ <import file="${gluegen.root}/make/gluegen-cpptasks.xml" />
+
+ <available file="${user.home}/newt.compiler.xml" property="newt.compiler.present"/>
+ <import file="${user.home}/newt.compiler.xml" optional="true" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Base initialization and detection of operating system.
+ -->
+ <target name="base.init">
+
+ <condition property="setup.noAWT">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="isCDCFP">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <condition property="javac.bootclasspath.jar"
+ value="../../gluegen/make/lib/cdc_fp.jar">
+ <isset property="setup.cdcfp"/>
+ </condition>
+ <echo message="setup.cdcfp: ${setup.cdcfp}" />
+ <echo message="setup.noAWT: ${setup.noAWT}" />
+ <echo message="setup.noOpenGL: ${setup.noOpenGL}" />
+ <echo message="javac.bootclasspath.jar: ${javac.bootclasspath.jar}" />
+
+ <!-- partitioning -->
+
+ <property name="java.part.core"
+ value="com/sun/javafx/newt/*, com/sun/javafx/newt/util/*, com/sun/javafx/newt/x11/*, com/sun/javafx/newt/windows/*, com/sun/javafx/newt/macosx/*, com/sun/javafx/newt/impl/*"/>
+
+ <property name="java.part.opengl"
+ value="com/sun/javafx/newt/opengl/*, com/sun/javafx/newt/opengl/kd/*"/>
+
+ <property name="java.part.awt"
+ value="com/sun/javafx/newt/awt/*"/>
+
+ <!-- condition excludes -->
+
+ <condition property="java.excludes.awt"
+ value="${java.part.awt}">
+ <isset property="setup.noAWT"/>
+ </condition>
+
+ <condition property="java.excludes.opengl"
+ value="${java.part.opengl}">
+ <isset property="setup.noOpenGL"/>
+ </condition>
+
+ <condition property="java.excludes.cdcfp"
+ value="">
+ <isset property="setup.cdcfp"/>
+ </condition>
+
+ <property name="java.excludes.all" value="${java.excludes.awt}, ${java.excludes.opengl}, ${java.excludes.cdcfp}" />
+ <echo message="java.excludes.all: ${java.excludes.all}" />
+
+
+ <!-- Set the project root directory to be up one directory. -->
+ <property name="project.root" value=".." />
+
+ <!-- Set the configuration and build files to this directory. -->
+ <property name="make" value="." />
+ </target>
+
+ <target name="base.init.sourcelevel.1">
+ <property name="newt.sourcelevel" value="1.4" />
+ </target>
+
+ <!--target name="base.init.sourcelevel.2" if="gluegen.nsig">
+ <property name="newt.sourcelevel" value="1.5" />
+ </target-->
+
+ <!-- ================================================================== -->
+ <!--
+ - Load user properties which override build defaults.
+ -->
+ <target name="load.user.properties" depends="base.init,base.init.sourcelevel.1" unless="user.properties.file">
+ <!-- Load the user specified properties file that defines various host
+ - specific paths. The user will be notified if this is does not
+ - exist. -->
+ <property name="user.properties.file" value="${user.home}/newt.properties" />
+ <property file="${user.properties.file}" />
+ <echo message="Loaded ${user.properties.file}." />
+ <property file="${user.home}/gluegen.properties" />
+ <echo message="Loaded ${user.home}/gluegen.properties." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Declare all paths and user defined variables.
+ -->
+ <target name="declare.common" description="Declare properties" depends="load.user.properties">
+ <!-- The location and name of the configuration ANT file that will
+ - validate to ensure that all user-define variables are set. -->
+ <property name="validate.user.properties" value="${make}/validate-properties.xml" />
+
+ <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
+ <property name="javacdebug" value="true" />
+ <property name="javacdebuglevel" value="source,lines" />
+
+ <!-- Names of directories relative to the project root.
+ Some of these are used in FileMappers later for dependence information
+ and need exact string matching, which is why they use file.separator
+ instead of "/". -->
+ <condition property="rootrel.build" value="build">
+ <not>
+ <isset property="rootrel.build"/>
+ </not>
+ </condition>
+ <property name="rootrel.build.newt" value="${rootrel.build}/newt" />
+ <property name="rootrel.src" value="src/newt" />
+ <property name="rootrel.src.java" value="${rootrel.src}/classes" />
+ <property name="rootrel.src.c" value="${rootrel.src}/native" />
+ <property name="rootrel.obj" value="${rootrel.build.newt}/obj" />
+
+ <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" />
+ <property name="nativewindow.all.jar" value="../${rootrel.build}/nativewindow/nativewindow.all.jar" />
+ <property name="jogl.all.jar" value="../${rootrel.build}/jogl/jogl.all.jar" />
+
+ <!-- The source directories. -->
+ <property name="src.java" value="${project.root}/${rootrel.src.java}" />
+ <property name="src.c" value="${project.root}/${rootrel.src.c}" />
+ <property name="build" value="${project.root}/${rootrel.build.newt}" />
+
+ <!-- The generated source directories. -->
+ <property name="src.generated" value="${build}/gensrc" />
+ <property name="src.generated.c" value="${src.generated}/native/newt" />
+
+ <!-- The compiler output directories. -->
+ <property name="classes" value="${build}/classes" />
+ <property name="obj" value="${project.root}/${rootrel.obj}" />
+
+ <path id="nativewindow_gluegen_jogl.classpath">
+ <pathelement location="${nativewindow.all.jar}" />
+ <pathelement location="${gluegen-rt.jar}" />
+ <pathelement location="${jogl.all.jar}" />
+ </path>
+
+ <!-- The resulting newt.jar. -->
+ <property name="newt.core.jar" value="${build}/newt.core.jar" />
+ <property name="newt.ogl.jar" value="${build}/newt.ogl.jar" />
+ <property name="newt.awt.jar" value="${build}/newt.awt.jar" />
+ <property name="newt.all.jar" value="${build}/newt.all.jar" />
+
+ <!-- The javadoc dirs. -->
+ <property name="javadoc" value="${project.root}/javadoc_newt_public" />
+ <property name="javadoc.spec" value="${project.root}/javadoc_newt_spec" />
+ <property name="javadoc.dev" value="${project.root}/javadoc_newt_dev" />
+ <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
+ <property name="javadoc.windowtitle" value="NEWT API -- ${base_version} Specification" />
+ <property name="javadoc.overview" value="spec-overview.html" />
+ <property name="javadoc.spec.packagenames" value="com.sun.javafx.newt, com.sun.javafx.newt.opengl" />
+
+ <property name="javadoc.packagenames" value="${javadoc.spec.packagenames}" />
+
+ <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.javafx.newt.*" />
+ <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=231&quot;&gt;license terms&lt;/a&gt;." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Initialize all parameters required for the build and create any
+ - required directories.
+ -->
+ <target name="init" depends="declare.common">
+ <!-- Call the external config validator script to make sure the config is ok and consistent -->
+ <ant antfile="${validate.user.properties}" inheritall="true"/>
+
+ <mkdir dir="${src.generated.c}" />
+ <mkdir dir="${src.generated.c}/X11" />
+ <mkdir dir="${src.generated.c}/KD" />
+ <mkdir dir="${src.generated.c}/MacOSX" />
+ <mkdir dir="${src.generated.c}/Windows" />
+ <mkdir dir="${classes}" />
+ <mkdir dir="${obj}" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Compile the original and generated source. The composable pipelines
+ - will be generated.
+ -->
+ <target name="java.compile.1" if="javac.bootclasspath.jar">
+ <!-- Perform the first pass Java compile; everything -->
+ <javac destdir="${classes}"
+ excludes="${java.excludes.all}"
+ source="${newt.sourcelevel}"
+ bootclasspath="${javac.bootclasspath.jar}"
+ fork="yes"
+ memoryMaximumSize="128m"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <classpath refid="nativewindow_gluegen_jogl.classpath"/>
+ <src path="${src.java}" />
+ </javac>
+ </target>
+
+ <target name="java.compile.2" unless="javac.bootclasspath.jar">
+ <!-- Perform the second pass Java compile; everything. -->
+ <javac destdir="${classes}"
+ excludes="${java.excludes.all}"
+ source="${newt.sourcelevel}"
+ fork="yes"
+ memoryMaximumSize="128m"
+ debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+ <src path="${src.java}" />
+ <classpath refid="nativewindow_gluegen_jogl.classpath"/>
+ </javac>
+ </target>
+
+ <target name="java.compile" depends="java.compile.1,java.compile.2" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Compile the native C code for JOGL (and optionally the Cg binding).
+ -->
+
+ <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler" unless="newt.compiler.present">
+ <!-- compiler configuration -->
+ <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
+
+ <compiler id="compiler.cfg.freebsd.newt" extends="compiler.cfg.freebsd">
+ <!-- Need to force X11R6 headers on to include path after stub_includes -->
+ <includepath path="/usr/X11R6/include" />
+ </compiler>
+
+ <!-- linker configuration -->
+
+ <linker id="linker.cfg.linux.newt.x11" extends="linker.cfg.linux">
+ <syslibset dir="/usr/X11R6/lib" libs="X11"/>
+ <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
+ </linker>
+
+ <linker id="linker.cfg.linux.amd64.newt.x11" extends="linker.cfg.linux.amd64">
+ <syslibset dir="/usr/X11R6/lib64" libs="X11"/>
+ <syslibset dir="/usr/X11R6/lib64" libs="Xxf86vm" />
+ </linker>
+
+ <linker id="linker.cfg.solaris.newt.x11" extends="linker.cfg.solaris">
+ <syslibset libs="X11"/>
+ </linker>
+
+ <linker id="linker.cfg.win32.mingw.newt" extends="linker.cfg.win32.mingw">
+ <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names -->
+ <syslibset libs="gdi32, kernel32"/>
+ </linker>
+
+ <linker id="linker.cfg.win32.msvc.newt" extends="linker.cfg.win32.msvc">
+ <syslibset libs="gdi32, user32, kernel32" />
+ </linker>
+
+ <linker id="linker.cfg.macosx.newt" extends="linker.cfg.macosx">
+ <linkerarg value="-framework" />
+ <linkerarg value="Cocoa" />
+ </linker>
+
+ <linker id="linker.cfg.hpux.newt" extends="linker.cfg.hpux">
+ <syslibset dir="/usr/lib" libs="X11"/>
+ </linker>
+ </target>
+
+ <target name="c.configure.win32.vc" if="isVCFamily">
+ <echo message="Win32.VC" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" />
+ <property name="linker.cfg.id.core" value="linker.cfg.win32.msvc" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.win32.msvc.newt" />
+ </target>
+
+ <target name="c.configure.win32.mingw" if="isMingW">
+ <echo message="Win32.MingW" />
+ <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" />
+ <property name="linker.cfg.id.core" value="linker.cfg.win32.mingw" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.win32.mingw.newt" />
+ </target>
+
+ <target name="c.configure.linux.x86" if="isLinuxX86">
+ <echo message="Linux.x86" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" />
+ </target>
+
+ <target name="c.configure.linux.amd64" if="isLinuxAMD64">
+ <echo message="Linux.AMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux.amd64" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.amd64.newt.x11" />
+ </target>
+
+ <target name="c.configure.linux.ia64" if="isLinuxIA64">
+ <echo message="Linux.IA64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.linux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" />
+ </target>
+
+ <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
+
+ <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
+ <echo message="Solaris" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.newt.x11" />
+ </target>
+
+
+ <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
+ <echo message="SolarisSparcv9" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris.sparcv9" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris.sparcv9" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.sparcv9.newt.x11" />
+ </target>
+
+
+ <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
+ <echo message="SolarisAMD64" />
+ <property name="compiler.cfg.id" value="compiler.cfg.solaris.amd64" />
+ <property name="linker.cfg.id.core" value="linker.cfg.solaris.amd64" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.solaris.amd64.newt.x11" />
+ </target>
+
+ <target name="c.configure.freebsd" depends="c.configure.x11" if="isFreeBSD">
+ <echo message="FreeBSD" />
+ <property name="compiler.cfg.id" value="compiler.cfg.freebsd.newt" />
+ <property name="linker.cfg.id.core" value="linker.cfg.linux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.linux.newt.x11" />
+ </target>
+
+ <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
+ <echo message="HP-UX" />
+ <property name="compiler.cfg.id" value="compiler.cfg.hpux" />
+ <property name="linker.cfg.id.core" value="linker.cfg.hpux" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.hpux.newt.x11" />
+ </target>
+
+ <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw" if="isWindows" />
+
+ <target name="c.configure.x11" if="isX11" />
+
+ <target name="c.configure.macosx" if="isOSX">
+ <property name="compiler.cfg.id" value="compiler.cfg.macosx" />
+ <property name="linker.cfg.id.core" value="linker.cfg.macosx" />
+ <property name="linker.cfg.id.oswin" value="linker.cfg.macosx.newt" />
+ </target>
+
+ <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" />
+
+ <target name="c.configure" depends="c.configure.1,c.configure.2" />
+
+ <target name="rename.mingw.dll" if="isMingW">
+ <move file="${src}" tofile="${dest}" />
+ </target>
+
+ <target name="rename.dylib" if="isOSX">
+ <move file="${src}" tofile="${dest}" />
+ </target>
+
+ <macrodef name="c.build">
+ <attribute name="c.compiler.src.files" />
+ <attribute name="compiler.cfg.id" />
+ <attribute name="linker.cfg.id" />
+ <attribute name="output.lib.name" />
+ <attribute name="c.compiler.use-jawt" default="false"/>
+ <sequential>
+ <echo message="Output lib name = @{output.lib.name}" />
+
+ <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally -->
+ <property name="c.compiler.debug" value="false" />
+ <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } -->
+ <property name="c.compiler.optimise" value="none" />
+
+ <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
+
+ <patternset id="c.src.files.newt">
+ <include name="${rootrel.src.c}/WindowsWindow.c" if="isWindows"/>
+ <include name="${rootrel.src.c}/*.m" if="isOSX"/>
+ <include name="${rootrel.src.c}/X11Window.c" if="isX11"/>
+ <include name="${rootrel.src.c}/KDWindow.c" if="useKD"/>
+ </patternset>
+
+ <echo message="Compiling @{output.lib.name}" />
+
+ <cc outtype="shared"
+ objdir="${obj}"
+ outfile="${obj}/@{output.lib.name}"
+ optimize="${c.compiler.optimise}"
+ debug="${c.compiler.debug}"
+ multithreaded="true"
+ exceptions="false"
+ rtti="false">
+
+ <!-- TODO: versioninfo companyname="java.net"
+ legalcopyright="Copyright"
+ productname="JOGL"
+ productversion="x.y.z"
+ description="Description"
+ fileversion="x.y.z"
+ filecomments="File Comment" /-->
+
+ <fileset dir="${project.root}"><patternset refid="@{c.compiler.src.files}"/></fileset>
+
+ <compiler extends="@{compiler.cfg.id}" >
+ <sysincludepath path="${java.includes.dir}"/>
+ <sysincludepath path="${java.includes.dir.platform}"/>
+ <includepath path="stub_includes/egl"/>
+ <!-- This is for the generated headers for handwritten C code -->
+ <includepath path="${src.generated.c}" />
+ <includepath path="${src.generated.c}/X11" if="isX11"/>
+ <includepath path="${src.generated.c}/MacOSX" if="isOSX"/>
+ <includepath path="${src.generated.c}/Windows" if="isWindows"/>
+ <includepath path="${src.generated.c}/KD"/>
+
+ <!-- This must come last to not override real include paths -->
+ <!-- includepath path="stub_includes/macosx" if="isOSX" / -->
+ </compiler>
+
+ <linker extends="@{linker.cfg.id}">
+ <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="@{output.lib.name}.useLibJAWT"/>
+ <syslibset dir="${java.lib.dir.platform}/server" libs="jvm" if="@{output.lib.name}.useLibJVM"/>
+ </linker>
+ </cc>
+
+ <!-- FIXME: this is a hack; the cpptask should have an option to change the
+ suffix or at least understand the override from dylib to jnilib -->
+ <antcall target="rename.dylib" inheritRefs="true">
+ <param name="src" value="${build}/obj/lib@{output.lib.name}.dylib" />
+ <param name="dest" value="${build}/obj/lib@{output.lib.name}.jnilib" />
+ </antcall>
+
+ <!-- FIXME: this is a hack; the cpptask should have an option to change the
+ suffix or at least understand the override from dylib to jnilib -->
+ <antcall target="rename.mingw.dll" inheritRefs="true">
+ <param name="src" value="${build}/obj/lib@{output.lib.name}.so" />
+ <param name="dest" value="${build}/obj/@{output.lib.name}.dll" />
+ </antcall>
+ </sequential>
+ </macrodef>
+
+ <target name="c.build.newt.prepare">
+ <javah destdir="../${rootrel.build.newt}/gensrc/native/newt/Windows" classpath="${newt.all.jar}" class="com.sun.javafx.newt.windows.WindowsWindow" />
+ <javah destdir="../${rootrel.build.newt}/gensrc/native/newt/MacOSX" classpath="${newt.all.jar}" class="com.sun.javafx.newt.macosx.MacWindow" />
+ <javah destdir="../${rootrel.build.newt}/gensrc/native/newt/X11" classpath="${newt.all.jar}" class="com.sun.javafx.newt.x11.X11Window" />
+ <javah destdir="../${rootrel.build.newt}/gensrc/native/newt/KD" classpath="${newt.all.jar}" class="com.sun.javafx.newt.opengl.kd.KDWindow" />
+ </target>
+
+ <target name="c.build.newt.windowlib">
+ <c.build c.compiler.src.files="c.src.files.newt"
+ output.lib.name="newt"
+ compiler.cfg.id="${compiler.cfg.id}"
+ linker.cfg.id="${linker.cfg.id.oswin}"/>
+ </target>
+
+ <target name="c.manifest" if="isVC8Family">
+ <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll -->
+ <msvc.manifest objdir="${obj}" dllname="newt" />
+ </target>
+
+ <target name="c.build.newt" depends="c.configure,c.build.newt.prepare,c.build.newt.windowlib">
+ <antcall target="c.manifest" inheritRefs="true" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the newt.jar files.
+ -->
+ <target name="jar" depends="java.compile,cond-if-RImanifest,cond-else-RImanifest"/>
+
+ <target name="check-RIcond">
+ <condition property="RIcond-is-true">
+ <isset property="RImanifestfile"/>
+ </condition>
+ </target>
+
+ <target name="cond-if-RImanifest" depends="check-RIcond" if="RIcond-is-true">
+ <copy file="newtRIversion"
+ tofile="tempversion"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
+ <filter token="BASEVERSION" value="${base_version}"/>
+ </filterset>
+ </copy>
+
+ <jar manifest="tempversion" destfile="${newt.core.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.core}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${newt.ogl.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.core}, ${java.part.opengl}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${newt.awt.jar}">
+ <fileset dir="${classes}"
+ includes="${java.part.awt}"/>
+ </jar>
+ <jar manifest="tempversion" destfile="${newt.all.jar}">
+ <fileset dir="${classes}">
+ <include name="com/sun/javafx/newt/**" />
+ </fileset>
+ </jar>
+ <delete file="tempversion"/>
+ </target>
+
+
+ <target name="cond-else-RImanifest" depends="check-RIcond" unless="RIcond-is-true">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMdd-HH:mm:ss"/>
+ </tstamp>
+ <copy file="newtversion"
+ tofile="tempversion"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${base_version}-pre-${timestamp}"/>
+ <filter token="BASEVERSION" value="${base_version}"/>
+ </filterset>
+ </copy>
+ <jar manifest="tempversion" destfile="${newt.jar}">
+ <fileset dir="${classes}">
+ <include name="com/sun/javafx/newt/**" />
+ </fileset>
+ </jar>
+ <delete file="tempversion"/>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the Javadocs for the sources.
+ - NOTE: these are not entirely correct as the javadocs targets depend
+ - on the platform specific build targets. To circumvent any
+ - errors, ensure that the source is built first.
+ -->
+ <target name="javadoc" depends="load.user.properties,init">
+ <!-- Build the general Javadoc -->
+ <javadoc packagenames="${javadoc.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen_jogl.classpath"/>
+ </javadoc>
+ </target>
+
+ <target name="javadoc.spec" depends="load.user.properties,init">
+ <!-- Build the general Javadoc -->
+ <javadoc packagenames="${javadoc.spec.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc.spec}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen_jogl.classpath"/>
+ </javadoc>
+ </target>
+
+ <target name="javadoc.dev" depends="load.user.properties,init">
+ <!-- Build the internal developer Javadoc -->
+ <javadoc packagenames="${javadoc.dev.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${src.java};${src.generated.java}"
+ destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ linkoffline="${javadoc.link} 142-packages"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="nativewindow_gluegen_jogl.classpath"/>
+ </javadoc>
+ </target>
+
+ <target name="all.doc" description="Build NEWT docs" depends="init,javadoc,javadoc.spec,javadoc.dev" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the platform-independent distribution out of jars built for
+ - Windows, Linux and Mac OS X; the Java sources for Jogl can't be
+ - fully cross-compiled at this time. To run this target, you need to
+ - specify the property newt.dist.dir as a System property (i.e.,
+ - "ant -Dnewt.dist.dir=../dist dist"); directories named newt-linux,
+ - newt-win, and newt-macosx need to be inside that directory and each
+ - of those directories needs to contain both the newt.jar for that
+ - platform as well as the native code (libnewt.so, newt.dll, or
+ - libnewt.jnilib). Also builds jars containing the native code for
+ - Windows, Linux, Mac OS X, Solaris/SPARC and Solaris/x86.
+ -->
+ <target name="dist.dir.check" unless="newt.dist.dir">
+ <fail>
+
+ ******************************************************************
+ ** To build the Jogl distribution out of the platform-specific **
+ ** component jars and native code, the property newt.dist.dir **
+ ** needs to be specified on the command line. Please read the **
+ ** comments associated with the "dist" target in the build.xml. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.windows" if="newt.dist.dir">
+ <condition property="windows.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-win/newt.jar" />
+ <available file="${newt.dist.dir}/newt-win/32/newt.dll" />
+ </and>
+ </condition>
+ <fail unless="windows.complete">
+ ******************************************************************
+ ** Files are missing from the Windows build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Windows build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.windows-amd64" if="newt.dist.dir">
+ <condition property="windows-amd64.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-win/64/newt.dll" />
+ </and>
+ </condition>
+ <fail unless="windows-amd64.complete">
+ *********************************************************************
+ ** Files are missing from the Windows/AMD64 build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Windows/AMD64 build and try again. **
+ *********************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.linux" if="newt.dist.dir">
+ <condition property="linux.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-linux/newt.jar" />
+ <available file="${newt.dist.dir}/newt-linux/32/libnewt.so" />
+ </and>
+ </condition>
+ <fail unless="linux.complete">
+ ******************************************************************
+ ** Files are missing from the Linux build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Linux build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.linux-amd64" if="newt.dist.dir">
+ <condition property="linux-amd64.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-linux/64/libnewt.so" />
+ </and>
+ </condition>
+ <fail unless="linux-amd64.complete">
+ *******************************************************************
+ ** Files are missing from the Linux/AMD64 build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Linux/AMD64 build and try again. **
+ *******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.macosx" if="newt.dist.dir">
+ <condition property="macosx.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-macosx/newt.jar" />
+ <available file="${newt.dist.dir}/newt-macosx/ppc/libnewt.jnilib" />
+ </and>
+ </condition>
+ <fail unless="macosx.complete">
+ ******************************************************************
+ ** Files are missing from the Mac OS X build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Mac OS X build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+
+ <target name="dist.check.macosxfat" if="newt.dist.dir">
+ <condition property="macosxfat.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-macosx/newt.jar" />
+ <available file="${newt.dist.dir}/newt-macosx/fat/libnewt.jnilib" />
+ </and>
+ </condition>
+ <fail unless="macosxfat.complete">
+ ******************************************************************
+ ** Files are missing from the Mac OS X build. This will cause **
+ ** the distribution to be incomplete. Please check the status **
+ ** of the Mac OS X build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+
+
+ <target name="dist.check.solsparc" if="newt.dist.dir">
+ <condition property="solsparc.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-solsparc/newt.jar" />
+ <available file="${newt.dist.dir}/newt-solsparc/32/libnewt.so" />
+ </and>
+ </condition>
+ <fail unless="solsparc.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/SPARC build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/SPARC build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solsparcv9" if="newt.dist.dir">
+ <condition property="solsparcv9.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-solsparc/newt.jar" />
+ <available file="${newt.dist.dir}/newt-solsparc/64/libnewt.so" />
+ </and>
+ </condition>
+ <fail unless="solsparcv9.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/SPARCv9 build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/SPARCv9 build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solx86" if="newt.dist.dir">
+ <condition property="solx86.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-solx86/newt.jar" />
+ <available file="${newt.dist.dir}/newt-solx86/32/libnewt.so" />
+ </and>
+ </condition>
+ <fail unless="solx86.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/x86 build. This will **
+ ** cause the distribution to be incomplete. Please check the **
+ ** status of the Solaris/x86 build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <target name="dist.check.solamd64" if="newt.dist.dir">
+ <condition property="solamd64.complete">
+ <and>
+ <available file="${newt.dist.dir}/newt-solx86/64/libnewt.so" />
+ </and>
+ </condition>
+ <fail unless="solamd64.complete">
+ ******************************************************************
+ ** Files are missing from the Solaris/x86/64 (amd64) build. This *
+ ** will cause the distribution **
+ ** to be incomplete. Please check the **
+ ** status of the Solaris/x86 (amd64) build and try again. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <!-- Helper task for dist target below -->
+ <!-- Required parameters: -->
+ <!-- zip.os.arch = the os/arch combination for this zip file (i.e., "windows-i586") -->
+ <!-- zip.src.so.dir = the directory containing the .so's / .dll's / .jnilib's for this platform-->
+ <target name="dist.build.zip">
+ <property name="newt.tmp.version" value="newt-${tmp.version}-${zip.os.arch}" />
+ <!-- Create all needed directories -->
+ <delete dir="${newt.dist.dir}/tmp" failonerror="false" />
+ <mkdir dir="${newt.dist.dir}/tmp/${newt.tmp.version}/lib" />
+ <!-- Copy in files -->
+ <copy todir="${newt.dist.dir}/tmp/${newt.tmp.version}/lib">
+ <fileset dir="${zip.src.so.dir}" includes="*${zip.so.suffix}" />
+ </copy>
+ <copy file="${newt.dist.dir}/newt.jar" todir="${newt.dist.dir}/tmp/${newt.tmp.version}/lib" />
+ <copy file="../CHANGELOG.txt" todir="${newt.dist.dir}/tmp/${newt.tmp.version}" />
+ <copy file="../COPYRIGHT.txt" todir="${newt.dist.dir}/tmp/${newt.tmp.version}" />
+ <copy file="../LICENSE.txt" tofile="${newt.dist.dir}/tmp/${newt.tmp.version}/LICENSE-NEWT-${tmp.version}.txt" />
+ <copy file="README-zip-bundles.txt"
+ tofile="${newt.dist.dir}/tmp/${newt.tmp.version}/README.txt"
+ overwrite="true">
+ <filterset>
+ <filter token="VERSION" value="${tmp.version}"/>
+ </filterset>
+ </copy>
+ <copy file="../doc/userguide/index.html" tofile="${newt.dist.dir}/tmp/${newt.tmp.version}/Userguide.html" />
+ <!-- zip it up -->
+ <zip destfile="${newt.dist.dir}/${newt.tmp.version}.zip"
+ basedir="${newt.dist.dir}/tmp"
+ includes="${newt.tmp.version}/**" />
+ </target>
+
+ <target name="setup-version-RI" if="RImanifestfile">
+ <property name="tmp.version" value="${base_version}" />
+ </target>
+
+ <target name="setup-version-non-RI" unless="RImanifestfile">
+ <tstamp>
+ <format property="timestamp" pattern="yyyyMMdd"/>
+ </tstamp>
+ <property name="tmp.version" value="${base_version}-pre-${timestamp}" />
+ </target>
+
+ <target name="dist" depends="dist.dir.check,dist.check.windows,dist.check.windows-amd64,dist.check.linux,dist.check.linux-amd64,dist.check.macosx,dist.check.macosxfat,dist.check.solsparc,dist.check.solsparcv9,dist.check.solx86,dist.check.solamd64,setup-version-RI,setup-version-non-RI">
+ <delete>
+ <fileset dir="${newt.dist.dir}" includes="*.jar" />
+ </delete>
+ <delete>
+ <fileset dir="${newt.dist.dir}" includes="*.zip" />
+ </delete>
+ <delete dir="${newt.dist.dir}/tmp" failonerror="false" />
+ <delete dir="${newt.dist.dir}/META-INF" failonerror="false" />
+ <!-- Extract manifest from one of the jars to re-use it in the dist jar -->
+ <unjar src="${newt.dist.dir}/newt-win/newt.jar" dest="${newt.dist.dir}" >
+ <patternset>
+ <include name="META-INF/MANIFEST.MF" />
+ </patternset>
+ </unjar>
+ <!-- Build jar files suitable for Java Web Start -->
+ <jar manifest="${newt.dist.dir}/META-INF/MANIFEST.MF" destfile="${newt.dist.dir}/newt.jar" duplicate="preserve">
+ <zipgroupfileset dir="${newt.dist.dir}"
+ includes="newt-win/newt.jar, newt-linux/newt.jar, newt-macosx/newt.jar" />
+ </jar>
+ <!-- Apply Pack200 repacking to allow later compression by that mechanism -->
+ <apply executable="pack200" verbose="true" >
+ <arg value="--repack" />
+ <fileset file="${newt.dist.dir}/newt.jar" />
+ </apply>
+ <jar destfile="${newt.dist.dir}/newt-natives-windows-i586.jar"
+ basedir="${newt.dist.dir}/newt-win/32"
+ includes="newt.dll" />
+ <jar destfile="${newt.dist.dir}/newt-natives-windows-amd64.jar"
+ basedir="${newt.dist.dir}/newt-win/64"
+ includes="newt.dll" />
+ <jar destfile="${newt.dist.dir}/newt-natives-linux-i586.jar"
+ basedir="${newt.dist.dir}/newt-linux/32"
+ includes="libnewt.so" />
+ <jar destfile="${newt.dist.dir}/newt-natives-linux-amd64.jar"
+ basedir="${newt.dist.dir}/newt-linux/64"
+ includes="libnewt.so" />
+ <jar destfile="${newt.dist.dir}/newt-natives-macosx-ppc.jar"
+ basedir="${newt.dist.dir}/newt-macosx/ppc"
+ includes="libnewt.jnilib" />
+ <jar destfile="${newt.dist.dir}/newt-natives-macosx-universal.jar"
+ basedir="${newt.dist.dir}/newt-macosx/fat"
+ includes="libnewt.jnilib" />
+ <jar destfile="${newt.dist.dir}/newt-natives-solaris-sparc.jar"
+ basedir="${newt.dist.dir}/newt-solsparc/32"
+ includes="libnewt.so" />
+ <jar destfile="${newt.dist.dir}/newt-natives-solaris-sparcv9.jar"
+ basedir="${newt.dist.dir}/newt-solsparc/64"
+ includes="libnewt.so" />
+ <jar destfile="${newt.dist.dir}/newt-natives-solaris-i586.jar"
+ basedir="${newt.dist.dir}/newt-solx86/32"
+ includes="libnewt.so" />
+ <jar destfile="${newt.dist.dir}/newt-natives-solaris-amd64.jar"
+ basedir="${newt.dist.dir}/newt-solx86/64"
+ includes="libnewt.so" />
+
+ <zip destfile="${newt.dist.dir}/newt-${tmp.version}-src.zip"
+ basedir="../.."
+ includes="jogl/*.txt,jogl/doc/**,jogl/make/**,jogl/src/newt/**"
+ excludes="**/*.class,**/*~"
+ />
+ <!-- Create zip archives suitable for developers -->
+ <!-- Unfortunately, we have to replicate the os/arch name combinations from
+ gluegen-cpptasks.xml. The reason for this is that we can't generate these
+ zip archives on the platform where the builds run; we have to run the dist
+ target in order to get the platform-independent newt.jar. -->
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="linux-i586" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-linux/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="linux-amd64" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-linux/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="macosx-ppc" />
+ <param name="zip.so.suffix" value=".jnilib" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-macosx/ppc" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="macosx-universal" />
+ <param name="zip.so.suffix" value=".jnilib" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-macosx/fat" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-i586" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solx86/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-amd64" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solx86/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-sparc" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solsparc/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="solaris-sparcv9" />
+ <param name="zip.so.suffix" value=".so" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-solsparc/64" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="windows-i586" />
+ <param name="zip.so.suffix" value=".dll" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-win/32" />
+ </antcall>
+ <antcall target="dist.build.zip" inheritAll="true">
+ <param name="zip.os.arch" value="windows-amd64" />
+ <param name="zip.so.suffix" value=".dll" />
+ <param name="zip.src.so.dir" value="${newt.dist.dir}/newt-win/64" />
+ </antcall>
+ <!-- Create one last zip archive by hand, this one containing all of the -->
+ <!-- Java Web Start jar files (for easier redistribution) -->
+ <zip destfile="${newt.dist.dir}/newt-${tmp.version}-webstart.zip"
+ basedir="${newt.dist.dir}"
+ includes="*.jar" />
+ <!-- Create a version.txt file indicating which version we just built -->
+ <echo message="${tmp.version}" file="${newt.dist.dir}/version.txt" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Clean up all that is built.
+ -->
+ <target name="clean" description="Remove all build products" depends="declare.common">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${build}" />
+ <fileset dir="${javadoc}" />
+ <fileset dir="${javadoc.spec}" />
+ <fileset dir="${javadoc.dev}" />
+ </delete>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build everything.
+ -->
+ <target name="all" description="Build NEWT JAR file(s) and native libraries." depends="load.user.properties,init,jar,c.build.newt" />
+
+ <!-- ================================================================== -->
+ <!--
+ - Build everything and use Sun's Implementation tag in the manifest to
+ - indicate this is the Reference Implementation.
+ -->
+ <target name="RI">
+ <!-- Set property for using the RI manifest file so newt.jar is versioned
+ - properly
+ -->
+ <property name="RImanifestfile" value="newtRIversion" />
+ <antcall target="all" inheritRefs="true" />
+ </target>
+</project>
diff --git a/make/build-staticglgen.xml b/make/build-staticglgen.xml
new file mode 100644
index 000000000..9ef1147a3
--- /dev/null
+++ b/make/build-staticglgen.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - Ant build for JOGL's BuildStaticGLInfo and corresponding ANT task. This
+ - build should not be called directly. It is invoked from the main
+ - "build.xml" file and relies on the properties set therein.
+ -
+ - This build has been tested with ANT 1.5.3 and JOGL 1.1.1.1.
+ -
+ - Public targets:
+ - all: clean and build BuildStaticGLInfo and StaticGLGen Ant task
+ - clean: clean all built
+ -->
+<project name="JOGL.BuildStaticGLInfo" default="all">
+ <!-- ================================================================== -->
+ <!--
+ - Declare all paths and user defined variables.
+ -->
+ <target name="declare" description="Declare properties">
+ <!-- The location of the BuildStaticGLInfo source. -->
+ <property name="static.gl.src" value="${src.java}/com/sun/gluegen/opengl" />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build BuildStaticGLInfo.
+ -->
+ <target name="build.static.gl" depends="declare">
+ <!-- Ensure that the output classes directory exists. -->
+ <mkdir dir="${classes}" />
+
+ <!-- Compile BuildStaticGLInfo -->
+ <javac srcdir="${src.java}" destdir="${classes}" includes="**/BuildStaticGLInfo.java" source="1.4" debug="true" debuglevel="source,lines">
+ <classpath refid="antlr.classpath" />
+ </javac>
+
+ <!-- Inform the user that BuildStaticGLInfo has been successfully built. -->
+ <echo message="" />
+ <echo message="BuildStaticGLInfo has been built successfully." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build the StaticGLGen ANT task.
+ -->
+ <target name="build.static.gl.task" depends="declare">
+ <!-- Ensure that the output classes directory exists. -->
+ <mkdir dir="${classes}" />
+
+ <!-- Build the BuildStaticGLInfo ANT task.
+ - NOTE: ONLY the StaticGLGen is built at this time. BuildStaticGLInfo
+ - itself is built in a separate task. -->
+ <javac destdir="${classes}" includes="**/StaticGLGenTask.java" source="1.4" debug="true" debuglevel="source,lines">
+ <src path="${src.java}" />
+ <classpath refid="classpath" />
+ </javac>
+
+ <!-- Inform the user that the BuildStaticGLInfo ANT task has been
+ - successfully built. -->
+ <echo message="" />
+ <echo message="StaticGLGen ANT task has been built successfully." />
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Clean up all that is built.
+ - NOTE: this is a bit heavy-handed as it may delete more than just
+ - what is built with this build.
+ -->
+ <target name="clean" depends="declare">
+ <!-- Create the directory before attempting to delete it. Deleting
+ - non-existant dirs will cause an error. -->
+ <mkdir dir="${classes}" />
+
+ <delete includeEmptyDirs="true">
+ <fileset dir="${classes}" />
+ </delete>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Build BuildStaticGLInfo and the BuildStaticGLInfo ANT task.
+ -->
+ <target name="all" depends="declare">
+ <!-- Build BuildStaticGLInfo -->
+ <antcall target="build.static.gl" />
+
+ <!-- Build the BuildStaticGLInfo ANT task -->
+ <antcall target="build.static.gl.task" />
+ </target>
+
+</project> \ No newline at end of file
diff --git a/make/build.xml b/make/build.xml
new file mode 100644
index 000000000..51ccc4efd
--- /dev/null
+++ b/make/build.xml
@@ -0,0 +1,145 @@
+
+<project name="JOGL_ALL" basedir="." default="all">
+
+ <target name="init">
+ <property name="base_version_jogl" value="1.2.0-rc1"/>
+ <property name="base_version_nw" value="1.0.0-rc1"/>
+ <property name="project.root" value=".." />
+ <condition property="rootrel.build" value="build">
+ <not>
+ <isset property="rootrel.build"/>
+ </not>
+ </condition>
+ <property name="build" value="${project.root}/${rootrel.build}" />
+ <property name="src" value="${project.root}/src" />
+
+ <property name="nativewindow.make.dir" value="." />
+ <property name="nativewindow.build.xml" value="${nativewindow.make.dir}/build-nativewindow.xml" />
+ <property name="jogl.make.dir" value="." />
+ <property name="jogl.build.xml" value="${jogl.make.dir}/build-jogl.xml" />
+ <property name="newt.make.dir" value="." />
+ <property name="newt.build.xml" value="${newt.make.dir}/build-newt.xml" />
+
+ <property name="all.srcj.path" value="${src}/nativewindow/classes;${src}/jogl/classes;${src}/newt/classes" />
+ <property name="all.genj.path" value="${build}/nativewindow/gensrc/classes;${build}/jogl/gensrc/classes;${build}/newt/gensrc/classes" />
+
+ <!-- The javadoc dirs. -->
+ <property name="javadoc" value="${project.root}/javadoc_public" />
+ <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" />
+ <property name="javadoc.overview" value="doc/jogl/spec-overview.html" />
+
+ <property name="javadoc.nw.overview" value="../src/nativewindow/classes/javax/media/nativewindow/package.html" />
+ <property name="javadoc.nw.spec" value="${project.root}/javadoc_nativewindow_spec" />
+ <property name="javadoc.nw.spec.windowtitle" value="NativeWindow API -- ${base_version_nw} Specification" />
+ <property name="javadoc.nw.spec.packagenames" value="javax.media.nativewindow.*" />
+
+ <property name="javadoc.spec" value="${project.root}/javadoc_jogl_spec" />
+ <property name="javadoc.spec.windowtitle" value="JOGL API -- JSR-231 ${base_version_jogl} Specification" />
+ <property name="javadoc.spec.packagenames" value="javax.media.opengl.*" />
+
+ <property name="javadoc.windowtitle" value="JOGL, NativeWindow and NEWT APIs" />
+ <property name="javadoc.packagenames" value="${javadoc.nw.spec.packagenames},${javadoc.spec.packagenames},com.sun.opengl.util.*,com.sun.javafx.newt, com.sun.javafx.newt.opengl" />
+
+ <property name="javadoc.dev" value="${project.root}/javadoc_dev" />
+ <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},com.sun.opengl.impl.*,com.sun.nativewindow.impl.*,com.sun.javafx.newt.*,com.sun.gluegen,com.sun.gluegen.runtime" />
+
+ <property name="java.excludes.javadoc.packagenames" value="com.sun.opengl.impl.gl2.fixme.*,com.sun.javafx.audio.windows.waveout.TestSpatialization"/>
+ <property name="javadoc.bottom" value="Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=231&quot;&gt;license terms&lt;/a&gt;." />
+
+ <property name="gluegen-rt.jar" value="../../gluegen/${rootrel.build}/gluegen-rt.jar" />
+ <property name="nativewindow.all.jar" value="../${rootrel.build}/nativewindow/nativewindow.all.jar" />
+ <property name="jogl.all.jar" value="../${rootrel.build}/jogl/jogl.all.jar" />
+ <property name="newt.all.jar" value="../${rootrel.build}/newt/newt.all.jar" />
+
+ <path id="all.classpath">
+ <pathelement location="${nativewindow.all.jar}" />
+ <pathelement location="${gluegen-rt.jar}" />
+ <pathelement location="${jogl.all.jar}" />
+ <pathelement location="${newt.all.jar}" />
+ </path>
+
+ </target>
+
+ <target name="build.nativewindow" depends="init">
+ <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make.dir}" target="all" inheritAll="false"/>
+ </target>
+
+ <target name="build.jogl" depends="init">
+ <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="all" inheritAll="false"/>
+ </target>
+
+ <target name="build.newt" depends="init">
+ <ant antfile="${newt.build.xml}" dir="${newt.make.dir}" target="all" inheritAll="false"/>
+ </target>
+
+ <target name="all" description="Build nativewindow, jogl and newt projects" depends="init,build.nativewindow,build.jogl,build.newt" />
+
+ <target name="clean" depends="init">
+ <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make.dir}" target="clean" inheritAll="false"/>
+ <ant antfile="${jogl.build.xml}" dir="${jogl.make.dir}" target="clean" inheritAll="false"/>
+ <ant antfile="${newt.build.xml}" dir="${newt.make.dir}" target="clean" inheritAll="false"/>
+ </target>
+
+ <target name="javadoc" depends="init">
+ <!-- Build the general public Javadoc -->
+ <javadoc packagenames="${javadoc.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${all.srcj.path};${all.genj.path}"
+ destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="all.classpath"/>
+ <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc.jogl.spec" depends="init,javadoc.nw.spec">
+ <!-- Build the specification Javadoc -->
+ <javadoc packagenames="${javadoc.spec.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${all.srcj.path};${all.genj.path}"
+ destdir="${javadoc.spec}" windowtitle="${javadoc.spec.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="all.classpath"/>
+ <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" />
+ <link offline="false" href="${javadoc.nw.spec}" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc.dev" depends="init">
+ <!-- Build the internal developer Javadoc -->
+ <javadoc packagenames="${javadoc.dev.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${all.srcj.path};${all.genj.path}"
+ destdir="${javadoc.dev}" windowtitle="${javadoc.windowtitle}"
+ overview="${javadoc.overview}"
+ source="1.4"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="all.classpath"/>
+ <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc.nw.spec" depends="init">
+ <!-- Build the general Javadoc -->
+ <javadoc packagenames="${javadoc.nw.spec.packagenames}"
+ excludepackagenames="${java.excludes.javadoc.packagenames}"
+ sourcepath="${all.srcj.path};${all.genj.path}"
+ destdir="${javadoc.nw.spec}" windowtitle="${javadoc.nw.spec.windowtitle}"
+ overview="${javadoc.nw.overview}"
+ source="1.4"
+ bottom="${javadoc.bottom}" >
+ <classpath refid="all.classpath"/>
+ <link offline="true" href="${javadoc.link}" packagelistLoc="142-packages" />
+ </javadoc>
+ </target>
+
+ <target name="javadoc.spec" description="Build Specifications JOGL and Nativewindow" depends="init,javadoc.jogl.spec" />
+
+ <target name="all.doc" description="Build NativeWindow, JOGL and NEWT docs" depends="init,javadoc,javadoc.spec,javadoc.dev" />
+
+</project>
+
diff --git a/make/config/intptr.cfg b/make/config/intptr.cfg
new file mode 100755
index 000000000..c946e4851
--- /dev/null
+++ b/make/config/intptr.cfg
@@ -0,0 +1,17 @@
+CustomCCode #ifdef _WIN32
+CustomCCode #ifdef _MSC_VER
+CustomCCode /* This typedef is apparently needed for Microsoft compilers before VC8,
+CustomCCode and on Windows CE */
+CustomCCode #if (_MSC_VER < 1400) || defined(UNDER_CE)
+CustomCCode #ifdef _WIN64
+CustomCCode typedef long long intptr_t;
+CustomCCode #else
+CustomCCode typedef int intptr_t;
+CustomCCode #endif
+CustomCCode #endif
+CustomCCode #else
+CustomCCode #include <inttypes.h>
+CustomCCode #endif
+CustomCCode #else
+CustomCCode #include <inttypes.h>
+CustomCCode #endif
diff --git a/make/config/jogl/cg-common-CustomJavaCode.java b/make/config/jogl/cg-common-CustomJavaCode.java
new file mode 100755
index 000000000..1f109d9f6
--- /dev/null
+++ b/make/config/jogl/cg-common-CustomJavaCode.java
@@ -0,0 +1,29 @@
+static {
+ com.sun.opengl.impl.NativeLibLoader.loadCgImpl();
+}
+
+/** A convenience method which reads all available data from the InputStream and then calls cgCreateProgram. */
+public static CGprogram cgCreateProgramFromStream(CGcontext ctx, int program_type, java.io.InputStream stream, int profile, java.lang.String entry, java.lang.String[] args) throws java.io.IOException {
+ if (stream == null) {
+ throw new java.io.IOException("null stream");
+ }
+ stream = new java.io.BufferedInputStream(stream);
+ int avail = stream.available();
+ byte[] data = new byte[avail];
+ int numRead = 0;
+ int pos = 0;
+ do {
+ if (pos + avail > data.length) {
+ byte[] newData = new byte[pos + avail];
+ System.arraycopy(data, 0, newData, 0, pos);
+ data = newData;
+ }
+ numRead = stream.read(data, pos, avail);
+ if (numRead >= 0) {
+ pos += numRead;
+ }
+ avail = stream.available();
+ } while (avail > 0 && numRead >= 0);
+ String program = new String(data, 0, pos, "US-ASCII");
+ return cgCreateProgram(ctx, program_type, program, profile, entry, args);
+}
diff --git a/make/config/jogl/cg-common.cfg b/make/config/jogl/cg-common.cfg
new file mode 100644
index 000000000..9b8dba079
--- /dev/null
+++ b/make/config/jogl/cg-common.cfg
@@ -0,0 +1,118 @@
+# This .cfg file provides common options used among all Cg glue code
+# generated for Jogl on all platforms.
+Package com.sun.opengl.cg
+JavaClass CgGL
+Style AllStatic
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl_cg
+HierarchicalNativeOutput false
+
+#
+# Map const char* return values to Java strings for these functions
+#
+ReturnsString cgGetAnnotationName
+ReturnsString cgGetEnumString
+ReturnsString cgGetErrorString
+ReturnsString cgGetLastErrorString
+ReturnsString cgGetLastListing
+ReturnsString cgGetParameterName
+ReturnsString cgGetParameterSemantic
+ReturnsString cgGetPassName
+ReturnsString cgGetProfileString
+ReturnsString cgGetProgramString
+ReturnsString cgGetResourceString
+ReturnsString cgGetStateName
+ReturnsString cgGetString
+ReturnsString cgGetStringAnnotationValue
+ReturnsString cgGetStringParameterValue
+ReturnsString cgGetStringStateAssignmentValue
+ReturnsString cgGetTechniqueName
+ReturnsString cgGetTypeString
+
+ArgumentIsString cgAddStateEnumerant 1
+ArgumentIsString cgCreateArrayState 1
+ArgumentIsString cgCreateArraySamplerState 1
+ArgumentIsString cgCreateEffect 1 2
+ArgumentIsString cgCreateEffectFromFile 1 2
+ArgumentIsString cgCreateProgram 2 4 5
+ArgumentIsString cgCreateProgramFromFile 2 4 5
+ArgumentIsString cgCreateProgramFromEffect 2 3
+ArgumentIsString cgCreateSamplerState 1
+ArgumentIsString cgCreateState 1
+ArgumentIsString cgGetEffectParameterBySemantic 1
+ArgumentIsString cgGetEnum 0
+ArgumentIsString cgGetNamedEffectParameter 1
+ArgumentIsString cgGetNamedParameter 1
+ArgumentIsString cgGetNamedPass 1
+ArgumentIsString cgGetNamedProgramParameter 2
+ArgumentIsString cgGetNamedSamplerState 1
+ArgumentIsString cgGetNamedState 1
+ArgumentIsString cgGetNamedSamplerStateAssignment 1
+ArgumentIsString cgGetNamedStateAssignment 1
+ArgumentIsString cgGetNamedStructParameter 1
+ArgumentIsString cgGetNamedTechnique 1
+ArgumentIsString cgGetNamedTechniqueAnnotation 1
+ArgumentIsString cgGetNamedPassAnnotation 1
+ArgumentIsString cgGetNamedParameterAnnotation 1
+ArgumentIsString cgGetNamedProgramAnnotation 1
+ArgumentIsString cgGetNamedUserType 1
+ArgumentIsString cgGetProfile 0
+ArgumentIsString cgGetType 0
+ArgumentIsString cgGetResource 0
+ArgumentIsString cgSetLastListing 1
+ArgumentIsString cgSetParameterSemantic 1
+ArgumentIsString cgSetStringParameterValue 1
+
+# Opaque definitions
+Opaque boolean CGbool
+
+#
+# FIXME!!!! Ignore these functions for now because we can't
+# automatically handle C callbacks
+#
+Ignore cgSetErrorCallback
+Ignore cgGetErrorCallback
+Ignore cgSetErrorHandler
+Ignore cgGetErrorHandler
+Ignore cgSetStateCallbacks
+Ignore cgGetStateSetCallback
+Ignore cgGetStateResetCallback
+Ignore cgGetStateValidateCallback
+
+#
+# FIXME!!!! Ignore these functions for now because bugs in the
+# emitter code can't handle them
+#
+Ignore cgGetBooleanAnnotationValues
+Ignore cgGetBoolStateAssignmentValues
+Ignore cgGetFloatAnnotationValues
+Ignore cgGetFloatStateAssignmentValues
+Ignore cgGetIntAnnotationValues
+Ignore cgGetIntStateAssignmentValues
+Ignore cgGetParameterValues
+Ignore cgGetProgramOptions
+
+#
+# Need to import New IO for Buffer classes
+#
+Import java.nio.*
+# And NativeLibLoader for help loading the native libraries
+Import com.sun.opengl.impl.*
+
+#
+# NIODirectOnly directives for routines requiring them for semantic reasons
+#
+NIODirectOnly cgGLSetParameterPointer
+
+# Raise CgException instead of RuntimeException in glue code
+RuntimeExceptionType CgException
+
+#
+# Make sure the right definitions and include files are added to the
+# generated C code
+#
+
+CustomCCode #include <stdlib.h>
+CustomCCode #include <Cg/cgGL.h>
+
+IncludeAs CustomJavaCode CgGL cg-common-CustomJavaCode.java
diff --git a/make/config/jogl/cgl-macosx.cfg b/make/config/jogl/cgl-macosx.cfg
new file mode 100644
index 000000000..780afcf5b
--- /dev/null
+++ b/make/config/jogl/cgl-macosx.cfg
@@ -0,0 +1,41 @@
+# This .cfg file is used to generate the interface to the CGL routines
+# used internally by the MacOSXGLContext implementation.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/MacOSX
+
+Package com.sun.opengl.impl.macosx.cgl
+JavaClass CGL
+Style allstatic
+Include gl-common-gl2.cfg
+Include gl-common-extensions.cfg
+Include gl-desktop.cfg
+
+Opaque long void *
+
+# Opaque directives for low-level CGL binding (for Java2D/JOGL bridge)
+Opaque long CGLContextObj
+Opaque long CGLPBufferObj
+Opaque long CGLPixelFormatObj
+
+CustomCCode #include </usr/include/machine/types.h>
+CustomCCode #include "macosx-window-system.h"
+
+# Implement the first argument to getProcAddress as String instead
+# of byte[]
+ArgumentIsString getProcAddress 0
+
+DropUniqVendorExtensions AMD
+# We need GL_APPLE_float_pixels for our pbuffer implementation
+# DropUniqVendorExtensions APPLE
+DropUniqVendorExtensions ATI
+DropUniqVendorExtensions HP
+DropUniqVendorExtensions IBM
+DropUniqVendorExtensions MESA
+DropUniqVendorExtensions MESAX
+DropUniqVendorExtensions NV
+DropUniqVendorExtensions SGI
+DropUniqVendorExtensions SGIS
+DropUniqVendorExtensions SGIX
+DropUniqVendorExtensions SUN
+DropUniqVendorExtensions WIN
+
diff --git a/make/config/jogl/cglext.cfg b/make/config/jogl/cglext.cfg
new file mode 100755
index 000000000..4000ecb2b
--- /dev/null
+++ b/make/config/jogl/cglext.cfg
@@ -0,0 +1,44 @@
+# This .cfg file is used to generate the interface and implementing
+# class for the CGL extensions.
+# Note that there are currently no such extensions exposed on Mac OS
+# X, but if in the future there are, this structure will allow them to
+# be easily exposed.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/MacOSX
+
+Package com.sun.opengl.impl.macosx.cgl
+Style InterfaceAndImpl
+JavaClass CGLExt
+ImplPackage com.sun.opengl.impl.macosx.cgl
+ImplJavaClass CGLExtImpl
+Include gl-common-gl2.cfg
+Include gl-desktop.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName CGLExtProcAddressTable
+GetProcAddressTableExpr _context.getCGLExtProcAddressTable()
+
+# Ignore everything that doesn't start with cgl or CGL
+IgnoreNot ^(cgl|CGL).+
+
+Include gl-headers.cfg
+Include ../intptr.cfg
+
+CustomJavaCode CGLExt public boolean isFunctionAvailable(String glFunctionName);
+CustomJavaCode CGLExt public boolean isExtensionAvailable(String glExtensionName);
+
+CustomJavaCode CGLExtImpl public CGLExtImpl(MacOSXCGLContext context) {
+CustomJavaCode CGLExtImpl this._context = context;
+CustomJavaCode CGLExtImpl }
+
+CustomJavaCode CGLExtImpl public boolean isFunctionAvailable(String glFunctionName)
+CustomJavaCode CGLExtImpl {
+CustomJavaCode CGLExtImpl return _context.isFunctionAvailable(glFunctionName);
+CustomJavaCode CGLExtImpl }
+
+CustomJavaCode CGLExtImpl public boolean isExtensionAvailable(String glExtensionName)
+CustomJavaCode CGLExtImpl {
+CustomJavaCode CGLExtImpl return _context.isExtensionAvailable(glExtensionName);
+CustomJavaCode CGLExtImpl }
+
+CustomJavaCode CGLExtImpl private MacOSXCGLContext _context;
diff --git a/make/config/jogl/egl.cfg b/make/config/jogl/egl.cfg
new file mode 100755
index 000000000..6457ab21a
--- /dev/null
+++ b/make/config/jogl/egl.cfg
@@ -0,0 +1,70 @@
+# This .cfg file is used to generate the interface to the EGL routines
+# used internally by the EGLContext implementation.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/egl
+
+Package com.sun.opengl.impl.egl
+JavaClass EGL
+Style allstatic
+# Shouldn't matter which one of these we pick up
+
+HierarchicalNativeOutput false
+Include gl-common.cfg
+
+# Use a ProcAddressTable so we dynamically look up the routines
+EmitProcAddressTable true
+ProcAddressTableClassName EGLProcAddressTable
+GetProcAddressTableExpr _table
+
+# Translate EGLBoolean as Java boolean
+Opaque boolean EGLBoolean
+
+# Implement the first argument to eglGetProcAddress as String instead
+# of byte[]
+ArgumentIsString eglGetProcAddress 0
+ReturnsString eglQueryString
+
+# Make eglGetProcAddress return an opaque long
+Opaque long __EGLFuncPtr
+
+# Force all of the methods to be emitted using dynamic linking so we
+# don't need to link against any emulation library on the desktop or
+# depend on the presence of an import library for a particular device
+ForceProcAddressGen __ALL__
+
+# Treat all of the EGL types as opaque longs
+Opaque long EGLContext
+Opaque long EGLDisplay
+Opaque long EGLSurface
+Opaque long EGLNativeDisplayType
+Opaque long EGLNativeWindowType
+Opaque long EGLNativePixmapType
+Opaque long EGLClientBuffer
+
+CustomCCode #include <EGL/egl.h>
+
+Include ../intptr.cfg
+
+CustomJavaCode EGL private static EGLProcAddressTable _table = new EGLProcAddressTable();
+CustomJavaCode EGL public static void resetProcAddressTable(DynamicLookupHelper lookup) {
+CustomJavaCode EGL GLProcAddressHelper.resetProcAddressTable(_table, lookup);
+CustomJavaCode EGL }
+
+# There are some #defines in egl.h that GlueGen and PCPP don't currently handle
+CustomJavaCode EGL public static final long EGL_DEFAULT_DISPLAY = 0;
+CustomJavaCode EGL public static final long EGL_NO_CONTEXT = 0;
+CustomJavaCode EGL public static final long EGL_NO_DISPLAY = 0;
+CustomJavaCode EGL public static final long EGL_NO_SURFACE = 0;
+CustomJavaCode EGL public static final int EGL_DONT_CARE = -1;
+CustomJavaCode EGL public static final int EGL_UNKNOWN = -1;
+CustomJavaCode EGL
+CustomJavaCode EGL protected static long eglGetProcAddress(long eglGetProcAddressHandle, java.lang.String procname)
+CustomJavaCode EGL {
+CustomJavaCode EGL if (eglGetProcAddressHandle == 0) {
+CustomJavaCode EGL throw new GLException("Passed null pointer for method \"eglGetProcAddress\"");
+CustomJavaCode EGL }
+CustomJavaCode EGL return dispatch_eglGetProcAddress0(procname, eglGetProcAddressHandle);
+CustomJavaCode EGL }
+
+
+Import com.sun.gluegen.runtime.opengl.GLProcAddressHelper
diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg
new file mode 100755
index 000000000..bdd9a3655
--- /dev/null
+++ b/make/config/jogl/eglext.cfg
@@ -0,0 +1,126 @@
+# This .cfg file is used to generate the interface to the EGL routines
+# used internally by the EGLContext implementation.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/egl
+
+Package com.sun.opengl.impl.egl
+Style InterfaceAndImpl
+JavaClass EGLExt
+ImplPackage com.sun.opengl.impl.egl
+ImplJavaClass EGLExtImpl
+# Shouldn't matter which one of these we pick up
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/com/sun/opengl/impl/egl/EGL.java
+HierarchicalNativeOutput false
+Include gl-common.cfg
+
+# Use a ProcAddressTable so we dynamically look up the routines
+EmitProcAddressTable true
+ProcAddressTableClassName EGLExtProcAddressTable
+GetProcAddressTableExpr _context.getEGLExtProcAddressTable()
+
+# Translate EGLBoolean as Java boolean
+Opaque boolean EGLBoolean
+
+# Implement the first argument to eglGetProcAddress as String instead
+# of byte[]
+ArgumentIsString eglGetProcAddress 0
+ReturnsString eglQueryString
+
+# Make eglGetProcAddress return an opaque long
+Opaque long __EGLFuncPtr
+
+# Force all of the methods to be emitted using dynamic linking so we
+# don't need to link against any emulation library on the desktop or
+# depend on the presence of an import library for a particular device
+ForceProcAddressGen __ALL__
+
+# Also force the calling conventions of the locally generated function
+# pointer typedefs for these routines to EGLAPIENTRY
+LocalProcAddressCallingConvention __ALL__ EGLAPIENTRY
+
+# Treat all of the EGL types as opaque longs
+# Opaque long EGLConfig
+Opaque long EGLContext
+Opaque long EGLDisplay
+Opaque long EGLSurface
+Opaque long EGLNativeDisplayType
+Opaque long EGLNativeWindowType
+Opaque long EGLNativePixmapType
+Opaque long EGLClientBuffer
+Opaque long EGLImageKHR
+#Opaque long EGLPerfMonitorNV
+#Opaque long EGLPerfCounterNV
+#Opaque long EGLPerfMarkerNV
+Opaque long EGLSyncKHR
+Opaque long NativeSyncKHR
+
+# Opaque long EGLClientBuffer
+
+CustomCCode /* Define EGL_EGLEXT_PROTOTYPES so that the EGL extension prototypes in
+CustomCCode "eglext.h" are parsed. */
+CustomCCode #define EGL_EGLEXT_PROTOTYPES
+CustomCCode
+CustomCCode #include <EGL/eglext.h>
+
+Include ../intptr.cfg
+
+# There are some #defines in eglext.h that GlueGen and PCPP don't currently handle
+CustomJavaCode EGLExt public static final long EGL_NO_IMAGE = 0;
+CustomJavaCode EGLExt public static final long EGL_NO_PERFMONITOR = 0;
+CustomJavaCode EGLExt public static final long EGL_DEFAULT_PERFMARKER = 0;
+CustomJavaCode EGLExt public boolean isFunctionAvailable(String glFunctionName);
+CustomJavaCode EGLExt public boolean isExtensionAvailable(String glExtensionName);
+
+CustomJavaCode EGLExtImpl public EGLExtImpl(EGLContext context) {
+CustomJavaCode EGLExtImpl this._context = context;
+CustomJavaCode EGLExtImpl }
+
+CustomJavaCode EGLExtImpl public boolean isFunctionAvailable(String glFunctionName)
+CustomJavaCode EGLExtImpl {
+CustomJavaCode EGLExtImpl return _context.isFunctionAvailable(glFunctionName);
+CustomJavaCode EGLExtImpl }
+
+CustomJavaCode EGLExtImpl public boolean isExtensionAvailable(String glExtensionName)
+CustomJavaCode EGLExtImpl {
+CustomJavaCode EGLExtImpl return _context.isExtensionAvailable(glExtensionName);
+CustomJavaCode EGLExtImpl }
+
+CustomJavaCode EGLExtImpl private EGLContext _context;
+
+# These Ignores cause the core EGL routines to be ignored from the
+# EGLExt interface and EGLExtImpl implementing class.
+Ignore eglBindAPI
+Ignore eglBindTexImage
+Ignore eglChooseConfig
+Ignore eglCopyBuffers
+Ignore eglCreateContext
+Ignore eglCreatePbufferFromClientBuffer
+Ignore eglCreatePbufferSurface
+Ignore eglCreatePixmapSurface
+Ignore eglCreateWindowSurface
+Ignore eglDestroyContext
+Ignore eglDestroySurface
+Ignore eglGetConfigAttrib
+Ignore eglGetConfigs
+Ignore eglGetCurrentContext
+Ignore eglGetCurrentDisplay
+Ignore eglGetCurrentSurface
+Ignore eglGetDisplay
+Ignore eglGetError
+Ignore eglGetProcAddress
+Ignore eglInitialize
+Ignore eglMakeCurrent
+Ignore eglQueryAPI
+Ignore eglQueryContext
+Ignore eglQueryString
+Ignore eglQuerySurface
+Ignore eglReleaseTexImage
+Ignore eglReleaseThread
+Ignore eglSurfaceAttrib
+Ignore eglSwapBuffers
+Ignore eglSwapInterval
+Ignore eglTerminate
+Ignore eglWaitClient
+Ignore eglWaitGL
+Ignore eglWaitNative
diff --git a/make/config/jogl/gl-common-extensions.cfg b/make/config/jogl/gl-common-extensions.cfg
new file mode 100644
index 000000000..fb46e43ca
--- /dev/null
+++ b/make/config/jogl/gl-common-extensions.cfg
@@ -0,0 +1,127 @@
+
+# Note: we keep the Apple, ATI and NVidia extensions since they are generally
+# the most useful and up-to-date
+DropUniqVendorExtensions 3DFX
+DropUniqVendorExtensions AMD
+# DropUniqVendorExtensions APPLE
+# DropUniqVendorExtensions ATI
+DropUniqVendorExtensions HP
+DropUniqVendorExtensions IBM
+DropUniqVendorExtensions INGR
+DropUniqVendorExtensions MESA
+DropUniqVendorExtensions MESAX
+# DropUniqVendorExtensions NV
+DropUniqVendorExtensions PGI
+DropUniqVendorExtensions SGI
+DropUniqVendorExtensions SGIS
+DropUniqVendorExtensions SGIX
+DropUniqVendorExtensions SUN
+DropUniqVendorExtensions WIN
+
+# Drop some obsolete or mostly-integrated vendor extensions that the above directives let in
+# Note that some of these are in LWJGL, so perhaps there is justification for leaving them in
+IgnoreExtension GL_APPLE_element_array
+IgnoreExtension GL_APPLE_vertex_array_object
+IgnoreExtension GL_ATI_element_array
+IgnoreExtension GL_ATI_envmap_bumpmap
+IgnoreExtension GL_ATI_fragment_shader
+IgnoreExtension GL_ATI_map_object_buffer
+IgnoreExtension GL_ATI_separate_stencil
+IgnoreExtension GL_ATI_text_fragment_shader
+IgnoreExtension GL_ATI_texture_env_combine3
+IgnoreExtension GL_ATI_texture_mirror_once
+IgnoreExtension GL_ATI_vertex_array_object
+IgnoreExtension GL_ATI_vertex_attrib_array_object
+IgnoreExtension GL_ATI_vertex_streams
+IgnoreExtension GL_NV_depth_buffer_float
+IgnoreExtension GL_NV_fragment_program
+IgnoreExtension GL_NV_fragment_program2
+IgnoreExtension GL_NV_packed_depth_stencil
+IgnoreExtension GL_NV_point_sprite
+IgnoreExtension GL_NV_register_combiners
+IgnoreExtension GL_NV_register_combiners2
+IgnoreExtension GL_NV_texgen_reflection
+IgnoreExtension GL_NV_texture_env_combine4
+IgnoreExtension GL_NV_texture_rectangle
+IgnoreExtension GL_NV_vertex_program
+# This one would require more work -- has associated GLX and WGL bindings
+IgnoreExtension GL_NV_present_video
+
+# For the time being, ignore these extensions which are in the ES 2.0 spec
+IgnoreExtension GL_NV_coverage_sample
+IgnoreExtension GL_NV_framebuffer_vertex_attrib_array
+
+# Remove extension suffixes from extensions which are common
+RenameExtensionIntoCore GL_ARB_framebuffer_object
+IgnoreExtension GL_EXT_framebuffer_object
+RenameExtensionIntoCore GL_OES_framebuffer_object
+
+# Remove extension suffixes from extensions which are common between OpenGL and OpenGL ES
+RenameExtensionIntoCore GL_ARB_half_float_pixel
+RenameExtensionIntoCore GL_ARB_point_sprite
+RenameExtensionIntoCore GL_OES_blend_equation_separate
+RenameExtensionIntoCore GL_OES_blend_func_separate
+RenameExtensionIntoCore GL_OES_blend_subtract
+RenameExtensionIntoCore GL_OES_compressed_paletted_texture
+RenameExtensionIntoCore GL_OES_depth24
+RenameExtensionIntoCore GL_OES_depth32
+RenameExtensionIntoCore GL_OES_mapbuffer
+RenameExtensionIntoCore GL_OES_point_sprite
+RenameExtensionIntoCore GL_OES_rgb8_rgba8
+RenameExtensionIntoCore GL_OES_read_format
+RenameExtensionIntoCore GL_OES_stencil1
+RenameExtensionIntoCore GL_OES_stencil4
+RenameExtensionIntoCore GL_OES_stencil8
+RenameExtensionIntoCore GL_OES_stencil_wrap
+RenameExtensionIntoCore GL_OES_texture_cube_map
+RenameExtensionIntoCore GL_OES_texture_half_float
+RenameExtensionIntoCore GL_OES_texture_mirrored_repeat
+
+# The following extensions have some differences requiring us to
+# manually rename some symbols and leave others alone for best
+# correctness
+# RenameExtensionIntoCore GL_ARB_matrix_palette
+# We do not want to pull in all of this extension into the core namespace
+# RenameExtensionIntoCore GL_ARB_vertex_blend
+
+RenameJavaSymbol GL_MAX_VERTEX_UNITS_ARB GL_MAX_VERTEX_UNITS
+RenameJavaSymbol GL_MAX_PALETTE_MATRICES_ARB GL_MAX_PALETTE_MATRICES
+RenameJavaSymbol GL_MATRIX_PALETTE_ARB GL_MATRIX_PALETTE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_ARB GL_MATRIX_INDEX_ARRAY
+RenameJavaSymbol GL_WEIGHT_ARRAY_ARB GL_WEIGHT_ARRAY
+RenameJavaSymbol GL_CURRENT_PALETTE_MATRIX_ARB GL_CURRENT_PALETTE_MATRIX
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_SIZE_ARB GL_MATRIX_INDEX_ARRAY_SIZE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_TYPE_ARB GL_MATRIX_INDEX_ARRAY_TYPE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_STRIDE_ARB GL_MATRIX_INDEX_ARRAY_STRIDE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_POINTER_ARB GL_MATRIX_INDEX_ARRAY_POINTER
+RenameJavaSymbol GL_WEIGHT_ARRAY_SIZE_ARB GL_WEIGHT_ARRAY_SIZE
+RenameJavaSymbol GL_WEIGHT_ARRAY_TYPE_ARB GL_WEIGHT_ARRAY_TYPE
+RenameJavaSymbol GL_WEIGHT_ARRAY_STRIDE_ARB GL_WEIGHT_ARRAY_STRIDE
+RenameJavaSymbol GL_WEIGHT_ARRAY_POINTER_ARB GL_WEIGHT_ARRAY_POINTER
+RenameJavaSymbol glCurrentPaletteMatrixARB glCurrentPaletteMatrix
+RenameJavaSymbol glMatrixIndexPointerARB glMatrixIndexPointer
+RenameJavaSymbol glWeightPointerARB glWeightPointer
+
+# There are some definitions in this extension that don't exist in desktop OpenGL,
+# so we shouldn't remove the suffixes of those OES-only variants
+# RenameExtensionIntoCore GL_OES_matrix_palette
+RenameJavaSymbol GL_MAX_VERTEX_UNITS_OES GL_MAX_VERTEX_UNITS
+RenameJavaSymbol GL_MAX_PALETTE_MATRICES_OES GL_MAX_PALETTE_MATRICES
+RenameJavaSymbol GL_MATRIX_PALETTE_OES GL_MATRIX_PALETTE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_OES GL_MATRIX_INDEX_ARRAY
+RenameJavaSymbol GL_WEIGHT_ARRAY_OES GL_WEIGHT_ARRAY
+RenameJavaSymbol GL_CURRENT_PALETTE_MATRIX_OES GL_CURRENT_PALETTE_MATRIX
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_SIZE_OES GL_MATRIX_INDEX_ARRAY_SIZE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_TYPE_OES GL_MATRIX_INDEX_ARRAY_TYPE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_STRIDE_OES GL_MATRIX_INDEX_ARRAY_STRIDE
+RenameJavaSymbol GL_MATRIX_INDEX_ARRAY_POINTER_OES GL_MATRIX_INDEX_ARRAY_POINTER
+RenameJavaSymbol GL_WEIGHT_ARRAY_SIZE_OES GL_WEIGHT_ARRAY_SIZE
+RenameJavaSymbol GL_WEIGHT_ARRAY_TYPE_OES GL_WEIGHT_ARRAY_TYPE
+RenameJavaSymbol GL_WEIGHT_ARRAY_STRIDE_OES GL_WEIGHT_ARRAY_STRIDE
+RenameJavaSymbol GL_WEIGHT_ARRAY_POINTER_OES GL_WEIGHT_ARRAY_POINTER
+RenameJavaSymbol GL_WEIGHT_ARRAY_BUFFER_BINDING_OES GL_WEIGHT_ARRAY_BUFFER_BINDING
+RenameJavaSymbol glCurrentPaletteMatrixOES glCurrentPaletteMatrix
+RenameJavaSymbol glMatrixIndexPointerOES glMatrixIndexPointer
+RenameJavaSymbol glWeightPointerOES glWeightPointer
+
+
diff --git a/make/config/jogl/gl-common-gl2.cfg b/make/config/jogl/gl-common-gl2.cfg
new file mode 100644
index 000000000..4d86d74cd
--- /dev/null
+++ b/make/config/jogl/gl-common-gl2.cfg
@@ -0,0 +1,8 @@
+# This .cfg file provides common options used among all GL glue code
+# generated for Jogl on Windows.
+
+HierarchicalNativeOutput false
+Include gl-common.cfg
+
+# XID needs to be treated as a long for 32/64 bit compatibility
+Opaque long XID
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg
new file mode 100644
index 000000000..50c2ff004
--- /dev/null
+++ b/make/config/jogl/gl-common.cfg
@@ -0,0 +1,641 @@
+# This .cfg file provides common options used among all glue code
+# generated for Jogl on all platforms.
+
+# Raise GLException instead of RuntimeException in glue code
+RuntimeExceptionType GLException
+UnsupportedExceptionType GLException
+
+# Imports needed by all glue code
+Import java.nio.*
+Import java.util.*
+Import javax.media.opengl.*
+Import javax.media.opengl.fixedfunc.*
+Import com.sun.opengl.impl.*
+
+#####################################################################
+# Mostly desktop OpenGL stuff below
+#
+
+# Don't output #defines of GL version identifier strings as constants,
+# because we don't need them java-side.
+Ignore GL_VERSION_.+
+
+# There are a few routines we don't handle yet
+Ignore glGetBufferPointerivNV
+Ignore glGetBufferPointerv
+
+# Ignore GL functions that deal with explicit pointer values in such a
+# way that we cannot implement the functionality in Java
+Ignore glGetBufferPointerv
+Ignore glGetBufferPointervARB
+Ignore glGetPointerv
+Ignore glGetPointervEXT
+Ignore glGetTexParameterPointervAPPLE
+Ignore glGetVertexAttribPointerv
+Ignore glGetVertexAttribPointervARB
+Ignore glGetVertexAttribPointervNV
+Ignore glTracePointerRangeMESA
+
+# Manually implement glMapBuffer as the size of the returned buffer
+# can only be computed by calling another routine
+ManuallyImplement glMapBuffer
+ManuallyImplement glMapBufferOES
+
+# Ignore the ATI_map_object_buffer extension for now unless someone
+# claims they need it, as it will undoubtedly require a similar
+# construct to glMapBuffer
+Ignore glMapObjectBufferATI
+Ignore glUnmapObjectBufferATI
+
+# Ignore some GL functions that have outgoing void** parameters; we cannot yet deal with them
+Ignore glGetVariantPointervEXT
+
+# Don't output #defines of GL name strings as constants, because we
+# don't need them java-side.
+# Format of name strings is found at:
+# http://oss.sgi.com/projects/ogl-sample/registry/doc/template.txt
+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_EXT_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_ARB_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_OES_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_PGI_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SGI_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SGIS_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SGIX_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_MESA_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_HP_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_ATI_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_NV_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_IBM_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_WIN_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_REND_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_APPLE_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_INTEL_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_INGR_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SUN_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_SUNX_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_3DFX_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_OML_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_I3D_.+
+Ignore (GL|GLU|GLX|WGL|AGL|CGL)_S3_.+
+Ignore GL_KTX_buffer_region
+
+# FIXME: these extensions require either a handle to a device context
+# or take void** parameters or both. Until we think through the
+# semantics of each of these individually we need to disable them.
+# WGL_ARB_buffer_region
+Ignore wglCreateBufferRegion
+Ignore wglDeleteBufferRegion
+Ignore wglSaveBufferRegion
+Ignore wglRestoreBufferRegion
+Ignore wglGetSyncValuesOML
+Ignore wglGetMscRateOML
+Ignore wglSwapBuffersMscOML
+Ignore wglSwapLayerBuffersMscOML
+Ignore wglWaitForMscOML
+Ignore wglWaitForSbcOML
+Ignore wglGetDigitalVideoParametersI3D
+Ignore wglSetDigitalVideoParametersI3D
+Ignore wglGetGammaTableParametersI3D
+Ignore wglSetGammaTableParametersI3D
+Ignore wglGetGammaTableI3D
+Ignore wglSetGammaTableI3D
+Ignore wglEnableGenlockI3D
+Ignore wglDisableGenlockI3D
+Ignore wglIsEnabledGenlockI3D
+Ignore wglGenlockSourceI3D
+Ignore wglGetGenlockSourceI3D
+Ignore wglGenlockSourceEdgeI3D
+Ignore wglGetGenlockSourceEdgeI3D
+Ignore wglGenlockSampleRateI3D
+Ignore wglGetGenlockSampleRateI3D
+Ignore wglGenlockSourceDelayI3D
+Ignore wglGetGenlockSourceDelayI3D
+Ignore wglQueryGenlockMaxSourceDelayI3D
+Ignore wglCreateImageBufferI3D
+Ignore wglDestroyImageBufferI3D
+Ignore wglAssociateImageBufferEventsI3D
+Ignore wglReleaseImageBufferEventsI3D
+
+#
+# IgnoreExtension directives
+#
+
+# Ignore extensions requiring persistent pointer-to-pointer storage as
+# there is no such thing as a direct "BufferBuffer"
+IgnoreExtension GL_IBM_vertex_array_lists
+IgnoreExtension GL_INTEL_parallel_arrays
+IgnoreExtension GL_SUN_triangle_list
+
+# Ignore extensions never approved by the ARB
+IgnoreExtension GL_EXT_coordinate_frame
+
+# Ignore discontinued extensions
+IgnoreExtension GL_NV_element_array
+
+# Ignore extensions subsumed in OpenGL 1.1 (from OpenGL 1.1 spec, Appendix C)
+IgnoreExtension GL_EXT_vertex_array
+IgnoreExtension GL_EXT_blend_logic_op
+IgnoreExtension GL_EXT_copy_texture
+IgnoreExtension GL_EXT_polygon_offset
+IgnoreExtension GL_EXT_subtexture
+IgnoreExtension GL_EXT_texture
+IgnoreExtension GL_EXT_texture_object
+
+# Ignore extensions subsumed in OpenGL 1.2 and 1.2.1 (from OpenGL 1.2.1 spec, Appendix D)
+IgnoreExtension GL_EXT_bgra
+IgnoreExtension GL_EXT_blend_color
+IgnoreExtension GL_EXT_blend_minmax
+IgnoreExtension GL_EXT_blend_subtract
+IgnoreExtension GL_EXT_color_subtable
+IgnoreExtension GL_EXT_convolution
+IgnoreExtension GL_EXT_draw_range_elements
+IgnoreExtension GL_EXT_histogram
+IgnoreExtension GL_EXT_packed_pixels
+# NOTE: also ignoring GL_EXT_paletted_texture because it appears that it was subsumed
+# into the core even though that isn't stated explicitly in the spec
+IgnoreExtension GL_EXT_paletted_texture
+IgnoreExtension GL_EXT_rescale_normal
+IgnoreExtension GL_EXT_separate_specular_color
+IgnoreExtension GL_EXT_texture3D
+IgnoreExtension GL_HP_convolution_border_modes
+IgnoreExtension GL_SGI_color_matrix
+IgnoreExtension GL_SGI_color_table
+IgnoreExtension GL_SGIS_texture_edge_clamp
+IgnoreExtension GL_SGIS_texture_lod
+
+# Ignore extensions subsumed in OpenGL 1.3 (from OpenGL 1.3 spec, Appendix F)
+IgnoreExtension GL_ARB_multisample
+IgnoreExtension GL_ARB_multitexture
+IgnoreExtension GL_ARB_texture_compression
+IgnoreExtension GL_ARB_texture_cube_map
+IgnoreExtension GL_ARB_texture_border_clamp
+IgnoreExtension GL_ARB_texture_env_add
+IgnoreExtension GL_ARB_texture_env_combine
+IgnoreExtension GL_ARB_texture_env_dot3
+IgnoreExtension GL_ARB_transpose_matrix
+IgnoreExtension GL_EXT_texture_cube_map
+IgnoreExtension GL_EXT_texture_env_add
+IgnoreExtension GL_EXT_texture_env_combine
+IgnoreExtension GL_EXT_texture_env_dot3
+IgnoreExtension GL_SGIS_texture_border_clamp
+
+# Ignore extensions subsumed in OpenGL 1.4 (from OpenGL 1.4 spec, Appendix G)
+IgnoreExtension GL_ARB_depth_texture
+IgnoreExtension GL_ARB_point_parameters
+IgnoreExtension GL_ARB_shadow
+IgnoreExtension GL_ARB_texture_env_crossbar
+IgnoreExtension GL_ARB_texture_mirrored_repeat
+IgnoreExtension GL_ARB_window_pos
+IgnoreExtension GL_EXT_blend_func_separate
+IgnoreExtension GL_EXT_fog_coord
+IgnoreExtension GL_EXT_texture_lod_bias
+IgnoreExtension GL_EXT_multi_draw_arrays
+IgnoreExtension GL_EXT_secondary_color
+IgnoreExtension GL_EXT_stencil_wrap
+IgnoreExtension GL_NV_blend_square
+IgnoreExtension GL_SGIS_generate_mipmap
+
+# Ignore extensions subsumed in OpenGL 1.5 (from OpenGL 1.5 spec, Appendix H)
+IgnoreExtension GL_ARB_occlusion_query
+IgnoreExtension GL_ARB_vertex_buffer_object
+IgnoreExtension GL_EXT_shadow_funcs
+
+# Ignore extensions subsumed in OpenGL 2.0 (from OpenGL 2.0 spec, Appendix I)
+# NOTE that GL_ARB_shader_objects is NOT ignored here, because the
+# naming convention is too different for us to pick up the entry
+# points automatically (e.g. glCreateShaderObjectARB was exposed as
+# glCreateShader)
+IgnoreExtension GL_ARB_vertex_shader
+IgnoreExtension GL_ARB_fragment_shader
+IgnoreExtension GL_ARB_draw_buffers
+IgnoreExtension GL_ARB_texture_non_power_of_two
+IgnoreExtension GL_ARB_point_sprite
+IgnoreExtension GL_EXT_blend_equation_separate
+# Don't ignore the following one since the entry point is different from anything in the core
+# IgnoreExtension GL_EXT_stencil_two_side
+
+# Ignore extensions subsumed in OpenGL 2.1 (from OpenGL 2.1 spec, Appendix J)
+IgnoreExtension GL_ARB_pixel_buffer_object
+IgnoreExtension GL_EXT_texture_sRGB
+
+# Ignore a few obsolete versions of extensions that have been subsumed into the core or ARB extensions
+IgnoreExtension GL_EXT_multisample
+IgnoreExtension GL_EXT_point_parameters
+IgnoreExtension GL_EXT_texture_rectangle
+
+#
+# Opaques and other directives for platform-independent routines
+#
+
+Opaque boolean GLboolean
+ReturnsString glGetString
+
+# Experimental: Only NIO function, no arrays ..
+# NIOOnly __ALL__
+
+#
+# NIODirectOnly directives for vertex arrays and other core routines
+#
+
+NIODirectOnly glColorPointer
+NIODirectOnly glEdgeFlagPointer
+NIODirectOnly glFeedbackBuffer
+NIODirectOnly glIndexPointer
+NIODirectOnly glNormalPointer
+NIODirectOnly glSelectBuffer
+NIODirectOnly glTexCoordPointer
+NIODirectOnly glVertexPointer
+#
+# FIXME: we should probably be ignoring the "EXT" variants of these
+#
+NIODirectOnly glColorPointerEXT
+NIODirectOnly glEdgeFlagPointerEXT
+NIODirectOnly glIndexPointerEXT
+NIODirectOnly glNormalPointerEXT
+NIODirectOnly glTexCoordPointerEXT
+NIODirectOnly glVertexPointerEXT
+#
+# NIODirectOnly directives for other extensions
+#
+NIODirectOnly glBinormalPointerEXT
+NIODirectOnly glGetBufferSubDataARB
+# FIXME: should add way to restrict argument to be a direct ByteBuffer
+NIODirectOnly glGetProgramStringARB
+NIODirectOnly glElementPointerATI
+NIODirectOnly glElementPointerNV
+NIODirectOnly glElementPointerAPPLE
+NIODirectOnly glFogCoordPointer
+NIODirectOnly glFogCoordPointerEXT
+NIODirectOnly glMatrixIndexPointerARB
+NIODirectOnly glPixelDataRangeNV
+NIODirectOnly glSecondaryColorPointer
+NIODirectOnly glSecondaryColorPointerEXT
+NIODirectOnly glTangentPointerEXT
+NIODirectOnly glVertexArrayRangeNV
+NIODirectOnly glVertexArrayRangeApple
+NIODirectOnly glVertexAttribPointerARB
+NIODirectOnly glVertexAttribPointerNV
+NIODirectOnly glVertexWeightPointerEXT
+NIODirectOnly glWeightPointerARB
+NIODirectOnly wglFreeMemoryNV
+NIODirectOnly glXFreeMemoryNV
+
+# Capacity of wglAllocateMemoryNV/glXAllocateMemoryNV return value is
+# same as value of first argument
+ReturnValueCapacity wglAllocateMemoryNV {0}
+ReturnValueCapacity glXAllocateMemoryNV {0}
+
+# Pass arguments to ARB_vertex_program, ARB_fragment_program,
+# ARB_shader_objects, NV_vertex_program, NV_fragment_program, and
+# ARB_vertex_shader as Strings
+ArgumentIsString glLoadProgramNV 3
+ArgumentIsString glProgramString 3
+ArgumentIsString glProgramStringARB 3
+ArgumentIsString glProgramNamedParameter4fNV 2
+ArgumentIsString glProgramNamedParameter4dNV 2
+ArgumentIsString glProgramNamedParameter4fvNV 2
+ArgumentIsString glProgramNamedParameter4dvNV 2
+ArgumentIsString glGetProgramNamedParameterfvNV 2
+ArgumentIsString glGetProgramNamedParameterdvNV 2
+ArgumentIsString glShaderSource 2
+ArgumentIsString glShaderSourceARB 2
+ArgumentIsString glGetUniformLocation 1
+ArgumentIsString glGetUniformLocationARB 1
+ArgumentIsString glBindAttribLocation 2
+ArgumentIsString glBindAttribLocationARB 2
+ArgumentIsString glGetAttribLocation 1
+ArgumentIsString glGetAttribLocationARB 1
+
+#
+# Directives for Vertex Buffer Object and Pixel Buffer Object checking
+#
+# NOTE: we currently don't emit glue code for some of these but
+# include them for completeness.
+#
+# FIXME: what about glMultiDrawElements? Do we want to add a VBO
+# variant for that, or simply add checks to the top of the current
+# implementation?
+#
+JavaPrologue glBegin inBeginEndPair = true;
+JavaEpilogue glEnd inBeginEndPair = false;
+JavaEpilogue glBindBuffer bufferStateTracker.setBoundBufferObject({0}, {1});
+JavaEpilogue glBindBufferARB bufferStateTracker.setBoundBufferObject({0}, {1});
+JavaEpilogue glPushClientAttrib bufferStateTracker.clearBufferObjectState();
+JavaEpilogue glPopClientAttrib bufferStateTracker.clearBufferObjectState();
+JavaEpilogue glBufferData bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1});
+
+BufferObjectKind Array glColorPointer
+BufferObjectKind Array glEdgeFlagPointer
+BufferObjectKind Array glElementPointerATI
+BufferObjectKind Array glFogCoordPointer
+BufferObjectKind Array glFogCoordPointerEXT
+# The next one is problematic. It isn't discussed by the specs and
+# doesn't have any associated state.
+BufferObjectKind Array glInterleavedArrays
+BufferObjectKind Array glMatrixIndexPointerARB
+BufferObjectKind Array glNormalPointer
+BufferObjectKind Array glSecondaryColorPointer
+BufferObjectKind Array glSecondaryColorPointerEXT
+BufferObjectKind Array glTexCoordPointer
+BufferObjectKind Array glVariantPointerEXT
+BufferObjectKind Array glVertexPointer
+BufferObjectKind Array glVertexAttribPointer
+BufferObjectKind Array glVertexAttribPointerARB
+BufferObjectKind Array glVertexAttribPointerNV
+BufferObjectKind Array glVertexWeightPointerEXT
+BufferObjectKind Array glWeightPointerARB
+
+BufferObjectKind Element glDrawElements
+BufferObjectKind Element glDrawRangeElements
+BufferObjectKind Element glDrawRangeElementsEXT
+
+# There are no PBOs in the embedded OpenGL variants right now
+BufferObjectKind UnpackPixel glBitmap
+BufferObjectKind UnpackPixel glColorTable
+BufferObjectKind UnpackPixel glColorSubTable
+BufferObjectKind UnpackPixel glCompressedTexImage1D
+BufferObjectKind UnpackPixel glCompressedTexImage1DARB
+BufferObjectKind UnpackPixel glCompressedTexImage2D
+BufferObjectKind UnpackPixel glCompressedTexImage2DARB
+BufferObjectKind UnpackPixel glCompressedTexImage3D
+BufferObjectKind UnpackPixel glCompressedTexImage3DARB
+BufferObjectKind UnpackPixel glCompressedTexSubImage1D
+BufferObjectKind UnpackPixel glCompressedTexSubImage1DARB
+BufferObjectKind UnpackPixel glCompressedTexSubImage2D
+BufferObjectKind UnpackPixel glCompressedTexSubImage2DARB
+BufferObjectKind UnpackPixel glCompressedTexSubImage3D
+BufferObjectKind UnpackPixel glCompressedTexSubImage3DARB
+BufferObjectKind UnpackPixel glConvolutionFilter1D
+BufferObjectKind UnpackPixel glConvolutionFilter2D
+BufferObjectKind UnpackPixel glDrawPixels
+BufferObjectKind UnpackPixel glPixelMapfv
+BufferObjectKind UnpackPixel glPixelMapuiv
+BufferObjectKind UnpackPixel glPixelMapusv
+BufferObjectKind UnpackPixel glPolygonStipple
+BufferObjectKind UnpackPixel glSeparableFilter2D
+BufferObjectKind UnpackPixel glTexImage1D
+BufferObjectKind UnpackPixel glTexImage2D
+BufferObjectKind UnpackPixel glTexImage3D
+BufferObjectKind UnpackPixel glTexSubImage1D
+BufferObjectKind UnpackPixel glTexSubImage2D
+BufferObjectKind UnpackPixel glTexSubImage3D
+
+BufferObjectKind PackPixel glGetColorTable
+BufferObjectKind PackPixel glGetCompressedTexImage
+BufferObjectKind PackPixel glGetCompressedTexImageARB
+BufferObjectKind PackPixel glGetConvolutionFilter
+BufferObjectKind PackPixel glGetHistogram
+BufferObjectKind PackPixel glGetMinmax
+BufferObjectKind PackPixel glGetPixelMapfv
+BufferObjectKind PackPixel glGetPixelMapuiv
+BufferObjectKind PackPixel glGetPixelMapusv
+BufferObjectKind PackPixel glGetPolygonStipple
+BufferObjectKind PackPixel glGetSeparableFilter
+BufferObjectKind PackPixel glGetTexImage
+BufferObjectKind PackPixel glReadPixels
+
+# Range check directives for various routines
+# FIXME: some of these are really the bare minimum and won't catch
+# many classes of errors. Should extend the DebugGL to perform much
+# more error checking with e.g. glDrawElements.
+RangeCheck glColorPointer 3 1
+RangeCheck glDrawElements 3 {1}
+RangeCheck glDrawRangeElements 5 {3}
+RangeCheck glEdgeFlagPointer 1 1
+RangeCheck glElementPointerATI 1 1
+RangeCheck glFogCoordPointer 2 1
+RangeCheck glFogCoordPointerEXT 2 1
+RangeCheck glInterleavedArrays 2 1
+RangeCheck glMatrixIndexPointerARB 3 1
+RangeCheck glNormalPointer 2 1
+RangeCheck glSecondaryColorPointer 3 1
+RangeCheck glSecondaryColorPointerEXT 3 1
+RangeCheck glTexCoordPointer 3 1
+RangeCheck glVariantPointerEXT 3 1
+RangeCheck glVertexPointer 3 1
+RangeCheck glVertexAttribPointer 5 1
+RangeCheck glVertexAttribPointerARB 5 1
+RangeCheck glWeightPointerARB 3 1
+
+# Give ourselves the texture width and height for range checking inside glGetTexImage
+JavaPrologue glGetTexImage int width = 0, height = 0, depth = 1;
+JavaPrologue glGetTexImage int[] tmp = new int[1];
+JavaPrologue glGetTexImage glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, tmp, 0);
+JavaPrologue glGetTexImage width = tmp[0];
+JavaPrologue glGetTexImage glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, tmp, 0);
+JavaPrologue glGetTexImage height = tmp[0];
+JavaPrologue glGetTexImage if (target == GL_TEXTURE_3D) {
+JavaPrologue glGetTexImage glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, tmp, 0);
+JavaPrologue glGetTexImage depth = tmp[0];
+JavaPrologue glGetTexImage }
+
+# Range check directives for various image-related routines
+RangeCheckBytes glColorTable 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , 1, false)
+RangeCheckBytes glColorTableEXT 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , 1, false)
+RangeCheckBytes glConvolutionFilter1D 5 imageSizeInBytes({3}, {4}, {2} , 1 , 1 , 1, false)
+RangeCheckBytes glConvolutionFilter2D 6 imageSizeInBytes({4}, {5}, {2} , {3} , 1 , 2, false)
+RangeCheckBytes glDrawPixels 4 imageSizeInBytes({2}, {3}, {0} , {1} , 1 , 2, false)
+RangeCheckBytes glReadPixels 6 imageSizeInBytes({4}, {5}, {2} , {3} , 1 , 2, true)
+RangeCheckBytes glTexImage1D 7 imageSizeInBytes({5}, {6}, {3} , 1 , 1 , 1, false)
+RangeCheckBytes glTexImage2D 8 imageSizeInBytes({6}, {7}, {3} , {4} , 1 , 2, false)
+RangeCheckBytes glTexImage3D 9 imageSizeInBytes({7}, {8}, {3} , {4} , {5} , 3, false)
+RangeCheckBytes glTexSubImage1D 6 imageSizeInBytes({4}, {5}, {3} , 1 , 1 , 1, false)
+RangeCheckBytes glTexSubImage2D 8 imageSizeInBytes({6}, {7}, {4} , {5} , 1 , 2, false)
+RangeCheckBytes glTexSubImage3D 10 imageSizeInBytes({8}, {9}, {5} , {6} , {7} , 3, false)
+# This may produce wrong answers for 1D textures
+RangeCheckBytes glGetTexImage 4 imageSizeInBytes({2}, {3}, width , height , depth, ((depth > 1) ? 3 : 2), true)
+# Note we don't support glTexImage4DSGIS / glTexSubImage4DSGIS
+# FIXME: add the following unpack operations:
+# glBitmap, glPolygonStipple
+# and the following pack operations:
+# glGetColorTable, glGetConvolutionFilter, glGetSeparableFilter, glGetHistogram, glGetMinmax
+
+# Range checks for server-side object creation and deletion methods
+RangeCheck glGenBuffers 1 {0}
+RangeCheck glDeleteBuffers 1 {0}
+RangeCheck glGenBuffersARB 1 {0}
+RangeCheck glDeleteBuffersARB 1 {0}
+RangeCheck glGenFencesAPPLE 1 {0}
+RangeCheck glDeleteFencesAPPLE 1 {0}
+RangeCheck glGenFencesNV 1 {0}
+RangeCheck glDeleteFencesNV 1 {0}
+RangeCheck glGenFramebuffersEXT 1 {0}
+RangeCheck glDeleteFramebuffersEXT 1 {0}
+RangeCheck glGenOcclusionQueriesNV 1 {0}
+RangeCheck glDeleteOcclusionQueriesNV 1 {0}
+RangeCheck glGenProgramsARB 1 {0}
+RangeCheck glDeleteProgramsARB 1 {0}
+RangeCheck glGenProgramsNV 1 {0}
+RangeCheck glDeleteProgramsNV 1 {0}
+RangeCheck glGenQueries 1 {0}
+RangeCheck glDeleteQueries 1 {0}
+RangeCheck glGenQueriesARB 1 {0}
+RangeCheck glDeleteQueriesARB 1 {0}
+RangeCheck glGenRenderbuffersEXT 1 {0}
+RangeCheck glDeleteRenderbuffersEXT 1 {0}
+RangeCheck glGenTextures 1 {0}
+RangeCheck glDeleteTextures 1 {0}
+RangeCheck glGenVertexArraysAPPLE 1 {0}
+RangeCheck glDeleteVertexArraysAPPLE 1 {0}
+
+# Javadoc for the GL class
+ClassJavadoc GL /**
+ClassJavadoc GL * <P> The basic interface to OpenGL, providing access to core
+ClassJavadoc GL * functionality up through the OpenGL 2.0 specification as well as
+ClassJavadoc GL * all vendor extensions. </P>
+ClassJavadoc GL *
+ClassJavadoc GL * <P> While the APIs for vendor extensions are unconditionally
+ClassJavadoc GL * exposed, the underlying functions may not be present. The method
+ClassJavadoc GL * {@link #isFunctionAvailable} should be used to query the
+ClassJavadoc GL * availability of any non-core function before it is used for the
+ClassJavadoc GL * first time; for example,
+ClassJavadoc GL * <code>gl.isFunctionAvailable("glProgramStringARB")</code>. On
+ClassJavadoc GL * certain platforms (Windows in particular), the most "core"
+ClassJavadoc GL * functionality is only OpenGL 1.1, so in theory any routines first
+ClassJavadoc GL * exposed in OpenGL 1.2, 1.3, and 1.4, 1.5, or 2.0 as well as vendor
+ClassJavadoc GL * extensions should all be queried. Calling an unavailable function
+ClassJavadoc GL * will cause a {@link GLException} to be raised. </P>
+ClassJavadoc GL *
+ClassJavadoc GL * {@link #isExtensionAvailable} may also be used to determine whether
+ClassJavadoc GL * a specific extension is available before calling the routines or
+ClassJavadoc GL * using the functionality it exposes: for example,
+ClassJavadoc GL * <code>gl.isExtensionAvailable("GL_ARB_vertex_program");</code>.
+ClassJavadoc GL * However, in this case it is up to the end user to know which
+ClassJavadoc GL * routines or functionality are associated with which OpenGL
+ClassJavadoc GL * extensions. It may also be used to test for the availability of a
+ClassJavadoc GL * particular version of OpenGL: for example,
+ClassJavadoc GL * <code>gl.isExtensionAvailable("GL_VERSION_1_5");</code>.
+ClassJavadoc GL *
+ClassJavadoc GL * <P> Exceptions to the window system extension naming rules:
+ClassJavadoc GL *
+ClassJavadoc GL * <UL>
+ClassJavadoc GL *
+ClassJavadoc GL * <LI> The memory allocators for the NVidia vertex_array_range (VAR)
+ClassJavadoc GL * extension, in particular <code>wglAllocateMemoryNV</code> /
+ClassJavadoc GL * <code>glXAllocateMemoryNV</code> and associated routines. {@link
+ClassJavadoc GL * #glAllocateMemoryNV} has been provided for window system-independent
+ClassJavadoc GL * access to VAR. {@link #isFunctionAvailable} will translate an argument
+ClassJavadoc GL * of "glAllocateMemoryNV" or "glFreeMemoryNV" into the appropriate
+ClassJavadoc GL * window system-specific name. </P>
+ClassJavadoc GL *
+ClassJavadoc GL * <LI> WGL_ARB_pbuffer, WGL_ARB_pixel_format, and other
+ClassJavadoc GL * platform-specific pbuffer functionality; the availability of
+ClassJavadoc GL * pbuffers can be queried on Windows, X11 and Mac OS X platforms by
+ClassJavadoc GL * querying {@link #isExtensionAvailable} with an argument of
+ClassJavadoc GL * "GL_ARB_pbuffer" or "GL_ARB_pixel_format".
+ClassJavadoc GL *
+ClassJavadoc GL * </UL> <P>
+ClassJavadoc GL *
+ClassJavadoc GL */
+
+# Javadoc for the WGL class
+ClassJavadoc WGL /**
+ClassJavadoc WGL * Provides access to the Windows-specific OpenGL vendor extensions.
+ClassJavadoc WGL * See {@link GL} for more information.
+ClassJavadoc WGL */
+
+# Javadoc for the GLX class
+ClassJavadoc GLX /**
+ClassJavadoc GLX * Provides access to the X11-specific OpenGL vendor extensions.
+ClassJavadoc GLX * See {@link GL} for more information.
+ClassJavadoc GLX */
+
+# Javadoc for the CGL class
+ClassJavadoc CGL /**
+ClassJavadoc CGL * Provides access to the MacOSX-specific OpenGL vendor extensions.
+ClassJavadoc CGL * See {@link GL} for more information.
+ClassJavadoc CGL */
+
+# Javadoc for the XVisualInfo class
+ClassJavadoc XVisualInfo /**
+ClassJavadoc XVisualInfo * Wrapper for the XVisualInfo data structure, referenced by some GLX OpenGL
+ClassJavadoc XVisualInfo * extensions. No other access is provided to these data structures so currently
+ClassJavadoc XVisualInfo * this wrapper is not useful to end users, though it is used in the implementation.
+ClassJavadoc XVisualInfo */
+
+# Custom code for querying extensions and exposing
+# wglAllocateMemoryNV/glXAllocateMemoryNV
+CustomJavaCode GL /**
+CustomJavaCode GL * Returns true if the specified OpenGL core- or extension-function can be
+CustomJavaCode GL * used successfully through this GL instance given the current host (OpenGL
+CustomJavaCode GL * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P>
+CustomJavaCode GL * By "successfully" we mean that the function is both <i>callable</i>
+CustomJavaCode GL * on the machine running the program and <i>available</i> on the current
+CustomJavaCode GL * display.<P>
+CustomJavaCode GL *
+CustomJavaCode GL * In order to call a function successfully, the function must be both
+CustomJavaCode GL * <i>callable</i> on the machine running the program and <i>available</i> on
+CustomJavaCode GL * the display device that is rendering the output (note: on non-networked,
+CustomJavaCode GL * single-display machines these two conditions are identical; on networked and/or
+CustomJavaCode GL * multi-display machines this becomes more complicated). These conditions are
+CustomJavaCode GL * met if the function is either part of the core OpenGL version supported by
+CustomJavaCode GL * both the host and display, or it is an OpenGL extension function that both
+CustomJavaCode GL * the host and display support. <P>
+CustomJavaCode GL *
+CustomJavaCode GL * A GL function is <i>callable</i> if it is successfully linked at runtime,
+CustomJavaCode GL * hence the GLContext must be made current at least once.
+CustomJavaCode GL *
+CustomJavaCode GL * @param glFunctionName the name of the OpenGL function (e.g., use
+CustomJavaCode GL * "glBindRenderbufferEXT" or "glBindRenderbuffer" to check if {@link
+CustomJavaCode GL * #glBindRenderbuffer(int,int)} is available).
+CustomJavaCode GL */
+CustomJavaCode GL public boolean isFunctionAvailable(String glFunctionName);
+
+CustomJavaCode GL /**
+CustomJavaCode GL * Returns true if the specified OpenGL extension can be
+CustomJavaCode GL * used successfully through this GL instance given the current host (OpenGL
+CustomJavaCode GL * <i>client</i>) and display (OpenGL <i>server</i>) configuration.<P>
+CustomJavaCode GL *
+CustomJavaCode GL * @param glExtensionName the name of the OpenGL extension (e.g.,
+CustomJavaCode GL * "GL_ARB_vertex_program").
+CustomJavaCode GL */
+CustomJavaCode GL public boolean isExtensionAvailable(String glExtensionName);
+
+CustomJavaCode GL /**
+CustomJavaCode GL * Provides platform-independent access to the <code>wglAllocateMemoryNV</code> /
+CustomJavaCode GL * <code>glXAllocateMemoryNV</code> extension.
+CustomJavaCode GL */
+CustomJavaCode GL public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3);
+
+CustomJavaCode GL /** Provides a platform-independent way to specify the minimum swap
+CustomJavaCode GL interval for buffer swaps. An argument of 0 disables
+CustomJavaCode GL sync-to-vertical-refresh completely, while an argument of 1
+CustomJavaCode GL causes the application to wait until the next vertical refresh
+CustomJavaCode GL until swapping buffers. The default, which is platform-specific,
+CustomJavaCode GL is usually either 0 or 1. This function is not guaranteed to
+CustomJavaCode GL have an effect, and in particular only affects heavyweight
+CustomJavaCode GL onscreen components. */
+CustomJavaCode GL public void setSwapInterval(int interval);
+
+CustomJavaCode GL /**
+CustomJavaCode GL * Returns an object through which platform-specific OpenGL extensions
+CustomJavaCode GL * (WGL, GLX, etc.) may be accessed. The data type of the returned
+CustomJavaCode GL * object and its associated capabilities are undefined. Most
+CustomJavaCode GL * applications will never need to call this method. It is highly
+CustomJavaCode GL * recommended that any applications which do call this method perform
+CustomJavaCode GL * all accesses on the returned object reflectively to guard
+CustomJavaCode GL * themselves against changes to the implementation.
+CustomJavaCode GL */
+CustomJavaCode GL public Object getPlatformGLExtensions();
+
+CustomJavaCode GL /**
+CustomJavaCode GL * Returns an object providing access to the specified OpenGL
+CustomJavaCode GL * extension. This is intended to provide a mechanism for vendors who
+CustomJavaCode GL * which to provide access to new OpenGL extensions without changing
+CustomJavaCode GL * the public API of the core package. For example, a user may request
+CustomJavaCode GL * access to extension "GL_VENDOR_foo" and receive back an object
+CustomJavaCode GL * which implements a vendor-specified interface which can call the
+CustomJavaCode GL * OpenGL extension functions corresponding to that extension. It is
+CustomJavaCode GL * up to the vendor to specify both the extension name and Java API
+CustomJavaCode GL * for accessing it, including which class or interface contains the
+CustomJavaCode GL * functions.
+CustomJavaCode GL *
+CustomJavaCode GL * <P>
+CustomJavaCode GL *
+CustomJavaCode GL * Note: it is the intent to add new extensions as quickly as possible
+CustomJavaCode GL * to the core GL API. Therefore it is unlikely that most vendors will
+CustomJavaCode GL * use this extension mechanism, but it is being provided for
+CustomJavaCode GL * completeness.
+CustomJavaCode GL */
+CustomJavaCode GL public Object getExtension(String extensionName);
diff --git a/make/config/jogl/gl-desktop-tracker.cfg b/make/config/jogl/gl-desktop-tracker.cfg
new file mode 100644
index 000000000..4b9a7edb7
--- /dev/null
+++ b/make/config/jogl/gl-desktop-tracker.cfg
@@ -0,0 +1,38 @@
+
+# Track server-side object creation and deletion when necessary
+# Note that this is only necessary when the Java 2D / JOGL bridge is active,
+# so will never be needed for the embedded OpenGL variants
+JavaEpilogue glGenBuffers if (tracker != null) tracker.addBuffers({0}, {1});
+JavaEpilogue glGenFencesAPPLE if (tracker != null) tracker.addFencesAPPLE({0}, {1});
+JavaEpilogue glGenFencesNV if (tracker != null) tracker.addFencesNV({0}, {1});
+JavaEpilogue glGenFragmentShadersATI if (tracker != null) tracker.addFragmentShadersATI(_res, {0});
+JavaEpilogue glGenFramebuffersEXT if (tracker != null) tracker.addFramebuffersEXT({0}, {1});
+JavaEpilogue glGenLists if (tracker != null) tracker.addLists(_res, {0});
+JavaEpilogue glGenOcclusionQueriesNV if (tracker != null) tracker.addOcclusionQueriesNV({0}, {1});
+JavaEpilogue glCreateProgram if (tracker != null) tracker.addProgramObject(_res);
+JavaEpilogue glGenPrograms if (tracker != null) tracker.addPrograms({0}, {1});
+JavaEpilogue glGenQueries if (tracker != null) tracker.addQueries({0}, {1});
+JavaEpilogue glGenRenderbuffersEXT if (tracker != null) tracker.addRenderbuffersEXT({0}, {1});
+JavaEpilogue glCreateShader if (tracker != null) tracker.addShaderObject(_res);
+JavaEpilogue glGenTextures if (tracker != null) tracker.addTextures({0}, {1});
+JavaEpilogue glGenVertexArraysAPPLE if (tracker != null) tracker.addVertexArraysAPPLE({0}, {1});
+JavaEpilogue glGenVertexShadersEXT if (tracker != null) tracker.addVertexShadersEXT(_res, {0});
+
+JavaEpilogue glDeleteBuffers if (tracker != null) tracker.removeBuffers({0}, {1});
+JavaEpilogue glDeleteFencesAPPLE if (tracker != null) tracker.removeFencesAPPLE({0}, {1});
+JavaEpilogue glDeleteFencesNV if (tracker != null) tracker.removeFencesNV({0}, {1});
+JavaEpilogue glDeleteFragmentShaderATI if (tracker != null) tracker.removeFragmentShaderATI({0});
+JavaEpilogue glDeleteFramebuffersEXT if (tracker != null) tracker.removeFramebuffersEXT({0}, {1});
+JavaEpilogue glDeleteLists if (tracker != null) tracker.removeLists({0}, {1});
+JavaEpilogue glDeleteOcclusionQueriesNV if (tracker != null) tracker.removeOcclusionQueriesNV({0}, {1});
+JavaEpilogue glDeleteProgram if (tracker != null) tracker.removeProgramObject({0});
+JavaEpilogue glDeleteObject if (tracker != null) tracker.removeProgramOrShaderObject({0});
+JavaEpilogue glDeletePrograms if (tracker != null) tracker.removePrograms({0}, {1});
+JavaEpilogue glDeleteProgramsNV if (tracker != null) tracker.removeProgramsNV({0}, {1});
+JavaEpilogue glDeleteQueries if (tracker != null) tracker.removeQueries({0}, {1});
+JavaEpilogue glDeleteRenderbuffersEXT if (tracker != null) tracker.removeRenderbuffersEXT({0}, {1});
+JavaEpilogue glDeleteShader if (tracker != null) tracker.removeShaderObject({0});
+JavaEpilogue glDeleteTextures if (tracker != null) tracker.removeTextures({0}, {1});
+JavaEpilogue glDeleteVertexArraysAPPLE if (tracker != null) tracker.removeVertexArraysAPPLE({0}, {1});
+JavaEpilogue glDeleteVertexShaderEXT if (tracker != null) tracker.removeVertexShaderEXT({0});
+
diff --git a/make/config/jogl/gl-desktop.cfg b/make/config/jogl/gl-desktop.cfg
new file mode 100755
index 000000000..d6a610c59
--- /dev/null
+++ b/make/config/jogl/gl-desktop.cfg
@@ -0,0 +1,67 @@
+# This .cfg file provides common options used by the desktop OpenGL
+# implementation on all platforms.
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GL/gl.h
+GLHeader GL/glext.h
+
+#Include gl-desktop-tracker.cfg
+
+
+#
+# Directives needed when processing wglext.h on Windows and other platforms
+#
+Opaque boolean BOOL
+ReturnsString wglGetExtensionsStringARB
+ReturnsString wglGetExtensionsStringEXT
+Opaque long HANDLE
+Opaque long HBITMAP
+Opaque long HDC
+Opaque long HGDIOBJ
+Opaque long HGLRC
+Opaque long HPBUFFERARB
+Opaque long HPBUFFEREXT
+Opaque boolean BOOL
+Opaque long PROC
+Opaque long void **
+
+#
+# Directives needed when processing cglext.h on MacOSX and other platforms
+#
+Opaque long CGContextRef
+Opaque long void **
+# Implement the first argument to cglGetProcAddress as String instead
+# of byte[]
+ArgumentIsString cglGetProcAddress 0
+
+#
+# Directives needed when processing glxext.h on X11 and other platforms
+#
+Opaque long __GLXextFuncPtr
+Opaque boolean Bool
+Opaque long Display *
+Opaque long GLXContext
+Opaque long Visual *
+# Ignore the empty Display and Visual data structures (though made
+# opaque, the references from XVisualInfo and elsewhere are still
+# traversed)
+Ignore Display
+Ignore Visual
+# Implement the first argument to glXGetProcAddress as String instead
+# of byte[]
+ArgumentIsString glXGetProcAddress 0
+ArgumentIsString glXGetProcAddressARB 0
+ReturnsString glXQueryExtensionsString
+ReturnsString glXQueryServerString
+ReturnsString glXGetClientString
+TemporaryCVariableDeclaration glXChooseFBConfig int count;
+TemporaryCVariableAssignment glXChooseFBConfig count = _ptr3[0];
+ReturnValueCapacity glXChooseFBConfig count * sizeof(GLXFBConfig)
+TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count;
+TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0];
+ReturnValueCapacity glXChooseFBConfigSGIX count * sizeof(GLXFBConfig)
+TemporaryCVariableDeclaration glXGetFBConfigs int count;
+TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0];
+ReturnValueCapacity glXGetFBConfigs count * sizeof(GLXFBConfig)
+
diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg
new file mode 100755
index 000000000..02aae2860
--- /dev/null
+++ b/make/config/jogl/gl-es1.cfg
@@ -0,0 +1,88 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/es1
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
+
+# There are a few routines we don't handle yet
+Ignore glGetBufferPointervOES
+Package javax.media.opengl
+Style InterfaceAndImpl
+JavaClass GLES1
+Extends GLES1 GLBase
+Extends GLES1 GL
+Extends GLES1 GL2ES1
+ImplPackage com.sun.opengl.impl.es1
+ImplJavaClass GLES1Impl
+Implements GLES1Impl GLBase
+Implements GLES1Impl GL
+Implements GLES1Impl GL2ES1
+HierarchicalNativeOutput false
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName GLES1ProcAddressTable
+GetProcAddressTableExpr ((GLES1ProcAddressTable)_context.getGLProcAddressTable())
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GLES/gl.h
+GLHeader GLES/glext.h
+GLHeader GL/gl.h
+GLHeader GL/glext.h
+
+# Force all of the methods to be emitted using dynamic linking so we
+# don't need to link against any emulation library on the desktop or
+# depend on the presence of an import library for a particular device
+ForceProcAddressGen __ALL__
+
+# Also force the calling conventions of the locally generated function
+# pointer typedefs for these routines to GL_APIENTRY
+LocalProcAddressCallingConvention __ALL__ GL_APIENTRY
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+# Ignore certain extensions that will be picked up by the dynamic
+# lookup mechanism anyway if they are present
+IgnoreExtension GL_OES_fixed_point
+IgnoreExtension GL_OES_single_precision
+
+CustomJavaCode GLES1Impl public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) {
+CustomJavaCode GLES1Impl glOrtho((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); }
+
+CustomJavaCode GLES1Impl public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) {
+CustomJavaCode GLES1Impl glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar); }
+
+CustomJavaCode GLES1Impl public void glClearDepth(double depth) {
+CustomJavaCode GLES1Impl glClearDepthf((float)depth); }
+
+CustomJavaCode GLES1Impl public void glDepthRange(double zNear, double zFar) {
+CustomJavaCode GLES1Impl glDepthRangef((float)zNear, (float)zFar); }
+
+CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode "glext.h" are parsed. */
+CustomCCode #define GL_GLEXT_PROTOTYPES
+
+CustomCCode /* Include the OpenGL headers */
+CustomCCode /* #define GL_APICALL __declspec(dllimport) */
+CustomCCode #include <GLES/gl.h>
+CustomCCode #include <GLES/glext.h>
+CustomCCode #include <stdlib.h>
+Include ../intptr.cfg
+
+IncludeAs CustomJavaCode GLES1Impl gl-impl-CustomJavaCode-common.java
+IncludeAs CustomJavaCode GLES1Impl gl-impl-CustomJavaCode-gles1.java
+IncludeAs CustomJavaCode GLES1Impl gl-impl-CustomJavaCode-embedded.java
+IncludeAs CustomCCode gl-impl-CustomCCode-gles1.c
+
+Import javax.media.opengl.GLES1
+Import javax.media.opengl.GLES2
+Import javax.media.opengl.GL2
+Import com.sun.opengl.impl.InternalBufferUtil
diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg
new file mode 100755
index 000000000..244f1944f
--- /dev/null
+++ b/make/config/jogl/gl-es2.cfg
@@ -0,0 +1,72 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/es2
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+
+Package javax.media.opengl
+Style InterfaceAndImpl
+JavaClass GLES2
+Extends GLES2 GLBase
+Extends GLES2 GL
+Extends GLES2 GL2ES2
+ImplPackage com.sun.opengl.impl.es2
+ImplJavaClass GLES2Impl
+Implements GLES2Impl GLBase
+Implements GLES2Impl GL
+Implements GLES2Impl GL2ES2
+HierarchicalNativeOutput false
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName GLES2ProcAddressTable
+GetProcAddressTableExpr ((GLES2ProcAddressTable)_context.getGLProcAddressTable())
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GLES2/gl2.h
+GLHeader GLES2/gl2ext.h
+GLHeader GL/gl.h
+GLHeader GL/glext.h
+
+# Force all of the methods to be emitted using dynamic linking so we
+# don't need to link against any emulation library on the desktop or
+# depend on the presence of an import library for a particular device
+ForceProcAddressGen __ALL__
+
+# Also force the calling conventions of the locally generated function
+# pointer typedefs for these routines to GL_APIENTRY
+LocalProcAddressCallingConvention __ALL__ GL_APIENTRY
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+IncludeAs CustomJavaCode GLES2 gl-if-CustomJavaCode-gles2.java
+
+CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode "glext.h" are parsed. */
+CustomCCode #define GL_GLEXT_PROTOTYPES
+
+CustomCCode /* Include the OpenGL headers */
+CustomCCode /* #define GL_APICALL __declspec(dllimport) */
+CustomCCode #include <GLES2/gl2ext.h>
+CustomCCode #include <stdlib.h>
+Include ../intptr.cfg
+
+IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-common.java
+IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-gles2.java
+IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-embedded.java
+IncludeAs CustomJavaCode GLES2Impl gl-impl-CustomJavaCode-gl2_es2.java
+IncludeAs CustomCCode gl-impl-CustomCCode-gles2.c
+
+Import javax.media.opengl.GLES1
+Import javax.media.opengl.GLES2
+Import javax.media.opengl.GL2
+Import javax.media.opengl.GLArrayData
+Import javax.media.opengl.GLUniformData
+Import com.sun.opengl.impl.InternalBufferUtil
+Import java.io.PrintStream
+
diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg
new file mode 100644
index 000000000..8dfe76758
--- /dev/null
+++ b/make/config/jogl/gl-gl2.cfg
@@ -0,0 +1,70 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/gl2
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
+
+Package javax.media.opengl
+Style InterfaceAndImpl
+JavaClass GL2
+Extends GL2 GLBase
+Extends GL2 GL
+Extends GL2 GL2ES1
+Extends GL2 GL2ES2
+ImplPackage com.sun.opengl.impl.gl2
+ImplJavaClass GL2Impl
+Implements GL2Impl GLBase
+Implements GL2Impl GL
+Implements GL2Impl GL2ES1
+Implements GL2Impl GL2ES2
+Include gl-common-gl2.cfg
+Include gl-common-extensions.cfg
+Include gl-desktop.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName GL2ProcAddressTable
+GetProcAddressTableExpr ((GL2ProcAddressTable)_context.getGLProcAddressTable())
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+# Ignore extensions that are already picked up via the GL2ES1 interface
+IgnoreExtension GL_EXT_point_parameters
+
+CustomJavaCode GL2 public boolean glIsPBOPackEnabled();
+CustomJavaCode GL2 public boolean glIsPBOUnpackEnabled();
+
+CustomJavaCode GL2Impl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
+CustomJavaCode GL2Impl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
+
+CustomJavaCode GL2Impl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
+CustomJavaCode GL2Impl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
+
+CustomJavaCode GL2Impl public void glClearDepthf(float depth) {
+CustomJavaCode GL2Impl glClearDepth((double)depth); }
+
+CustomJavaCode GL2Impl public void glDepthRangef(float zNear, float zFar) {
+CustomJavaCode GL2Impl glDepthRange((double)zNear, (double)zFar); }
+
+Include gl-headers.cfg
+Include ../intptr.cfg
+
+IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-common.java
+IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-gl2.java
+IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-desktop.java
+IncludeAs CustomJavaCode GL2Impl gl-impl-CustomJavaCode-gl2_es2.java
+IncludeAs CustomCCode gl-impl-CustomCCode-gl2.c
+
+Import javax.media.opengl.GLES1
+Import javax.media.opengl.GLES2
+Import javax.media.opengl.GL2
+Import javax.media.opengl.GLArrayData
+Import javax.media.opengl.GLUniformData
+Import com.sun.opengl.impl.InternalBufferUtil
+Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg
new file mode 100644
index 000000000..b46bc99ab
--- /dev/null
+++ b/make/config/jogl/gl-gl2es12.cfg
@@ -0,0 +1,74 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/gl2es12
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
+
+Style ImplOnly
+ImplPackage com.sun.opengl.impl.gl2es12
+ImplJavaClass GL2ES12Impl
+Implements GL2ES12Impl GL
+Implements GL2ES12Impl GL2ES1
+Implements GL2ES12Impl GL2ES2
+Implements GL2ES12Impl GLBase
+
+Include gl-common-gl2.cfg
+Include gl-common-extensions.cfg
+Include gl-desktop.cfg
+
+# Because we're manually implementing glMapBuffer but only producing
+# the implementing class, GlueGen doesn't notice that it has to emit a
+# proc address table entry for it. Force it to here.
+ForceProcAddressGen glMapBuffer
+
+EmitProcAddressTable true
+ProcAddressTableClassName GL2ES12ProcAddressTable
+GetProcAddressTableExpr ((GL2ES12ProcAddressTable)_context.getGLProcAddressTable())
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+# There seem to be some errors in the glue code generation where we are not ignoring
+# enough routines from desktop GL in GL2ES12Impl. For now manually ignore those which
+# we know shouldn't be in there
+Ignore glGetTexImage
+Ignore glPixelStoref
+
+# Add input validation to glPixelStorei to make sure that, even if we
+# are running on top of desktop OpenGL, parameters not exposed in
+# OpenGL ES can not be changed
+JavaPrologue glPixelStorei if (param != GL_PACK_ALIGNMENT && param != GL_UNPACK_ALIGNMENT) {
+JavaPrologue glPixelStorei throw new GLException("Unsupported pixel store parameter 0x" + Integer.toHexString(param));
+JavaPrologue glPixelStorei }
+
+CustomJavaCode GL2ES12Impl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
+CustomJavaCode GL2ES12Impl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
+
+CustomJavaCode GL2ES12Impl public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
+CustomJavaCode GL2ES12Impl glOrtho((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); }
+
+CustomJavaCode GL2ES12Impl public void glClearDepthf(float depth) {
+CustomJavaCode GL2ES12Impl glClearDepth((double)depth); }
+
+CustomJavaCode GL2ES12Impl public void glDepthRangef(float zNear, float zFar) {
+CustomJavaCode GL2ES12Impl glDepthRange((double)zNear, (double)zFar); }
+
+Include gl-headers.cfg
+Include ../intptr.cfg
+
+IncludeAs CustomJavaCode GL2ES12Impl gl-impl-CustomJavaCode-common.java
+IncludeAs CustomJavaCode GL2ES12Impl gl-impl-CustomJavaCode-gl2es12.java
+IncludeAs CustomJavaCode GL2ES12Impl gl-impl-CustomJavaCode-embedded.java
+IncludeAs CustomJavaCode GL2ES12Impl gl-impl-CustomJavaCode-gl2_es2.java
+IncludeAs CustomCCode gl-impl-CustomCCode-gl2es12.c
+
+Import javax.media.opengl.GLES1
+Import javax.media.opengl.GLES2
+Import com.sun.opengl.impl.InternalBufferUtil
+Import java.io.PrintStream
diff --git a/make/config/jogl/gl-gl3.cfg b/make/config/jogl/gl-gl3.cfg
new file mode 100644
index 000000000..2b521e30a
--- /dev/null
+++ b/make/config/jogl/gl-gl3.cfg
@@ -0,0 +1,51 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/gl3
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+
+Package javax.media.opengl
+Style InterfaceAndImpl
+JavaClass GL3
+Extends GL3 GLBase
+Extends GL3 GL
+Extends GL3 GL2ES2
+ImplPackage com.sun.opengl.impl.gl3
+ImplJavaClass GL3Impl
+Implements GL3Impl GLBase
+Implements GL3Impl GL
+Implements GL3Impl GL2ES2
+Include gl-common-gl2.cfg
+Include gl-common-extensions.cfg
+Include gl3-desktop.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName GL3ProcAddressTable
+GetProcAddressTableExpr ((GL3ProcAddressTable)_context.getGLProcAddressTable())
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+CustomJavaCode GL3Impl public void glClearDepthf(float depth) {
+CustomJavaCode GL3Impl glClearDepth((double)depth); }
+
+CustomJavaCode GL3Impl public void glDepthRangef(float zNear, float zFar) {
+CustomJavaCode GL3Impl glDepthRange((double)zNear, (double)zFar); }
+
+Include gl3-headers.cfg
+Include ../intptr.cfg
+
+IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-common.java
+IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-gl3.java
+IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-desktop.java
+IncludeAs CustomJavaCode GL3Impl gl-impl-CustomJavaCode-gl2_es2.java
+IncludeAs CustomCCode gl-impl-CustomCCode-gl3.c
+
+Import javax.media.opengl.GLES2
+Import javax.media.opengl.GL3
+Import javax.media.opengl.GLArrayData
+Import javax.media.opengl.GLUniformData
+Import com.sun.opengl.impl.InternalBufferUtil
+Import java.io.PrintStream
diff --git a/make/config/jogl/gl-headers.cfg b/make/config/jogl/gl-headers.cfg
new file mode 100755
index 000000000..1cc5bf05b
--- /dev/null
+++ b/make/config/jogl/gl-headers.cfg
@@ -0,0 +1,41 @@
+CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode "glext.h" are parsed. */
+CustomCCode #define GL_GLEXT_PROTOTYPES
+CustomCCode #if defined(_WIN32)
+CustomCCode #define WIN32_LEAN_AND_MEAN
+CustomCCode #include <windows.h>
+CustomCCode #undef WIN32_LEAN_AND_MEAN
+CustomCCode #include <stdlib.h>
+CustomCCode #include <stddef.h>
+CustomCCode #include <malloc.h>
+CustomCCode /* Define WGL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode "wglext.h" are parsed. */
+CustomCCode #define WGL_GLEXT_PROTOTYPES
+CustomCCode /* Include the OpenGL headers */
+CustomCCode #include <GL/gl.h>
+CustomCCode #include <GL/wglext.h>
+CustomCCode #elif defined(macosx)
+CustomCCode #include <inttypes.h>
+CustomCCode #include <stdlib.h>
+CustomCCode /* Include the OpenGL headers */
+CustomCCode #include <GL/gl.h>
+CustomCCode #include </usr/include/machine/types.h>
+CustomCCode /* Provide Windows typedefs */
+CustomCCode typedef void* LPVOID;
+CustomCCode typedef unsigned int* PUINT;
+CustomCCode #elif defined(linux) || defined(__sun) || defined(__FreeBSD__) || defined(_HPUX)
+CustomCCode #include <inttypes.h>
+CustomCCode #include <stdlib.h>
+CustomCCode #include <X11/Xlib.h>
+CustomCCode /* Define GLX_GLXEXT_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode "glxext.h" are parsed. */
+CustomCCode #define GLX_GLXEXT_PROTOTYPES
+CustomCCode /* Include the OpenGL headers */
+CustomCCode #include <GL/gl.h>
+CustomCCode #include <GL/glx.h>
+CustomCCode #include <GL/glxext.h>
+CustomCCode #endif
+CustomCCode /* Provide GLES #define for locally generated function pointer typedefs */
+CustomCCode #ifndef GL_APIENTRY
+CustomCCode #define GL_APIENTRY GLAPIENTRY
+CustomCCode #endif
diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl.java b/make/config/jogl/gl-if-CustomJavaCode-gl.java
new file mode 100644
index 000000000..28d24c072
--- /dev/null
+++ b/make/config/jogl/gl-if-CustomJavaCode-gl.java
@@ -0,0 +1,12 @@
+
+ public GLProfile getGLProfile();
+
+ public void glClearDepth( double depth );
+
+ public void glDepthRange(double zNear, double zFar);
+
+ public int glGetBoundBuffer(int target);
+
+ public boolean glIsVBOArrayEnabled();
+ public boolean glIsVBOElementEnabled();
+
diff --git a/make/config/jogl/gl-if-CustomJavaCode-gles2.java b/make/config/jogl/gl-if-CustomJavaCode-gles2.java
new file mode 100644
index 000000000..ea40f6329
--- /dev/null
+++ b/make/config/jogl/gl-if-CustomJavaCode-gles2.java
@@ -0,0 +1,3 @@
+
+ public static final int GL_NVIDIA_PLATFORM_BINARY_NV = 0x890B;
+
diff --git a/make/config/jogl/gl-if-gl-ignores.cfg b/make/config/jogl/gl-if-gl-ignores.cfg
new file mode 100644
index 000000000..1fa439702
--- /dev/null
+++ b/make/config/jogl/gl-if-gl-ignores.cfg
@@ -0,0 +1,523 @@
+# FIXME: some of these definitions like the ARB_imaging subset should end up in the GL interface
+Ignore GL.+_NV
+Ignore GL.+_ATI
+Ignore GL.+_AMD
+Ignore GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
+Ignore GL_ACTIVE_ATTRIBUTES
+Ignore GL_ACTIVE_UNIFORM_MAX_LENGTH
+Ignore GL_ACTIVE_UNIFORMS
+Ignore GL_ADD
+Ignore GL_ADD_SIGNED
+Ignore GL_ALPHA_SCALE
+Ignore GL_ALPHA_TEST
+Ignore GL_ALPHA_TEST_FUNC
+Ignore GL_ALPHA_TEST_REF
+Ignore GL_AMBIENT
+Ignore GL_AMBIENT_AND_DIFFUSE
+Ignore GL_AND
+Ignore GL_AND_INVERTED
+Ignore GL_AND_REVERSE
+Ignore GL_ATTACHED_SHADERS
+Ignore GL_BLEND_COLOR
+Ignore GL_BLEND_DST
+#Ignore GL_BLEND_DST_ALPHA
+#Ignore GL_BLEND_DST_RGB
+#Ignore GL_BLEND_EQUATION
+#Ignore GL_BLEND_EQUATION_ALPHA
+#Ignore GL_BLEND_EQUATION_ALPHA_OES
+Ignore GL_BLEND_EQUATION_OES
+#Ignore GL_BLEND_EQUATION_RGB
+#Ignore GL_BLEND_EQUATION_RGB_OES
+Ignore GL_BLEND_SRC
+#Ignore GL_BLEND_SRC_ALPHA
+#Ignore GL_BLEND_SRC_ALPHA_OES
+#Ignore GL_BLEND_SRC_RGB
+#Ignore GL_BLEND_SRC_RGB_OES
+Ignore GL_BOOL
+Ignore GL_BOOL_VEC2
+Ignore GL_BOOL_VEC3
+Ignore GL_BOOL_VEC4
+Ignore GL_BUFFER_ACCESS_OES
+Ignore GL_CLEAR
+Ignore GL_CLIENT_ACTIVE_TEXTURE
+Ignore GL_CLIP_PLANE0
+Ignore GL_CLIP_PLANE1
+Ignore GL_CLIP_PLANE2
+Ignore GL_CLIP_PLANE3
+Ignore GL_CLIP_PLANE4
+Ignore GL_CLIP_PLANE5
+Ignore GL_COLOR_ARRAY
+Ignore GL_COLOR_ARRAY_BUFFER_BINDING
+Ignore GL_COLOR_ARRAY_POINTER
+Ignore GL_COLOR_ARRAY_SIZE
+Ignore GL_COLOR_ARRAY_STRIDE
+Ignore GL_COLOR_ARRAY_TYPE
+Ignore GL_COLOR_LOGIC_OP
+Ignore GL_COLOR_MATERIAL
+Ignore GL_COMBINE
+Ignore GL_COMBINE_ALPHA
+Ignore GL_COMBINE_RGB
+Ignore GL_COMPILE_STATUS
+Ignore GL_CONSTANT
+Ignore GL_CONSTANT_ALPHA
+Ignore GL_CONSTANT_ATTENUATION
+Ignore GL_CONSTANT_COLOR
+Ignore GL_COORD_REPLACE_OES
+Ignore GL_COPY
+Ignore GL_COPY_INVERTED
+Ignore GL_CURRENT_COLOR
+Ignore GL_CURRENT_NORMAL
+Ignore GL_CURRENT_PALETTE_MATRIX_OES
+Ignore GL_CURRENT_PROGRAM
+Ignore GL_CURRENT_TEXTURE_COORDS
+Ignore GL_CURRENT_VERTEX_ATTRIB
+Ignore GL_DECAL
+#Ignore GL_DECR_WRAP
+#Ignore GL_DECR_WRAP_OES
+Ignore GL_DELETE_STATUS
+Ignore GL_DEPTH_COMPONENT
+Ignore GL_DEPTH_COMPONENT24_OES
+Ignore GL_DEPTH_COMPONENT32_OES
+Ignore GL_DIFFUSE
+Ignore GL_DOT3_RGB
+Ignore GL_DOT3_RGBA
+Ignore GL_EMISSION
+Ignore GL_EQUIV
+Ignore GL_ES_VERSION_2_0
+Ignore GL_ETC1_RGB8_OES
+Ignore GL_EXP
+Ignore GL_EXP2
+#Ignore GL_FIXED_OES
+#Ignore GL_FIXED
+Ignore GL_FLAT
+Ignore GL_FLOAT_MAT2
+Ignore GL_FLOAT_MAT3
+Ignore GL_FLOAT_MAT4
+Ignore GL_FLOAT_VEC2
+Ignore GL_FLOAT_VEC3
+Ignore GL_FLOAT_VEC4
+Ignore GL_FOG
+Ignore GL_FOG_COLOR
+Ignore GL_FOG_DENSITY
+Ignore GL_FOG_END
+Ignore GL_FOG_HINT
+Ignore GL_FOG_MODE
+Ignore GL_FOG_START
+Ignore GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT
+Ignore GL_FRAGMENT_SHADER
+Ignore GL_FRAGMENT_SHADER_DERIVATIVE_HINT
+#Ignore GL_FUNC_ADD
+#Ignore GL_FUNC_ADD_OES
+#Ignore GL_FUNC_REVERSE_SUBTRACT
+#Ignore GL_FUNC_REVERSE_SUBTRACT_OES
+#Ignore GL_FUNC_SUBTRACT
+#Ignore GL_FUNC_SUBTRACT_OES
+Ignore GL_GENERATE_MIPMAP
+Ignore GL_HIGH_FLOAT
+Ignore GL_HIGH_INT
+#Ignore GL_IMPLEMENTATION_COLOR_READ_FORMAT
+#Ignore GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES
+#Ignore GL_IMPLEMENTATION_COLOR_READ_TYPE
+#Ignore GL_IMPLEMENTATION_COLOR_READ_TYPE_OES
+#Ignore GL_INCR_WRAP
+#Ignore GL_INCR_WRAP_OES
+Ignore GL_INFO_LOG_LENGTH
+Ignore GL_INT
+Ignore GL_INTERPOLATE
+Ignore GL_INT_VEC2
+Ignore GL_INT_VEC3
+Ignore GL_INT_VEC4
+Ignore GL_LIGHT0
+Ignore GL_LIGHT1
+Ignore GL_LIGHT2
+Ignore GL_LIGHT3
+Ignore GL_LIGHT4
+Ignore GL_LIGHT5
+Ignore GL_LIGHT6
+Ignore GL_LIGHT7
+Ignore GL_LIGHTING
+Ignore GL_LIGHT_MODEL_AMBIENT
+Ignore GL_LIGHT_MODEL_TWO_SIDE
+Ignore GL_LINEAR_ATTENUATION
+Ignore GL_LINE_SMOOTH
+Ignore GL_LINE_SMOOTH_HINT
+Ignore GL_LINK_STATUS
+Ignore GL_LOGIC_OP_MODE
+Ignore GL_LOW_FLOAT
+Ignore GL_LOW_INT
+Ignore GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES
+Ignore GL_MATRIX_INDEX_ARRAY_OES
+Ignore GL_MATRIX_INDEX_ARRAY_POINTER_OES
+Ignore GL_MATRIX_INDEX_ARRAY_SIZE_OES
+Ignore GL_MATRIX_INDEX_ARRAY_STRIDE_OES
+Ignore GL_MATRIX_INDEX_ARRAY_TYPE_OES
+Ignore GL_MATRIX_MODE
+Ignore GL_MATRIX_PALETTE_OES
+Ignore GL_MAX_ARRAY_TEXTURE_LAYERS_EXT
+Ignore GL_MAX_CLIP_PLANES
+Ignore GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
+Ignore GL_MAX_FRAGMENT_UNIFORM_VECTORS
+Ignore GL_MAX_LIGHTS
+Ignore GL_MAX_MODELVIEW_STACK_DEPTH
+Ignore GL_MAX_PALETTE_MATRICES_OES
+Ignore GL_MAX_PROJECTION_STACK_DEPTH
+Ignore GL_MAX_TEXTURE_IMAGE_UNITS
+Ignore GL_MAX_TEXTURE_STACK_DEPTH
+Ignore GL_MAX_TEXTURE_UNITS
+Ignore GL_MAX_VARYING_VECTORS
+Ignore GL_MAX_VERTEX_ATTRIBS
+Ignore GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
+Ignore GL_MAX_VERTEX_UNIFORM_VECTORS
+Ignore GL_MAX_VERTEX_UNITS_OES
+Ignore GL_MEDIUM_FLOAT
+Ignore GL_MEDIUM_INT
+#Ignore GL_MIRRORED_REPEAT
+#Ignore GL_MIRRORED_REPEAT_OES
+Ignore GL_MODELVIEW
+Ignore GL_MODELVIEW_MATRIX
+Ignore GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES
+Ignore GL_MODELVIEW_STACK_DEPTH
+Ignore GL_MODULATE
+Ignore GL_MULTISAMPLE
+Ignore GL_NAND
+Ignore GL_NOOP
+Ignore GL_NOR
+Ignore GL_NORMAL_ARRAY
+Ignore GL_NORMAL_ARRAY_BUFFER_BINDING
+Ignore GL_NORMAL_ARRAY_POINTER
+Ignore GL_NORMAL_ARRAY_STRIDE
+Ignore GL_NORMAL_ARRAY_TYPE
+Ignore GL_NORMALIZE
+Ignore GL_NORMAL_MAP_OES
+Ignore GL_NUM_SHADER_BINARY_FORMATS
+Ignore GL_OES_blend_equation_separate
+Ignore GL_OES_blend_func_separate
+Ignore GL_OES_blend_subtract
+Ignore GL_OES_byte_coordinates
+Ignore GL_OES_compressed_ETC1_RGB8_texture
+Ignore GL_OES_compressed_paletted_texture
+Ignore GL_OES_depth24
+Ignore GL_OES_depth32
+Ignore GL_OES_draw_texture
+Ignore GL_OES_element_index_uint
+Ignore GL_OES_extended_matrix_palette
+Ignore GL_OES_fbo_render_mipmap
+Ignore GL_OES_fixed_point
+Ignore GL_OES_framebuffer_object
+Ignore GL_OES_matrix_get
+Ignore GL_OES_matrix_palette
+Ignore GL_OES_point_size_array
+Ignore GL_OES_point_sprite
+Ignore GL_OES_query_matrix
+Ignore GL_OES_read_format
+Ignore GL_OES_single_precision
+Ignore GL_OES_stencil1
+Ignore GL_OES_stencil4
+Ignore GL_OES_stencil8
+Ignore GL_OES_stencil_wrap
+Ignore GL_OES_texture_cube_map
+Ignore GL_OES_texture_env_crossbar
+Ignore GL_OES_texture_half_float
+Ignore GL_OES_texture_mirrored_repeat
+Ignore GL_OES_vertex_half_float
+Ignore GL_ONE_MINUS_CONSTANT_ALPHA
+Ignore GL_ONE_MINUS_CONSTANT_COLOR
+Ignore GL_OPERAND0_ALPHA
+Ignore GL_OPERAND0_RGB
+Ignore GL_OPERAND1_ALPHA
+Ignore GL_OPERAND1_RGB
+Ignore GL_OPERAND2_ALPHA
+Ignore GL_OPERAND2_RGB
+Ignore GL_OR
+Ignore GL_OR_INVERTED
+Ignore GL_OR_REVERSE
+Ignore GL_PALETTE4_R5_G6_B5_OES
+Ignore GL_PALETTE4_RGB5_A1_OES
+Ignore GL_PALETTE4_RGB8_OES
+Ignore GL_PALETTE4_RGBA4_OES
+Ignore GL_PALETTE4_RGBA8_OES
+Ignore GL_PALETTE8_R5_G6_B5_OES
+Ignore GL_PALETTE8_RGB5_A1_OES
+Ignore GL_PALETTE8_RGB8_OES
+Ignore GL_PALETTE8_RGBA4_OES
+Ignore GL_PALETTE8_RGBA8_OES
+Ignore GL_PERSPECTIVE_CORRECTION_HINT
+Ignore GL_PLATFORM_BINARY
+Ignore GL_POINT_DISTANCE_ATTENUATION
+Ignore GL_POINT_FADE_THRESHOLD_SIZE
+Ignore GL_POINT_SIZE
+Ignore GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES
+Ignore GL_POINT_SIZE_ARRAY_OES
+Ignore GL_POINT_SIZE_ARRAY_POINTER_OES
+Ignore GL_POINT_SIZE_ARRAY_STRIDE_OES
+Ignore GL_POINT_SIZE_ARRAY_TYPE_OES
+Ignore GL_POINT_SIZE_MAX
+Ignore GL_POINT_SIZE_MIN
+Ignore GL_POINT_SMOOTH
+Ignore GL_POINT_SMOOTH_HINT
+Ignore GL_POINT_SPRITE_OES
+Ignore GL_POSITION
+Ignore GL_PREVIOUS
+Ignore GL_PRIMARY_COLOR
+Ignore GL_PROJECTION
+Ignore GL_PROJECTION_MATRIX
+Ignore GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES
+Ignore GL_PROJECTION_STACK_DEPTH
+Ignore GL_QUADRATIC_ATTENUATION
+Ignore GL_R11F_G11F_B10F_EXT
+Ignore GL_REFLECTION_MAP_OES
+Ignore GL_RESCALE_NORMAL
+Ignore GL_RGBA_SIGNED_COMPONENTS_EXT
+Ignore GL_RGB_SCALE
+Ignore GL_SAMPLE_ALPHA_TO_ONE
+Ignore GL_SAMPLER_2D
+Ignore GL_SAMPLER_2D_ARRAY_EXT
+Ignore GL_SAMPLER_CUBE
+Ignore GL_SET
+Ignore GL_SHADE_MODEL
+Ignore GL_SHADER_BINARY_FORMATS
+Ignore GL_SHADER_COMPILER
+Ignore GL_SHADER_SOURCE_LENGTH
+Ignore GL_SHADER_TYPE
+Ignore GL_SHADING_LANGUAGE_VERSION
+Ignore GL_SHININESS
+Ignore GL_SMOOTH
+Ignore GL_SMOOTH_LINE_WIDTH_RANGE
+Ignore GL_SMOOTH_POINT_SIZE_RANGE
+Ignore GL_SPECULAR
+Ignore GL_SPOT_CUTOFF
+Ignore GL_SPOT_DIRECTION
+Ignore GL_SPOT_EXPONENT
+Ignore GL_SRC0_ALPHA
+Ignore GL_SRC0_RGB
+Ignore GL_SRC1_ALPHA
+Ignore GL_SRC1_RGB
+Ignore GL_SRC2_ALPHA
+Ignore GL_SRC2_RGB
+Ignore GL_STACK_OVERFLOW
+Ignore GL_STACK_UNDERFLOW
+Ignore GL_STENCIL_BACK_FAIL
+Ignore GL_STENCIL_BACK_FUNC
+Ignore GL_STENCIL_BACK_PASS_DEPTH_FAIL
+Ignore GL_STENCIL_BACK_PASS_DEPTH_PASS
+Ignore GL_STENCIL_BACK_REF
+Ignore GL_STENCIL_BACK_VALUE_MASK
+Ignore GL_STENCIL_BACK_WRITEMASK
+Ignore GL_STENCIL_INDEX
+Ignore GL_STENCIL_INDEX1_OES
+Ignore GL_STENCIL_INDEX4_OES
+Ignore GL_STREAM_DRAW
+Ignore GL_SUBTRACT
+Ignore GL_TEXTURE_2D_ARRAY_EXT
+Ignore GL_TEXTURE_2D_OES
+Ignore GL_TEXTURE_BINDING_2D_ARRAY_EXT
+Ignore GL_TEXTURE_COORD_ARRAY
+Ignore GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
+Ignore GL_TEXTURE_COORD_ARRAY_POINTER
+Ignore GL_TEXTURE_COORD_ARRAY_SIZE
+Ignore GL_TEXTURE_COORD_ARRAY_STRIDE
+Ignore GL_TEXTURE_COORD_ARRAY_TYPE
+Ignore GL_TEXTURE_CROP_RECT_OES
+Ignore GL_TEXTURE_ENV
+Ignore GL_TEXTURE_ENV_COLOR
+Ignore GL_TEXTURE_ENV_MODE
+Ignore GL_TEXTURE_GEN_MODE_OES
+Ignore GL_TEXTURE_GEN_STR_OES
+Ignore GL_TEXTURE_MATRIX
+Ignore GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES
+Ignore GL_TEXTURE_RECTANGLE_NV_OES
+Ignore GL_TEXTURE_STACK_DEPTH
+Ignore GL_UNSIGNED_INT
+Ignore GL_UNSIGNED_INT_10F_11F_11F_REV_EXT
+Ignore GL_VALIDATE_STATUS
+Ignore GL_VERTEX_ARRAY
+Ignore GL_VERTEX_ARRAY_BUFFER_BINDING
+Ignore GL_VERTEX_ARRAY_POINTER
+Ignore GL_VERTEX_ARRAY_SIZE
+Ignore GL_VERTEX_ARRAY_STRIDE
+Ignore GL_VERTEX_ARRAY_TYPE
+Ignore GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
+Ignore GL_VERTEX_ATTRIB_ARRAY_ENABLED
+Ignore GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
+Ignore GL_VERTEX_ATTRIB_ARRAY_POINTER
+Ignore GL_VERTEX_ATTRIB_ARRAY_SIZE
+Ignore GL_VERTEX_ATTRIB_ARRAY_STRIDE
+Ignore GL_VERTEX_ATTRIB_ARRAY_TYPE
+Ignore GL_VERTEX_SHADER
+Ignore GL_WEIGHT_ARRAY_BUFFER_BINDING_OES
+Ignore GL_WEIGHT_ARRAY_OES
+Ignore GL_WEIGHT_ARRAY_POINTER_OES
+Ignore GL_WEIGHT_ARRAY_SIZE_OES
+Ignore GL_WEIGHT_ARRAY_STRIDE_OES
+Ignore GL_WEIGHT_ARRAY_TYPE_OES
+Ignore GL_WRITE_ONLY_OES
+Ignore GL_XOR
+Ignore glIsProgram
+Ignore glIsShader
+Ignore glUnmapBufferOES
+Ignore glCreateProgram
+Ignore glCreateShader
+Ignore glGetAttribLocation
+Ignore glGetUniformLocation
+Ignore glAlphaFunc
+Ignore glAttachShader
+Ignore glBindAttribLocation
+Ignore glBlendColor
+Ignore glBlendEquation
+Ignore glBlendEquationOES
+Ignore glBlendEquationSeparate
+Ignore glBlendEquationSeparateOES
+Ignore glBlendFuncSeparate
+Ignore glBlendFuncSeparateOES
+Ignore glClearDepthfOES
+Ignore glClientActiveTexture
+Ignore glClipPlanef
+Ignore glClipPlanefOES
+Ignore glColor4f
+Ignore glColor4ub
+Ignore glColorPointer
+Ignore glCompileShader
+Ignore glCoverageMaskNV
+Ignore glCoverageOperationNV
+Ignore glDeleteProgram
+Ignore glDeleteShader
+Ignore glDepthRangefOES
+Ignore glDetachShader
+Ignore glDisableClientState
+Ignore glDisableVertexAttribArray
+Ignore glDrawTexfOES
+Ignore glDrawTexfvOES
+Ignore glDrawTexiOES
+Ignore glDrawTexivOES
+Ignore glDrawTexsOES
+Ignore glDrawTexsvOES
+Ignore glDrawTexxvOES
+Ignore glEnableClientState
+Ignore glEnableVertexAttribArray
+Ignore glFogf
+Ignore glFogfv
+Ignore glFogxv
+Ignore glFogxvOES
+Ignore glFramebufferVertexAttribArrayNV
+Ignore glFrustumf
+Ignore glFrustumfOES
+Ignore glGenerateMipmap
+Ignore glGenerateMipmapOES
+Ignore glGetActiveAttrib
+Ignore glGetActiveUniform
+Ignore glGetAttachedShaders
+Ignore glGetClipPlanef
+Ignore glGetClipPlanefOES
+Ignore glGetFixedv
+Ignore glGetFixedvOES
+Ignore glGetLightfv
+Ignore glGetLightxv
+Ignore glGetLightxvOES
+Ignore glGetMaterialfv
+Ignore glGetMaterialxv
+Ignore glGetMaterialxvOES
+Ignore glGetProgramInfoLog
+Ignore glGetProgramiv
+Ignore glGetShaderInfoLog
+Ignore glGetShaderiv
+Ignore glGetShaderPrecisionFormat
+Ignore glGetShaderSource
+Ignore glGetTexEnvfv
+Ignore glGetTexEnviv
+Ignore glGetTexEnvxv
+Ignore glGetTexEnvxvOES
+Ignore glGetTexGenfvOES
+Ignore glGetTexGenivOES
+Ignore glGetTexGenxvOES
+Ignore glGetTexParameterxv
+Ignore glGetTexParameterxvOES
+Ignore glGetUniformfv
+Ignore glGetUniformiv
+Ignore glGetVertexAttribfv
+Ignore glGetVertexAttribiv
+Ignore glLightf
+Ignore glLightfv
+Ignore glLightModelf
+Ignore glLightModelfv
+Ignore glLightModelxv
+Ignore glLightModelxvOES
+Ignore glLightxv
+Ignore glLightxvOES
+Ignore glLinkProgram
+Ignore glLoadIdentity
+Ignore glLoadMatrixf
+Ignore glLogicOp
+Ignore glMaterialf
+Ignore glMaterialfv
+Ignore glMaterialxv
+Ignore glMaterialxvOES
+Ignore glMatrixIndexPointerOES
+Ignore glMatrixMode
+Ignore glMultiTexCoord4f
+Ignore glMultMatrixf
+Ignore glNormal3f
+Ignore glNormalPointer
+Ignore glOrthof
+Ignore glOrthofOES
+Ignore glPointParameterf
+Ignore glPointParameterfv
+Ignore glPointParameterxv
+Ignore glPointParameterxvOES
+Ignore glPointSize
+Ignore glPointSizePointer
+Ignore glReleaseShaderCompiler
+Ignore glRotatef
+Ignore glScalef
+Ignore glShadeModel
+Ignore glShaderBinary
+Ignore glShaderSource
+Ignore glStencilFuncSeparate
+Ignore glStencilMaskSeparate
+Ignore glStencilOpSeparate
+Ignore glTexCoordPointer
+Ignore glTexEnvf
+Ignore glTexEnvfv
+Ignore glTexEnvi
+Ignore glTexEnviv
+Ignore glTexEnvxv
+Ignore glTexEnvxvOES
+Ignore glTexGenfOES
+Ignore glTexGenfvOES
+Ignore glTexGeniOES
+Ignore glTexGenivOES
+Ignore glTexGenxvOES
+Ignore glTexParameterxv
+Ignore glTexParameterxvOES
+Ignore glTranslatef
+Ignore glUniform1f
+Ignore glUniform1fv
+Ignore glUniform1i
+Ignore glUniform1iv
+Ignore glUniform2f
+Ignore glUniform2fv
+Ignore glUniform2i
+Ignore glUniform2iv
+Ignore glUniform3f
+Ignore glUniform3fv
+Ignore glUniform3i
+Ignore glUniform3iv
+Ignore glUniform4f
+Ignore glUniform4fv
+Ignore glUniform4i
+Ignore glUniform4iv
+Ignore glUniformMatrix2fv
+Ignore glUniformMatrix3fv
+Ignore glUniformMatrix4fv
+Ignore glUseProgram
+Ignore glValidateProgram
+Ignore glVertexAttrib1f
+Ignore glVertexAttrib1fv
+Ignore glVertexAttrib2f
+Ignore glVertexAttrib2fv
+Ignore glVertexAttrib3f
+Ignore glVertexAttrib3fv
+Ignore glVertexAttrib4f
+Ignore glVertexAttrib4fv
+Ignore glVertexAttribPointer
+Ignore glVertexPointer
+Ignore glWeightPointerOES
diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg
new file mode 100755
index 000000000..46e11fdd4
--- /dev/null
+++ b/make/config/jogl/gl-if-gl.cfg
@@ -0,0 +1,40 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+Package javax.media.opengl
+Style InterfaceOnly
+JavaClass GL
+Extends GL GLBase
+
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+
+HierarchicalNativeOutput false
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+Include gl-if-gl-ignores.cfg
+
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl
+
+Import javax.media.opengl.GLES1
+Import javax.media.opengl.GLES2
+Import javax.media.opengl.GL2
+
+# Ignore all ES 2.X only stuff ..
+Ignore ^gl.*x
+Ignore ^gl.*xOES
+Ignore glEGL.*
+
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GLES2/gl2.h
+GLHeader GLES2/gl2ext.h
+GLHeader GL/gl.h
+GLHeader GL/glext.h
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+IncludeAs CustomJavaCode GL gl-if-CustomJavaCode-gl.java
diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg
new file mode 100755
index 000000000..d09ebcb30
--- /dev/null
+++ b/make/config/jogl/gl-if-gl2_es1.cfg
@@ -0,0 +1,96 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+Package javax.media.opengl
+Style InterfaceOnly
+JavaClass GL2ES1
+Extends GL2ES1 GLBase
+Extends GL2ES1 GL
+Extends GL2ES1 GLMatrixFunc
+Extends GL2ES1 GLPointerFunc
+Extends GL2ES1 GLLightingFunc
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
+
+HierarchicalNativeOutput false
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl
+
+# Ignore all ES 1.X only stuff not in GL2
+IgnoreExtension GL_OES_compressed_ETC1_RGB8_texture
+IgnoreExtension GL_OES_draw_texture
+IgnoreExtension GL_OES_fixed_point
+IgnoreExtension GL_OES_matrix_get
+IgnoreExtension GL_OES_point_size_array
+IgnoreExtension GL_OES_query_matrix
+IgnoreExtension GL_OES_vertex_half_float
+Ignore glGetFixedv
+
+# Ignore OES variants of single precision floating point routines
+IgnoreExtension GL_OES_single_precision
+
+# Ignore fixed point versions of routines in ES 1.x core
+Ignore glAlphaFuncx
+Ignore glClearColorx
+Ignore glClearDepthx
+Ignore glClipPlanex
+Ignore glColor4x
+Ignore glDepthRangex
+Ignore glFogx
+Ignore glFrustumx
+Ignore glGetClipPlanex
+Ignore glLightModelx
+Ignore glLightx
+Ignore glLineWidthx
+Ignore glLoadMatrixx
+Ignore glMaterialx
+Ignore glMultMatrixx
+Ignore glMultiTexCoord4x
+Ignore glNormal3x
+Ignore glOrthox
+Ignore glPointParameterx
+Ignore glPointSizex
+Ignore glPolygonOffsetx
+Ignore glQueryMatrixx
+Ignore glRotatex
+Ignore glSampleCoveragex
+Ignore glScalex
+Ignore glTexEnvx
+Ignore glTexGenx
+Ignore glTexParameterx
+Ignore glTranslatex
+
+#heavy float/double array diff to GL2
+Ignore glClipPlanef
+Ignore ^glGetClipPlanef(OES)?
+
+#impl diff
+Ignore ^glEGL.*
+Ignore ^gl.*(xv)(OES)?
+Ignore glTexGenxOES
+Ignore GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES
+Ignore glLoadPaletteFromModelViewMatrixOES
+Ignore glGetFixedv
+
+CustomJavaCode GL2ES1 public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val);
+CustomJavaCode GL2ES1 public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar);
+
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GLES/gl.h
+GLHeader GLES/glext.h
+GLHeader GL/gl.h
+GLHeader GL/glext.h
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg
new file mode 100755
index 000000000..5345c3ba1
--- /dev/null
+++ b/make/config/jogl/gl-if-gl2_es2.cfg
@@ -0,0 +1,47 @@
+# This .cfg file is used to generate the GL interface and implementing class.
+Package javax.media.opengl
+Style InterfaceOnly
+JavaClass GL2ES2
+Extends GL2ES2 GLBase
+Extends GL2ES2 GL
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbols ../src/jogl/classes/javax/media/opengl/GLBase.java
+HierarchicalNativeOutput false
+Include gl-common.cfg
+Include gl-common-extensions.cfg
+
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl
+
+# Ignore all ES 2.X only stuff ..
+# Ignore ^gl.*x(v)?(OES)?
+Ignore glGetShaderPrecisionFormat
+Ignore glEGL.*
+#Ignore glFramebufferVertexAttribArrayNV
+#Ignore glCoverageOperationNV
+#Ignore glCoverageMaskNV
+
+CustomJavaCode GL2ES2 public void glClearDepth( double depth );
+CustomJavaCode GL2ES2 public void glDepthRange(double zNear, double zFar);
+
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GLES2/gl2.h
+GLHeader GLES2/gl2ext.h
+GLHeader GL/gl.h
+GLHeader GL/glext.h
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+CustomJavaCode GL2ES2 public void glVertexAttribPointer(GLArrayData array);
+CustomJavaCode GL2ES2 public void glUniform(GLUniformData data);
+CustomJavaCode GL2ES2
+
+Import java.io.PrintStream
+
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2.c b/make/config/jogl/gl-impl-CustomCCode-gl2.c
new file mode 100644
index 000000000..f97b8eaff
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomCCode-gl2.c
@@ -0,0 +1,24 @@
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.gl2.GL2Impl
+ * Java method: long dispatch_glMapBuffer(int target, int access)
+ * C function: void * glMapBuffer(GLenum target, GLenum access);
+ */
+JNIEXPORT jlong JNICALL
+Java_com_sun_opengl_impl_gl2_GL2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+ PFNGLMAPBUFFERPROC ptr_glMapBuffer;
+ void * _res;
+ ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
+ assert(ptr_glMapBuffer != NULL);
+ _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
+ return (jlong) (intptr_t) _res;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.gl2.GL2Impl
+ * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
+ * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_gl2_GL2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+ return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
+}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl2es12.c b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c
new file mode 100644
index 000000000..e2d5cb58d
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomCCode-gl2es12.c
@@ -0,0 +1,24 @@
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl
+ * Java method: long dispatch_glMapBuffer(int target, int access)
+ * C function: void * glMapBuffer(GLenum target, GLenum access);
+ */
+JNIEXPORT jlong JNICALL
+Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+ PFNGLMAPBUFFERPROC ptr_glMapBuffer;
+ void * _res;
+ ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
+ assert(ptr_glMapBuffer != NULL);
+ _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
+ return (jlong) (intptr_t) _res;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.gl2es12.GL2ES12Impl
+ * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
+ * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_gl2es12_GL2ES12Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+ return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
+}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gl3.c b/make/config/jogl/gl-impl-CustomCCode-gl3.c
new file mode 100644
index 000000000..a5f78a460
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomCCode-gl3.c
@@ -0,0 +1,24 @@
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.gl3.GL3Impl
+ * Java method: long dispatch_glMapBuffer(int target, int access)
+ * C function: void * glMapBuffer(GLenum target, GLenum access);
+ */
+JNIEXPORT jlong JNICALL
+Java_com_sun_opengl_impl_gl3_GL3Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+ PFNGLMAPBUFFERPROC ptr_glMapBuffer;
+ void * _res;
+ ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
+ assert(ptr_glMapBuffer != NULL);
+ _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
+ return (jlong) (intptr_t) _res;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.gl3.GL3Impl
+ * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
+ * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_gl3_GL3Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+ return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
+}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gles1.c b/make/config/jogl/gl-impl-CustomCCode-gles1.c
new file mode 100644
index 000000000..efc614e64
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomCCode-gles1.c
@@ -0,0 +1,25 @@
+typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.es1.GLES1Impl
+ * Java method: long dispatch_glMapBuffer(int target, int access)
+ * C function: void * glMapBuffer(GLenum target, GLenum access);
+ */
+JNIEXPORT jlong JNICALL
+Java_com_sun_opengl_impl_es1_GLES1Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+ PFNGLMAPBUFFERPROC ptr_glMapBuffer;
+ void * _res;
+ ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
+ assert(ptr_glMapBuffer != NULL);
+ _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
+ return (jlong) (intptr_t) _res;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.es1.GLES1Impl
+ * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
+ * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_es1_GLES1Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+ return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
+}
diff --git a/make/config/jogl/gl-impl-CustomCCode-gles2.c b/make/config/jogl/gl-impl-CustomCCode-gles2.c
new file mode 100644
index 000000000..27be04749
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomCCode-gles2.c
@@ -0,0 +1,25 @@
+typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.es2.GLES2Impl
+ * Java method: long dispatch_glMapBuffer(int target, int access)
+ * C function: void * glMapBuffer(GLenum target, GLenum access);
+ */
+JNIEXPORT jlong JNICALL
+Java_com_sun_opengl_impl_es2_GLES2Impl_dispatch_1glMapBuffer(JNIEnv *env, jobject _unused, jint target, jint access, jlong glProcAddress) {
+ PFNGLMAPBUFFERPROC ptr_glMapBuffer;
+ void * _res;
+ ptr_glMapBuffer = (PFNGLMAPBUFFERPROC) (intptr_t) glProcAddress;
+ assert(ptr_glMapBuffer != NULL);
+ _res = (* ptr_glMapBuffer) ((GLenum) target, (GLenum) access);
+ return (jlong) (intptr_t) _res;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.es2.GLES2Impl
+ * Java method: ByteBuffer newDirectByteBuffer(long addr, int capacity);
+ * C function: jobject newDirectByteBuffer(jlong addr, jint capacity);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_es2_GLES2Impl_newDirectByteBuffer(JNIEnv *env, jobject _unused, jlong addr, jint capacity) {
+ return (*env)->NewDirectByteBuffer(env, (void*) (intptr_t) addr, capacity);
+}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java
new file mode 100644
index 000000000..564606799
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java
@@ -0,0 +1,16 @@
+ public GLProfile getGLProfile() {
+ return this.glProfile;
+ }
+ private GLProfile glProfile;
+
+ public int glGetBoundBuffer(int target) {
+ return bufferStateTracker.getBoundBufferObject(target, this);
+ }
+
+ public boolean glIsVBOArrayEnabled() {
+ return checkArrayVBOEnabled(false);
+ }
+
+ public boolean glIsVBOElementEnabled() {
+ return checkElementVBOEnabled(false);
+ }
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
new file mode 100644
index 000000000..0d01aaec4
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java
@@ -0,0 +1,74 @@
+private int[] imageSizeTemp = new int[1];
+
+/** Helper for more precise computation of number of bytes that will
+ be touched by a pixel pack or unpack operation. */
+private int imageSizeInBytes(int bytesPerElement,
+ int w, int h, int d,
+ int dimensions,
+ boolean pack) {
+ int rowLength = 0;
+ int skipRows = 0;
+ int skipPixels = 0;
+ int alignment = 1;
+ int imageHeight = 0;
+ int skipImages = 0;
+
+ if (pack) {
+ glGetIntegerv(GL_PACK_ROW_LENGTH, imageSizeTemp, 0);
+ rowLength = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_SKIP_ROWS, imageSizeTemp, 0);
+ skipRows = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_SKIP_PIXELS, imageSizeTemp, 0);
+ skipPixels = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_ALIGNMENT, imageSizeTemp, 0);
+ alignment = imageSizeTemp[0];
+ if (dimensions > 2) {
+ glGetIntegerv(GL_PACK_IMAGE_HEIGHT, imageSizeTemp, 0);
+ imageHeight = imageSizeTemp[0];
+ glGetIntegerv(GL_PACK_SKIP_IMAGES, imageSizeTemp, 0);
+ skipImages = imageSizeTemp[0];
+ }
+ } else {
+ glGetIntegerv(GL_UNPACK_ROW_LENGTH, imageSizeTemp, 0);
+ rowLength = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_SKIP_ROWS, imageSizeTemp, 0);
+ skipRows = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_SKIP_PIXELS, imageSizeTemp, 0);
+ skipPixels = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_ALIGNMENT, imageSizeTemp, 0);
+ alignment = imageSizeTemp[0];
+ if (dimensions > 2) {
+ glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT, imageSizeTemp, 0);
+ imageHeight = imageSizeTemp[0];
+ glGetIntegerv(GL_UNPACK_SKIP_IMAGES, imageSizeTemp, 0);
+ skipImages = imageSizeTemp[0];
+ }
+ }
+ // Try to deal somewhat correctly with potentially invalid values
+ rowLength = Math.max(0, rowLength);
+ skipRows = Math.max(0, skipRows);
+ skipPixels = Math.max(0, skipPixels);
+ alignment = Math.max(1, alignment);
+ imageHeight = Math.max(0, imageHeight);
+ skipImages = Math.max(0, skipImages);
+ rowLength = Math.max(rowLength, w + skipPixels);
+ int rowLengthInBytes = rowLength * bytesPerElement;
+ if (alignment > 1) {
+ int modulus = rowLengthInBytes % alignment;
+ if (modulus > 0) {
+ rowLengthInBytes += alignment - modulus;
+ }
+ }
+
+ int size = 0;
+ if (dimensions == 1) {
+ return (w + skipPixels) * bytesPerElement;
+ } else {
+ int size2D = ((skipRows + h - 1) * rowLengthInBytes) + (w + skipPixels) * bytesPerElement;
+ if (dimensions == 2) {
+ return size2D;
+ }
+ int imageSizeInBytes = imageHeight * rowLength;
+ return ((skipImages + d - 1) * imageSizeInBytes) + size2D;
+ }
+}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-embedded.java b/make/config/jogl/gl-impl-CustomJavaCode-embedded.java
new file mode 100644
index 000000000..2d4cd1372
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-embedded.java
@@ -0,0 +1,37 @@
+private int[] imageSizeTemp = new int[1];
+
+/** Helper for more precise computation of number of bytes that will
+ be touched by a pixel pack or unpack operation. */
+private int imageSizeInBytes(int bytesPerElement,
+ int w, int h, int d,
+ int dimensions,
+ boolean pack) {
+ int rowLength = w;
+ int alignment = 1;
+
+ if (pack) {
+ glGetIntegerv(GL_PACK_ALIGNMENT, imageSizeTemp, 0);
+ alignment = imageSizeTemp[0];
+ } else {
+ glGetIntegerv(GL_UNPACK_ALIGNMENT, imageSizeTemp, 0);
+ alignment = imageSizeTemp[0];
+ }
+ // Try to deal somewhat correctly with potentially invalid values
+ rowLength = Math.max(0, rowLength);
+ alignment = Math.max(1, alignment);
+ h = Math.max(0, h);
+ int rowLengthInBytes = rowLength * bytesPerElement;
+ if (alignment > 1) {
+ int modulus = rowLengthInBytes % alignment;
+ if (modulus > 0) {
+ rowLengthInBytes += alignment - modulus;
+ }
+ }
+
+ int size = 0;
+ if (dimensions == 1) {
+ return rowLengthInBytes;
+ } else {
+ return h * rowLengthInBytes;
+ }
+}
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java
new file mode 100644
index 000000000..b3410040b
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java
@@ -0,0 +1,474 @@
+// Tracks glBegin/glEnd calls to determine whether it is legal to
+// query Vertex Buffer Object state
+private boolean inBeginEndPair;
+
+/* FIXME: refactor dependence on Java 2D / JOGL bridge
+
+// Tracks creation and destruction of server-side OpenGL objects when
+// the Java2D/OpenGL pipeline is enabled and it is using frame buffer
+// objects (FBOs) to do its rendering
+private GLObjectTracker tracker;
+
+public void setObjectTracker(GLObjectTracker tracker) {
+ this.tracker = tracker;
+}
+
+*/
+
+public GL2Impl(GLProfile glp, GLContextImpl context) {
+ this._context = context;
+ this.bufferSizeTracker = context.getBufferSizeTracker();
+ this.glProfile = glp;
+}
+
+public final boolean isGL() {
+ return true;
+}
+
+public final boolean isGL3() {
+ return false;
+}
+
+public final boolean isGL2() {
+ return true;
+}
+
+public final boolean isGLES1() {
+ return false;
+}
+
+public final boolean isGLES2() {
+ return false;
+}
+
+public final boolean isGLES() {
+ return false;
+}
+
+public final boolean isGL2ES1() {
+ return true;
+}
+
+public final boolean isGL2ES2() {
+ return true;
+}
+
+public final boolean hasGLSL() {
+ return true;
+}
+
+public final GL getGL() throws GLException {
+ return this;
+}
+
+public final GL3 getGL3() throws GLException {
+ throw new GLException("Not a GL3 implementation");
+}
+
+public final GL2 getGL2() throws GLException {
+ return this;
+}
+
+public final GLES1 getGLES1() throws GLException {
+ throw new GLException("Not a GLES1 implementation");
+}
+
+public final GLES2 getGLES2() throws GLException {
+ throw new GLException("Not a GLES2 implementation");
+}
+
+public final GL2ES1 getGL2ES1() throws GLException {
+ return this;
+}
+
+public final GL2ES2 getGL2ES2() throws GLException {
+ return this;
+}
+
+public boolean isFunctionAvailable(String glFunctionName) {
+ return _context.isFunctionAvailable(glFunctionName);
+}
+
+public boolean isExtensionAvailable(String glExtensionName) {
+ return _context.isExtensionAvailable(glExtensionName);
+}
+
+public Object getExtension(String extensionName) {
+ // At this point we don't expose any extensions using this mechanism
+ return null;
+}
+
+/** Returns the context this GL object is associated with for better
+ error checking by DebugGL. */
+public GLContext getContext() {
+ return _context;
+}
+
+private GLContextImpl _context;
+
+/**
+ * Provides platform-independent access to the wglAllocateMemoryNV /
+ * glXAllocateMemoryNV extension.
+ */
+public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
+}
+
+public void setSwapInterval(int interval) {
+ _context.setSwapInterval(interval);
+}
+
+public Object getPlatformGLExtensions() {
+ return _context.getPlatformGLExtensions();
+}
+
+//
+// Helpers for ensuring the correct amount of texture data
+//
+
+/** Returns the number of bytes required to fill in the appropriate
+ texture. This is computed as closely as possible based on the
+ pixel pack or unpack parameters. The logic in this routine is
+ based on code in the SGI OpenGL sample implementation. */
+
+private int imageSizeInBytes(int format, int type, int w, int h, int d,
+ int dimensions, boolean pack) {
+ int elements = 0;
+ int esize = 0;
+
+ if (w < 0) return 0;
+ if (h < 0) return 0;
+ if (d < 0) return 0;
+ switch (format) {
+ case GL_COLOR_INDEX:
+ case GL_STENCIL_INDEX:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_DEPTH_COMPONENT:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ case GL_BGR:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ elements = 4;
+ break;
+ /* FIXME ??
+ case GL_HILO_NV:
+ elements = 2;
+ break; */
+ default:
+ return 0;
+ }
+ switch (type) {
+ case GL_BITMAP:
+ if (format == GL_COLOR_INDEX) {
+ return (d * (h * ((w+7)/8)));
+ } else {
+ return 0;
+ }
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return 0;
+ }
+ return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack);
+}
+
+private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+private GLBufferSizeTracker bufferSizeTracker;
+
+private boolean bufferObjectExtensionsInitialized = false;
+private boolean haveARBPixelBufferObject;
+private boolean haveEXTPixelBufferObject;
+private boolean haveGL15;
+private boolean haveGL21;
+private boolean haveARBVertexBufferObject;
+
+private void initBufferObjectExtensionChecks() {
+ if (bufferObjectExtensionsInitialized)
+ return;
+ bufferObjectExtensionsInitialized = true;
+ haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object");
+ haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object");
+ haveGL15 = isExtensionAvailable("GL_VERSION_1_5");
+ haveGL21 = isExtensionAvailable("GL_VERSION_2_1");
+ haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object");
+}
+
+private boolean checkBufferObject(boolean extension1,
+ boolean extension2,
+ boolean extension3,
+ boolean enabled,
+ int state,
+ String kind, boolean throwException) {
+ if (inBeginEndPair) {
+ throw new GLException("May not call this between glBegin and glEnd");
+ }
+ boolean avail = (extension1 || extension2 || extension3);
+ if (!avail) {
+ if (!enabled)
+ return true;
+ if(throwException) {
+ throw new GLException("Required extensions not available to call this function");
+ }
+ return false;
+ }
+ int buffer = bufferStateTracker.getBoundBufferObject(state, this);
+ if (enabled) {
+ if (buffer == 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be enabled to call this method");
+ }
+ return false;
+ }
+ } else {
+ if (buffer != 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be disabled to call this method");
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
+private boolean checkArrayVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ false,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkArrayVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ true,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ false,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ true,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ false,
+ GL2.GL_PIXEL_UNPACK_BUFFER,
+ "unpack pixel_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ true,
+ GL2.GL_PIXEL_UNPACK_BUFFER,
+ "unpack pixel_buffer_object", throwException);
+}
+
+private boolean checkPackPBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ false,
+ GL2.GL_PIXEL_PACK_BUFFER,
+ "pack pixel_buffer_object", throwException);
+}
+
+private boolean checkPackPBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ true,
+ GL2.GL_PIXEL_PACK_BUFFER,
+ "pack pixel_buffer_object", throwException);
+}
+
+public boolean glIsPBOPackEnabled() {
+ return checkPackPBOEnabled(false);
+}
+
+public boolean glIsPBOUnpackEnabled() {
+ return checkUnpackPBOEnabled(false);
+}
+
+// Attempt to return the same ByteBuffer object from glMapBuffer if
+// the vertex buffer object's base address and size haven't changed
+private static class ARBVBOKey {
+ private long addr;
+ private int capacity;
+
+ ARBVBOKey(long addr, int capacity) {
+ this.addr = addr;
+ this.capacity = capacity;
+ }
+
+ public int hashCode() {
+ return (int) addr;
+ }
+
+ public boolean equals(Object o) {
+ if ((o == null) || (!(o instanceof ARBVBOKey))) {
+ return false;
+ }
+
+ ARBVBOKey other = (ARBVBOKey) o;
+ return ((addr == other.addr) && (capacity == other.capacity));
+ }
+}
+
+private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
+
+/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+public java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ final long __addr_ = ((GL2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapBuffer\" not available");
+ }
+ int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
+ target,
+ this);
+ long addr;
+ addr = dispatch_glMapBuffer(target, access, __addr_);
+ if (addr == 0 || sz == 0) {
+ return null;
+ }
+ ARBVBOKey key = new ARBVBOKey(addr, sz);
+ ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key);
+ if (_res == null) {
+ _res = newDirectByteBuffer(addr, sz);
+ InternalBufferUtil.nativeOrder(_res);
+ arbVBOCache.put(key, _res);
+ }
+ _res.position(0);
+ return _res;
+}
+
+/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+native private long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+
+native private ByteBuffer newDirectByteBuffer(long addr, int capacity);
+
+ /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
+ public void glShaderBinary(int n, java.nio.IntBuffer shaders, int binaryformat, java.nio.Buffer binary, int length) {
+ throw new GLException("Method \"glShaderBinary\" not available");
+ }
+
+ /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
+ public void glShaderBinary(int n, int[] shaders, int shaders_offset, int binaryformat, java.nio.Buffer binary, int length) {
+ throw new GLException("Method \"glShaderBinary\" not available");
+ }
+
+ public void glReleaseShaderCompiler() {
+ // nothing to do
+ }
+
+ public void glVertexPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+ }
+ public void glColorPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+
+ }
+ public void glNormalPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.getComponentNumber()!=3) {
+ throw new GLException("Only 3 components per normal allowed");
+ }
+ if(array.isVBO()) {
+ glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+ }
+ public void glTexCoordPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+ }
+
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java
new file mode 100644
index 000000000..0d0daf463
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2_es2.java
@@ -0,0 +1,60 @@
+ public void glVertexAttribPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glVertexAttribPointer(array.getLocation(), array.getComponentNumber(), array.getComponentType(),
+ array.getNormalized(), array.getStride(), array.getOffset());
+ } else {
+ glVertexAttribPointer(array.getLocation(), array.getComponentNumber(), array.getComponentType(),
+ array.getNormalized(), array.getStride(), array.getBuffer());
+ }
+ }
+
+ public void glUniform(GLUniformData data) {
+ boolean done=false;
+ if(data.isBuffer()) {
+ Buffer buffer = data.getBuffer();
+ if(data.isMatrix()) {
+ if(buffer instanceof FloatBuffer) {
+ switch(data.columns()) {
+ case 2: glUniformMatrix2fv(data.getLocation(), data.count(), false, (FloatBuffer)buffer); done=true; break;
+ case 3: glUniformMatrix3fv(data.getLocation(), data.count(), false, (FloatBuffer)buffer); done=true; break;
+ case 4: glUniformMatrix4fv(data.getLocation(), data.count(), false, (FloatBuffer)buffer); done=true; break;
+ }
+ }
+ if(!done) {
+ throw new GLException("glUniformMatrix only available for 2fv, 3fv and 4fv");
+ }
+ } else {
+ if(buffer instanceof IntBuffer) {
+ switch(data.components()) {
+ case 1: glUniform1iv(data.getLocation(), data.count(), (IntBuffer)buffer); done=true; break;
+ case 2: glUniform2iv(data.getLocation(), data.count(), (IntBuffer)buffer); done=true; break;
+ case 3: glUniform3iv(data.getLocation(), data.count(), (IntBuffer)buffer); done=true; break;
+ case 4: glUniform4iv(data.getLocation(), data.count(), (IntBuffer)buffer); done=true; break;
+ }
+ } else if(buffer instanceof FloatBuffer) {
+ switch(data.components()) {
+ case 1: glUniform1fv(data.getLocation(), data.count(), (FloatBuffer)buffer); done=true; break;
+ case 2: glUniform2fv(data.getLocation(), data.count(), (FloatBuffer)buffer); done=true; break;
+ case 3: glUniform3fv(data.getLocation(), data.count(), (FloatBuffer)buffer); done=true; break;
+ case 4: glUniform4fv(data.getLocation(), data.count(), (FloatBuffer)buffer); done=true; break;
+ }
+ }
+ if(!done) {
+ throw new GLException("glUniform vector only available for 1[if]v 2[if]v, 3[if]v and 4[if]v");
+ }
+ }
+ } else {
+ Object obj = data.getObject();
+ if(obj instanceof Integer) {
+ glUniform1i(data.getLocation(), ((Integer)obj).intValue());
+ done=true;
+ } else if (obj instanceof Float) {
+ glUniform1f(data.getLocation(), ((Float)obj).floatValue());
+ done=true;
+ }
+ if(!done) {
+ throw new GLException("glUniform atom only available for 1i and 1f");
+ }
+ }
+ }
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java
new file mode 100644
index 000000000..d7b3de789
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java
@@ -0,0 +1,424 @@
+// Tracks glBegin/glEnd calls to determine whether it is legal to
+// query Vertex Buffer Object state
+private boolean inBeginEndPair;
+
+/* FIXME: refactor dependence on Java 2D / JOGL bridge
+
+// Tracks creation and destruction of server-side OpenGL objects when
+// the Java2D/OpenGL pipeline is enabled and it is using frame buffer
+// objects (FBOs) to do its rendering
+private GLObjectTracker tracker;
+
+public void setObjectTracker(GLObjectTracker tracker) {
+ this.tracker = tracker;
+}
+
+*/
+
+public GL2ES12Impl(GLProfile glp, GLContextImpl context) {
+ this._context = context;
+ this.bufferSizeTracker = context.getBufferSizeTracker();
+ this.isGL2ES2 = glp.isGL2ES2();
+ this.glProfile = glp;
+}
+
+private boolean isGL2ES2;
+
+public final boolean isGL() {
+ return true;
+}
+
+public final boolean isGL3() {
+ return false;
+}
+
+public final boolean isGL2() {
+ return false;
+}
+
+public final boolean isGLES1() {
+ return false;
+}
+
+public final boolean isGLES2() {
+ return false;
+}
+
+public final boolean isGLES() {
+ return false;
+}
+
+public final boolean isGL2ES1() {
+ return !isGL2ES2;
+}
+
+public final boolean isGL2ES2() {
+ return isGL2ES2;
+}
+
+public final boolean hasGLSL() {
+ return isGL2ES2;
+}
+
+public final GL getGL() throws GLException {
+ return this;
+}
+
+public final GL3 getGL3() throws GLException {
+ throw new GLException("Not a GL3 implementation");
+}
+
+public final GL2 getGL2() throws GLException {
+ throw new GLException("Not a GL2 implementation");
+}
+
+public final GLES1 getGLES1() throws GLException {
+ throw new GLException("Not a GLES1 implementation");
+}
+
+public final GLES2 getGLES2() throws GLException {
+ throw new GLException("Not a GLES2 implementation");
+}
+
+public final GL2ES1 getGL2ES1() throws GLException {
+ if (isGL2ES1()) {
+ return this;
+ }
+ throw new GLException("Not a GL2ES1 implementation");
+}
+
+public final GL2ES2 getGL2ES2() throws GLException {
+ if (isGL2ES2()) {
+ return this;
+ }
+ throw new GLException("Not a GL2ES2 implementation");
+}
+
+public boolean isFunctionAvailable(String glFunctionName) {
+ return _context.isFunctionAvailable(glFunctionName);
+}
+
+public boolean isExtensionAvailable(String glExtensionName) {
+ return _context.isExtensionAvailable(glExtensionName);
+}
+
+public Object getExtension(String extensionName) {
+ // At this point we don't expose any extensions using this mechanism
+ return null;
+}
+
+/** Returns the context this GL object is associated with for better
+ error checking by DebugGL. */
+public GLContext getContext() {
+ return _context;
+}
+
+private GLContextImpl _context;
+
+/**
+ * Provides platform-independent access to the wglAllocateMemoryNV /
+ * glXAllocateMemoryNV extension.
+ */
+public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
+}
+
+public void setSwapInterval(int interval) {
+ _context.setSwapInterval(interval);
+}
+
+public Object getPlatformGLExtensions() {
+ return _context.getPlatformGLExtensions();
+}
+
+//
+// Helpers for ensuring the correct amount of texture data
+//
+
+/** Returns the number of bytes required to fill in the appropriate
+ texture. This is computed as closely as possible based on the
+ pixel pack or unpack parameters. The logic in this routine is
+ based on code in the SGI OpenGL sample implementation. */
+
+private int imageSizeInBytes(int format, int type, int w, int h, int d,
+ int dimensions, boolean pack) {
+ int elements = 0;
+ int esize = 0;
+
+ if (w < 0) return 0;
+ if (h < 0) return 0;
+ if (d < 0) return 0;
+ switch (format) {
+ case GL_STENCIL_INDEX:
+ elements = 1;
+ break;
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_DEPTH_COMPONENT:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ elements = 4;
+ break;
+ /* FIXME ??
+ case GL_HILO_NV:
+ elements = 2;
+ break; */
+ default:
+ return 0;
+ }
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ default:
+ return 0;
+ }
+ return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack);
+}
+
+private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+private GLBufferSizeTracker bufferSizeTracker;
+
+private boolean bufferObjectExtensionsInitialized = false;
+private boolean haveGL15;
+private boolean haveGL21;
+private boolean haveARBVertexBufferObject;
+
+private void initBufferObjectExtensionChecks() {
+ if (bufferObjectExtensionsInitialized)
+ return;
+ bufferObjectExtensionsInitialized = true;
+ haveGL15 = isExtensionAvailable("GL_VERSION_1_5");
+ haveGL21 = isExtensionAvailable("GL_VERSION_2_1");
+ haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object");
+}
+
+private boolean checkBufferObject(boolean extension1,
+ boolean extension2,
+ boolean extension3,
+ boolean enabled,
+ int state,
+ String kind, boolean throwException) {
+ if (inBeginEndPair) {
+ throw new GLException("May not call this between glBegin and glEnd");
+ }
+ boolean avail = (extension1 || extension2 || extension3);
+ if (!avail) {
+ if (!enabled)
+ return true;
+ if(throwException) {
+ throw new GLException("Required extensions not available to call this function");
+ }
+ return false;
+ }
+ int buffer = bufferStateTracker.getBoundBufferObject(state, this);
+ if (enabled) {
+ if (buffer == 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be enabled to call this method");
+ }
+ return false;
+ }
+ } else {
+ if (buffer != 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be disabled to call this method");
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
+private boolean checkArrayVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ false,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkArrayVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ true,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ false,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ true,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBODisabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return true;
+}
+
+private boolean checkUnpackPBOEnabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return false;
+}
+
+private boolean checkPackPBODisabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return true;
+}
+
+private boolean checkPackPBOEnabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return false;
+}
+
+// Attempt to return the same ByteBuffer object from glMapBuffer if
+// the vertex buffer object's base address and size haven't changed
+private static class ARBVBOKey {
+ private long addr;
+ private int capacity;
+
+ ARBVBOKey(long addr, int capacity) {
+ this.addr = addr;
+ this.capacity = capacity;
+ }
+
+ public int hashCode() {
+ return (int) addr;
+ }
+
+ public boolean equals(Object o) {
+ if ((o == null) || (!(o instanceof ARBVBOKey))) {
+ return false;
+ }
+
+ ARBVBOKey other = (ARBVBOKey) o;
+ return ((addr == other.addr) && (capacity == other.capacity));
+ }
+}
+
+private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
+
+/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+public java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ final long __addr_ = ((GL2ES12ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapBuffer\" not available");
+ }
+ int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
+ target,
+ this);
+ long addr;
+ addr = dispatch_glMapBuffer(target, access, __addr_);
+ if (addr == 0 || sz == 0) {
+ return null;
+ }
+ ARBVBOKey key = new ARBVBOKey(addr, sz);
+ ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key);
+ if (_res == null) {
+ _res = newDirectByteBuffer(addr, sz);
+ InternalBufferUtil.nativeOrder(_res);
+ arbVBOCache.put(key, _res);
+ }
+ _res.position(0);
+ return _res;
+}
+
+/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+native private long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+
+native private ByteBuffer newDirectByteBuffer(long addr, int capacity);
+
+ /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
+ public void glShaderBinary(int n, java.nio.IntBuffer shaders, int binaryformat, java.nio.Buffer binary, int length) {
+ throw new GLException("Method \"glShaderBinary\" not available");
+ }
+
+ /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
+ public void glShaderBinary(int n, int[] shaders, int shaders_offset, int binaryformat, java.nio.Buffer binary, int length) {
+ throw new GLException("Method \"glShaderBinary\" not available");
+ }
+
+ public void glReleaseShaderCompiler() {
+ // nothing to do
+ }
+
+ public void glVertexPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+ }
+ public void glColorPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+
+ }
+ public void glNormalPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.getComponentNumber()!=3) {
+ throw new GLException("Only 3 components per normal allowed");
+ }
+ if(array.isVBO()) {
+ glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+ }
+ public void glTexCoordPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+ }
+
+
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java
new file mode 100644
index 000000000..aa1ef6575
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java
@@ -0,0 +1,429 @@
+// Tracks glBegin/glEnd calls to determine whether it is legal to
+// query Vertex Buffer Object state
+private boolean inBeginEndPair;
+
+/* FIXME: refactor dependence on Java 2D / JOGL bridge
+
+// Tracks creation and destruction of server-side OpenGL objects when
+// the Java2D/OpenGL pipeline is enabled and it is using frame buffer
+// objects (FBOs) to do its rendering
+private GLObjectTracker tracker;
+
+public void setObjectTracker(GLObjectTracker tracker) {
+ this.tracker = tracker;
+}
+
+*/
+
+public GL3Impl(GLProfile glp, GLContextImpl context) {
+ this._context = context;
+ this.bufferSizeTracker = context.getBufferSizeTracker();
+ this.glProfile = glp;
+}
+
+public final boolean isGL() {
+ return true;
+}
+
+public final boolean isGL3() {
+ return true;
+}
+
+public final boolean isGL2() {
+ return false;
+}
+
+public final boolean isGLES1() {
+ return false;
+}
+
+public final boolean isGLES2() {
+ return false;
+}
+
+public final boolean isGLES() {
+ return false;
+}
+
+public final boolean isGL2ES1() {
+ return false;
+}
+
+public final boolean isGL2ES2() {
+ return true;
+}
+
+public final boolean hasGLSL() {
+ return true;
+}
+
+public final GL getGL() throws GLException {
+ return this;
+}
+
+public final GL3 getGL3() throws GLException {
+ return this;
+}
+
+public final GL2 getGL2() throws GLException {
+ throw new GLException("Not a GL2 implementation");
+}
+
+public final GLES1 getGLES1() throws GLException {
+ throw new GLException("Not a GLES1 implementation");
+}
+
+public final GLES2 getGLES2() throws GLException {
+ throw new GLException("Not a GLES2 implementation");
+}
+
+public final GL2ES1 getGL2ES1() throws GLException {
+ throw new GLException("Not a GLES2ES1 implementation");
+}
+
+public final GL2ES2 getGL2ES2() throws GLException {
+ return this;
+}
+
+public boolean isFunctionAvailable(String glFunctionName) {
+ return _context.isFunctionAvailable(glFunctionName);
+}
+
+public boolean isExtensionAvailable(String glExtensionName) {
+ return _context.isExtensionAvailable(glExtensionName);
+}
+
+public Object getExtension(String extensionName) {
+ // At this point we don't expose any extensions using this mechanism
+ return null;
+}
+
+/** Returns the context this GL object is associated with for better
+ error checking by DebugGL. */
+public GLContext getContext() {
+ return _context;
+}
+
+private GLContextImpl _context;
+
+/**
+ * Provides platform-independent access to the wglAllocateMemoryNV /
+ * glXAllocateMemoryNV extension.
+ */
+public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
+}
+
+public void setSwapInterval(int interval) {
+ _context.setSwapInterval(interval);
+}
+
+public Object getPlatformGLExtensions() {
+ return _context.getPlatformGLExtensions();
+}
+
+//
+// Helpers for ensuring the correct amount of texture data
+//
+
+/** Returns the number of bytes required to fill in the appropriate
+ texture. This is computed as closely as possible based on the
+ pixel pack or unpack parameters. The logic in this routine is
+ based on code in the SGI OpenGL sample implementation. */
+
+private int imageSizeInBytes(int format, int type, int w, int h, int d,
+ int dimensions, boolean pack) {
+ int elements = 0;
+ int esize = 0;
+
+ if (w < 0) return 0;
+ if (h < 0) return 0;
+ if (d < 0) return 0;
+ switch (format) {
+ case GL_STENCIL_INDEX:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_DEPTH_COMPONENT:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ case GL_BGR:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_BGRA:
+ elements = 4;
+ break;
+ /* FIXME ??
+ case GL_HILO_NV:
+ elements = 2;
+ break; */
+ default:
+ return 0;
+ }
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return 0;
+ }
+ return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack);
+}
+
+private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+private GLBufferSizeTracker bufferSizeTracker;
+
+private boolean bufferObjectExtensionsInitialized = false;
+private boolean haveARBPixelBufferObject;
+private boolean haveEXTPixelBufferObject;
+private boolean haveGL15;
+private boolean haveGL21;
+private boolean haveARBVertexBufferObject;
+
+private void initBufferObjectExtensionChecks() {
+ if (bufferObjectExtensionsInitialized)
+ return;
+ bufferObjectExtensionsInitialized = true;
+ haveARBPixelBufferObject = isExtensionAvailable("GL_ARB_pixel_buffer_object");
+ haveEXTPixelBufferObject = isExtensionAvailable("GL_EXT_pixel_buffer_object");
+ haveGL15 = isExtensionAvailable("GL_VERSION_1_5");
+ haveGL21 = isExtensionAvailable("GL_VERSION_2_1");
+ haveARBVertexBufferObject = isExtensionAvailable("GL_ARB_vertex_buffer_object");
+}
+
+private boolean checkBufferObject(boolean extension1,
+ boolean extension2,
+ boolean extension3,
+ boolean enabled,
+ int state,
+ String kind, boolean throwException) {
+ if (inBeginEndPair) {
+ throw new GLException("May not call this between glBegin and glEnd");
+ }
+ boolean avail = (extension1 || extension2 || extension3);
+ if (!avail) {
+ if (!enabled)
+ return true;
+ if(throwException) {
+ throw new GLException("Required extensions not available to call this function");
+ }
+ return false;
+ }
+ int buffer = bufferStateTracker.getBoundBufferObject(state, this);
+ if (enabled) {
+ if (buffer == 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be enabled to call this method");
+ }
+ return false;
+ }
+ } else {
+ if (buffer != 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be disabled to call this method");
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
+private boolean checkArrayVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ false,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkArrayVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ true,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ false,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveGL15,
+ haveARBVertexBufferObject,
+ false,
+ true,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ false,
+ GL2.GL_PIXEL_UNPACK_BUFFER,
+ "unpack pixel_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ true,
+ GL2.GL_PIXEL_UNPACK_BUFFER,
+ "unpack pixel_buffer_object", throwException);
+}
+
+private boolean checkPackPBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ false,
+ GL2.GL_PIXEL_PACK_BUFFER,
+ "pack pixel_buffer_object", throwException);
+}
+
+private boolean checkPackPBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(haveARBPixelBufferObject,
+ haveEXTPixelBufferObject,
+ haveGL21,
+ true,
+ GL2.GL_PIXEL_PACK_BUFFER,
+ "pack pixel_buffer_object", throwException);
+}
+
+public boolean glIsPBOPackEnabled() {
+ return checkPackPBOEnabled(false);
+}
+
+public boolean glIsPBOUnpackEnabled() {
+ return checkUnpackPBOEnabled(false);
+}
+
+// Attempt to return the same ByteBuffer object from glMapBuffer if
+// the vertex buffer object's base address and size haven't changed
+private static class ARBVBOKey {
+ private long addr;
+ private int capacity;
+
+ ARBVBOKey(long addr, int capacity) {
+ this.addr = addr;
+ this.capacity = capacity;
+ }
+
+ public int hashCode() {
+ return (int) addr;
+ }
+
+ public boolean equals(Object o) {
+ if ((o == null) || (!(o instanceof ARBVBOKey))) {
+ return false;
+ }
+
+ ARBVBOKey other = (ARBVBOKey) o;
+ return ((addr == other.addr) && (capacity == other.capacity));
+ }
+}
+
+private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
+
+/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+public java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ final long __addr_ = ((GL3ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBuffer;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapBuffer\" not available");
+ }
+ int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
+ target,
+ this);
+ long addr;
+ addr = dispatch_glMapBuffer(target, access, __addr_);
+ if (addr == 0 || sz == 0) {
+ return null;
+ }
+ ARBVBOKey key = new ARBVBOKey(addr, sz);
+ ByteBuffer _res = (ByteBuffer) arbVBOCache.get(key);
+ if (_res == null) {
+ _res = newDirectByteBuffer(addr, sz);
+ InternalBufferUtil.nativeOrder(_res);
+ arbVBOCache.put(key, _res);
+ }
+ _res.position(0);
+ return _res;
+}
+
+/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+native private long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+
+native private ByteBuffer newDirectByteBuffer(long addr, int capacity);
+
+ /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
+ public void glShaderBinary(int n, java.nio.IntBuffer shaders, int binaryformat, java.nio.Buffer binary, int length) {
+ throw new GLException("Method \"glShaderBinary\" not available");
+ }
+
+ /** Dummy implementation for the ES 2.0 function: <br> <code> void {@native glShaderBinary}(GLint n, const GLuint * shaders, GLenum binaryformat, const void * binary, GLint length); </code> <br> Always throws a GLException! */
+ public void glShaderBinary(int n, int[] shaders, int shaders_offset, int binaryformat, java.nio.Buffer binary, int length) {
+ throw new GLException("Method \"glShaderBinary\" not available");
+ }
+
+ public void glReleaseShaderCompiler() {
+ // nothing to do
+ }
+
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
new file mode 100755
index 000000000..d349f8018
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java
@@ -0,0 +1,355 @@
+public GLES1Impl(GLProfile glp, GLContextImpl context) {
+ this._context = context;
+ this.bufferSizeTracker = context.getBufferSizeTracker();
+ this.glProfile = glp;
+}
+
+public final boolean isGL() {
+ return true;
+}
+
+public final boolean isGL3() {
+ return false;
+}
+
+public final boolean isGL2() {
+ return false;
+}
+
+public final boolean isGLES1() {
+ return true;
+}
+
+public final boolean isGLES2() {
+ return false;
+}
+
+public final boolean isGLES() {
+ return true;
+}
+
+public final boolean isGL2ES1() {
+ return true;
+}
+
+public final boolean isGL2ES2() {
+ return false;
+}
+
+public final boolean hasGLSL() {
+ return false;
+}
+
+public final GL getGL() throws GLException {
+ return this;
+}
+
+public final GL3 getGL3() throws GLException {
+ throw new GLException("Not a GL3 implementation");
+}
+
+public final GL2 getGL2() throws GLException {
+ throw new GLException("Not a GL2 implementation");
+}
+
+public final GLES1 getGLES1() throws GLException {
+ return this;
+}
+
+public final GLES2 getGLES2() throws GLException {
+ throw new GLException("Not a GLES2 implementation");
+}
+
+public final GL2ES1 getGL2ES1() throws GLException {
+ return this;
+}
+
+public final GL2ES2 getGL2ES2() throws GLException {
+ throw new GLException("Not a GL2ES2 implementation");
+}
+
+public boolean isFunctionAvailable(String glFunctionName) {
+ return _context.isFunctionAvailable(glFunctionName);
+}
+
+public boolean isExtensionAvailable(String glExtensionName) {
+ return _context.isExtensionAvailable(glExtensionName);
+}
+
+public Object getExtension(String extensionName) {
+ // At this point we don't expose any extensions using this mechanism
+ return null;
+}
+
+/** Returns the context this GL object is associated with for better
+ error checking by DebugGL. */
+public GLContext getContext() {
+ return _context;
+}
+
+private GLContextImpl _context;
+
+/**
+ * Provides platform-independent access to the wglAllocateMemoryNV /
+ * glXAllocateMemoryNV extension.
+ */
+public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
+}
+
+public void setSwapInterval(int interval) {
+ _context.setSwapInterval(interval);
+}
+
+public Object getPlatformGLExtensions() {
+ return _context.getPlatformGLExtensions();
+}
+
+//
+// Helpers for ensuring the correct amount of texture data
+//
+
+/** Returns the number of bytes required to fill in the appropriate
+ texture. This is computed as closely as possible based on the
+ pixel pack or unpack parameters. The logic in this routine is
+ based on code in the SGI OpenGL sample implementation. */
+
+private int imageSizeInBytes(int format, int type, int w, int h, int d,
+ int dimensions, boolean pack) {
+ int elements = 0;
+ int esize = 0;
+
+ if (w < 0) return 0;
+ if (h < 0) return 0;
+ if (d < 0) return 0;
+ switch (format) {
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ elements = 4;
+ break;
+ default:
+ return 0;
+ }
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ default:
+ return 0;
+ }
+ return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack);
+}
+
+private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+private GLBufferSizeTracker bufferSizeTracker;
+
+private boolean bufferObjectExtensionsInitialized = false;
+private boolean haveOESFramebufferObject;
+
+private void initBufferObjectExtensionChecks() {
+ if (bufferObjectExtensionsInitialized)
+ return;
+ bufferObjectExtensionsInitialized = true;
+ haveOESFramebufferObject = isExtensionAvailable("GL_OES_framebuffer_object");
+}
+
+private boolean checkBufferObject(boolean avail,
+ boolean enabled,
+ int state,
+ String kind, boolean throwException) {
+ if (!avail) {
+ if (!enabled)
+ return true;
+ if(throwException) {
+ throw new GLException("Required extensions not available to call this function");
+ }
+ return false;
+ }
+ int buffer = bufferStateTracker.getBoundBufferObject(state, this);
+ if (enabled) {
+ if (buffer == 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be enabled to call this method");
+ }
+ return false;
+ }
+ } else {
+ if (buffer != 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be disabled to call this method");
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
+private boolean checkArrayVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ false,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkArrayVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ true,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ false,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ true,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBODisabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return true;
+}
+
+private boolean checkUnpackPBOEnabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return false;
+}
+
+private boolean checkPackPBODisabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return true;
+}
+
+private boolean checkPackPBOEnabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return false;
+}
+
+// Attempt to return the same ByteBuffer object from glMapBufferARB if
+// the vertex buffer object's base address and size haven't changed
+private static class ARBVBOKey {
+ private long addr;
+ private int capacity;
+
+ ARBVBOKey(long addr, int capacity) {
+ this.addr = addr;
+ this.capacity = capacity;
+ }
+
+ public int hashCode() {
+ return (int) addr;
+ }
+
+ public boolean equals(Object o) {
+ if ((o == null) || (!(o instanceof ARBVBOKey))) {
+ return false;
+ }
+
+ ARBVBOKey other = (ARBVBOKey) o;
+ return ((addr == other.addr) && (capacity == other.capacity));
+ }
+}
+
+private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
+
+/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+public java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ final long __addr_ = ((GLES1ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferOES;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapBuffer\" not available");
+ }
+ int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
+ target,
+ this);
+ long addr;
+ addr = dispatch_glMapBuffer(target, access, __addr_);
+ if (addr == 0 || sz == 0) {
+ return null;
+ }
+ ARBVBOKey key = new ARBVBOKey(addr, sz);
+ java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key);
+ if (_res == null) {
+ _res = newDirectByteBuffer(addr, sz);
+ InternalBufferUtil.nativeOrder(_res);
+ arbVBOCache.put(key, _res);
+ }
+ _res.position(0);
+ return _res;
+}
+
+/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+native private long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+
+native private ByteBuffer newDirectByteBuffer(long addr, int capacity);
+
+public void glVertexPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glVertexPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+}
+public void glColorPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glColorPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+
+}
+public void glNormalPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.getComponentNumber()!=3) {
+ throw new GLException("Only 3 components per normal allowed");
+ }
+ if(array.isVBO()) {
+ glNormalPointer(array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glNormalPointer(array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+}
+public void glTexCoordPointer(GLArrayData array) {
+ if(array.getComponentNumber()==0) return;
+ if(array.isVBO()) {
+ glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getOffset());
+ } else {
+ glTexCoordPointer(array.getComponentNumber(), array.getComponentType(), array.getStride(), array.getBuffer());
+ }
+}
+
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java
new file mode 100755
index 000000000..28edd7a63
--- /dev/null
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java
@@ -0,0 +1,336 @@
+// Tracks glBegin/glEnd calls to determine whether it is legal to
+// query Vertex Buffer Object state
+private boolean inBeginEndPair;
+
+public GLES2Impl(GLProfile glp, GLContextImpl context) {
+ this._context = context;
+ this.bufferSizeTracker = context.getBufferSizeTracker();
+ this.glProfile = glp;
+}
+
+public final boolean isGL() {
+ return true;
+}
+
+public final boolean isGL3() {
+ return false;
+}
+
+public final boolean isGL2() {
+ return false;
+}
+
+public final boolean isGLES1() {
+ return false;
+}
+
+public final boolean isGLES2() {
+ return true;
+}
+
+public final boolean isGLES() {
+ return true;
+}
+
+public final boolean isGL2ES1() {
+ return false;
+}
+
+public final boolean isGL2ES2() {
+ return true;
+}
+
+public final boolean hasGLSL() {
+ return true;
+}
+
+public final GL getGL() throws GLException {
+ return this;
+}
+
+public final GL3 getGL3() throws GLException {
+ throw new GLException("Not a GL3 implementation");
+}
+
+public final GL2 getGL2() throws GLException {
+ throw new GLException("Not a GL2 implementation");
+}
+
+public final GLES1 getGLES1() throws GLException {
+ throw new GLException("Not a GLES1 implementation");
+}
+
+public final GLES2 getGLES2() throws GLException {
+ return this;
+}
+
+public final GL2ES1 getGL2ES1() throws GLException {
+ throw new GLException("Not a GL2ES1 implementation");
+}
+
+public final GL2ES2 getGL2ES2() throws GLException {
+ return this;
+}
+
+public boolean isFunctionAvailable(String glFunctionName) {
+ return _context.isFunctionAvailable(glFunctionName);
+}
+
+public boolean isExtensionAvailable(String glExtensionName) {
+ return _context.isExtensionAvailable(glExtensionName);
+}
+
+public Object getExtension(String extensionName) {
+ // At this point we don't expose any extensions using this mechanism
+ return null;
+}
+
+/** Returns the context this GL object is associated with for better
+ error checking by DebugGL. */
+public GLContext getContext() {
+ return _context;
+}
+
+private GLContextImpl _context;
+
+/**
+ * Provides platform-independent access to the wglAllocateMemoryNV /
+ * glXAllocateMemoryNV extension.
+ */
+public java.nio.ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return _context.glAllocateMemoryNV(arg0, arg1, arg2, arg3);
+}
+
+public void setSwapInterval(int interval) {
+ _context.setSwapInterval(interval);
+}
+
+public Object getPlatformGLExtensions() {
+ return _context.getPlatformGLExtensions();
+}
+
+//
+// Helpers for ensuring the correct amount of texture data
+//
+
+/** Returns the number of bytes required to fill in the appropriate
+ texture. This is computed as closely as possible based on the
+ pixel pack or unpack parameters. The logic in this routine is
+ based on code in the SGI OpenGL sample implementation. */
+
+private int imageSizeInBytes(int format, int type, int w, int h, int d,
+ int dimensions, boolean pack) {
+ int elements = 0;
+ int esize = 0;
+
+ if (w < 0) return 0;
+ if (h < 0) return 0;
+ if (d < 0) return 0;
+ switch (format) {
+ case GL_STENCIL_INDEX:
+ elements = 1;
+ break;
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ case GL_DEPTH_COMPONENT:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ elements = 4;
+ break;
+ default:
+ return 0;
+ }
+ switch (type) {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ default:
+ return 0;
+ }
+ return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack);
+}
+
+private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker();
+private GLBufferSizeTracker bufferSizeTracker;
+
+private boolean bufferObjectExtensionsInitialized = false;
+private boolean haveOESFramebufferObject;
+
+private void initBufferObjectExtensionChecks() {
+ if (bufferObjectExtensionsInitialized)
+ return;
+ bufferObjectExtensionsInitialized = true;
+ haveOESFramebufferObject = isExtensionAvailable("GL_OES_framebuffer_object");
+}
+
+private boolean checkBufferObject(boolean avail,
+ boolean enabled,
+ int state,
+ String kind, boolean throwException) {
+ if (!avail) {
+ if (!enabled)
+ return true;
+ if(throwException) {
+ throw new GLException("Required extensions not available to call this function");
+ }
+ return false;
+ }
+ int buffer = bufferStateTracker.getBoundBufferObject(state, this);
+ if (enabled) {
+ if (buffer == 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be enabled to call this method");
+ }
+ return false;
+ }
+ } else {
+ if (buffer != 0) {
+ if(throwException) {
+ throw new GLException(kind + " must be disabled to call this method");
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
+private boolean checkArrayVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ false,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkArrayVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ true,
+ GL.GL_ARRAY_BUFFER,
+ "array vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBODisabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ false,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkElementVBOEnabled(boolean throwException) {
+ initBufferObjectExtensionChecks();
+ return checkBufferObject(true,
+ true,
+ GL.GL_ELEMENT_ARRAY_BUFFER,
+ "element vertex_buffer_object", throwException);
+}
+
+private boolean checkUnpackPBODisabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return true;
+}
+
+private boolean checkUnpackPBOEnabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return false;
+}
+
+private boolean checkPackPBODisabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return true;
+}
+
+private boolean checkPackPBOEnabled(boolean throwException) {
+ // PBO n/a for ES 1.1 or ES 2.0
+ return false;
+}
+
+// Attempt to return the same ByteBuffer object from glMapBufferARB if
+// the vertex buffer object's base address and size haven't changed
+private static class ARBVBOKey {
+ private long addr;
+ private int capacity;
+
+ ARBVBOKey(long addr, int capacity) {
+ this.addr = addr;
+ this.capacity = capacity;
+ }
+
+ public int hashCode() {
+ return (int) addr;
+ }
+
+ public boolean equals(Object o) {
+ if ((o == null) || (!(o instanceof ARBVBOKey))) {
+ return false;
+ }
+
+ ARBVBOKey other = (ARBVBOKey) o;
+ return ((addr == other.addr) && (capacity == other.capacity));
+ }
+}
+
+private Map/*<ARBVBOKey, ByteBuffer>*/ arbVBOCache = new HashMap();
+
+/** Entry point to C language function: <br> <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+public java.nio.ByteBuffer glMapBuffer(int target, int access) {
+ final long __addr_ = ((GLES2ProcAddressTable)_context.getGLProcAddressTable())._addressof_glMapBufferOES;
+ if (__addr_ == 0) {
+ throw new GLException("Method \"glMapBuffer\" not available");
+ }
+ int sz = bufferSizeTracker.getBufferSize(bufferStateTracker,
+ target,
+ this);
+ long addr;
+ addr = dispatch_glMapBuffer(target, access, __addr_);
+ if (addr == 0 || sz == 0) {
+ return null;
+ }
+ ARBVBOKey key = new ARBVBOKey(addr, sz);
+ java.nio.ByteBuffer _res = (java.nio.ByteBuffer) arbVBOCache.get(key);
+ if (_res == null) {
+ _res = newDirectByteBuffer(addr, sz);
+ InternalBufferUtil.nativeOrder(_res);
+ arbVBOCache.put(key, _res);
+ }
+ _res.position(0);
+ return _res;
+}
+
+/** Encapsulates function pointer for OpenGL function <br>: <code> LPVOID glMapBuffer(GLenum target, GLenum access); </code> */
+native private long dispatch_glMapBuffer(int target, int access, long glProcAddress);
+
+native private ByteBuffer newDirectByteBuffer(long addr, int capacity);
+
+public void glClearDepth(double depth) {
+ glClearDepthf((float)depth);
+}
+
+public void glDepthRange(double zNear, double zFar) {
+ glDepthRangef((float)zNear, (float)zFar);
+}
+
diff --git a/make/config/jogl/gl-macosx-nsig.cfg b/make/config/jogl/gl-macosx-nsig.cfg
new file mode 100755
index 000000000..6a4bc0a06
--- /dev/null
+++ b/make/config/jogl/gl-macosx-nsig.cfg
@@ -0,0 +1,2 @@
+Include nsig.cfg
+Include gl-macosx.cfg
diff --git a/make/config/jogl/gl-win32-nsig.cfg b/make/config/jogl/gl-win32-nsig.cfg
new file mode 100755
index 000000000..b7c4973d4
--- /dev/null
+++ b/make/config/jogl/gl-win32-nsig.cfg
@@ -0,0 +1,2 @@
+Include nsig.cfg
+Include gl-win32.cfg
diff --git a/make/config/jogl/gl-x11-nsig.cfg b/make/config/jogl/gl-x11-nsig.cfg
new file mode 100755
index 000000000..bb8a76821
--- /dev/null
+++ b/make/config/jogl/gl-x11-nsig.cfg
@@ -0,0 +1,2 @@
+Include nsig.cfg
+Include gl-x11.cfg
diff --git a/make/config/jogl/gl3-desktop-tracker.cfg b/make/config/jogl/gl3-desktop-tracker.cfg
new file mode 100644
index 000000000..4b9a7edb7
--- /dev/null
+++ b/make/config/jogl/gl3-desktop-tracker.cfg
@@ -0,0 +1,38 @@
+
+# Track server-side object creation and deletion when necessary
+# Note that this is only necessary when the Java 2D / JOGL bridge is active,
+# so will never be needed for the embedded OpenGL variants
+JavaEpilogue glGenBuffers if (tracker != null) tracker.addBuffers({0}, {1});
+JavaEpilogue glGenFencesAPPLE if (tracker != null) tracker.addFencesAPPLE({0}, {1});
+JavaEpilogue glGenFencesNV if (tracker != null) tracker.addFencesNV({0}, {1});
+JavaEpilogue glGenFragmentShadersATI if (tracker != null) tracker.addFragmentShadersATI(_res, {0});
+JavaEpilogue glGenFramebuffersEXT if (tracker != null) tracker.addFramebuffersEXT({0}, {1});
+JavaEpilogue glGenLists if (tracker != null) tracker.addLists(_res, {0});
+JavaEpilogue glGenOcclusionQueriesNV if (tracker != null) tracker.addOcclusionQueriesNV({0}, {1});
+JavaEpilogue glCreateProgram if (tracker != null) tracker.addProgramObject(_res);
+JavaEpilogue glGenPrograms if (tracker != null) tracker.addPrograms({0}, {1});
+JavaEpilogue glGenQueries if (tracker != null) tracker.addQueries({0}, {1});
+JavaEpilogue glGenRenderbuffersEXT if (tracker != null) tracker.addRenderbuffersEXT({0}, {1});
+JavaEpilogue glCreateShader if (tracker != null) tracker.addShaderObject(_res);
+JavaEpilogue glGenTextures if (tracker != null) tracker.addTextures({0}, {1});
+JavaEpilogue glGenVertexArraysAPPLE if (tracker != null) tracker.addVertexArraysAPPLE({0}, {1});
+JavaEpilogue glGenVertexShadersEXT if (tracker != null) tracker.addVertexShadersEXT(_res, {0});
+
+JavaEpilogue glDeleteBuffers if (tracker != null) tracker.removeBuffers({0}, {1});
+JavaEpilogue glDeleteFencesAPPLE if (tracker != null) tracker.removeFencesAPPLE({0}, {1});
+JavaEpilogue glDeleteFencesNV if (tracker != null) tracker.removeFencesNV({0}, {1});
+JavaEpilogue glDeleteFragmentShaderATI if (tracker != null) tracker.removeFragmentShaderATI({0});
+JavaEpilogue glDeleteFramebuffersEXT if (tracker != null) tracker.removeFramebuffersEXT({0}, {1});
+JavaEpilogue glDeleteLists if (tracker != null) tracker.removeLists({0}, {1});
+JavaEpilogue glDeleteOcclusionQueriesNV if (tracker != null) tracker.removeOcclusionQueriesNV({0}, {1});
+JavaEpilogue glDeleteProgram if (tracker != null) tracker.removeProgramObject({0});
+JavaEpilogue glDeleteObject if (tracker != null) tracker.removeProgramOrShaderObject({0});
+JavaEpilogue glDeletePrograms if (tracker != null) tracker.removePrograms({0}, {1});
+JavaEpilogue glDeleteProgramsNV if (tracker != null) tracker.removeProgramsNV({0}, {1});
+JavaEpilogue glDeleteQueries if (tracker != null) tracker.removeQueries({0}, {1});
+JavaEpilogue glDeleteRenderbuffersEXT if (tracker != null) tracker.removeRenderbuffersEXT({0}, {1});
+JavaEpilogue glDeleteShader if (tracker != null) tracker.removeShaderObject({0});
+JavaEpilogue glDeleteTextures if (tracker != null) tracker.removeTextures({0}, {1});
+JavaEpilogue glDeleteVertexArraysAPPLE if (tracker != null) tracker.removeVertexArraysAPPLE({0}, {1});
+JavaEpilogue glDeleteVertexShaderEXT if (tracker != null) tracker.removeVertexShaderEXT({0});
+
diff --git a/make/config/jogl/gl3-desktop.cfg b/make/config/jogl/gl3-desktop.cfg
new file mode 100755
index 000000000..2d34ade30
--- /dev/null
+++ b/make/config/jogl/gl3-desktop.cfg
@@ -0,0 +1,67 @@
+# This .cfg file provides common options used by the desktop OpenGL
+# implementation on all platforms.
+
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GL3/gl3.h
+GLHeader GL3/gl3ext.h
+
+#Include gl-desktop-tracker.cfg
+
+
+#
+# Directives needed when processing wglext.h on Windows and other platforms
+#
+Opaque boolean BOOL
+ReturnsString wglGetExtensionsStringARB
+ReturnsString wglGetExtensionsStringEXT
+Opaque long HANDLE
+Opaque long HBITMAP
+Opaque long HDC
+Opaque long HGDIOBJ
+Opaque long HGLRC
+Opaque long HPBUFFERARB
+Opaque long HPBUFFEREXT
+Opaque boolean BOOL
+Opaque long PROC
+Opaque long void **
+
+#
+# Directives needed when processing cglext.h on MacOSX and other platforms
+#
+Opaque long CGContextRef
+Opaque long void **
+# Implement the first argument to cglGetProcAddress as String instead
+# of byte[]
+ArgumentIsString cglGetProcAddress 0
+
+#
+# Directives needed when processing glxext.h on X11 and other platforms
+#
+Opaque long __GLXextFuncPtr
+Opaque boolean Bool
+Opaque long Display *
+Opaque long GLXContext
+Opaque long Visual *
+# Ignore the empty Display and Visual data structures (though made
+# opaque, the references from XVisualInfo and elsewhere are still
+# traversed)
+Ignore Display
+Ignore Visual
+# Implement the first argument to glXGetProcAddress as String instead
+# of byte[]
+ArgumentIsString glXGetProcAddress 0
+ArgumentIsString glXGetProcAddressARB 0
+ReturnsString glXQueryExtensionsString
+ReturnsString glXQueryServerString
+ReturnsString glXGetClientString
+TemporaryCVariableDeclaration glXChooseFBConfig int count;
+TemporaryCVariableAssignment glXChooseFBConfig count = _ptr3[0];
+ReturnValueCapacity glXChooseFBConfig count * sizeof(GLXFBConfig)
+TemporaryCVariableDeclaration glXChooseFBConfigSGIX int count;
+TemporaryCVariableAssignment glXChooseFBConfigSGIX count = _ptr3[0];
+ReturnValueCapacity glXChooseFBConfigSGIX count * sizeof(GLXFBConfig)
+TemporaryCVariableDeclaration glXGetFBConfigs int count;
+TemporaryCVariableAssignment glXGetFBConfigs count = _ptr2[0];
+ReturnValueCapacity glXGetFBConfigs count * sizeof(GLXFBConfig)
+
diff --git a/make/config/jogl/gl3-headers.cfg b/make/config/jogl/gl3-headers.cfg
new file mode 100755
index 000000000..282a91ec5
--- /dev/null
+++ b/make/config/jogl/gl3-headers.cfg
@@ -0,0 +1,29 @@
+CustomCCode /* Define GL3_PROTOTYPES so that the OpenGL extension prototypes in
+CustomCCode "gl3.h" are parsed. */
+CustomCCode #define GL3_PROTOTYPES
+CustomCCode #if defined(_WIN32)
+CustomCCode #define WIN32_LEAN_AND_MEAN
+CustomCCode #include <windows.h>
+CustomCCode #undef WIN32_LEAN_AND_MEAN
+CustomCCode #include <stdlib.h>
+CustomCCode #include <stddef.h>
+CustomCCode #include <malloc.h>
+CustomCCode #include <GL3/gl3.h>
+CustomCCode #elif defined(macosx)
+CustomCCode #include <inttypes.h>
+CustomCCode #include <stdlib.h>
+CustomCCode #include <GL3/gl3.h>
+CustomCCode #include </usr/include/machine/types.h>
+CustomCCode /* Provide Windows typedefs */
+CustomCCode typedef void* LPVOID;
+CustomCCode typedef unsigned int* PUINT;
+CustomCCode #elif defined(linux) || defined(__sun) || defined(__FreeBSD__) || defined(_HPUX)
+CustomCCode #include <inttypes.h>
+CustomCCode #include <stdlib.h>
+CustomCCode #include <X11/Xlib.h>
+CustomCCode #include <GL3/gl3.h>
+CustomCCode #endif
+CustomCCode /* Provide GLES #define for locally generated function pointer typedefs */
+CustomCCode #ifndef GL_APIENTRY
+CustomCCode #define GL_APIENTRY GLAPIENTRY
+CustomCCode #endif
diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java
new file mode 100755
index 000000000..6949cfb68
--- /dev/null
+++ b/make/config/jogl/glu-CustomJavaCode-base.java
@@ -0,0 +1,1469 @@
+/**
+ * Returns true if the specified GLU core- or extension-function can be
+ * successfully used through this GLU instance. By "successfully" we mean
+ * that the function is both <i>callable</i> on the machine running the
+ * program and <i>available</i> on the current display.<P>
+ *
+ * A GLU function is <i>callable</i> if it is a GLU core- or extension-function
+ * that is supported by the underlying GLU implementation. The function is
+ * <i>available</i> if the OpenGL implementation on the display meets the
+ * requirements of the GLU function being called (because GLU functions utilize
+ * OpenGL functions). <P>
+ *
+ * Whether or not a GLU function is <i>callable</i> is determined as follows:
+ * <ul>
+ * <li>If the function is a GLU core function (i.e., not an
+ * extension), <code>gluGetString(GLU_VERSION)</code> is used to determine the
+ * version number of the underlying GLU implementation on the host.
+ * then the function name is cross-referenced with that specification to
+ * see if it is part of that version's specification.
+ *
+ * <li> If the function is a GLU extension, the function name is
+ * cross-referenced with the list returned by
+ * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of
+ * the extensions that is supported by the underlying GLU implementation.
+ * </ul>
+ *
+ * Whether or not a GLU function is <i>available</i> is determined as follows:
+ * <ul>
+ * <li>If the function is a GLU core function then the function is first
+ * cross-referenced with the GLU specifications to find the minimum GLU
+ * version required to <i>call</i> that GLU function. Then the following table
+ * is consulted to determine the minimum GL version required for that version
+ * of GLU:
+ * <ul>
+ * <li> GLU 1.0 requires OpenGL 1.0
+ * <li> GLU 1.1 requires OpenGL 1.0
+ * <li> GLU 1.2 requires OpenGL 1.1
+ * <li> GLU 1.3 requires OpenGL 1.2
+ * </ul>
+ * Finally, <code>glGetString(GL_VERSION)</code> is used to determine the
+ * highest OpenGL version that both host and display support, and from that it
+ * is possible to determine if the GL facilities required by the GLU function
+ * are <i>available</i> on the display.
+ *
+ * <li> If the function is a GLU extension, the function name is
+ * cross-referenced with the list returned by
+ * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of
+ * the extensions that is supported by the underlying GLU implementation.
+ * </ul>
+ *
+ * <b>NOTE:</b>The availability of a function may change at runtime in
+ * response to changes in the display environment. For example, when a window
+ * is dragged from one display to another on a multi-display system, or when
+ * the properties of the display device are modified (e.g., changing the color
+ * depth of the display). Any application that is concerned with handling
+ * these situations correctly should confirm availability after a display
+ * change before calling a questionable OpenGL function. To detect a change in
+ * the display device, please see {@link
+ * GLEventListener#displayChanged(GLAutoDrawable,boolean,boolean)}.
+ *
+ * @param gluFunctionName the name of the OpenGL function (e.g., use
+ * "gluNurbsCallbackDataEXT" to check if the <code>
+ * gluNurbsCallbackDataEXT(GLUnurbs, GLvoid)</code> extension is available).
+ */
+public boolean isFunctionAvailable(String gluFunctionName)
+{
+ // if (useJavaMipmapCode) {
+ // All GLU functions are available in Java port
+ return true;
+ // }
+ // return (gluProcAddressTable.getAddressFor(gluFunctionName) != 0);
+}
+
+
+//----------------------------------------------------------------------
+// Utility routines
+//
+
+private static Class gl2Class;
+private static Class gl2es1Class;
+
+/**
+ * Instantiates a GLU implementation object in respect to the given GL profile
+ * of this thread current GL.
+ */
+public static final GLU createGLU() throws GLException {
+ return createGLU(getCurrentGL());
+}
+
+/**
+ * Instantiates a GLU implementation object in respect to the given GL profile
+ * of the given GL.
+ */
+public static final GLU createGLU(GL gl) throws GLException {
+ try {
+ Class c = null;
+ if(gl.isGL2()) {
+ if (gl2Class == null) {
+ gl2Class = Class.forName("javax.media.opengl.glu.gl2.GLUgl2");
+ }
+ c = gl2Class;
+ } else if (gl.isGL2ES1()) {
+ if (gl2es1Class == null) {
+ gl2es1Class = Class.forName("javax.media.opengl.glu.gl2es1.GLUgl2es1");
+ }
+ c = gl2es1Class;
+ }
+ if (c != null) {
+ return (GLU) c.newInstance();
+ }
+ } catch (Exception e) {
+ throw new GLException(e);
+ }
+ // There is no specialized ES 2 GLU at this time
+ /*
+ try {
+ if(GLProfile.GL2ES12.equals(profile) || GLProfile.GL2.equals(profile) || GLProfile.GLES2.equals(profile)) {
+ return (GLU) NWReflection.createInstance("javax.media.opengl.glu.gl2es2.GLUgl2es2");
+ }
+ } catch (GLException e) { e.printStackTrace(); }
+ */
+ return new GLU();
+}
+
+public GLU()
+{
+ this.project = new ProjectFloat();
+}
+
+public void destroy() {
+ if(null!=this.project) {
+ this.project.destroy();
+ this.project=null;
+ }
+}
+
+public static final GL getCurrentGL() throws GLException {
+ GLContext curContext = GLContext.getCurrent();
+ if (curContext == null) {
+ throw new GLException("No OpenGL context current on this thread");
+ }
+ return curContext.getGL();
+}
+
+public final String gluErrorString(int errorCode) {
+ return Error.gluErrorString(errorCode);
+}
+
+/* extName is an extension name.
+ * extString is a string of extensions separated by blank(s). There may or
+ * may not be leading or trailing blank(s) in extString.
+ * This works in cases of extensions being prefixes of another like
+ * GL_EXT_texture and GL_EXT_texture3D.
+ * Returns true if extName is found otherwise it returns false.
+ */
+public final boolean gluCheckExtension(java.lang.String extName, java.lang.String extString) {
+ return Registry.gluCheckExtension(extName, extString);
+}
+
+public final String gluGetString(int name) {
+ return Registry.gluGetString(name);
+}
+
+//----------------------------------------------------------------------
+// Tessellation routines
+//
+
+protected static boolean availableGLUtessellatorImpl = false;
+protected static boolean checkedGLUtessellatorImpl = false;
+
+protected static final void validateGLUtessellatorImpl() {
+ if(!checkedGLUtessellatorImpl) {
+ availableGLUtessellatorImpl = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl");
+ checkedGLUtessellatorImpl = true;
+ }
+ if(!availableGLUtessellatorImpl) {
+ throw new GLException("GLUtessellator not available (GLUtessellatorImpl)");
+ }
+}
+
+/*****************************************************************************
+ * <b>gluNewTess</b> creates and returns a new tessellation object. This
+ * object must be referred to when calling tesselation methods. A return
+ * value of null means that there was not enough memeory to allocate the
+ * object.
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * @return A new tessellation object.
+ *
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluDeleteTess gluDeleteTess
+ * @see #gluTessCallback gluTessCallback
+ ****************************************************************************/
+public static final GLUtessellator gluNewTess() {
+ validateGLUtessellatorImpl();
+ return GLUtessellatorImpl.gluNewTess();
+}
+
+/*****************************************************************************
+ * <b>gluDeleteTess</b> destroys the indicated tessellation object (which was
+ * created with {@link #gluNewTess gluNewTess}).
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * @param tessellator
+ * Specifies the tessellation object to destroy.
+ *
+ * @see #gluBeginPolygon gluBeginPolygon
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessCallback gluTessCallback
+ ****************************************************************************/
+public static final void gluDeleteTess(GLUtessellator tessellator) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluDeleteTess();
+}
+
+/*****************************************************************************
+ * <b>gluTessProperty</b> is used to control properites stored in a
+ * tessellation object. These properties affect the way that the polygons are
+ * interpreted and rendered. The legal value for <i>which</i> are as
+ * follows:<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * <b>GLU_TESS_WINDING_RULE</b>
+ * <UL>
+ * Determines which parts of the polygon are on the "interior".
+ * <em>value</em> may be set to one of
+ * <BR><b>GLU_TESS_WINDING_ODD</b>,
+ * <BR><b>GLU_TESS_WINDING_NONZERO</b>,
+ * <BR><b>GLU_TESS_WINDING_POSITIVE</b>, or
+ * <BR><b>GLU_TESS_WINDING_NEGATIVE</b>, or
+ * <BR><b>GLU_TESS_WINDING_ABS_GEQ_TWO</b>.<P>
+ *
+ * To understand how the winding rule works, consider that the input
+ * contours partition the plane into regions. The winding rule determines
+ * which of these regions are inside the polygon.<P>
+ *
+ * For a single contour C, the winding number of a point x is simply the
+ * signed number of revolutions we make around x as we travel once around C
+ * (where CCW is positive). When there are several contours, the individual
+ * winding numbers are summed. This procedure associates a signed integer
+ * value with each point x in the plane. Note that the winding number is
+ * the same for all points in a single region.<P>
+ *
+ * The winding rule classifies a region as "inside" if its winding number
+ * belongs to the chosen category (odd, nonzero, positive, negative, or
+ * absolute value of at least two). The previous GLU tessellator (prior to
+ * GLU 1.2) used the "odd" rule. The "nonzero" rule is another common way
+ * to define the interior. The other three rules are useful for polygon CSG
+ * operations.
+ * </UL>
+ * <BR><b>GLU_TESS_BOUNDARY_ONLY</b>
+ * <UL>
+ * Is a boolean value ("value" should be set to GL_TRUE or GL_FALSE). When
+ * set to GL_TRUE, a set of closed contours separating the polygon interior
+ * and exterior are returned instead of a tessellation. Exterior contours
+ * are oriented CCW with respect to the normal; interior contours are
+ * oriented CW. The <b>GLU_TESS_BEGIN</b> and <b>GLU_TESS_BEGIN_DATA</b>
+ * callbacks use the type GL_LINE_LOOP for each contour.
+ * </UL>
+ * <BR><b>GLU_TESS_TOLERANCE</b>
+ * <UL>
+ * Specifies a tolerance for merging features to reduce the size of the
+ * output. For example, two vertices that are very close to each other
+ * might be replaced by a single vertex. The tolerance is multiplied by the
+ * largest coordinate magnitude of any input vertex; this specifies the
+ * maximum distance that any feature can move as the result of a single
+ * merge operation. If a single feature takes part in several merge
+ * operations, the toal distance moved could be larger.<P>
+ *
+ * Feature merging is completely optional; the tolerance is only a hint.
+ * The implementation is free to merge in some cases and not in others, or
+ * to never merge features at all. The initial tolerance is 0.<P>
+ *
+ * The current implementation merges vertices only if they are exactly
+ * coincident, regardless of the current tolerance. A vertex is spliced
+ * into an edge only if the implementation is unable to distinguish which
+ * side of the edge the vertex lies on. Two edges are merged only when both
+ * endpoints are identical.
+ * </UL>
+ *
+ * @param tessellator
+ * Specifies the tessellation object created with
+ * {@link #gluNewTess gluNewTess}
+ * @param which
+ * Specifies the property to be set. Valid values are
+ * <b>GLU_TESS_WINDING_RULE</b>, <b>GLU_TESS_BOUNDARDY_ONLY</b>,
+ * <b>GLU_TESS_TOLERANCE</b>.
+ * @param value
+ * Specifices the value of the indicated property.
+ *
+ * @see #gluGetTessProperty gluGetTessProperty
+ * @see #gluNewTess gluNewTess
+ ****************************************************************************/
+public static final void gluTessProperty(GLUtessellator tessellator, int which, double value) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessProperty(which, value);
+}
+
+/*****************************************************************************
+ * <b>gluGetTessProperty</b> retrieves properties stored in a tessellation
+ * object. These properties affect the way that tessellation objects are
+ * interpreted and rendered. See the
+ * {@link #gluTessProperty gluTessProperty} reference
+ * page for information about the properties and what they do.
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ * @param which
+ * Specifies the property whose value is to be fetched. Valid values
+ * are <b>GLU_TESS_WINDING_RULE</b>, <b>GLU_TESS_BOUNDARY_ONLY</b>,
+ * and <b>GLU_TESS_TOLERANCES</b>.
+ * @param value
+ * Specifices an array into which the value of the named property is
+ * written.
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessProperty gluTessProperty
+ ****************************************************************************/
+public static final void gluGetTessProperty(GLUtessellator tessellator, int which, double[] value, int value_offset) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluGetTessProperty(which, value, value_offset);
+}
+
+/*****************************************************************************
+ * <b>gluTessNormal</b> describes a normal for a polygon that the program is
+ * defining. All input data will be projected onto a plane perpendicular to
+ * the one of the three coordinate axes before tessellation and all output
+ * triangles will be oriented CCW with repsect to the normal (CW orientation
+ * can be obtained by reversing the sign of the supplied normal). For
+ * example, if you know that all polygons lie in the x-y plane, call
+ * <b>gluTessNormal</b>(tess, 0.0, 0.0, 0.0) before rendering any polygons.<P>
+ *
+ * If the supplied normal is (0.0, 0.0, 0.0)(the initial value), the normal
+ * is determined as follows. The direction of the normal, up to its sign, is
+ * found by fitting a plane to the vertices, without regard to how the
+ * vertices are connected. It is expected that the input data lies
+ * approximately in the plane; otherwise, projection perpendicular to one of
+ * the three coordinate axes may substantially change the geometry. The sign
+ * of the normal is chosen so that the sum of the signed areas of all input
+ * contours is nonnegative (where a CCW contour has positive area).<P>
+ *
+ * The supplied normal persists until it is changed by another call to
+ * <b>gluTessNormal</b>.
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created by
+ * {@link #gluNewTess gluNewTess}).
+ * @param x
+ * Specifies the first component of the normal.
+ * @param y
+ * Specifies the second component of the normal.
+ * @param z
+ * Specifies the third component of the normal.
+ *
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessEndPolygon gluTessEndPolygon
+ ****************************************************************************/
+public static final void gluTessNormal(GLUtessellator tessellator, double x, double y, double z) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessNormal(x, y, z);
+}
+
+/*****************************************************************************
+ * <b>gluTessCallback</b> is used to indicate a callback to be used by a
+ * tessellation object. If the specified callback is already defined, then it
+ * is replaced. If <i>aCallback</i> is null, then the existing callback
+ * becomes undefined.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * These callbacks are used by the tessellation object to describe how a
+ * polygon specified by the user is broken into triangles. Note that there are
+ * two versions of each callback: one with user-specified polygon data and one
+ * without. If both versions of a particular callback are specified, then the
+ * callback with user-specified polygon data will be used. Note that the
+ * polygonData parameter used by some of the methods is a copy of the
+ * reference that was specified when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The legal callbacks are as follows:<P>
+ *
+ * <b>GLU_TESS_BEGIN</b>
+ * <UL>
+ * The begin callback is invoked like {@link javax.media.opengl.GL#glBegin
+ * glBegin} to indicate the start of a (triangle) primitive. The method
+ * takes a single argument of type int. If the
+ * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_FALSE</b>, then
+ * the argument is set to either <b>GL_TRIANGLE_FAN</b>,
+ * <b>GL_TRIANGLE_STRIP</b>, or <b>GL_TRIANGLES</b>. If the
+ * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_TRUE</b>, then the
+ * argument will be set to <b>GL_LINE_LOOP</b>. The method prototype for
+ * this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void begin(int type);</PRE><P>
+ *
+ * <b>GLU_TESS_BEGIN_DATA</b>
+ * <UL>
+ * The same as the <b>GLU_TESS_BEGIN</b> callback except
+ * that it takes an additional reference argument. This reference is
+ * identical to the opaque reference provided when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void beginData(int type, Object polygonData);</PRE>
+ *
+ * <b>GLU_TESS_EDGE_FLAG</b>
+ * <UL>
+ * The edge flag callback is similar to
+ * {@link javax.media.opengl.GL#glEdgeFlag glEdgeFlag}. The method takes
+ * a single boolean boundaryEdge that indicates which edges lie on the
+ * polygon boundary. If the boundaryEdge is <b>GL_TRUE</b>, then each vertex
+ * that follows begins an edge that lies on the polygon boundary, that is,
+ * an edge that separates an interior region from an exterior one. If the
+ * boundaryEdge is <b>GL_FALSE</b>, then each vertex that follows begins an
+ * edge that lies in the polygon interior. The edge flag callback (if
+ * defined) is invoked before the first vertex callback.<P>
+ *
+ * Since triangle fans and triangle strips do not support edge flags, the
+ * begin callback is not called with <b>GL_TRIANGLE_FAN</b> or
+ * <b>GL_TRIANGLE_STRIP</b> if a non-null edge flag callback is provided.
+ * (If the callback is initialized to null, there is no impact on
+ * performance). Instead, the fans and strips are converted to independent
+ * triangles. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void edgeFlag(boolean boundaryEdge);</PRE>
+ *
+ * <b>GLU_TESS_EDGE_FLAG_DATA</b>
+ * <UL>
+ * The same as the <b>GLU_TESS_EDGE_FLAG</b> callback except that it takes
+ * an additional reference argument. This reference is identical to the
+ * opaque reference provided when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void edgeFlagData(boolean boundaryEdge, Object polygonData);</PRE>
+ *
+ * <b>GLU_TESS_VERTEX</b>
+ * <UL>
+ * The vertex callback is invoked between the begin and end callbacks. It is
+ * similar to {@link javax.media.opengl.GL#glVertex3f glVertex3f}, and it
+ * defines the vertices of the triangles created by the tessellation
+ * process. The method takes a reference as its only argument. This
+ * reference is identical to the opaque reference provided by the user when
+ * the vertex was described (see
+ * {@link #gluTessVertex gluTessVertex}). The method
+ * prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void vertex(Object vertexData);</PRE>
+ *
+ * <b>GLU_TESS_VERTEX_DATA</b>
+ * <UL>
+ * The same as the <b>GLU_TESS_VERTEX</b> callback except that it takes an
+ * additional reference argument. This reference is identical to the opaque
+ * reference provided when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void vertexData(Object vertexData, Object polygonData);</PRE>
+ *
+ * <b>GLU_TESS_END</b>
+ * <UL>
+ * The end callback serves the same purpose as
+ * {@link javax.media.opengl.GL#glEnd glEnd}. It indicates the end of a
+ * primitive and it takes no arguments. The method prototype for this
+ * callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void end();</PRE>
+ *
+ * <b>GLU_TESS_END_DATA</b>
+ * <UL>
+ * The same as the <b>GLU_TESS_END</b> callback except that it takes an
+ * additional reference argument. This reference is identical to the opaque
+ * reference provided when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void endData(Object polygonData);</PRE>
+ *
+ * <b>GLU_TESS_COMBINE</b>
+ * <UL>
+ * The combine callback is called to create a new vertex when the
+ * tessellation detects an intersection, or wishes to merge features. The
+ * method takes four arguments: an array of three elements each of type
+ * double, an array of four references, an array of four elements each of
+ * type float, and a reference to a reference. The prototype is:
+ * </UL>
+ *
+ * <PRE>
+ * void combine(double[] coords, Object[] data,
+ * float[] weight, Object[] outData);</PRE>
+ *
+ * <UL>
+ * The vertex is defined as a linear combination of up to four existing
+ * vertices, stored in <i>data</i>. The coefficients of the linear
+ * combination are given by <i>weight</i>; these weights always add up to 1.
+ * All vertex pointers are valid even when some of the weights are 0.
+ * <i>coords</i> gives the location of the new vertex.<P>
+ *
+ * The user must allocate another vertex, interpolate parameters using
+ * <i>data</i> and <i>weight</i>, and return the new vertex pointer
+ * in <i>outData</i>. This handle is supplied during rendering callbacks.
+ * The user is responsible for freeing the memory some time after
+ * {@link #gluTessEndPolygon gluTessEndPolygon} is
+ * called.<P>
+ *
+ * For example, if the polygon lies in an arbitrary plane in 3-space, and a
+ * color is associated with each vertex, the <b>GLU_TESS_COMBINE</b>
+ * callback might look like this:
+ * </UL>
+ * <PRE>
+ * void myCombine(double[] coords, Object[] data,
+ * float[] weight, Object[] outData)
+ * {
+ * MyVertex newVertex = new MyVertex();
+ *
+ * newVertex.x = coords[0];
+ * newVertex.y = coords[1];
+ * newVertex.z = coords[2];
+ * newVertex.r = weight[0]*data[0].r +
+ * weight[1]*data[1].r +
+ * weight[2]*data[2].r +
+ * weight[3]*data[3].r;
+ * newVertex.g = weight[0]*data[0].g +
+ * weight[1]*data[1].g +
+ * weight[2]*data[2].g +
+ * weight[3]*data[3].g;
+ * newVertex.b = weight[0]*data[0].b +
+ * weight[1]*data[1].b +
+ * weight[2]*data[2].b +
+ * weight[3]*data[3].b;
+ * newVertex.a = weight[0]*data[0].a +
+ * weight[1]*data[1].a +
+ * weight[2]*data[2].a +
+ * weight[3]*data[3].a;
+ * outData = newVertex;
+ * }</PRE>
+ *
+ * <UL>
+ * If the tessellation detects an intersection, then the
+ * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback (see
+ * below) must be defined, and it must write a non-null reference into
+ * <i>outData</i>. Otherwise the <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> error
+ * occurs, and no output is generated.
+ * </UL>
+ *
+ * <b>GLU_TESS_COMBINE_DATA</b>
+ * <UL>
+ * The same as the <b>GLU_TESS_COMBINE</b> callback except that it takes an
+ * additional reference argument. This reference is identical to the opaque
+ * reference provided when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void combineData(double[] coords, Object[] data,
+ float[] weight, Object[] outData,
+ Object polygonData);</PRE>
+ *
+ * <b>GLU_TESS_ERROR</b>
+ * <UL>
+ * The error callback is called when an error is encountered. The one
+ * argument is of type int; it indicates the specific error that occurred
+ * and will be set to one of <b>GLU_TESS_MISSING_BEGIN_POLYGON</b>,
+ * <b>GLU_TESS_MISSING_END_POLYGON</b>,
+ * <b>GLU_TESS_MISSING_BEGIN_CONTOUR</b>,
+ * <b>GLU_TESS_MISSING_END_CONTOUR</b>, <b>GLU_TESS_COORD_TOO_LARGE</b>,
+ * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> or <b>GLU_OUT_OF_MEMORY</b>.
+ * Character strings describing these errors can be retrieved with the
+ * {@link #gluErrorString gluErrorString} call. The
+ * method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void error(int errnum);</PRE>
+ *
+ * <UL>
+ * The GLU library will recover from the first four errors by inserting the
+ * missing call(s). <b>GLU_TESS_COORD_TOO_LARGE</b> indicates that some
+ * vertex coordinate exceeded the predefined constant
+ * <b>GLU_TESS_MAX_COORD</b> in absolute value, and that the value has been
+ * clamped. (Coordinate values must be small enough so that two can be
+ * multiplied together without overflow.)
+ * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> indicates that the tessellation
+ * detected an intersection between two edges in the input data, and the
+ * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback was not
+ * provided. No output is generated. <b>GLU_OUT_OF_MEMORY</b> indicates that
+ * there is not enough memory so no output is generated.
+ * </UL>
+ *
+ * <b>GLU_TESS_ERROR_DATA</b>
+ * <UL>
+ * The same as the GLU_TESS_ERROR callback except that it takes an
+ * additional reference argument. This reference is identical to the opaque
+ * reference provided when
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * was called. The method prototype for this callback is:
+ * </UL>
+ *
+ * <PRE>
+ * void errorData(int errnum, Object polygonData);</PRE>
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ * @param which
+ * Specifies the callback being defined. The following values are
+ * valid: <b>GLU_TESS_BEGIN</b>, <b>GLU_TESS_BEGIN_DATA</b>,
+ * <b>GLU_TESS_EDGE_FLAG</b>, <b>GLU_TESS_EDGE_FLAG_DATA</b>,
+ * <b>GLU_TESS_VERTEX</b>, <b>GLU_TESS_VERTEX_DATA</b>,
+ * <b>GLU_TESS_END</b>, <b>GLU_TESS_END_DATA</b>,
+ * <b>GLU_TESS_COMBINE</b>, <b>GLU_TESS_COMBINE_DATA</b>,
+ * <b>GLU_TESS_ERROR</b>, and <b>GLU_TESS_ERROR_DATA</b>.
+ * @param aCallback
+ * Specifies the callback object to be called.
+ *
+ * @see javax.media.opengl.GL#glBegin glBegin
+ * @see javax.media.opengl.GL#glEdgeFlag glEdgeFlag
+ * @see javax.media.opengl.GL#glVertex3f glVertex3f
+ * @see #gluNewTess gluNewTess
+ * @see #gluErrorString gluErrorString
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessBeginContour gluTessBeginContour
+ * @see #gluTessProperty gluTessProperty
+ * @see #gluTessNormal gluTessNormal
+ ****************************************************************************/
+public static final void gluTessCallback(GLUtessellator tessellator, int which, GLUtessellatorCallback aCallback) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessCallback(which, aCallback);
+}
+
+/*****************************************************************************
+ * <b>gluTessVertex</b> describes a vertex on a polygon that the program
+ * defines. Successive <b>gluTessVertex</b> calls describe a closed contour.
+ * For example, to describe a quadrilateral <b>gluTessVertex</b> should be
+ * called four times. <b>gluTessVertex</b> can only be called between
+ * {@link #gluTessBeginContour gluTessBeginContour} and
+ * {@link #gluTessBeginContour gluTessEndContour}.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * <b>data</b> normally references to a structure containing the vertex
+ * location, as well as other per-vertex attributes such as color and normal.
+ * This reference is passed back to the user through the
+ * <b>GLU_TESS_VERTEX</b> or <b>GLU_TESS_VERTEX_DATA</b> callback after
+ * tessellation (see the {@link #gluTessCallback
+ * gluTessCallback} reference page).
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ * @param coords
+ * Specifies the coordinates of the vertex.
+ * @param data
+ * Specifies an opaque reference passed back to the program with the
+ * vertex callback (as specified by
+ * {@link #gluTessCallback gluTessCallback}).
+ *
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessBeginContour gluTessBeginContour
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessProperty gluTessProperty
+ * @see #gluTessNormal gluTessNormal
+ * @see #gluTessEndPolygon gluTessEndPolygon
+ ****************************************************************************/
+public static final void gluTessVertex(GLUtessellator tessellator, double[] coords, int coords_offset, Object data) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessVertex(coords, coords_offset, data);
+}
+
+/*****************************************************************************
+ * <b>gluTessBeginPolygon</b> and
+ * {@link #gluTessEndPolygon gluTessEndPolygon} delimit
+ * the definition of a convex, concave or self-intersecting polygon. Within
+ * each <b>gluTessBeginPolygon</b>/
+ * {@link #gluTessEndPolygon gluTessEndPolygon} pair,
+ * there must be one or more calls to
+ * {@link #gluTessBeginContour gluTessBeginContour}/
+ * {@link #gluTessEndContour gluTessEndContour}. Within
+ * each contour, there are zero or more calls to
+ * {@link #gluTessVertex gluTessVertex}. The vertices
+ * specify a closed contour (the last vertex of each contour is automatically
+ * linked to the first). See the {@link #gluTessVertex
+ * gluTessVertex}, {@link #gluTessBeginContour
+ * gluTessBeginContour}, and {@link #gluTessEndContour
+ * gluTessEndContour} reference pages for more details.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * <b>data</b> is a reference to a user-defined data structure. If the
+ * appropriate callback(s) are specified (see
+ * {@link #gluTessCallback gluTessCallback}), then this
+ * reference is returned to the callback method(s). Thus, it is a convenient
+ * way to store per-polygon information.<P>
+ *
+ * Once {@link #gluTessEndPolygon gluTessEndPolygon} is
+ * called, the polygon is tessellated, and the resulting triangles are
+ * described through callbacks. See
+ * {@link #gluTessCallback gluTessCallback} for
+ * descriptions of the callback methods.
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ * @param data
+ * Specifies a reference to user polygon data.
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessBeginContour gluTessBeginContour
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessProperty gluTessProperty
+ * @see #gluTessNormal gluTessNormal
+ * @see #gluTessEndPolygon gluTessEndPolygon
+ ****************************************************************************/
+public static final void gluTessBeginPolygon(GLUtessellator tessellator, Object data) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessBeginPolygon(data);
+}
+
+/*****************************************************************************
+ * <b>gluTessBeginContour</b> and
+ * {@link #gluTessEndContour gluTessEndContour} delimit
+ * the definition of a polygon contour. Within each
+ * <b>gluTessBeginContour</b>/
+ * {@link #gluTessEndContour gluTessEndContour} pair,
+ * there can be zero or more calls to
+ * {@link #gluTessVertex gluTessVertex}. The vertices
+ * specify a closed contour (the last vertex of each contour is automatically
+ * linked to the first). See the {@link #gluTessVertex
+ * gluTessVertex} reference page for more details. <b>gluTessBeginContour</b>
+ * can only be called between
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon} and
+ * {@link #gluTessEndPolygon gluTessEndPolygon}.
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessProperty gluTessProperty
+ * @see #gluTessNormal gluTessNormal
+ * @see #gluTessEndPolygon gluTessEndPolygon
+ ****************************************************************************/
+public static final void gluTessBeginContour(GLUtessellator tessellator) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessBeginContour();
+}
+
+/*****************************************************************************
+ * <b>gluTessEndContour</b> and
+ * {@link #gluTessBeginContour gluTessBeginContour}
+ * delimit the definition of a polygon contour. Within each
+ * {@link #gluTessBeginContour gluTessBeginContour}/
+ * <b>gluTessEndContour</b> pair, there can be zero or more calls to
+ * {@link #gluTessVertex gluTessVertex}. The vertices
+ * specify a closed contour (the last vertex of each contour is automatically
+ * linked to the first). See the {@link #gluTessVertex
+ * gluTessVertex} reference page for more details.
+ * {@link #gluTessBeginContour gluTessBeginContour} can
+ * only be called between {@link #gluTessBeginPolygon
+ * gluTessBeginPolygon} and
+ * {@link #gluTessEndPolygon gluTessEndPolygon}.
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessProperty gluTessProperty
+ * @see #gluTessNormal gluTessNormal
+ * @see #gluTessEndPolygon gluTessEndPolygon
+ ****************************************************************************/
+public static final void gluTessEndContour(GLUtessellator tessellator) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessEndContour();
+}
+
+/*****************************************************************************
+ * <b>gluTessEndPolygon</b> and
+ * {@link #gluTessBeginPolygon gluTessBeginPolygon}
+ * delimit the definition of a convex, concave or self-intersecting polygon.
+ * Within each {@link #gluTessBeginPolygon
+ * gluTessBeginPolygon}/<b>gluTessEndPolygon</b> pair, there must be one or
+ * more calls to {@link #gluTessBeginContour
+ * gluTessBeginContour}/{@link #gluTessEndContour
+ * gluTessEndContour}. Within each contour, there are zero or more calls to
+ * {@link #gluTessVertex gluTessVertex}. The vertices
+ * specify a closed contour (the last vertex of each contour is automatically
+ * linked to the first). See the {@link #gluTessVertex
+ * gluTessVertex}, {@link #gluTessBeginContour
+ * gluTessBeginContour} and {@link #gluTessEndContour
+ * gluTessEndContour} reference pages for more details.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * Once <b>gluTessEndPolygon</b> is called, the polygon is tessellated, and
+ * the resulting triangles are described through callbacks. See
+ * {@link #gluTessCallback gluTessCallback} for
+ * descriptions of the callback functions.
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessBeginContour gluTessBeginContour
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessProperty gluTessProperty
+ * @see #gluTessNormal gluTessNormal
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ ****************************************************************************/
+public static final void gluTessEndPolygon(GLUtessellator tessellator) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluTessEndPolygon();
+}
+
+/*****************************************************************************
+
+ * <b>gluBeginPolygon</b> and {@link #gluEndPolygon gluEndPolygon}
+ * delimit the definition of a nonconvex polygon. To define such a
+ * polygon, first call <b>gluBeginPolygon</b>. Then define the
+ * contours of the polygon by calling {@link #gluTessVertex
+ * gluTessVertex} for each vertex and {@link #gluNextContour
+ * gluNextContour} to start each new contour. Finally, call {@link
+ * #gluEndPolygon gluEndPolygon} to signal the end of the
+ * definition. See the {@link #gluTessVertex gluTessVertex} and {@link
+ * #gluNextContour gluNextContour} reference pages for more
+ * details.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * Once {@link #gluEndPolygon gluEndPolygon} is called,
+ * the polygon is tessellated, and the resulting triangles are described
+ * through callbacks. See {@link #gluTessCallback
+ * gluTessCallback} for descriptions of the callback methods.
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluNextContour gluNextContour
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessBeginContour gluTessBeginContour
+ ****************************************************************************/
+public static final void gluBeginPolygon(GLUtessellator tessellator) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluBeginPolygon();
+}
+
+/*****************************************************************************
+ * <b>gluNextContour</b> is used to describe polygons with multiple
+ * contours. After you describe the first contour through a series of
+ * {@link #gluTessVertex gluTessVertex} calls, a
+ * <b>gluNextContour</b> call indicates that the previous contour is complete
+ * and that the next contour is about to begin. Perform another series of
+ * {@link #gluTessVertex gluTessVertex} calls to
+ * describe the new contour. Repeat this process until all contours have been
+ * described.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * The type parameter defines what type of contour follows. The following
+ * values are valid. <P>
+ *
+ * <b>GLU_EXTERIOR</b>
+ * <UL>
+ * An exterior contour defines an exterior boundary of the polygon.
+ * </UL>
+ * <b>GLU_INTERIOR</b>
+ * <UL>
+ * An interior contour defines an interior boundary of the polygon (such as
+ * a hole).
+ * </UL>
+ * <b>GLU_UNKNOWN</b>
+ * <UL>
+ * An unknown contour is analyzed by the library to determine whether it is
+ * interior or exterior.
+ * </UL>
+ * <b>GLU_CCW, GLU_CW</b>
+ * <UL>
+ * The first <b>GLU_CCW</b> or <b>GLU_CW</b> contour defined is considered
+ * to be exterior. All other contours are considered to be exterior if they
+ * are oriented in the same direction (clockwise or counterclockwise) as the
+ * first contour, and interior if they are not. If one contour is of type
+ * <b>GLU_CCW</b> or <b>GLU_CW</b>, then all contours must be of the same
+ * type (if they are not, then all <b>GLU_CCW</b> and <b>GLU_CW</b> contours
+ * will be changed to <b>GLU_UNKNOWN</b>). Note that there is no
+ * real difference between the <b>GLU_CCW</b> and <b>GLU_CW</b> contour
+ * types.
+ * </UL><P>
+ *
+ * To define the type of the first contour, you can call <b>gluNextContour</b>
+ * before describing the first contour. If you do not call
+ * <b>gluNextContour</b> before the first contour, the first contour is marked
+ * <b>GLU_EXTERIOR</b>.<P>
+ *
+ * <UL>
+ * <b>Note:</b> The <b>gluNextContour</b> function is obsolete and is
+ * provided for backward compatibility only. The <b>gluNextContour</b>
+ * function is mapped to {@link #gluTessEndContour
+ * gluTessEndContour} followed by
+ * {@link #gluTessBeginContour gluTessBeginContour}.
+ * </UL>
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ * @param type
+ * The type of the contour being defined.
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluTessBeginContour gluTessBeginContour
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessEndContour gluTessEndContour
+ * @see #gluTessVertex gluTessVertex
+ ****************************************************************************/
+public static final void gluNextContour(GLUtessellator tessellator, int type) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluNextContour(type);
+}
+
+/*****************************************************************************
+ * <b>gluEndPolygon</b> and {@link #gluBeginPolygon
+ * gluBeginPolygon} delimit the definition of a nonconvex polygon. To define
+ * such a polygon, first call {@link #gluBeginPolygon
+ * gluBeginPolygon}. Then define the contours of the polygon by calling
+ * {@link #gluTessVertex gluTessVertex} for each vertex
+ * and {@link #gluNextContour gluNextContour} to start
+ * each new contour. Finally, call <b>gluEndPolygon</b> to signal the end of
+ * the definition. See the {@link #gluTessVertex
+ * gluTessVertex} and {@link #gluNextContour
+ * gluNextContour} reference pages for more details.<P>
+ *
+ * Optional, throws GLException if not available in profile
+ *
+ * Once <b>gluEndPolygon</b> is called, the polygon is tessellated, and the
+ * resulting triangles are described through callbacks. See
+ * {@link #gluTessCallback gluTessCallback} for
+ * descriptions of the callback methods.
+ *
+ * @param tessellator
+ * Specifies the tessellation object (created with
+ * {@link #gluNewTess gluNewTess}).
+ *
+ * @see #gluNewTess gluNewTess
+ * @see #gluNextContour gluNextContour
+ * @see #gluTessCallback gluTessCallback
+ * @see #gluTessVertex gluTessVertex
+ * @see #gluTessBeginPolygon gluTessBeginPolygon
+ * @see #gluTessBeginContour gluTessBeginContour
+ ****************************************************************************/
+public static final void gluEndPolygon(GLUtessellator tessellator) {
+ validateGLUtessellatorImpl();
+ GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
+ tess.gluEndPolygon();
+}
+
+// Boolean
+public static final int GLU_FALSE = 0;
+public static final int GLU_TRUE = 1;
+
+// String Name
+public static final int GLU_VERSION = 100800;
+public static final int GLU_EXTENSIONS = 100801;
+
+// Extensions
+public static final String versionString = "1.3";
+public static final String extensionString = "GLU_EXT_nurbs_tessellator " +
+ "GLU_EXT_object_space_tess ";
+
+// ErrorCode
+public static final int GLU_INVALID_ENUM = 100900;
+public static final int GLU_INVALID_VALUE = 100901;
+public static final int GLU_OUT_OF_MEMORY = 100902;
+public static final int GLU_INVALID_OPERATION = 100904;
+
+
+// QuadricDrawStyle
+public static final int GLU_POINT = 100010;
+public static final int GLU_LINE = 100011;
+public static final int GLU_FILL = 100012;
+public static final int GLU_SILHOUETTE = 100013;
+
+// QuadricCallback
+// GLU_ERROR
+
+// QuadricNormal
+public static final int GLU_SMOOTH = 100000;
+public static final int GLU_FLAT = 100001;
+public static final int GLU_NONE = 100002;
+
+// QuadricOrientation
+public static final int GLU_OUTSIDE = 100020;
+public static final int GLU_INSIDE = 100021;
+
+// NurbsDisplay
+// GLU_FILL
+//public static final int GLU_OUTLINE_POLYGON = 100240;
+//public static final int GLU_OUTLINE_PATCH = 100241;
+
+// NurbsCallback
+//public static final int GLU_NURBS_ERROR = 100103;
+public static final int GLU_ERROR = 100103;
+//public static final int GLU_NURBS_BEGIN = 100164;
+//public static final int GLU_NURBS_BEGIN_EXT = 100164;
+//public static final int GLU_NURBS_VERTEX = 100165;
+//public static final int GLU_NURBS_VERTEX_EXT = 100165;
+//public static final int GLU_NURBS_NORMAL = 100166;
+//public static final int GLU_NURBS_NORMAL_EXT = 100166;
+//public static final int GLU_NURBS_COLOR = 100167;
+//public static final int GLU_NURBS_COLOR_EXT = 100167;
+//public static final int GLU_NURBS_TEXTURE_COORD = 100168;
+//public static final int GLU_NURBS_TEX_COORD_EXT = 100168;
+//public static final int GLU_NURBS_END = 100169;
+//public static final int GLU_NURBS_END_EXT = 100169;
+//public static final int GLU_NURBS_BEGIN_DATA = 100170;
+//public static final int GLU_NURBS_BEGIN_DATA_EXT = 100170;
+//public static final int GLU_NURBS_VERTEX_DATA = 100171;
+//public static final int GLU_NURBS_VERTEX_DATA_EXT = 100171;
+//public static final int GLU_NURBS_NORMAL_DATA = 100172;
+//public static final int GLU_NURBS_NORMAL_DATA_EXT = 100172;
+//public static final int GLU_NURBS_COLOR_DATA = 100173;
+//public static final int GLU_NURBS_COLOR_DATA_EXT = 100173;
+//public static final int GLU_NURBS_TEXTURE_COORD_DATA = 100174;
+//public static final int GLU_NURBS_TEX_COORD_DATA_EXT = 100174;
+//public static final int GLU_NURBS_END_DATA = 100175;
+//public static final int GLU_NURBS_END_DATA_EXT = 100175;
+
+// NurbsError
+//public static final int GLU_NURBS_ERROR1 = 100251;
+//public static final int GLU_NURBS_ERROR2 = 100252;
+//public static final int GLU_NURBS_ERROR3 = 100253;
+//public static final int GLU_NURBS_ERROR4 = 100254;
+//public static final int GLU_NURBS_ERROR5 = 100255;
+//public static final int GLU_NURBS_ERROR6 = 100256;
+//public static final int GLU_NURBS_ERROR7 = 100257;
+//public static final int GLU_NURBS_ERROR8 = 100258;
+//public static final int GLU_NURBS_ERROR9 = 100259;
+//public static final int GLU_NURBS_ERROR10 = 100260;
+//public static final int GLU_NURBS_ERROR11 = 100261;
+//public static final int GLU_NURBS_ERROR12 = 100262;
+//public static final int GLU_NURBS_ERROR13 = 100263;
+//public static final int GLU_NURBS_ERROR14 = 100264;
+//public static final int GLU_NURBS_ERROR15 = 100265;
+//public static final int GLU_NURBS_ERROR16 = 100266;
+//public static final int GLU_NURBS_ERROR17 = 100267;
+//public static final int GLU_NURBS_ERROR18 = 100268;
+//public static final int GLU_NURBS_ERROR19 = 100269;
+//public static final int GLU_NURBS_ERROR20 = 100270;
+//public static final int GLU_NURBS_ERROR21 = 100271;
+//public static final int GLU_NURBS_ERROR22 = 100272;
+//public static final int GLU_NURBS_ERROR23 = 100273;
+//public static final int GLU_NURBS_ERROR24 = 100274;
+//public static final int GLU_NURBS_ERROR25 = 100275;
+//public static final int GLU_NURBS_ERROR26 = 100276;
+//public static final int GLU_NURBS_ERROR27 = 100277;
+//public static final int GLU_NURBS_ERROR28 = 100278;
+//public static final int GLU_NURBS_ERROR29 = 100279;
+//public static final int GLU_NURBS_ERROR30 = 100280;
+//public static final int GLU_NURBS_ERROR31 = 100281;
+//public static final int GLU_NURBS_ERROR32 = 100282;
+//public static final int GLU_NURBS_ERROR33 = 100283;
+//public static final int GLU_NURBS_ERROR34 = 100284;
+//public static final int GLU_NURBS_ERROR35 = 100285;
+//public static final int GLU_NURBS_ERROR36 = 100286;
+//public static final int GLU_NURBS_ERROR37 = 100287;
+
+// NurbsProperty
+//public static final int GLU_AUTO_LOAD_MATRIX = 100200;
+//public static final int GLU_CULLING = 100201;
+//public static final int GLU_SAMPLING_TOLERANCE = 100203;
+//public static final int GLU_DISPLAY_MODE = 100204;
+//public static final int GLU_PARAMETRIC_TOLERANCE = 100202;
+//public static final int GLU_SAMPLING_METHOD = 100205;
+//public static final int GLU_U_STEP = 100206;
+//public static final int GLU_V_STEP = 100207;
+//public static final int GLU_NURBS_MODE = 100160;
+//public static final int GLU_NURBS_MODE_EXT = 100160;
+//public static final int GLU_NURBS_TESSELLATOR = 100161;
+//public static final int GLU_NURBS_TESSELLATOR_EXT = 100161;
+//public static final int GLU_NURBS_RENDERER = 100162;
+//public static final int GLU_NURBS_RENDERER_EXT = 100162;
+
+// NurbsSampling
+//public static final int GLU_OBJECT_PARAMETRIC_ERROR = 100208;
+//public static final int GLU_OBJECT_PARAMETRIC_ERROR_EXT = 100208;
+//public static final int GLU_OBJECT_PATH_LENGTH = 100209;
+//public static final int GLU_OBJECT_PATH_LENGTH_EXT = 100209;
+//public static final int GLU_PATH_LENGTH = 100215;
+//public static final int GLU_PARAMETRIC_ERROR = 100216;
+//public static final int GLU_DOMAIN_DISTANCE = 100217;
+
+// NurbsTrim
+//public static final int GLU_MAP1_TRIM_2 = 100210;
+//public static final int GLU_MAP1_TRIM_3 = 100211;
+
+// QuadricCallback
+// GLU_ERROR
+
+// TessCallback
+public static final int GLU_TESS_BEGIN = 100100;
+public static final int GLU_BEGIN = 100100;
+public static final int GLU_TESS_VERTEX = 100101;
+public static final int GLU_VERTEX = 100101;
+public static final int GLU_TESS_END = 100102;
+public static final int GLU_END = 100102;
+public static final int GLU_TESS_ERROR = 100103;
+public static final int GLU_TESS_EDGE_FLAG = 100104;
+public static final int GLU_EDGE_FLAG = 100104;
+public static final int GLU_TESS_COMBINE = 100105;
+public static final int GLU_TESS_BEGIN_DATA = 100106;
+public static final int GLU_TESS_VERTEX_DATA = 100107;
+public static final int GLU_TESS_END_DATA = 100108;
+public static final int GLU_TESS_ERROR_DATA = 100109;
+public static final int GLU_TESS_EDGE_FLAG_DATA = 100110;
+public static final int GLU_TESS_COMBINE_DATA = 100111;
+
+// TessContour
+public static final int GLU_CW = 100120;
+public static final int GLU_CCW = 100121;
+public static final int GLU_INTERIOR = 100122;
+public static final int GLU_EXTERIOR = 100123;
+public static final int GLU_UNKNOWN = 100124;
+
+// TessProperty
+public static final int GLU_TESS_WINDING_RULE = 100140;
+public static final int GLU_TESS_BOUNDARY_ONLY = 100141;
+public static final int GLU_TESS_TOLERANCE = 100142;
+// JOGL-specific boolean property, false by default, that may improve the tessellation
+public static final int GLU_TESS_AVOID_DEGENERATE_TRIANGLES = 100149;
+
+// TessError
+public static final int GLU_TESS_ERROR1 = 100151;
+public static final int GLU_TESS_ERROR2 = 100152;
+public static final int GLU_TESS_ERROR3 = 100153;
+public static final int GLU_TESS_ERROR4 = 100154;
+public static final int GLU_TESS_ERROR5 = 100155;
+public static final int GLU_TESS_ERROR6 = 100156;
+public static final int GLU_TESS_ERROR7 = 100157;
+public static final int GLU_TESS_ERROR8 = 100158;
+public static final int GLU_TESS_MISSING_BEGIN_POLYGON = 100151;
+public static final int GLU_TESS_MISSING_BEGIN_CONTOUR = 100152;
+public static final int GLU_TESS_MISSING_END_POLYGON = 100153;
+public static final int GLU_TESS_MISSING_END_CONTOUR = 100154;
+public static final int GLU_TESS_COORD_TOO_LARGE = 100155;
+public static final int GLU_TESS_NEED_COMBINE_CALLBACK = 100156;
+
+// TessWinding
+public static final int GLU_TESS_WINDING_ODD = 100130;
+public static final int GLU_TESS_WINDING_NONZERO = 100131;
+public static final int GLU_TESS_WINDING_POSITIVE = 100132;
+public static final int GLU_TESS_WINDING_NEGATIVE = 100133;
+public static final int GLU_TESS_WINDING_ABS_GEQ_TWO = 100134;
+public static final double GLU_TESS_MAX_COORD = 1.0e150;
+
+//----------------------------------------------------------------------
+// Quadric functionality
+//
+
+protected static boolean availableGLUquadricImpl = false;
+protected static boolean checkedGLUquadricImpl = false;
+protected static volatile Object syncObject = new Object();
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+protected static final void validateGLUquadricImpl() {
+ if(!checkedGLUquadricImpl) {
+ synchronized (syncObject) {
+ if(!checkedGLUquadricImpl) {
+ availableGLUquadricImpl = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.GLUquadricImpl");
+ checkedGLUquadricImpl = true;
+ }
+ }
+ }
+ if(!availableGLUquadricImpl) {
+ throw new GLException("GLUquadric not available (GLUquadricImpl)");
+ }
+}
+
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluCylinder(GLUquadric * quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); </code> */
+public final void gluCylinder(GLUquadric quad, double base, double top, double height, int slices, int stacks) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).drawCylinder(getCurrentGL(), (float) base, (float) top, (float) height, slices, stacks);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluDeleteQuadric(GLUquadric * quad); </code> */
+public final void gluDeleteQuadric(GLUquadric quad) {
+ validateGLUquadricImpl();
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluDisk(GLUquadric * quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); </code> */
+public final void gluDisk(GLUquadric quad, double inner, double outer, int slices, int loops) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).drawDisk(getCurrentGL(), (float) inner, (float) outer, slices, loops);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> GLUquadric * gluNewQuadric(void); </code> */
+public final GLUquadric gluNewQuadric() {
+ return gluNewQuadric(false);
+}
+
+public final GLUquadric gluNewQuadric(boolean useGLSL) {
+ GL gl = getCurrentGL();
+ if(useGLSL && !gl.isGL2ES2()) {
+ throw new GLException("GLUquadric GLSL implementation not supported for profile: "+gl);
+ }
+ validateGLUquadricImpl();
+ return new GLUquadricImpl(gl, useGLSL);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluPartialDisk(GLUquadric * quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); </code> */
+public final void gluPartialDisk(GLUquadric quad, double inner, double outer, int slices, int loops, double start, double sweep) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).drawPartialDisk(getCurrentGL(), (float) inner, (float) outer, slices, loops, (float) start, (float) sweep);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricDrawStyle(GLUquadric * quad, GLenum draw); </code> */
+public final void gluQuadricDrawStyle(GLUquadric quad, int draw) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).setDrawStyle(draw);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricNormals(GLUquadric * quad, GLenum normal); </code> */
+public final void gluQuadricNormals(GLUquadric quad, int normal) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).setNormals(normal);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricOrientation(GLUquadric * quad, GLenum orientation); </code> */
+public final void gluQuadricOrientation(GLUquadric quad, int orientation) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).setOrientation(orientation);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricTexture(GLUquadric * quad, GLboolean texture); </code> */
+public final void gluQuadricTexture(GLUquadric quad, boolean texture) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).setTextureFlag(texture);
+}
+
+/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluSphere(GLUquadric * quad, GLdouble radius, GLint slices, GLint stacks); </code> */
+public final void gluSphere(GLUquadric quad, double radius, int slices, int stacks) {
+ validateGLUquadricImpl();
+ ((GLUquadricImpl) quad).drawSphere(getCurrentGL(), (float) radius, slices, stacks);
+}
+
+//----------------------------------------------------------------------
+// Projection routines
+//
+
+private ProjectFloat project;
+
+public void gluOrtho2D(float left, float right, float bottom, float top) {
+ project.gluOrtho2D(getCurrentGL().getGL2ES1(), left, right, bottom, top);
+}
+
+public void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
+ project.gluPerspective(getCurrentGL().getGL2ES1(), fovy, aspect, zNear, zFar);
+}
+
+public void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) {
+ project.gluLookAt(getCurrentGL().getGL2ES1(), eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
+}
+
+/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
+ * <P> Accepts the outgoing window coordinates as a single array.
+ */
+public boolean gluProject(float objX, float objY, float objZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] winPos, int winPos_offset) {
+ return project.gluProject(objX, objY, objZ, model, model_offset, proj, proj_offset, view, view_offset, winPos, winPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
+ * <P> Accepts the outgoing window coordinates as a single buffer.
+ */
+public boolean gluProject(float objX, float objY, float objZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer winPos) {
+ return project.gluProject(objX, objY, objZ, model, proj, view, winPos);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
+ * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array.
+ */
+public boolean gluUnProject(float winX, float winY, float winZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, int objPos_offset) {
+ return project.gluUnProject(winX, winY, winZ, model, model_offset, proj, proj_offset, view, view_offset, objPos, objPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
+ * <P> Accepts the outgoing object coordinates (a 3-vector) as a single buffer.
+ */
+public boolean gluUnProject(float winX, float winY, float winZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer objPos) {
+ return project.gluUnProject(winX, winY, winZ, model, proj, view, objPos);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
+ * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array.
+ */
+public boolean gluUnProject4(float winX, float winY, float winZ, float clipW, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float nearVal, float farVal, float[] objPos, int objPos_offset) {
+ return project.gluUnProject4(winX, winY, winZ, clipW, model, model_offset, proj, proj_offset, view, view_offset, nearVal, farVal, objPos, objPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
+ * <P> Accepts the outgoing object coordinates (a 4-vector) as a single buffer.
+ */
+public boolean gluUnProject4(float winX, float winY, float winZ, float clipW, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, float nearVal, float farVal, java.nio.FloatBuffer objPos) {
+ return project.gluUnProject4(winX, winY, winZ, clipW, model, proj, view, nearVal, farVal, objPos);
+}
+
+public void gluPickMatrix(float x, float y, float delX, float delY, int[] viewport, int viewport_offset) {
+ project.gluPickMatrix(getCurrentGL().getGL2ES1(), x, y, delX, delY, viewport, viewport_offset);
+}
+
+public void gluPickMatrix(float x, float y, float delX, float delY, java.nio.IntBuffer viewport) {
+ project.gluPickMatrix(getCurrentGL().getGL2ES1(), x, y, delX, delY, viewport);
+}
+
+public void gluOrtho2D(double left, double right, double bottom, double top) {
+ project.gluOrtho2D(getCurrentGL().getGL2ES1(), (float)left, (float)right, (float)bottom, (float)top);
+}
+
+public void gluPerspective(double fovy, double aspect, double zNear, double zFar) {
+ project.gluPerspective(getCurrentGL().getGL2ES1(), (float)fovy, (float)aspect, (float)zNear, (float)zFar);
+}
+
+public void gluLookAt(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ) {
+ project.gluLookAt(getCurrentGL().getGL2ES1(), (float)eyeX, (float)eyeY, (float)eyeZ, (float)centerX, (float)centerY, (float)centerZ, (float)upX, (float)upY, (float)upZ);
+}
+
+/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
+ * <P> Accepts the outgoing window coordinates as a single array.
+ */
+public boolean gluProject(double objX, double objY, double objZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] winPos, int winPos_offset) {
+ return project.gluProject((float)objX, (float)objY, (float)objZ, InternalBufferUtil.getFloatArray(model), model_offset, InternalBufferUtil.getFloatArray(proj), proj_offset, view, view_offset, InternalBufferUtil.getFloatArray(winPos), winPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
+ * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array.
+ */
+public boolean gluUnProject(double winX, double winY, double winZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] objPos, int objPos_offset) {
+ return project.gluUnProject((float)winX, (float)winY, (float)winZ, InternalBufferUtil.getFloatArray(model), model_offset, InternalBufferUtil.getFloatArray(proj), proj_offset, view, view_offset, InternalBufferUtil.getFloatArray(objPos), objPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
+ * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array.
+ */
+public boolean gluUnProject4(double winX, double winY, double winZ, double clipW, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double nearVal, double farVal, double[] objPos, int objPos_offset) {
+ return project.gluUnProject4((float)winX, (float)winY, (float)winZ, (float)clipW, InternalBufferUtil.getFloatArray(model), model_offset, InternalBufferUtil.getFloatArray(proj), proj_offset, view, view_offset, (float)nearVal, (float)farVal, InternalBufferUtil.getFloatArray(objPos), objPos_offset);
+}
+
+public void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset) {
+ project.gluPickMatrix(getCurrentGL().getGL2ES1(), (float)x, (float)y, (float)delX, (float)delY, viewport, viewport_offset);
+}
+
+public void gluPickMatrix(double x, double y, double delX, double delY, IntBuffer viewport) {
+ project.gluPickMatrix(getCurrentGL().getGL2ES1(), (float)x, (float)y, (float)delX, (float)delY, viewport);
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluScaleImage( int format, int widthin, int heightin,
+ int typein, java.nio.Buffer datain, int widthout, int heightout,
+ int typeout, java.nio.Buffer dataout ) {
+ throw new GLException("not implemented");
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluBuild1DMipmapLevels( int target, int internalFormat, int width,
+ int format, int type, int userLevel, int baseLevel, int maxLevel,
+ java.nio.Buffer data ) {
+ throw new GLException("not implemented");
+}
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluBuild1DMipmaps( int target, int internalFormat, int width,
+ int format, int type, java.nio.Buffer data ) {
+ throw new GLException("not implemented");
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluBuild2DMipmapLevels( int target, int internalFormat, int width,
+ int height, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, java.nio.Buffer data ) {
+ throw new GLException("not implemented");
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluBuild2DMipmaps( int target, int internalFormat, int width,
+ int height, int format, int type, java.nio.Buffer data ) {
+ throw new GLException("not implemented");
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluBuild3DMipmapLevels( int target, int internalFormat, int width,
+ int height, int depth, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, java.nio.Buffer data) {
+ throw new GLException("not implemented");
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public int gluBuild3DMipmaps( int target, int internalFormat, int width,
+ int height, int depth, int format, int type, java.nio.Buffer data ) {
+ throw new GLException("not implemented");
+}
+
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2.java b/make/config/jogl/glu-CustomJavaCode-gl2.java
new file mode 100644
index 000000000..5b2a3ed89
--- /dev/null
+++ b/make/config/jogl/glu-CustomJavaCode-gl2.java
@@ -0,0 +1,562 @@
+private static boolean useJavaMipmapCode = true;
+
+static {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String val = System.getProperty("jogl.glu.nojava");
+ if (val != null && !val.toLowerCase().equals("false")) {
+ useJavaMipmapCode = false;
+ }
+ return null;
+ }
+ });
+}
+
+/**
+ * Instantiates a new OpenGL Utility Library object. A GLU object may
+ * be instantiated at any point in the application and is not
+ * inherently tied to any particular OpenGL context; however, the GLU
+ * object may only be used when an OpenGL context is current on the
+ * current thread. Attempts to call most of the methods in the GLU
+ * library when no OpenGL context is current will cause an exception
+ * to be thrown.
+ *
+ * <P>
+ *
+ * The returned GLU object is not guaranteed to be thread-safe and
+ * should only be used from one thread at a time. Multiple GLU objects
+ * may be instantiated to be used from different threads
+ * simultaneously.
+ */
+
+public GLUgl2()
+{
+ this.project = new ProjectDouble();
+}
+
+public void destroy() {
+ if(null!=this.project) {
+ this.project.destroy();
+ this.project=null;
+ }
+ super.destroy();
+}
+
+
+//----------------------------------------------------------------------
+// Utility routines
+//
+
+public static final GL2 getCurrentGL2() throws GLException {
+ GLContext curContext = GLContext.getCurrent();
+ if (curContext == null) {
+ throw new GLException("No OpenGL context current on this thread");
+ }
+ return curContext.getGL().getGL2();
+}
+
+/**
+ * Returns true if the specified GLU core- or extension-function can be
+ * successfully used through this GLU instance. By "successfully" we mean
+ * that the function is both <i>callable</i> on the machine running the
+ * program and <i>available</i> on the current display.<P>
+ *
+ * A GLU function is <i>callable</i> if it is a GLU core- or extension-function
+ * that is supported by the underlying GLU implementation. The function is
+ * <i>available</i> if the OpenGL implementation on the display meets the
+ * requirements of the GLU function being called (because GLU functions utilize
+ * OpenGL functions). <P>
+ *
+ * Whether or not a GLU function is <i>callable</i> is determined as follows:
+ * <ul>
+ * <li>If the function is a GLU core function (i.e., not an
+ * extension), <code>gluGetString(GLU_VERSION)</code> is used to determine the
+ * version number of the underlying GLU implementation on the host.
+ * then the function name is cross-referenced with that specification to
+ * see if it is part of that version's specification.
+ *
+ * <li> If the function is a GLU extension, the function name is
+ * cross-referenced with the list returned by
+ * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of
+ * the extensions that is supported by the underlying GLU implementation.
+ * </ul>
+ *
+ * Whether or not a GLU function is <i>available</i> is determined as follows:
+ * <ul>
+ * <li>If the function is a GLU core function then the function is first
+ * cross-referenced with the GLU specifications to find the minimum GLU
+ * version required to <i>call</i> that GLU function. Then the following table
+ * is consulted to determine the minimum GL version required for that version
+ * of GLU:
+ * <ul>
+ * <li> GLU 1.0 requires OpenGL 1.0
+ * <li> GLU 1.1 requires OpenGL 1.0
+ * <li> GLU 1.2 requires OpenGL 1.1
+ * <li> GLU 1.3 requires OpenGL 1.2
+ * </ul>
+ * Finally, <code>glGetString(GL_VERSION)</code> is used to determine the
+ * highest OpenGL version that both host and display support, and from that it
+ * is possible to determine if the GL facilities required by the GLU function
+ * are <i>available</i> on the display.
+ *
+ * <li> If the function is a GLU extension, the function name is
+ * cross-referenced with the list returned by
+ * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of
+ * the extensions that is supported by the underlying GLU implementation.
+ * </ul>
+ *
+ * <b>NOTE:</b>The availability of a function may change at runtime in
+ * response to changes in the display environment. For example, when a window
+ * is dragged from one display to another on a multi-display system, or when
+ * the properties of the display device are modified (e.g., changing the color
+ * depth of the display). Any application that is concerned with handling
+ * these situations correctly should confirm availability after a display
+ * change before calling a questionable OpenGL function. To detect a change in
+ * the display device, please see {@link
+ * GLEventListener#displayChanged(GLAutoDrawable,boolean,boolean)}.
+ *
+ * @param gluFunctionName the name of the OpenGL function (e.g., use
+ * "gluNurbsCallbackDataEXT" to check if the <code>
+ * gluNurbsCallbackDataEXT(GLUnurbs, GLvoid)</code> extension is available).
+ */
+public final boolean isFunctionAvailable(String gluFunctionName)
+{
+ if (useJavaMipmapCode) {
+ // All GLU functions are available in Java port
+ return true;
+ }
+ return (gluProcAddressTable.getAddressFor(gluFunctionName) != 0);
+}
+
+//----------------------------------------------------------------------
+// Projection routines
+//
+
+private ProjectDouble project;
+
+public final void gluOrtho2D(float left, float right, float bottom, float top) {
+ project.gluOrtho2D(getCurrentGL2(), (double)left, (double)right, (double)bottom, (double)top);
+
+}
+
+public final void gluOrtho2D(double left, double right, double bottom, double top) {
+ project.gluOrtho2D(getCurrentGL2(), left, right, bottom, top);
+}
+
+public final void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
+ project.gluPerspective(getCurrentGL2(), (double)fovy, (double)aspect, (double)zNear, (double)zFar);
+}
+
+public final void gluPerspective(double fovy, double aspect, double zNear, double zFar) {
+ project.gluPerspective(getCurrentGL2(), fovy, aspect, zNear, zFar);
+}
+
+public final void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) {
+ project.gluLookAt(getCurrentGL2(), (double)eyeX, (double)eyeY, (double)eyeZ, (double)centerX, (double)centerY, (double)centerZ, (double)upX, (double)upY, (double)upZ);
+}
+
+public final void gluLookAt(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ) {
+ project.gluLookAt(getCurrentGL2(), eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
+}
+
+/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
+ * <P> Accepts the outgoing window coordinates as a single array.
+ */
+public final boolean gluProject(double objX, double objY, double objZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] winPos, int winPos_offset) {
+ return project.gluProject(objX, objY, objZ, model, model_offset, proj, proj_offset, view, view_offset, winPos, winPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
+ * <P> Accepts the outgoing window coordinates as a single buffer.
+ */
+public final boolean gluProject(double objX, double objY, double objZ, DoubleBuffer model, DoubleBuffer proj, IntBuffer view, DoubleBuffer winPos) {
+ return project.gluProject(objX, objY, objZ, model, proj, view, winPos);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
+ * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array.
+ */
+public final boolean gluUnProject(double winX, double winY, double winZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] objPos, int objPos_offset) {
+ return project.gluUnProject(winX, winY, winZ, model, model_offset, proj, proj_offset, view, view_offset, objPos, objPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
+ * <P> Accepts the outgoing object coordinates (a 3-vector) as a single buffer.
+ */
+public final boolean gluUnProject(double winX, double winY, double winZ, DoubleBuffer model, DoubleBuffer proj, IntBuffer view, DoubleBuffer objPos) {
+ return project.gluUnProject(winX, winY, winZ, model, proj, view, objPos);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
+ * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array.
+ */
+public final boolean gluUnProject4(double winX, double winY, double winZ, double clipW, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double nearVal, double farVal, double[] objPos, int objPos_offset) {
+ return project.gluUnProject4(winX, winY, winZ, clipW, model, model_offset, proj, proj_offset, view, view_offset, nearVal, farVal, objPos, objPos_offset);
+}
+
+/** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
+ * <P> Accepts the outgoing object coordinates (a 4-vector) as a single buffer.
+ */
+public final boolean gluUnProject4(double winX, double winY, double winZ, double clipW, DoubleBuffer model, DoubleBuffer proj, IntBuffer view, double nearVal, double farVal, DoubleBuffer objPos) {
+ return project.gluUnProject4(winX, winY, winZ, clipW, model, proj, view, nearVal, farVal, objPos);
+}
+
+public final void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset) {
+ project.gluPickMatrix(getCurrentGL2(), x, y, delX, delY, viewport, viewport_offset);
+}
+
+public final void gluPickMatrix(double x, double y, double delX, double delY, IntBuffer viewport) {
+ project.gluPickMatrix(getCurrentGL2(), x, y, delX, delY, viewport);
+}
+
+//----------------------------------------------------------------------
+// Mipmap and image scaling functionality
+
+
+private final ByteBuffer copyToByteBuffer(Buffer buf) {
+ if (buf instanceof ByteBuffer) {
+ if (buf.position() == 0) {
+ return (ByteBuffer) buf;
+ }
+ return InternalBufferUtil.copyByteBuffer((ByteBuffer) buf);
+ } else if (buf instanceof ShortBuffer) {
+ return InternalBufferUtil.copyShortBufferAsByteBuffer((ShortBuffer) buf);
+ } else if (buf instanceof IntBuffer) {
+ return InternalBufferUtil.copyIntBufferAsByteBuffer((IntBuffer) buf);
+ } else if (buf instanceof FloatBuffer) {
+ return InternalBufferUtil.copyFloatBufferAsByteBuffer((FloatBuffer) buf);
+ } else {
+ throw new IllegalArgumentException("Unsupported buffer type (must be one of byte, short, int, or float)");
+ }
+}
+
+private final int gluScaleImageJava( int format, int widthin, int heightin,
+ int typein, Buffer datain, int widthout, int heightout,
+ int typeout, Buffer dataout ) {
+ ByteBuffer in = null;
+ ByteBuffer out = null;
+ in = copyToByteBuffer(datain);
+ if( dataout instanceof ByteBuffer ) {
+ out = (ByteBuffer)dataout;
+ } else if( dataout instanceof ShortBuffer ) {
+ out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_SHORT);
+ } else if ( dataout instanceof IntBuffer ) {
+ out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_INT);
+ } else if ( dataout instanceof FloatBuffer ) {
+ out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_FLOAT);
+ } else {
+ throw new IllegalArgumentException("Unsupported destination buffer type (must be byte, short, int, or float)");
+ }
+ int errno = Mipmap.gluScaleImage( getCurrentGL2(), format, widthin, heightin, typein, in,
+ widthout, heightout, typeout, out );
+ if( errno == 0 ) {
+ out.rewind();
+ if (out != dataout) {
+ if( dataout instanceof ShortBuffer ) {
+ ((ShortBuffer) dataout).put(out.asShortBuffer());
+ } else if( dataout instanceof IntBuffer ) {
+ ((IntBuffer) dataout).put(out.asIntBuffer());
+ } else if( dataout instanceof FloatBuffer ) {
+ ((FloatBuffer) dataout).put(out.asFloatBuffer());
+ } else {
+ throw new RuntimeException("Should not reach here");
+ }
+ }
+ }
+ return( errno );
+}
+
+
+private final int gluBuild1DMipmapLevelsJava( int target, int internalFormat, int width,
+ int format, int type, int userLevel, int baseLevel, int maxLevel,
+ Buffer data ) {
+ ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild1DMipmapLevels( getCurrentGL2(), target, internalFormat, width,
+ format, type, userLevel, baseLevel, maxLevel, buffer ) );
+}
+
+
+private final int gluBuild1DMipmapsJava( int target, int internalFormat, int width,
+ int format, int type, Buffer data ) {
+ ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild1DMipmaps( getCurrentGL2(), target, internalFormat, width, format,
+ type, buffer ) );
+}
+
+
+private final int gluBuild2DMipmapLevelsJava( int target, int internalFormat, int width,
+ int height, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, Buffer data ) {
+ // While the code below handles other data types, it doesn't handle non-ByteBuffers
+ data = copyToByteBuffer(data);
+ return( Mipmap.gluBuild2DMipmapLevels( getCurrentGL2(), target, internalFormat, width,
+ height, format, type, userLevel, baseLevel, maxLevel, data ) );
+}
+
+private final int gluBuild2DMipmapsJava( int target, int internalFormat, int width,
+ int height, int format, int type, Buffer data ) {
+ // While the code below handles other data types, it doesn't handle non-ByteBuffers
+ data = copyToByteBuffer(data);
+ return( Mipmap.gluBuild2DMipmaps( getCurrentGL2(), target, internalFormat, width, height,
+ format, type, data) );
+}
+
+private final int gluBuild3DMipmapLevelsJava( int target, int internalFormat, int width,
+ int height, int depth, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, Buffer data) {
+ ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild3DMipmapLevels( getCurrentGL2(), target, internalFormat, width,
+ height, depth, format, type, userLevel, baseLevel, maxLevel, buffer) );
+}
+
+private final int gluBuild3DMipmapsJava( int target, int internalFormat, int width,
+ int height, int depth, int format, int type, Buffer data ) {
+ ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild3DMipmaps( getCurrentGL2(), target, internalFormat, width, height,
+ depth, format, type, buffer ) );
+}
+
+
+//----------------------------------------------------------------------
+// Wrappers for mipmap and image scaling entry points which dispatch either
+// to the Java or C versions.
+//
+
+/** Interface to C language function: <br> <code> GLint gluBuild1DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data); </code> */
+public final int gluBuild1DMipmapLevels(int target, int internalFormat, int width, int format, int type, int level, int base, int max, java.nio.Buffer data) {
+ if (useJavaMipmapCode) {
+ return gluBuild1DMipmapLevelsJava(target, internalFormat, width, format, type, level, base, max, data);
+ } else {
+ return gluBuild1DMipmapLevelsC(target, internalFormat, width, format, type, level, base, max, data);
+ }
+}
+
+/** Interface to C language function: <br> <code> GLint gluBuild1DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void * data); </code> */
+public final int gluBuild1DMipmaps(int target, int internalFormat, int width, int format, int type, java.nio.Buffer data) {
+ if (useJavaMipmapCode) {
+ return gluBuild1DMipmapsJava(target, internalFormat, width, format, type, data);
+ } else {
+ return gluBuild1DMipmapsC(target, internalFormat, width, format, type, data);
+ }
+}
+
+/** Interface to C language function: <br> <code> GLint gluBuild2DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data); </code> */
+public final int gluBuild2DMipmapLevels(int target, int internalFormat, int width, int height, int format, int type, int level, int base, int max, java.nio.Buffer data) {
+ if (useJavaMipmapCode) {
+ return gluBuild2DMipmapLevelsJava(target, internalFormat, width, height, format, type, level, base, max, data);
+ } else {
+ return gluBuild2DMipmapLevelsC(target, internalFormat, width, height, format, type, level, base, max, data);
+ }
+}
+
+
+/** Interface to C language function: <br> <code> GLint gluBuild2DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * data); </code> */
+public final int gluBuild2DMipmaps(int target, int internalFormat, int width, int height, int format, int type, java.nio.Buffer data) {
+ if (useJavaMipmapCode) {
+ return gluBuild2DMipmapsJava(target, internalFormat, width, height, format, type, data);
+ } else {
+ return gluBuild2DMipmapsC(target, internalFormat, width, height, format, type, data);
+ }
+}
+
+
+/** Interface to C language function: <br> <code> GLint gluBuild3DMipmapLevels(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void * data); </code> */
+public final int gluBuild3DMipmapLevels(int target, int internalFormat, int width, int height, int depth, int format, int type, int level, int base, int max, java.nio.Buffer data) {
+ if (useJavaMipmapCode) {
+ return gluBuild3DMipmapLevelsJava(target, internalFormat, width, height, depth, format, type, level, base, max, data);
+ } else {
+ return gluBuild3DMipmapLevelsC(target, internalFormat, width, height, depth, format, type, level, base, max, data);
+ }
+}
+
+/** Interface to C language function: <br> <code> GLint gluBuild3DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * data); </code> */
+public final int gluBuild3DMipmaps(int target, int internalFormat, int width, int height, int depth, int format, int type, java.nio.Buffer data) {
+ if (useJavaMipmapCode) {
+ return gluBuild3DMipmapsJava(target, internalFormat, width, height, depth, format, type, data);
+ } else {
+ return gluBuild3DMipmapsC(target, internalFormat, width, height, depth, format, type, data);
+ }
+}
+
+
+/** Interface to C language function: <br> <code> GLint gluScaleImage(GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void * dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid * dataOut); </code> */
+public final int gluScaleImage(int format, int wIn, int hIn, int typeIn, java.nio.Buffer dataIn, int wOut, int hOut, int typeOut, java.nio.Buffer dataOut) {
+ if (useJavaMipmapCode) {
+ return gluScaleImageJava(format, wIn, hIn, typeIn, dataIn, wOut, hOut, typeOut, dataOut);
+ } else {
+ return gluScaleImageC(format, wIn, hIn, typeIn, dataIn, wOut, hOut, typeOut, dataOut);
+ }
+}
+
+//----------------------------------------------------------------------
+// NURBS functionality
+//
+
+/**
+ * Sets a property on a NURBS object. (NOTE: this function is not currently implemented.)
+ *
+ * @param r
+ * GLUnurbs object holding NURBS to which a property should be
+ * set
+ * @param property
+ * property id
+ * @param value
+ * property value
+ */
+public final void gluNurbsProperty(GLUnurbs r, int property, float value) {
+ // TODO glunurbsproperty
+ float nurbsValue;
+ switch (property) {
+ default:
+ // System.out.println("TODO gluwnurbs.glunurbsproperty");
+ break;
+ }
+}
+
+/**
+ * Creates a new GLUnurbs object.
+ *
+ * @return GLUnurbs object
+ */
+public final GLUnurbs gluNewNurbsRenderer() {
+ // DONE
+ return new GLUgl2nurbsImpl();
+}
+
+/**
+ * Begins a curve definition.
+ *
+ * @param r
+ * GLUnurbs object to specify curve to
+ */
+public final void gluBeginCurve(GLUnurbs r) {
+ // DONE
+ ((GLUgl2nurbsImpl) r).bgncurve();
+}
+
+/**
+ * Begins a surface definition.
+ *
+ * @param r
+ * GLUnurbs object to specify surface to
+ */
+public final void gluBeginSurface(GLUnurbs r) {
+ // DONE
+ ((GLUgl2nurbsImpl) r).bgnsurface();
+}
+
+/**
+ * Ends a surface.
+ *
+ * @param r
+ * GLUnurbs object holding surface
+ */
+public final void gluEndSurface(GLUnurbs r) {
+ // DONE
+ ((GLUgl2nurbsImpl) r).endsurface();
+}
+
+/**
+ * Makes a NURBS surface.
+ *
+ * @param r
+ * GLUnurbs object holding the surface
+ * @param sknot_count
+ * number of knots in s direction
+ * @param sknot
+ * knots in s direction
+ * @param tknot_count
+ * number of knots in t direction
+ * @param tknot
+ * knots in t direction
+ * @param s_stride
+ * number of control points coordinates in s direction
+ * @param t_stride
+ * number of control points coordinates in t direction
+ * @param ctlarray
+ * control points
+ * @param sorder
+ * order of surface in s direction
+ * @param torder
+ * order of surface in t direction
+ * @param type
+ * surface type
+ */
+public final void gluNurbsSurface(GLUnurbs r, int sknot_count, float[] sknot,
+ int tknot_count, float[] tknot, int s_stride, int t_stride,
+ float[] ctlarray, int sorder, int torder, int type) {
+ // DONE
+ ((GLUgl2nurbsImpl) r).nurbssurface(sknot_count, sknot, tknot_count, tknot, s_stride,
+ t_stride, ctlarray, sorder, torder, type);
+}
+
+/**
+ * Make a NURBS curve.
+ *
+ * @param r
+ * GLUnurbs object holding the curve
+ * @param nknots
+ * number of knots
+ * @param knot
+ * knot vector
+ * @param stride
+ * number of control point coordinates
+ * @param ctlarray
+ * control points
+ * @param order
+ * order of the curve
+ * @param type
+ * curve type
+ */
+public final void gluNurbsCurve(GLUnurbs r, int nknots, float[] knot, int stride,
+ float[] ctlarray, int order, int type) {
+ int realType;
+ switch (type) {
+ // TODO GLU_MAP1_TRIM_2 etc.
+ default:
+ realType = type;
+ break;
+ }
+ ((GLUgl2nurbsImpl) r).nurbscurve(nknots, knot, stride, ctlarray, order, realType);
+}
+
+/**
+ * Ends a curve definition.
+ *
+ * @param r
+ * GLUnurbs object holding the curve
+ */
+public final void gluEndCurve(GLUnurbs r) {
+ //DONE
+ ((GLUgl2nurbsImpl) r).endcurve();
+}
+
+//----------------------------------------------------------------------
+// GLUProcAddressTable handling
+//
+
+private static GLUgl2ProcAddressTable gluProcAddressTable;
+private static volatile boolean gluLibraryLoaded;
+
+private static final GLUgl2ProcAddressTable getGLUProcAddressTable() {
+ if (!gluLibraryLoaded) {
+ loadGLULibrary();
+ }
+ if (gluProcAddressTable == null) {
+ GLContext curContext = GLContext.getCurrent();
+ if (curContext == null) {
+ throw new GLException("No OpenGL context current on this thread");
+ }
+ GLUgl2ProcAddressTable tmp = new GLUgl2ProcAddressTable();
+ GLProcAddressHelper.resetProcAddressTable(tmp, ((GLDrawableImpl)curContext.getGLDrawable()).getDynamicLookupHelper());
+ gluProcAddressTable = tmp;
+ }
+ return gluProcAddressTable;
+}
+
+private static final synchronized void loadGLULibrary() {
+ if (!gluLibraryLoaded) {
+ GLDrawableFactoryImpl.getFactoryImpl(null).loadGLULibrary();
+ gluLibraryLoaded = true;
+ }
+}
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
new file mode 100755
index 000000000..8afc28c15
--- /dev/null
+++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
@@ -0,0 +1,254 @@
+/*
+private static boolean useJavaMipmapCode = true;
+
+static {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String val = System.getProperty("jogl.glu.nojava");
+ if (val != null && !val.toLowerCase().equals("false")) {
+ useJavaMipmapCode = false;
+ }
+ return null;
+ }
+ });
+}
+*/
+
+/**
+ * Instantiates a new OpenGL Utility Library object. A GLU object may
+ * be instantiated at any point in the application and is not
+ * inherently tied to any particular OpenGL context; however, the GLU
+ * object may only be used when an OpenGL context is current on the
+ * current thread. Attempts to call most of the methods in the GLU
+ * library when no OpenGL context is current will cause an exception
+ * to be thrown.
+ *
+ * <P>
+ *
+ * The returned GLU object is not guaranteed to be thread-safe and
+ * should only be used from one thread at a time. Multiple GLU objects
+ * may be instantiated to be used from different threads
+ * simultaneously.
+ */
+
+public GLUgl2es1()
+{
+ super();
+}
+
+public void destroy() {
+ super.destroy();
+}
+
+//----------------------------------------------------------------------
+// Utility routines
+//
+
+public static final GL2ES1 getCurrentGL2ES1() throws GLException {
+ GLContext curContext = GLContext.getCurrent();
+ if (curContext == null) {
+ throw new GLException("No OpenGL context current on this thread");
+ }
+ return curContext.getGL().getGL2ES1();
+}
+
+
+/*
+public String gluErrorString(int errorCode) {
+ return Error.gluErrorString(errorCode);
+}
+*/
+
+/* extName is an extension name.
+ * extString is a string of extensions separated by blank(s). There may or
+ * may not be leading or trailing blank(s) in extString.
+ * This works in cases of extensions being prefixes of another like
+ * GL_EXT_texture and GL_EXT_texture3D.
+ * Returns true if extName is found otherwise it returns false.
+ */
+/*
+public boolean gluCheckExtension(java.lang.String extName, java.lang.String extString) {
+ return Registry.gluCheckExtension(extName, extString);
+}
+*/
+
+/*
+public String gluGetString(int name) {
+ return Registry.gluGetString(name);
+}
+*/
+
+//----------------------------------------------------------------------
+// Mipmap and image scaling functionality
+
+protected static boolean availableMipmap = false;
+protected static boolean checkedMipmap = false;
+
+protected static final void validateMipmap() {
+ if(!checkedMipmap) {
+ availableMipmap = NWReflection.isClassAvailable("com.sun.opengl.impl.glu.mipmap.Mipmap");
+ checkedMipmap = true;
+ }
+ if(!availableMipmap) {
+ throw new GLException("Mipmap not available");
+ }
+}
+
+private final java.nio.ByteBuffer copyToByteBuffer(java.nio.Buffer buf) {
+ if (buf instanceof java.nio.ByteBuffer) {
+ if (buf.position() == 0) {
+ return (java.nio.ByteBuffer) buf;
+ }
+ return InternalBufferUtil.copyByteBuffer((java.nio.ByteBuffer) buf);
+ } else if (buf instanceof java.nio.ShortBuffer) {
+ return InternalBufferUtil.copyShortBufferAsByteBuffer((java.nio.ShortBuffer) buf);
+ } else if (buf instanceof java.nio.IntBuffer) {
+ return InternalBufferUtil.copyIntBufferAsByteBuffer((java.nio.IntBuffer) buf);
+ } else if (buf instanceof java.nio.FloatBuffer) {
+ return InternalBufferUtil.copyFloatBufferAsByteBuffer((java.nio.FloatBuffer) buf);
+ } else {
+ throw new IllegalArgumentException("Unsupported buffer type (must be one of byte, short, int, or float)");
+ }
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluScaleImage( int format, int widthin, int heightin,
+ int typein, java.nio.Buffer datain, int widthout, int heightout,
+ int typeout, java.nio.Buffer dataout ) {
+ validateMipmap();
+ java.nio.ByteBuffer in = null;
+ java.nio.ByteBuffer out = null;
+ in = copyToByteBuffer(datain);
+ if( dataout instanceof java.nio.ByteBuffer ) {
+ out = (java.nio.ByteBuffer)dataout;
+ } else if( dataout instanceof java.nio.ShortBuffer ) {
+ out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_SHORT);
+ } else if ( dataout instanceof java.nio.IntBuffer ) {
+ out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_INT);
+ } else if ( dataout instanceof java.nio.FloatBuffer ) {
+ out = InternalBufferUtil.newByteBuffer(dataout.remaining() * InternalBufferUtil.SIZEOF_FLOAT);
+ } else {
+ throw new IllegalArgumentException("Unsupported destination buffer type (must be byte, short, int, or float)");
+ }
+ int errno = Mipmap.gluScaleImage( getCurrentGL2ES1(), format, widthin, heightin, typein, in,
+ widthout, heightout, typeout, out );
+ if( errno == 0 ) {
+ out.rewind();
+ if (out != dataout) {
+ if( dataout instanceof java.nio.ShortBuffer ) {
+ ((java.nio.ShortBuffer) dataout).put(out.asShortBuffer());
+ } else if( dataout instanceof java.nio.IntBuffer ) {
+ ((java.nio.IntBuffer) dataout).put(out.asIntBuffer());
+ } else if( dataout instanceof java.nio.FloatBuffer ) {
+ ((java.nio.FloatBuffer) dataout).put(out.asFloatBuffer());
+ } else {
+ throw new RuntimeException("Should not reach here");
+ }
+ }
+ }
+ return( errno );
+}
+
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluBuild1DMipmapLevels( int target, int internalFormat, int width,
+ int format, int type, int userLevel, int baseLevel, int maxLevel,
+ java.nio.Buffer data ) {
+ validateMipmap();
+ java.nio.ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild1DMipmapLevels( getCurrentGL2ES1(), target, internalFormat, width,
+ format, type, userLevel, baseLevel, maxLevel, buffer ) );
+}
+
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluBuild1DMipmaps( int target, int internalFormat, int width,
+ int format, int type, java.nio.Buffer data ) {
+ validateMipmap();
+ java.nio.ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild1DMipmaps( getCurrentGL2ES1(), target, internalFormat, width, format,
+ type, buffer ) );
+}
+
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluBuild2DMipmapLevels( int target, int internalFormat, int width,
+ int height, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, java.nio.Buffer data ) {
+ validateMipmap();
+ // While the code below handles other data types, it doesn't handle non-ByteBuffers
+ data = copyToByteBuffer(data);
+ return( Mipmap.gluBuild2DMipmapLevels( getCurrentGL2ES1(), target, internalFormat, width,
+ height, format, type, userLevel, baseLevel, maxLevel, data ) );
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluBuild2DMipmaps( int target, int internalFormat, int width,
+ int height, int format, int type, java.nio.Buffer data ) {
+ validateMipmap();
+ // While the code below handles other data types, it doesn't handle non-ByteBuffers
+ data = copyToByteBuffer(data);
+ return( Mipmap.gluBuild2DMipmaps( getCurrentGL2ES1(), target, internalFormat, width, height,
+ format, type, data) );
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluBuild3DMipmapLevels( int target, int internalFormat, int width,
+ int height, int depth, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, java.nio.Buffer data) {
+ validateMipmap();
+ java.nio.ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild3DMipmapLevels( getCurrentGL2ES1(), target, internalFormat, width,
+ height, depth, format, type, userLevel, baseLevel, maxLevel, buffer) );
+}
+
+/**
+ * Optional, throws GLException if not available in profile
+ */
+public final int gluBuild3DMipmaps( int target, int internalFormat, int width,
+ int height, int depth, int format, int type, java.nio.Buffer data ) {
+ validateMipmap();
+ java.nio.ByteBuffer buffer = copyToByteBuffer(data);
+ return( Mipmap.gluBuild3DMipmaps( getCurrentGL2ES1(), target, internalFormat, width, height,
+ depth, format, type, buffer ) );
+}
+
+//----------------------------------------------------------------------
+// GLUProcAddressTable handling
+//
+
+/*
+private static GLUProcAddressTable gluProcAddressTable;
+private static volatile boolean gluLibraryLoaded;
+
+private static GLUProcAddressTable getGLUProcAddressTable() {
+ if (!gluLibraryLoaded) {
+ loadGLULibrary();
+ }
+ if (gluProcAddressTable == null) {
+ GLUProcAddressTable tmp = new GLUProcAddressTable();
+ GLProcAddressHelper.resetProcAddressTable(tmp, GLDrawableFactoryImpl.getFactoryImpl());
+ gluProcAddressTable = tmp;
+ }
+ return gluProcAddressTable;
+}
+
+private static synchronized void loadGLULibrary() {
+ if (!gluLibraryLoaded) {
+ GLDrawableFactoryImpl.getFactoryImpl().loadGLULibrary();
+ gluLibraryLoaded = true;
+ }
+}
+*/
diff --git a/make/config/jogl/glu-base.cfg b/make/config/jogl/glu-base.cfg
new file mode 100755
index 000000000..f67673a78
--- /dev/null
+++ b/make/config/jogl/glu-base.cfg
@@ -0,0 +1,28 @@
+# This .cfg file is used to generate the GLU implementation for OpenGL ES 1.0,
+# where it is pure Java.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl
+
+Style ImplOnly
+ImplPackage javax.media.opengl.glu
+ImplJavaClass GLU
+AccessControl GLU PUBLIC
+
+Ignore gluBuild1DMipmapLevels
+Ignore gluBuild1DMipmaps
+Ignore gluBuild2DMipmapLevels
+Ignore gluBuild2DMipmaps
+Ignore gluBuild3DMipmapLevels
+Ignore gluBuild3DMipmaps
+Ignore gluScaleImage
+
+# Custom Java code for GLU class
+IncludeAs CustomJavaCode GLU glu-CustomJavaCode-base.java
+
+# Imports for the Error and Registry classes
+Import com.sun.opengl.impl.glu.error.Error
+Import com.sun.opengl.impl.glu.registry.Registry
+
+Include glu-common.cfg
+
+Import java.lang.reflect.*
diff --git a/make/config/jogl/glu-common.cfg b/make/config/jogl/glu-common.cfg
new file mode 100644
index 000000000..3b5a1160a
--- /dev/null
+++ b/make/config/jogl/glu-common.cfg
@@ -0,0 +1,177 @@
+# This .cfg file provides common options used among all GLU glue code
+HierarchicalNativeOutput false
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
+#
+# Imports needed by all glue code
+#
+Import java.nio.*
+Import javax.media.opengl.*
+Import javax.media.opengl.glu.*
+Import com.sun.opengl.impl.*
+Import com.sun.opengl.impl.glu.*
+Import com.sun.opengl.impl.glu.tessellator.GLUtessellatorImpl
+Import com.sun.nativewindow.impl.NWReflection
+
+# Raise GLException instead of RuntimeException in glue code
+RuntimeExceptionType GLException
+UnsupportedExceptionType GLException
+
+#
+# Opaques and other directives for platform-independent routines
+#
+
+Opaque boolean GLboolean
+Opaque boolean BOOL
+
+#
+# Don't output #defines of GLU version identifier strings as constants,
+# because we don't need them java-side.
+#
+Ignore GLU_VERSION_.+
+
+#
+# Ignore the non-GLU functions
+#
+Ignore gl[^u].+
+
+#
+# Ignore the non-GLU constants
+#
+Ignore GL[^U]?_.+
+
+#
+# Ignore the GLU extension constants, since we don't need them java-side
+#
+Ignore GLU_EXT_.+
+
+# Javadoc for the GLU class
+ClassJavadoc GLU /**
+ClassJavadoc GLU * Provides access to the OpenGL Utility Library (GLU). This library
+ClassJavadoc GLU * provides standard methods for setting up view volumes, building
+ClassJavadoc GLU * mipmaps and performing other common operations. The GLU NURBS
+ClassJavadoc GLU * routines are not currently exposed.
+ClassJavadoc GLU *
+ClassJavadoc GLU * <P>
+ClassJavadoc GLU *
+ClassJavadoc GLU * Notes from the Reference Implementation for this class:
+ClassJavadoc GLU * Thanks to the contributions of many individuals, this class is a
+ClassJavadoc GLU * pure Java port of SGI's original C sources. All of the projection,
+ClassJavadoc GLU * mipmap, scaling, and tessellation routines that are exposed are
+ClassJavadoc GLU * compatible with the GLU 1.3 specification. The GLU NURBS routines
+ClassJavadoc GLU * are not currently exposed.
+ClassJavadoc GLU */
+
+#
+# We ignore most of the function declarations in glu.h because we
+# provide a pure Java implementation of most of GLU. Currently the
+# only reason we generate glue code for this class is to provide a
+# fallback path to the C code for the mipmap routines in case of bugs
+# with the Java port (although it has been pretty thoroughly debugged
+# at this point).
+#
+
+#
+# ------------------------
+# Utility routines
+# ------------------------
+#
+
+# These are implemented by pure Java
+Ignore gluCheckExtension
+Ignore gluErrorString
+Ignore gluGetString
+
+#
+# ------------------------
+# NURBS
+# ------------------------
+#
+
+#
+# !!!!!!!!!!!!! FIXME:
+# Ignore these Nurbs things until we get other stuff working
+#
+Ignore gluBeginCurve
+Ignore gluBeginSurface
+Ignore gluBeginTrim
+Ignore gluEndCurve
+Ignore gluEndSurface
+Ignore gluEndTrim
+Ignore gluLoadSamplingMatrices
+Ignore gluPwlCurve
+Ignore gluNewNurbsRenderer
+Ignore gluDeleteNurbsRenderer
+Ignore gluNurbsProperty
+Ignore gluGetNurbsProperty
+Ignore gluNurbsCallback.*
+Ignore gluNurbsCurve
+Ignore gluNurbsSurface
+Ignore GLU_NURB.+
+Ignore GLU_.*PARAMETRIC.+
+Ignore GLUnurbs
+
+#
+# ------------------------
+# Tesselators
+# ------------------------
+#
+
+#
+# Ignore these methods; we must manually implement their C and Java code
+#
+Ignore gluBeginPolygon
+Ignore gluTessCallback
+Ignore gluDeleteTess
+Ignore gluEndPolygon
+Ignore gluGetTessProperty
+Ignore gluNewTess
+Ignore gluNextContour
+Ignore gluTessBeginContour
+Ignore gluTessBeginPolygon
+Ignore gluTessEndContour
+Ignore gluTessEndPolygon
+Ignore gluTessNormal
+Ignore gluTessProperty
+Ignore gluTessVertex
+Ignore gluTessCallback.*
+Ignore GLUtesselator
+
+#
+# ------------------------
+# Quadrics
+# ------------------------
+#
+#
+# !!!!!!!!!!!!! FIXME:
+# Ignore these Quadric things until we get other stuff working
+#
+Ignore gluQuadricCallback.*
+
+# Manually implement the GLU quadric functionality to mostly conform
+# to the C APIs
+Ignore GLUquadric
+Ignore gluCylinder
+Ignore gluDeleteQuadric
+Ignore gluDisk
+Ignore gluNewQuadric
+Ignore gluPartialDisk
+Ignore gluQuadricDrawStyle
+Ignore gluQuadricNormals
+Ignore gluQuadricOrientation
+Ignore gluQuadricTexture
+Ignore gluSphere
+
+# Ignore a few of the projection/unprojection APIs altogether because
+# their signatures aren't specified correctly in the header file
+Ignore gluProject
+Ignore gluUnProject
+Ignore gluUnProject4
+
+# Manually implement the rest of the projection / unprojection APIs
+Ignore gluOrtho2D
+Ignore gluPerspective
+Ignore gluLookAt
+Ignore gluPickMatrix
diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg
new file mode 100755
index 000000000..712f9a305
--- /dev/null
+++ b/make/config/jogl/glu-gl2.cfg
@@ -0,0 +1,80 @@
+# This .cfg file provides common options used among gl2 GLU glue code
+# generated for Jogl on all platforms.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/gl2
+
+Style ImplOnly
+ImplPackage javax.media.opengl.glu.gl2
+ImplJavaClass GLUgl2
+ParentClass GLUgl2 GLU
+
+CustomCCode #if defined(WIN32)
+CustomCCode #define WIN32_LEAN_AND_MEAN
+CustomCCode #include <windows.h>
+CustomCCode #undef WIN32_LEAN_AND_MEAN
+CustomCCode
+CustomCCode #include <stddef.h>
+CustomCCode #elif defined(macosx)
+CustomCCode #include <inttypes.h>
+CustomCCode #include <jni.h>
+CustomCCode #include </usr/include/machine/types.h>
+CustomCCode #elif defined(linux) || defined(__sun) || defined(__FreeBSD__) || defined(_HPUX)
+CustomCCode #include <inttypes.h>
+CustomCCode #endif
+
+Include ../intptr.cfg
+
+EmitProcAddressTable true
+ProcAddressTablePackage com.sun.opengl.impl.glu.gl2
+ProcAddressTableClassName GLUgl2ProcAddressTable
+GetProcAddressTableExpr getGLUProcAddressTable()
+
+CustomCCode /* Include the OpenGL GLU header */
+CustomCCode #include <GL/glu.h>
+
+# Custom Java code for GLU class
+IncludeAs CustomJavaCode GLUgl2 glu-CustomJavaCode-gl2.java
+
+# GLU needs access to the GLUtesselatorImpl class for GLUtesselator,
+# to the Mipmap class for scaling and mipmap generation,
+# and to the nurbs.* package for the NURBS functionality
+Import com.sun.opengl.impl.glu.nurbs.*
+Import java.security.*
+Import com.sun.gluegen.runtime.opengl.GLProcAddressHelper
+Import com.sun.opengl.impl.glu.gl2.nurbs.*
+Import com.sun.opengl.impl.glu.mipmap.Mipmap
+Import com.sun.opengl.impl.glu.gl2.*
+Import javax.media.opengl.GL2
+Import com.sun.opengl.impl.gl2.ProjectDouble
+
+#
+# ------------------------
+# Mipmape
+# ------------------------
+#
+# Ignore the C versions of the mipmap code in the public interface and
+# use GKW's Java port instead. The bindings to the C entry points are
+# still being left in for now, but only for debugging purposes and the
+# intent is to remove them in a future release.
+
+# Emit these entry points as private
+
+AccessControl gluBuild1DMipmapLevels PRIVATE
+AccessControl gluBuild1DMipmaps PRIVATE
+AccessControl gluBuild2DMipmapLevels PRIVATE
+AccessControl gluBuild2DMipmaps PRIVATE
+AccessControl gluBuild3DMipmapLevels PRIVATE
+AccessControl gluBuild3DMipmaps PRIVATE
+AccessControl gluScaleImage PRIVATE
+
+# Rename these methods in the implementing class
+
+RenameJavaMethod gluBuild1DMipmapLevels gluBuild1DMipmapLevelsC
+RenameJavaMethod gluBuild1DMipmaps gluBuild1DMipmapsC
+RenameJavaMethod gluBuild2DMipmapLevels gluBuild2DMipmapLevelsC
+RenameJavaMethod gluBuild2DMipmaps gluBuild2DMipmapsC
+RenameJavaMethod gluBuild3DMipmapLevels gluBuild3DMipmapLevelsC
+RenameJavaMethod gluBuild3DMipmaps gluBuild3DMipmapsC
+RenameJavaMethod gluScaleImage gluScaleImageC
+
+Include glu-common.cfg
diff --git a/make/config/jogl/glu-gl2es1.cfg b/make/config/jogl/glu-gl2es1.cfg
new file mode 100755
index 000000000..8927f96b9
--- /dev/null
+++ b/make/config/jogl/glu-gl2es1.cfg
@@ -0,0 +1,26 @@
+# This .cfg file is used to generate the GLU implementation for OpenGL ES 1.0,
+# where it is pure Java.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/gl2es1
+
+Style ImplOnly
+ImplPackage javax.media.opengl.glu.gl2es1
+ImplJavaClass GLUgl2es1
+ParentClass GLUgl2es1 GLU
+
+Ignore gluBuild1DMipmapLevels
+Ignore gluBuild1DMipmaps
+Ignore gluBuild2DMipmapLevels
+Ignore gluBuild2DMipmaps
+Ignore gluBuild3DMipmapLevels
+Ignore gluBuild3DMipmaps
+Ignore gluScaleImage
+
+# Custom Java code for GLU class
+IncludeAs CustomJavaCode GLUgl2es1 glu-CustomJavaCode-gl2es1.java
+
+Import javax.media.opengl.GLES1
+Import com.sun.opengl.impl.glu.mipmap.Mipmap
+
+
+Include glu-common.cfg
diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c
new file mode 100755
index 000000000..93347a174
--- /dev/null
+++ b/make/config/jogl/glx-CustomCCode.c
@@ -0,0 +1,151 @@
+#include <inttypes.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <GL/glx.h>
+/* Linux headers don't work properly */
+#define __USE_GNU
+#include <dlfcn.h>
+#undef __USE_GNU
+
+/* HP-UX doesn't define RTLD_DEFAULT. */
+#if defined(_HPUX) && !defined(RTLD_DEFAULT)
+#define RTLD_DEFAULT NULL
+#endif
+
+/* We expect glXGetProcAddressARB to be defined */
+extern void (*glXGetProcAddressARB(const GLubyte *procname))();
+
+static const char * clazzNameInternalBufferUtil = "com/sun/opengl/impl/InternalBufferUtil";
+static const char * clazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer";
+static const char * clazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;";
+static const char * clazzNameByteBuffer = "java/nio/ByteBuffer";
+static jclass clazzInternalBufferUtil = NULL;
+static jmethodID cstrInternalBufferUtil = NULL;
+static jclass clazzByteBuffer = NULL;
+
+static void _initClazzAccess(JNIEnv *env) {
+ if(NULL!=cstrInternalBufferUtil) return ;
+
+ jclass c = (*env)->FindClass(env, clazzNameInternalBufferUtil);
+ if(NULL==c) {
+ fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameInternalBufferUtil);
+ (*env)->FatalError(env, clazzNameInternalBufferUtil);
+ }
+ clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c);
+ if(NULL==clazzInternalBufferUtil) {
+ fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameInternalBufferUtil);
+ (*env)->FatalError(env, clazzNameInternalBufferUtil);
+ }
+ c = (*env)->FindClass(env, clazzNameByteBuffer);
+ if(NULL==c) {
+ fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer);
+ (*env)->FatalError(env, clazzNameByteBuffer);
+ }
+ clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
+ if(NULL==c) {
+ fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer);
+ (*env)->FatalError(env, clazzNameByteBuffer);
+ }
+
+ cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil,
+ clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
+ if(NULL==cstrInternalBufferUtil) {
+ fprintf(stderr, "FatalError: Java_com_sun_opengl_impl_x11_glx_GLX:: can't create %s.%s %s\n",
+ clazzNameInternalBufferUtil,
+ clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
+ (*env)->FatalError(env, clazzNameInternalBufferUtilStaticCstrName);
+ }
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.x11.glx.GLX
+ * Java method: XVisualInfo glXGetVisualFromFBConfig(long dpy, long config)
+ * C function: XVisualInfo * glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_x11_glx_GLX_glXGetVisualFromFBConfigCopied0__JJ(JNIEnv *env, jclass _unused, jlong dpy, jlong config) {
+ XVisualInfo * _res;
+ _res = glXGetVisualFromFBConfig((Display *) (intptr_t) dpy, (GLXFBConfig) (intptr_t) config);
+ if (_res == NULL) return NULL;
+
+ _initClazzAccess(env);
+
+ jobject jbyteSource = (*env)->NewDirectByteBuffer(env, _res, sizeof(XVisualInfo));
+ jobject jbyteCopy = (*env)->CallStaticObjectMethod(env,
+ clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
+
+ // FIXME: remove reference/gc jbyteSource ??
+ XFree(_res);
+
+ return jbyteCopy;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.x11.glx.GLX
+ * Java method: java.nio.LongBuffer glXChooseFBConfig(long dpy, int screen, java.nio.IntBuffer attribList, java.nio.IntBuffer nitems)
+ * C function: GLXFBConfig * glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseFBConfigCopied1__JILjava_lang_Object_2ILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset, jobject nitems, jint nitems_byte_offset) {
+ int * _ptr2 = NULL;
+ int * _ptr3 = NULL;
+ GLXFBConfig * _res;
+ int count;
+ if (attribList != NULL) {
+ _ptr2 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, attribList, NULL)) + attribList_byte_offset);
+ }
+ if (nitems != NULL) {
+ _ptr3 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, nitems, NULL)) + nitems_byte_offset);
+ }
+ _res = glXChooseFBConfig((Display *) (intptr_t) dpy, (int) screen, (int *) _ptr2, (int *) _ptr3);
+ count = _ptr3[0];
+ if (attribList != NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, attribList, _ptr2, 0);
+ }
+ if (nitems != NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, nitems, _ptr3, 0);
+ }
+ if (_res == NULL) return NULL;
+
+ _initClazzAccess(env);
+
+ jobject jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(GLXFBConfig));
+ jobject jbyteCopy = (*env)->CallStaticObjectMethod(env,
+ clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
+
+ // FIXME: remove reference/gc jbyteSource ??
+ XFree(_res);
+
+ return jbyteCopy;
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.opengl.impl.x11.glx.GLX
+ * Java method: XVisualInfo glXChooseVisual(long dpy, int screen, java.nio.IntBuffer attribList)
+ * C function: XVisualInfo * glXChooseVisual(Display * dpy, int screen, int * attribList);
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_opengl_impl_x11_glx_GLX_glXChooseVisualCopied1__JILjava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong dpy, jint screen, jobject attribList, jint attribList_byte_offset) {
+ int * _ptr2 = NULL;
+ XVisualInfo * _res;
+ if (attribList != NULL) {
+ _ptr2 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, attribList, NULL)) + attribList_byte_offset);
+ }
+ _res = glXChooseVisual((Display *) (intptr_t) dpy, (int) screen, (int *) _ptr2);
+ if (attribList != NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, attribList, _ptr2, 0);
+ }
+ if (_res == NULL) return NULL;
+
+ _initClazzAccess(env);
+
+ jobject jbyteSource = (*env)->NewDirectByteBuffer(env, _res, sizeof(XVisualInfo));
+ jobject jbyteCopy = (*env)->CallStaticObjectMethod(env,
+ clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
+
+ // FIXME: remove reference/gc jbyteSource ??
+ XFree(_res);
+
+ return jbyteCopy;
+}
+
diff --git a/make/config/jogl/glx-CustomJavaCode.java b/make/config/jogl/glx-CustomJavaCode.java
new file mode 100644
index 000000000..f59e71e41
--- /dev/null
+++ b/make/config/jogl/glx-CustomJavaCode.java
@@ -0,0 +1,46 @@
+
+ /** Interface to C language function: <br> - Alias for: <br> <code> XVisualInfo * glXGetVisualFromFBConfigSGIX, glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config); </code> */
+ public static XVisualInfo glXGetVisualFromFBConfigCopied(long dpy, long config)
+ {
+ java.nio.ByteBuffer _res;
+ _res = glXGetVisualFromFBConfigCopied0(dpy, config);
+ if (_res == null) return null;
+ return XVisualInfo.create(_res);
+ }
+
+ /** Entry point to C language function: - Alias for: <br> <code> XVisualInfo * glXGetVisualFromFBConfigSGIX, glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config); </code> */
+ private static native java.nio.ByteBuffer glXGetVisualFromFBConfigCopied0(long dpy, long config);
+
+
+ /** Interface to C language function: <br> - Alias for: <br> <code> GLXFBConfig * glXChooseFBConfigSGIX, glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems); </code> */
+ public static java.nio.LongBuffer glXChooseFBConfigCopied(long dpy, int screen, int[] attribList, int attribList_offset, int[] nitems, int nitems_offset)
+ {
+ if(attribList != null && attribList.length <= attribList_offset)
+ throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")");
+ if(nitems != null && nitems.length <= nitems_offset)
+ throw new GLException("array offset argument \"nitems_offset\" (" + nitems_offset + ") equals or exceeds array length (" + nitems.length + ")");
+ java.nio.ByteBuffer _res;
+ _res = glXChooseFBConfigCopied1(dpy, screen, attribList, BufferFactory.SIZEOF_INT * attribList_offset, nitems, BufferFactory.SIZEOF_INT * nitems_offset);
+
+ if (_res == null) return null;
+ return BufferFactory.asPointerBuffer(_res);
+ }
+
+ /** Entry point to C language function: - Alias for: <br> <code> GLXFBConfig * glXChooseFBConfigSGIX, glXChooseFBConfig(Display * dpy, int screen, const int * attribList, int * nitems); </code> */
+ private static native java.nio.ByteBuffer glXChooseFBConfigCopied1(long dpy, int screen, Object attribList, int attribList_byte_offset, Object nitems, int nitems_byte_offset);
+
+ /** Interface to C language function: <br> - Alias for: <br> <code> XVisualInfo * glXChooseVisual(Display * dpy, int screen, int * attribList); </code> */
+ public static XVisualInfo glXChooseVisualCopied(long dpy, int screen, int[] attribList, int attribList_offset)
+ {
+ if(attribList != null && attribList.length <= attribList_offset)
+ throw new GLException("array offset argument \"attribList_offset\" (" + attribList_offset + ") equals or exceeds array length (" + attribList.length + ")");
+ java.nio.ByteBuffer _res;
+ _res = glXChooseVisualCopied1(dpy, screen, attribList, BufferFactory.SIZEOF_INT * attribList_offset);
+
+ if (_res == null) return null;
+ return XVisualInfo.create(_res);
+ }
+
+ /** Entry point to C language function: - Alias for: <br> <code> XVisualInfo * glXChooseVisual(Display * dpy, int screen, int * attribList); </code> */
+ private static native java.nio.ByteBuffer glXChooseVisualCopied1(long dpy, int screen, Object attribList, int attribList_byte_offset);
+
diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg
new file mode 100644
index 000000000..5511b339e
--- /dev/null
+++ b/make/config/jogl/glx-x11.cfg
@@ -0,0 +1,83 @@
+# This .cfg file is used to generate the interface to the GLX routines
+# used internally by the X11GLContext implementation.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/X11
+
+Package com.sun.opengl.impl.x11.glx
+JavaClass GLX
+Style allstatic
+Include gl-common-gl2.cfg
+Include gl-common-extensions.cfg
+Include gl-desktop.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName GLXProcAddressTable
+GetProcAddressTableExpr glxProcAddressTable
+# This must be present for bootstrapping
+SkipProcAddressGen glXGetProcAddressARB
+
+Import com.sun.nativewindow.impl.x11.*
+
+
+CustomJavaCode GLX private static GLXProcAddressTable glxProcAddressTable = new GLXProcAddressTable();
+CustomJavaCode GLX public static GLXProcAddressTable getGLXProcAddressTable() { return glxProcAddressTable; }
+
+IncludeAs CustomJavaCode GLX glx-CustomJavaCode.java
+IncludeAs CustomCCode glx-CustomCCode.c
+
+ArgumentIsString XOpenDisplay 0
+
+Opaque long GLXFBConfig
+
+Ignore glXCreateContextAttribsARB
+
+#
+# We have Custom code for the following
+Ignore glXGetVisualFromFBConfig
+Ignore glXGetVisualFromFBConfigSGIX
+Ignore glXChooseFBConfig
+Ignore glXChooseVisual
+
+# Ignore everything not in the GLX core (up through GLX 1.4) aside from glXGetProcAddress
+# FIXME: this needs to be kept in sync with the stub headers more than usual
+Ignore glXFreeContextEXT
+Ignore glXGetContextIDEXT
+Ignore glXGetCurrentDisplayEXT
+Ignore glXImportContextEXT
+Ignore glXQueryContextInfoEXT
+
+Ignore glXGetSyncValues
+Ignore glXGetMscRate
+Ignore glXSwapBuffersMsc
+Ignore glXWaitForMsc
+Ignore glXWaitForSbc
+
+# Ignore non-GLX GL routines and constants
+Ignore ^GL_.+
+Ignore TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB
+Ignore CLAMP_TO_EDGE_EXT
+Ignore ^gl[^X].+
+Ignore ^X.+
+Ignore ^Visual.+
+
+DropUniqVendorExtensions AMD
+# We need GL_APPLE_float_pixels for our pbuffer implementation
+# DropUniqVendorExtensions APPLE
+DropUniqVendorExtensions ATI
+DropUniqVendorExtensions HP
+DropUniqVendorExtensions IBM
+DropUniqVendorExtensions MESA
+DropUniqVendorExtensions MESAX
+DropUniqVendorExtensions NV
+DropUniqVendorExtensions SGI
+DropUniqVendorExtensions SGIS
+DropUniqVendorExtensions SGIX
+DropUniqVendorExtensions SUN
+DropUniqVendorExtensions WIN
+
+# Ignore the SGI hyperpipe extension, which will require more GlueGen
+# work to expose the pipeName fields in the various structs
+Ignore GLXHyperpipeNetworkSGIX
+Ignore GLXHyperpipeConfigSGIX
+Ignore GLXPipeRect
+Ignore GLXPipeRectLimits
diff --git a/make/config/jogl/glxext.cfg b/make/config/jogl/glxext.cfg
new file mode 100755
index 000000000..b1b8fe65a
--- /dev/null
+++ b/make/config/jogl/glxext.cfg
@@ -0,0 +1,132 @@
+# This .cfg file is used to generate the interface and implementing
+# class for the GLX extensions.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/X11
+
+Package com.sun.opengl.impl.x11.glx
+Style InterfaceAndImpl
+JavaClass GLXExt
+ImplPackage com.sun.opengl.impl.x11.glx
+ImplJavaClass GLXExtImpl
+
+ExtendedInterfaceSymbols ../build-temp/gensrc/classes/com/sun/opengl/impl/x11/glx/GLX.java
+Include gl-common-gl2.cfg
+Include gl-desktop.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName GLXExtProcAddressTable
+GetProcAddressTableExpr _context.getGLXExtProcAddressTable()
+
+Import com.sun.nativewindow.impl.x11.*
+
+# Ignore everything that doesn't start with glX or GLX
+IgnoreNot ^(glX|GLX).+
+
+Include gl-headers.cfg
+Include ../intptr.cfg
+
+CustomCCode /* Provide Windows typedefs */
+CustomCCode typedef void* LPVOID;
+CustomCCode typedef unsigned int* PUINT;
+
+CustomJavaCode GLXExt public boolean isFunctionAvailable(String glFunctionName);
+CustomJavaCode GLXExt public boolean isExtensionAvailable(String glExtensionName);
+
+CustomJavaCode GLXExtImpl public GLXExtImpl(X11GLXContext context) {
+CustomJavaCode GLXExtImpl this._context = context;
+CustomJavaCode GLXExtImpl }
+
+CustomJavaCode GLXExtImpl public boolean isFunctionAvailable(String glFunctionName)
+CustomJavaCode GLXExtImpl {
+CustomJavaCode GLXExtImpl return _context.isFunctionAvailable(glFunctionName);
+CustomJavaCode GLXExtImpl }
+
+CustomJavaCode GLXExtImpl public boolean isExtensionAvailable(String glExtensionName)
+CustomJavaCode GLXExtImpl {
+CustomJavaCode GLXExtImpl return _context.isExtensionAvailable(glExtensionName);
+CustomJavaCode GLXExtImpl }
+
+CustomJavaCode GLXExtImpl private X11GLXContext _context;
+
+
+# These Ignores cause the core GLX routines to be ignored from the
+# GLXExt interface and GLXExtImpl implementing class.
+Ignore glXGetVisualFromFBConfig
+Ignore glXGetVisualFromFBConfigSGIX
+Ignore glXChooseFBConfig
+Ignore glXChooseVisual
+Ignore glXCreateContext
+Ignore glXDestroyContext
+Ignore glXMakeCurrent
+Ignore glXCopyContext
+Ignore glXSwapBuffers
+Ignore glXCreateGLXPixmap
+Ignore glXDestroyGLXPixmap
+Ignore glXQueryExtension
+Ignore glXQueryVersion
+Ignore glXIsDirect
+Ignore glXGetConfig
+Ignore glXGetCurrentContext
+Ignore glXGetCurrentDrawable
+Ignore glXWaitGL
+Ignore glXWaitX
+Ignore glXUseXFont
+Ignore glXQueryExtensionsString
+Ignore glXQueryServerString
+Ignore glXGetClientString
+Ignore glXGetCurrentDisplay
+Ignore glXChooseFBConfig
+Ignore glXGetFBConfigAttrib
+Ignore glXGetFBConfigs
+Ignore glXGetVisualFromFBConfig
+Ignore glXCreateWindow
+Ignore glXDestroyWindow
+Ignore glXCreatePixmap
+Ignore glXDestroyPixmap
+Ignore glXCreatePbuffer
+Ignore glXDestroyPbuffer
+Ignore glXQueryDrawable
+Ignore glXCreateNewContext
+Ignore glXMakeContextCurrent
+Ignore glXGetCurrentReadDrawable
+Ignore glXQueryContext
+Ignore glXSelectEvent
+Ignore glXGetSelectedEvent
+Ignore glXGetProcAddress
+
+# Ignore a few extensions that bring in data types we don't want to
+# expose in the public API (and that are useless anyway without
+# exposing more of the implementation)
+Ignore glXGetFBConfigAttribSGIX
+Ignore glXChooseFBConfigSGIX
+Ignore glXCreateGLXPixmapWithConfigSGIX
+Ignore glXCreateContextWithConfigSGIX
+Ignore glXGetVisualFromFBConfigSGIX
+Ignore glXGetFBConfigFromVisualSGIX
+Ignore glXCreateGLXPbufferSGIX
+Ignore glXDestroyGLXPbufferSGIX
+Ignore glXQueryGLXPbufferSGIX
+Ignore glXSelectEventSGIX
+Ignore glXGetSelectedEventSGIX
+Ignore glXCreateGLXPixmapMESA
+
+Opaque long GLXFBConfig
+
+# Now we can ignore the GLXFBConfig and XVisualInfo data types
+# Ignore GLXFBConfig
+Ignore XVisualInfo
+
+# Ignore the SGI hyperpipe extension, which will require more GlueGen
+# work to expose the pipeName fields in the various structs
+Ignore glXQueryHyperpipeNetworkSGIX
+Ignore glXHyperpipeConfigSGIX
+Ignore glXQueryHyperpipeConfigSGIX
+Ignore glXDestroyHyperpipeConfigSGIX
+Ignore glXBindHyperpipeSGIX
+Ignore glXQueryHyperpipeBestAttribSGIX
+Ignore glXHyperpipeAttribSGIX
+Ignore glXQueryHyperpipeAttribSGIX
+Ignore GLXHyperpipeNetworkSGIX
+Ignore GLXHyperpipeConfigSGIX
+Ignore GLXPipeRect
+Ignore GLXPipeRectLimits
diff --git a/make/config/jogl/nsig.cfg b/make/config/jogl/nsig.cfg
new file mode 100755
index 000000000..404746cc3
--- /dev/null
+++ b/make/config/jogl/nsig.cfg
@@ -0,0 +1,22 @@
+# The NativeSignatureEmitter can not yet handle some constructs
+Ignore glColorPointerListIBM
+Ignore glColorPointervINTEL
+Ignore glEdgeFlagPointerListIBM
+Ignore glFogCoordPointerListIBM
+Ignore glIndexPointerListIBM
+Ignore glMultiDrawElements
+Ignore glMultiDrawElementsEXT
+Ignore glMultiModeDrawElementsIBM
+Ignore glNormalPointerListIBM
+Ignore glNormalPointervINTEL
+Ignore glReplacementCodePointerSUN
+Ignore glSecondaryColorPointerListIBM
+Ignore glTexCoordPointerListIBM
+Ignore glTexCoordPointervINTEL
+Ignore glVertexPointerListIBM
+Ignore glVertexPointervINTEL
+Ignore glShaderSource
+Ignore glShaderSourceARB
+Ignore glGetSeparableFilter
+Ignore glGetSeparableFilterEXT
+Ignore glGetShaderSourceARB
diff --git a/make/config/jogl/wgl-CustomCCode.c b/make/config/jogl/wgl-CustomCCode.c
new file mode 100755
index 000000000..0fe9ee628
--- /dev/null
+++ b/make/config/jogl/wgl-CustomCCode.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+
+#define JOGL_DUMMY_WINDOW_NAME "__jogl_dummy_window"
+
+LRESULT CALLBACK DummyWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ return DefWindowProc(hWnd,uMsg,wParam,lParam);
+}
+
+ATOM oglClass = 0;
+
+HWND CreateDummyWindow( int x, int y, int width, int height ) {
+ HINSTANCE hInstance;
+ DWORD dwExStyle;
+ DWORD dwStyle;
+ HWND hWnd;
+
+ hInstance = GetModuleHandle(NULL);
+ if( !oglClass ) {
+ WNDCLASS wc;
+ ZeroMemory( &wc, sizeof( wc ) );
+ wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
+ wc.lpfnWndProc = (WNDPROC) DummyWndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = hInstance;
+ wc.hIcon = NULL;
+ wc.hCursor = NULL;
+ wc.hbrBackground = NULL;
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = JOGL_DUMMY_WINDOW_NAME;
+ if( !(oglClass = RegisterClass( &wc )) ) {
+ printf( "RegisterClass Failed: %d\n", GetLastError() );
+ return( 0 );
+ }
+ }
+
+ dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
+ dwStyle = WS_OVERLAPPEDWINDOW;
+ if( !(hWnd=CreateWindowEx( dwExStyle,
+ JOGL_DUMMY_WINDOW_NAME,
+ JOGL_DUMMY_WINDOW_NAME,
+ dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
+ x, y, width, height,
+ NULL, NULL, hInstance, NULL ) ) ) {
+ return( 0 );
+ }
+ return( hWnd );
+}
diff --git a/make/config/jogl/wgl-win32.cfg b/make/config/jogl/wgl-win32.cfg
new file mode 100644
index 000000000..f86f1adcc
--- /dev/null
+++ b/make/config/jogl/wgl-win32.cfg
@@ -0,0 +1,44 @@
+# This .cfg file is used to generate the interface to the wgl routines
+# used internally by the WindowsGLContext implementation.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/Windows
+
+Package com.sun.opengl.impl.windows.wgl
+JavaClass WGL
+Style allstatic
+Include gl-common-gl2.cfg
+Include gl-common-extensions.cfg
+Include gl-desktop.cfg
+
+# Implement the first argument to wglGetProcAddress as String instead
+# of byte[]
+ArgumentIsString wglGetProcAddress 0
+ArgumentIsString LoadLibraryA 0
+ArgumentIsString GetProcAddress 1
+
+CustomCCode #define WIN32_LEAN_AND_MEAN
+CustomCCode #include <windows.h>
+CustomCCode #undef WIN32_LEAN_AND_MEAN
+
+CustomCCode #include <wingdi.h>
+CustomCCode #include <stddef.h>
+
+Include ../intptr.cfg
+
+IncludeAs CustomCCode wgl-CustomCCode.c
+
+DropUniqVendorExtensions AMD
+# We need GL_APPLE_float_pixels for our pbuffer implementation
+# DropUniqVendorExtensions APPLE
+DropUniqVendorExtensions ATI
+DropUniqVendorExtensions HP
+DropUniqVendorExtensions IBM
+DropUniqVendorExtensions MESA
+DropUniqVendorExtensions MESAX
+DropUniqVendorExtensions NV
+DropUniqVendorExtensions SGI
+DropUniqVendorExtensions SGIS
+DropUniqVendorExtensions SGIX
+DropUniqVendorExtensions SUN
+DropUniqVendorExtensions WIN
+
diff --git a/make/config/jogl/wglext.cfg b/make/config/jogl/wglext.cfg
new file mode 100644
index 000000000..af4430bbe
--- /dev/null
+++ b/make/config/jogl/wglext.cfg
@@ -0,0 +1,51 @@
+# This .cfg file is used to generate the interface and implementing
+# class for the WGL extensions.
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/jogl/Windows
+
+Package com.sun.opengl.impl.windows.wgl
+Style InterfaceAndImpl
+JavaClass WGLExt
+ImplPackage com.sun.opengl.impl.windows.wgl
+ImplJavaClass WGLExtImpl
+Include gl-common-gl2.cfg
+Include gl-desktop.cfg
+
+EmitProcAddressTable true
+ProcAddressTableClassName WGLExtProcAddressTable
+GetProcAddressTableExpr _context.getWGLExtProcAddressTable()
+
+# Ignore everything that doesn't start with wgl or WGL
+Ignore GL_.+
+Ignore gl.+
+
+Include gl-headers.cfg
+Include ../intptr.cfg
+
+# FIXME: for the time being, ignore all extensions requiring the
+# presence of java.nio.LongBuffer because it doesn't exist on CDC/FP +
+# JSR-239 NIO subset (remove once we have Java SE classes running on CVM)
+# Inform the glue code generator of the association between #defines
+# and functions and the extensions in which they are defined
+GLHeader GL/wglext.h
+IgnoreExtension WGL_OML_sync_control
+IgnoreExtension WGL_NV_gpu_affinity
+
+CustomJavaCode WGLExt public boolean isFunctionAvailable(String glFunctionName);
+CustomJavaCode WGLExt public boolean isExtensionAvailable(String glExtensionName);
+
+CustomJavaCode WGLExtImpl public WGLExtImpl(WindowsWGLContext context) {
+CustomJavaCode WGLExtImpl this._context = context;
+CustomJavaCode WGLExtImpl }
+
+CustomJavaCode WGLExtImpl public boolean isFunctionAvailable(String glFunctionName)
+CustomJavaCode WGLExtImpl {
+CustomJavaCode WGLExtImpl return _context.isFunctionAvailable(glFunctionName);
+CustomJavaCode WGLExtImpl }
+
+CustomJavaCode WGLExtImpl public boolean isExtensionAvailable(String glExtensionName)
+CustomJavaCode WGLExtImpl {
+CustomJavaCode WGLExtImpl return _context.isExtensionAvailable(glExtensionName);
+CustomJavaCode WGLExtImpl }
+
+CustomJavaCode WGLExtImpl private WindowsWGLContext _context;
diff --git a/make/config/nativewindow/jawt-CustomJavaCode.java b/make/config/nativewindow/jawt-CustomJavaCode.java
new file mode 100755
index 000000000..f1ef91075
--- /dev/null
+++ b/make/config/nativewindow/jawt-CustomJavaCode.java
@@ -0,0 +1,27 @@
+private static volatile JAWT jawt;
+
+/** Helper routine for all users to call to access the JAWT. */
+public static JAWT getJAWT() {
+ if (jawt == null) {
+ synchronized (JAWT.class) {
+ if (jawt == null) {
+ JAWTNativeLibLoader.loadAWTImpl();
+ // Workaround for 4845371.
+ // Make sure the first reference to the JNI GetDirectBufferAddress is done
+ // from a privileged context so the VM's internal class lookups will succeed.
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ JAWT j = JAWT.create();
+ j.version(JAWTFactory.JAWT_VERSION_1_4);
+ if (!JAWTFactory.JAWT_GetAWT(j)) {
+ throw new RuntimeException("Unable to initialize JAWT");
+ }
+ jawt = j;
+ return null;
+ }
+ });
+ }
+ }
+ }
+ return jawt;
+}
diff --git a/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java b/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
new file mode 100755
index 000000000..dab377ad4
--- /dev/null
+++ b/make/config/nativewindow/jawt-DrawingSurfaceInfo-CustomJavaCode.java
@@ -0,0 +1,38 @@
+public JAWT_PlatformInfo platformInfo() {
+ return newPlatformInfo(platformInfo0(getBuffer()));
+}
+
+private native ByteBuffer platformInfo0(Buffer jthis0);
+
+private static java.lang.reflect.Method platformInfoFactoryMethod;
+
+private static JAWT_PlatformInfo newPlatformInfo(ByteBuffer buf) {
+ if (platformInfoFactoryMethod == null) {
+ String osName = (String) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty("os.name").toLowerCase();
+ }
+ });
+ try {
+ Class factoryClass;
+ if (osName.startsWith("wind")) {
+ factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.windows.JAWT_Win32DrawingSurfaceInfo");
+ } else if (osName.startsWith("mac os x")) {
+ factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.macosx.JAWT_MacOSXDrawingSurfaceInfo");
+ } else {
+ // Assume Linux, Solaris, etc. Should probably test for these explicitly.
+ factoryClass = Class.forName("com.sun.nativewindow.impl.jawt.x11.JAWT_X11DrawingSurfaceInfo");
+ }
+ platformInfoFactoryMethod = factoryClass.getMethod("create",
+ new Class[] { ByteBuffer.class });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ try {
+ return (JAWT_PlatformInfo)
+ platformInfoFactoryMethod.invoke(null, new Object[] { buf });
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+}
diff --git a/make/config/nativewindow/jawt-macosx.cfg b/make/config/nativewindow/jawt-macosx.cfg
new file mode 100644
index 000000000..b047ecdff
--- /dev/null
+++ b/make/config/nativewindow/jawt-macosx.cfg
@@ -0,0 +1,30 @@
+# This .cfg file is used to generate the interface to the JAWT, which
+# is used by the MacOSXOnscreenGLContext.
+Style AllStatic
+Package com.sun.nativewindow.impl.jawt
+JavaClass JAWTFactory
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/MacOSX
+
+HierarchicalNativeOutput false
+
+Opaque boolean jboolean
+Opaque long void *
+Opaque long NSView *
+
+IgnoreField JAWT GetComponent
+IgnoreField JAWT_DrawingSurfaceInfo platformInfo
+
+IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java
+
+CustomCCode #include <inttypes.h>
+CustomCCode #include <jawt.h>
+CustomCCode #include </usr/include/machine/types.h>
+
+import java.security.*
+import com.sun.nativewindow.impl.jawt.*
+StructPackage JAWT_MacOSXDrawingSurfaceInfo com.sun.nativewindow.impl.jawt.macosx
+EmitStruct JAWT_MacOSXDrawingSurfaceInfo
+Implements JAWT_MacOSXDrawingSurfaceInfo JAWT_PlatformInfo
+
+IncludeAs CustomJavaCode JAWT_DrawingSurfaceInfo jawt-DrawingSurfaceInfo-CustomJavaCode.java
diff --git a/make/config/nativewindow/jawt-win32.cfg b/make/config/nativewindow/jawt-win32.cfg
new file mode 100644
index 000000000..e7754843e
--- /dev/null
+++ b/make/config/nativewindow/jawt-win32.cfg
@@ -0,0 +1,30 @@
+# This .cfg file is used to generate the interface to the JAWT, which
+# is used by the WindowsOnscreenGLContext.
+Style AllStatic
+Package com.sun.nativewindow.impl.jawt
+JavaClass JAWTFactory
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/Windows
+
+HierarchicalNativeOutput false
+
+Opaque boolean jboolean
+Opaque long HDC
+
+IgnoreField JAWT GetComponent
+IgnoreField JAWT_DrawingSurfaceInfo platformInfo
+IgnoreField JAWT_Win32DrawingSurfaceInfo null
+IgnoreField JAWT_Win32DrawingSurfaceInfo hpalette
+
+IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java
+
+CustomCCode #include <jawt.h>
+Include ../intptr.cfg
+
+import java.security.*
+import com.sun.nativewindow.impl.jawt.*
+StructPackage JAWT_Win32DrawingSurfaceInfo com.sun.nativewindow.impl.jawt.windows
+EmitStruct JAWT_Win32DrawingSurfaceInfo
+Implements JAWT_Win32DrawingSurfaceInfo JAWT_PlatformInfo
+
+IncludeAs CustomJavaCode JAWT_DrawingSurfaceInfo jawt-DrawingSurfaceInfo-CustomJavaCode.java
diff --git a/make/config/nativewindow/jawt-x11.cfg b/make/config/nativewindow/jawt-x11.cfg
new file mode 100644
index 000000000..25df57a1f
--- /dev/null
+++ b/make/config/nativewindow/jawt-x11.cfg
@@ -0,0 +1,30 @@
+# This .cfg file is used to generate the interface to the JAWT, which
+# is used by the X11OnscreenGLContext.
+Style AllStatic
+Package com.sun.nativewindow.impl.jawt
+JavaClass JAWTFactory
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/X11
+
+HierarchicalNativeOutput false
+
+Opaque boolean jboolean
+Opaque long Drawable
+Opaque long Display *
+
+IgnoreField JAWT GetComponent
+IgnoreField JAWT_DrawingSurfaceInfo platformInfo
+IgnoreField JAWT_X11DrawingSurfaceInfo GetAWTColor
+
+IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java
+
+CustomCCode #include <inttypes.h>
+CustomCCode #include <jawt.h>
+
+import java.security.*
+import com.sun.nativewindow.impl.jawt.*
+StructPackage JAWT_X11DrawingSurfaceInfo com.sun.nativewindow.impl.jawt.x11
+EmitStruct JAWT_X11DrawingSurfaceInfo
+Implements JAWT_X11DrawingSurfaceInfo JAWT_PlatformInfo
+
+IncludeAs CustomJavaCode JAWT_DrawingSurfaceInfo jawt-DrawingSurfaceInfo-CustomJavaCode.java
diff --git a/make/config/nativewindow/x11-CustomCCode.c b/make/config/nativewindow/x11-CustomCCode.c
new file mode 100755
index 000000000..e24e0cd1c
--- /dev/null
+++ b/make/config/nativewindow/x11-CustomCCode.c
@@ -0,0 +1,165 @@
+#include <inttypes.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+/* Linux headers don't work properly */
+#define __USE_GNU
+#include <dlfcn.h>
+#undef __USE_GNU
+
+/* Current versions of Solaris don't expose the XF86 extensions,
+ although with the recent transition to Xorg this will probably
+ happen in an upcoming release */
+#if !defined(__sun) && !defined(_HPUX)
+#include <X11/extensions/xf86vmode.h>
+#else
+/* Need to provide stubs for these */
+Bool XF86VidModeGetGammaRampSize(
+ Display *display,
+ int screen,
+ int* size)
+{
+ return False;
+}
+
+Bool XF86VidModeGetGammaRamp(
+ Display *display,
+ int screen,
+ int size,
+ unsigned short *red_array,
+ unsigned short *green_array,
+ unsigned short *blue_array) {
+ return False;
+}
+Bool XF86VidModeSetGammaRamp(
+ Display *display,
+ int screen,
+ int size,
+ unsigned short *red_array,
+ unsigned short *green_array,
+ unsigned short *blue_array) {
+ return False;
+}
+#endif
+
+/* HP-UX doesn't define RTLD_DEFAULT. */
+#if defined(_HPUX) && !defined(RTLD_DEFAULT)
+#define RTLD_DEFAULT NULL
+#endif
+
+/* Need to expose DefaultScreen and RootWindow macros to Java */
+JNIEXPORT jlong JNICALL
+Java_com_sun_nativewindow_impl_x11_X11Lib_DefaultScreen(JNIEnv *env, jclass _unused, jlong display) {
+ return DefaultScreen((Display*) (intptr_t) display);
+}
+
+JNIEXPORT jlong JNICALL
+Java_com_sun_nativewindow_impl_x11_X11Lib_DefaultVisualID(JNIEnv *env, jclass _unused, jlong display, jint screen) {
+ return (jlong) XVisualIDFromVisual( DefaultVisual( (Display*) (intptr_t) display, screen ) );
+}
+
+JNIEXPORT jlong JNICALL
+Java_com_sun_nativewindow_impl_x11_X11Lib_RootWindow(JNIEnv *env, jclass _unused, jlong display, jint screen) {
+ return RootWindow((Display*) (intptr_t) display, screen);
+}
+
+JNIEXPORT jlong JNICALL
+Java_com_sun_nativewindow_impl_x11_X11Lib_dlopen(JNIEnv *env, jclass _unused, jstring name) {
+ const jbyte* chars;
+ void* res;
+ chars = (*env)->GetStringUTFChars(env, name, NULL);
+ res = dlopen(chars, RTLD_LAZY | RTLD_GLOBAL);
+ (*env)->ReleaseStringUTFChars(env, name, chars);
+ return (jlong) ((intptr_t) res);
+}
+
+JNIEXPORT jlong JNICALL
+Java_com_sun_nativewindow_impl_x11_X11Lib_dlsym(JNIEnv *env, jclass _unused, jstring name) {
+ const jbyte* chars;
+ void* res;
+ chars = (*env)->GetStringUTFChars(env, name, NULL);
+ res = dlsym(RTLD_DEFAULT, chars);
+ (*env)->ReleaseStringUTFChars(env, name, chars);
+ return (jlong) ((intptr_t) res);
+}
+
+/* Need to pull this in as we don't have a stub header for it */
+extern Bool XineramaEnabled(Display* display);
+
+static const char * clazzNameInternalBufferUtil = "com/sun/nativewindow/impl/InternalBufferUtil";
+static const char * clazzNameInternalBufferUtilStaticCstrName = "copyByteBuffer";
+static const char * clazzNameInternalBufferUtilStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;";
+static const char * clazzNameByteBuffer = "java/nio/ByteBuffer";
+static jclass clazzInternalBufferUtil = NULL;
+static jmethodID cstrInternalBufferUtil = NULL;
+static jclass clazzByteBuffer = NULL;
+
+static void _initClazzAccess(JNIEnv *env) {
+ if(NULL!=cstrInternalBufferUtil) return ;
+
+ jclass c = (*env)->FindClass(env, clazzNameInternalBufferUtil);
+ if(NULL==c) {
+ fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't find %s\n", clazzNameInternalBufferUtil);
+ (*env)->FatalError(env, clazzNameInternalBufferUtil);
+ }
+ clazzInternalBufferUtil = (jclass)(*env)->NewGlobalRef(env, c);
+ if(NULL==clazzInternalBufferUtil) {
+ fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't use %s\n", clazzNameInternalBufferUtil);
+ (*env)->FatalError(env, clazzNameInternalBufferUtil);
+ }
+ c = (*env)->FindClass(env, clazzNameByteBuffer);
+ if(NULL==c) {
+ fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't find %s\n", clazzNameByteBuffer);
+ (*env)->FatalError(env, clazzNameByteBuffer);
+ }
+ clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
+ if(NULL==c) {
+ fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib: can't use %s\n", clazzNameByteBuffer);
+ (*env)->FatalError(env, clazzNameByteBuffer);
+ }
+
+ cstrInternalBufferUtil = (*env)->GetStaticMethodID(env, clazzInternalBufferUtil,
+ clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
+ if(NULL==cstrInternalBufferUtil) {
+ fprintf(stderr, "FatalError: Java_com_sun_nativewindow_impl_x11_X11Lib:: can't create %s.%s %s\n",
+ clazzNameInternalBufferUtil,
+ clazzNameInternalBufferUtilStaticCstrName, clazzNameInternalBufferUtilStaticCstrSignature);
+ (*env)->FatalError(env, clazzNameInternalBufferUtilStaticCstrName);
+ }
+}
+
+/* Java->C glue code:
+ * Java package: com.sun.nativewindow.impl.x11.X11Lib
+ * Java method: XVisualInfo XGetVisualInfo(long arg0, long arg1, XVisualInfo arg2, java.nio.IntBuffer arg3)
+ * C function: XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * );
+ */
+JNIEXPORT jobject JNICALL
+Java_com_sun_nativewindow_impl_x11_X11Lib_XGetVisualInfoCopied1__JJLjava_nio_ByteBuffer_2Ljava_lang_Object_2I(JNIEnv *env, jclass _unused, jlong arg0, jlong arg1, jobject arg2, jobject arg3, jint arg3_byte_offset) {
+ XVisualInfo * _ptr2 = NULL;
+ int * _ptr3 = NULL;
+ XVisualInfo * _res;
+ int count;
+ if (arg2 != NULL) {
+ _ptr2 = (XVisualInfo *) (((char*) (*env)->GetDirectBufferAddress(env, arg2)) + 0);
+ }
+ if (arg3 != NULL) {
+ _ptr3 = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) + arg3_byte_offset);
+ }
+ _res = XGetVisualInfo((Display *) (intptr_t) arg0, (long) arg1, (XVisualInfo *) _ptr2, (int *) _ptr3);
+ count = _ptr3[0];
+ if (arg3 != NULL) {
+ (*env)->ReleasePrimitiveArrayCritical(env, arg3, _ptr3, 0);
+ }
+ if (_res == NULL) return NULL;
+
+ _initClazzAccess(env);
+
+ jobject jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(XVisualInfo));
+ jobject jbyteCopy = (*env)->CallStaticObjectMethod(env,
+ clazzInternalBufferUtil, cstrInternalBufferUtil, jbyteSource);
+
+ // FIXME: remove reference/gc jbyteSource ??
+ XFree(_res);
+
+ return jbyteCopy;
+}
+
diff --git a/make/config/nativewindow/x11-CustomJavaCode.java b/make/config/nativewindow/x11-CustomJavaCode.java
new file mode 100644
index 000000000..b1ee3a6c3
--- /dev/null
+++ b/make/config/nativewindow/x11-CustomJavaCode.java
@@ -0,0 +1,26 @@
+
+ /** Interface to C language function: <br> <code> XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * ); </code> */
+ public static XVisualInfo[] XGetVisualInfoCopied(long arg0, long arg1, XVisualInfo arg2, int[] arg3, int arg3_offset)
+ {
+ if(arg3 != null && arg3.length <= arg3_offset)
+ throw new RuntimeException("array offset argument \"arg3_offset\" (" + arg3_offset + ") equals or exceeds array length (" + arg3.length + ")");
+ java.nio.ByteBuffer _res;
+ _res = XGetVisualInfoCopied1(arg0, arg1, ((arg2 == null) ? null : arg2.getBuffer()), arg3, BufferFactory.SIZEOF_INT * arg3_offset);
+
+ if (_res == null) return null;
+ BufferFactory.nativeOrder(_res);
+ XVisualInfo[] _retarray = new XVisualInfo[getFirstElement(arg3, arg3_offset)];
+ for (int _count = 0; _count < getFirstElement(arg3, arg3_offset); _count++) {
+ _res.position(_count * XVisualInfo.size());
+ _res.limit ((1 + _count) * XVisualInfo.size());
+ java.nio.ByteBuffer _tmp = _res.slice();
+ _res.position(0);
+ _res.limit(_res.capacity());
+ _retarray[_count] = XVisualInfo.create(_tmp);
+ }
+ return _retarray;
+ }
+
+ /** Entry point to C language function: <code> XVisualInfo * XGetVisualInfo(Display * , long, XVisualInfo * , int * ); </code> */
+ private static native java.nio.ByteBuffer XGetVisualInfoCopied1(long arg0, long arg1, java.nio.ByteBuffer arg2, Object arg3, int arg3_byte_offset);
+
diff --git a/make/config/nativewindow/x11-lib.cfg b/make/config/nativewindow/x11-lib.cfg
new file mode 100644
index 000000000..321444725
--- /dev/null
+++ b/make/config/nativewindow/x11-lib.cfg
@@ -0,0 +1,43 @@
+# This .cfg file is used to generate the interface to the GLX routines
+# used internally by the X11GLContext implementation.
+Package com.sun.nativewindow.impl.x11
+JavaClass X11Lib
+Style allstatic
+
+HierarchicalNativeOutput false
+
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/X11
+
+# Imports needed by all glue code
+Import java.nio.*
+Import java.util.*
+
+# XID needs to be treated as a long for 32/64 bit compatibility
+Opaque long XID
+
+Opaque long Display *
+Opaque boolean Bool
+Opaque long GLXFBConfig
+
+CustomJavaCode X11Lib public static native long dlopen(String name);
+CustomJavaCode X11Lib public static native long dlsym(String name);
+
+IncludeAs CustomJavaCode X11Lib x11-CustomJavaCode.java
+IncludeAs CustomCCode x11-CustomCCode.c
+
+ArgumentIsString XOpenDisplay 0
+
+# Need to expose DefaultScreen and RootWindow macros to Java
+CustomJavaCode X11Lib public static native int DefaultScreen(long display);
+CustomJavaCode X11Lib public static native long DefaultVisualID(long display, int screen);
+CustomJavaCode X11Lib public static native long RootWindow(long display, int screen);
+
+# We have Custom code for the following
+Ignore XGetVisualInfo
+
+# Helper routine to make the ReturnedArrayLength expression below work correctly
+CustomJavaCode X11Lib private static int getFirstElement(IntBuffer buf) { return buf.get(buf.position()); }
+CustomJavaCode X11Lib private static int getFirstElement(int[] arr, int offset) { return arr[offset]; }
+
+CustomJavaCode XVisualInfo public static XVisualInfo create(XVisualInfo s) { XVisualInfo d = XVisualInfo.create(); d.getBuffer().put(s.getBuffer()); d.getBuffer().rewind(); s.getBuffer().rewind(); return d; }
diff --git a/make/doc/jogl/spec-overview.html b/make/doc/jogl/spec-overview.html
new file mode 100644
index 000000000..11074e601
--- /dev/null
+++ b/make/doc/jogl/spec-overview.html
@@ -0,0 +1,509 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>JSR 231 Draft Public Review Specification</title>
+</head>
+ <body>
+
+<h2>JSR 231 Specification Overview</h2>
+
+<h3>Preface</h3>
+ This specification, an optional set of packages, describes the Java(TM)
+bindings to the native OpenGL(R) 3D graphics library profiles:
+<ul>
+ <li> Desktop OpenGL 1.x, 2.y and 3.0, with x >= 5 and y >= 0 </li>
+ <li> Desktop OpenGL 3.x, with x >= 1 </li>
+ <li> Embedded OpenGL ES 1.x, with x >= 0 </li>
+ <li> Embedded OpenGL ES 2.x, with x >= 0 </li>
+</ul><br>
+ A binding to the native OpenCL(R) library is not yet specified, but intended to be
+ included in a <a href="#maintenanceupdates">maintenance update</a>.
+ <br>
+
+<h3>Dependencies</h3>
+ This binding has dependencies to the following:<br><br>
+ <ul>
+ <li> Either of the following Java implementations:<br>
+ <ul>
+ <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/">Java SE 1.4 or later</a> </li><br>
+ <li> <a href="http://java.sun.com/javame/technology/cdc/">Java ME CDC 1.1.2 (JSR 218)</a> and
+ <a href="http://java.sun.com/products/foundation/">Foundation Profile 1.1.2 (JSR 219)</a><br>
+ and either of the following <i>java.nio</i> implementations:<br>
+ <ul>
+ <li> <a href="http://java.sun.com/javame/reference/apis/jsr239/java/nio/package-summary.html"> JSR239 <i>java.nio</i> subset</a> </li>
+ <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/package-summary.html"> Java 1.4 <i>java.nio</i> implementation</a> </li>
+ </ul><br>
+ </ul>
+ <li> {@linkplain javax.media.nativewindow NativeWindow Protocol} <br>
+ <br>
+ The <i>NativeWindow Protocol</i> is included in Sun's sample implementation </li><br>
+ </ul>
+ <br>
+
+<h3>Package Structure</h3>
+ The packages defined by this specification include:<br>
+
+<ul>
+ <li>The <b>javax.media.opengl</b> package<br><br>
+ This package contains all Java bindings for all OpenGL profiles.<br>
+ The main OpenGL profile interfaces are:<br><br>
+ <ul>
+ <li> {@link javax.media.opengl.GL2 javax.media.opengl.GL2} interface<br>
+ <br>
+ This interface contains all core desktop OpenGL methods through
+version 3.0, inclusive, as well as most of it's extensions defined at the
+time of this specification. Early OpenGL extensions whose functionality
+was incorporated into core OpenGL by version 2.0, inclusive, are specifically
+excluded.<br>
+ Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+
+ <li> {@link javax.media.opengl.GL3 javax.media.opengl.GL3} interface<br>
+ <br>
+ This interface contains all core desktop OpenGL methods starting from 3.1,
+inclusive, as well as most of it's extensions defined at the
+time of this specification. <br>
+ Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+
+ <li> {@link javax.media.opengl.GLES1 javax.media.opengl.GLES1} interface<br>
+ <br>
+ This interface contains all core embedded OpenGL methods of ES 1.x, with x >= 0,
+inclusive, as well as most of it's extensions defined at the
+time of this specification. <br>
+ Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+
+ <li> {@link javax.media.opengl.GLES2 javax.media.opengl.GLES2} interface<br>
+ <br>
+ This interface contains all core embedded OpenGL methods of ES 2.x, with x >= 0,
+inclusive, as well as most of it's extensions defined at the
+time of this specification. <br>
+ Future extensions will be added with a <a href="#maintenanceupdates">maintenance update</a></li><br>
+ </ul>
+ Additionally the packages contains interfaces where the main profiles intersect each other.
+ These interfaces purposes is to provide common subsets of profiles to be used
+ on both, the desktop and the embedded device. These are:<br><br>
+ <ul>
+ <li> {@link javax.media.opengl.GLBase javax.media.opengl.GLBase} interface<br>
+ <br>
+ Common interface containing the profile type identification and conversion methods.<br>
+ Used to query which specialized profile class an instance of this object actually is and
+ offering a protocol to convert it to these types.</li><br>
+
+ <li> {@link javax.media.opengl.GL javax.media.opengl.GL} interface<br>
+ <br>
+ Common interface containing the subset of all profiles, GL3, GL2, GLES1 and GLES2.<br>
+ This interface reflects common data types, texture and framebuffer functionality.</li><br>
+
+ <li> {@link javax.media.opengl.GL2ES1 javax.media.opengl.GL2ES1} interface<br>
+ <br>
+ Interface containing the common subset of GL2 and GLES1.<br>
+ This interface reflects only the fixed functionality of OpenGL</li><br>
+
+ <li> {@link javax.media.opengl.GL2ES2 javax.media.opengl.GL2ES2} interface<br>
+ <br>
+ Interface containing the common subset of GL3, GL2 and GLES2.<br>
+ This interface reflects only the programmable shader functionality of OpenGL</li><br>
+ </ul>
+ </li><br>
+
+ <li>The <b>javax.media.opengl.glu</b> package<br>
+ <br>
+ This package contains bindings for the OpenGL Graphics System Utility (GLU)
+Library version 1.3, inclusive, with the exception of the GLU NURBS routines
+which are not exposed.</li><br>
+</ul>
+<br>
+
+<h3>API Binding Conventions</h3>
+ The Java language bindings to the pre-existing C APIs in these packages
+have been created using a consistent set of rules. Vendor-defined extensions
+should make use of the same rules in order to provide a consistent developer
+experience.<br>
+ <br>
+ The rules for creating the Java language binding are described in the following
+sections. These rules should be followed as closely as possible for all future
+APIs that share the javax.media.opengl namespace.<br>
+
+<h4>Function Naming</h4>
+ Functions are named in the same way as in the C binding. That is, an OpenGL
+API function glClear is bound to Java method GL.glClear. Although it would
+be possible to drop the gl prefix (since it is redundant with the interface
+name GL), the resulting code was deemed to look too foreign to experienced
+OpenGL developers. For the same reason, we have also carried over all type
+suffixes like 3f and 3fv from methods such as glColor3f and glColor3fv, respectively.<br>
+ <br>
+ Extension suffixes, such as EXT, ARB, and vendor-specific suffixes, are
+retained so as to match C conventions.<br>
+
+<h4>Mapping of Constants</h4>
+ Constants are named in the same way as in the C binding. For instance,
+the OpenGL constant GL_RGB is bound to Java constant GL.GL_RGB.<br>
+
+<h4>Mapping of Primitive Types</h4>
+ All 8-bit integral types become byte, all 16-bit integral types become
+short, and all 32-bit integral types become int. All 32-bit floating-point
+types become float and all 64-bit floating-point types become double.<br>
+ <br>
+ Integer return values that can only be GL_TRUE or GL_FALSE are mapped to
+boolean.<br>
+
+<h4>Mapping of Pointer Arguments</h4>
+ OpenGL functions that take pointer arguments fall into several categories:<br>
+
+<ul>
+ <li>Functions that take an untyped pointer argument for immediate use</li>
+ <li>Functions that take a typed pointer argument for immediate use</li>
+ <li>Functions that take an untyped pointer argument for deferred use</li>
+ <li>Functions that take a typed pointer argument for deferred use</li>
+ <br>
+</ul>
+ Functions that take an untyped (void*) pointer argument for immediate use
+are given a single binding that takes a New I/O (NIO) Buffer object. The Buffer
+may be of any type allowable by the function (and compatible with the other
+arguments to the function) and may be direct or indirect. An example of
+an OpenGL API in this category is glTexImage2D.<br>
+ <br>
+ Functions that take a typed pointer (e.g., GLfloat *) argument for immediate
+use are given two bindings. The first takes a Java primitive array with a
+type that matches the C pointer type (i.e., GLfloat* maps to float[]). The
+second takes a typed Buffer object (i.e., GLfloat* maps to FloatBuffer).
+An example of an OpenGL API in this category is glColor3fv.<br>
+ <br>
+ Functions that take an untyped (void*) pointer argument for deferred use
+are given a single binding that takes a Buffer object. The Buffer may be of
+any type allowable by the function (and compatible with the other arguments
+to the function), but must be direct. That is, it may not have been created
+from a Java primitive array using the wrap method. The functions that fall
+into this category generally have names ending with the suffix "pointer."
+An example of an OpenGL API in this category is glVertexPointer. Because these
+functions do not consume the data located at the given pointer immediately,
+but only at some unspecified later time, it is not possible to use a Java
+primitive array whose memory location may change.<br>
+ <br>
+ Functions that take a typed (e.g., GLfloat*) pointer argument for deferred
+use are given a single binding that takes a typed Buffer object (i.e., GLfloat*
+maps to FloatBuffer). The Buffer must be direct. That is, it may not have
+been created from a Java primitive array using the wrap method. An example
+of an OpenGL API in this category is glFeedbackBuffer.<br>
+ <br>
+ Methods that read or write a specific number of values from an array or
+Buffer argument do not read or write any subsequent elements of the array
+or Buffer.<br>
+ <br>
+ An outgoing C char* pointer, if representing a null-terminated, read-only
+C string, maps to a Java String. An outgoing C char** pointer, if similarly
+representing an array of read-only C strings, maps to a Java String[] (array
+of String objects). All other char* pointers, including those representing
+mutable C strings as used in some Get methods, are mapped to byte[] and ByteBuffer.
+ <br>
+
+<h4>Index Parameter for Arrays</h4>
+ Each C method argument that is mapped to a primitive array in Java is actually
+mapped to two separate parameters: the appropriate primitive array type in
+Java and an integer offset parameter. The value of the integer offset is
+the index which the method will start reading from within the array. Earlier
+indices will be ignored. This mapping provides more congruity with existing
+Java APIs and allows reuse of a single array across multiple Java method calls
+by changing the index in much the same way that C pointers permit for C arrays.<br>
+
+<h4>Reduction of Method Explosions</h4>
+ Since there are two ways to expand a given C method pointer parameter,
+it would be possible for C methods with multiple pointer arguments to expand
+to many Java methods if one was to consider every possible combination of
+mappings (the C method would expand to the number of pointer parameters to
+the power of 2). In order to avoid an API explosion, we restrict a given
+Java method to like kind mappings only. In other words, a given C method
+with N typed pointer parameters for immediate use, where N &gt;= 1, will map
+to exactly two Java methods: One with all primitive arrays and one with all
+Buffer types.<br>
+ <br>
+ Also, methods that accept multiple Buffer arguments require all direct
+or all non-direct Buffers. Direct and non-direct buffers should never be
+mixed within an API call by an application.<br>
+
+<h4>Byte ordering of Buffers</h4>
+ When allocating a New I/O Buffer (in particular, a direct ByteBuffer) to
+be passed to the APIs in these packages, it is essential to set the <em>byte
+ordering</em> of the newly-allocated ByteBuffer to the <em>native</em> byte
+ordering of the platform: e.g. <code>ByteBuffer.allocateDirect(...).order(ByteOrder.nativeOrder());</code>.
+The byte order of the ByteBuffer indicates how multi-byte values such as
+int and float are stored in the Buffer either using methods like putInt and
+putFloat or views such as IntBuffer or FloatBuffer. The Java bindings perform
+no conversion or byte swapping on the outgoing data to OpenGL, and the native
+OpenGL implementation expects data in the host CPU's byte order, so it is
+essential to always match the byte order of the underlying platform when
+filling Buffers with data. <br>
+
+<h4>Auto-slicing of Buffers</h4>
+ When a Buffer object is passed to an OpenGL function binding, the actual
+pointer argument that is passed down to the OpenGL C implementation is equal
+to the starting pointer of the Buffer data, plus an offset given by the Buffer.position()
+function, multiplied by the data type size in bytes (1 for a ByteBuffer, 2
+for a ShortBuffer, 4 for a IntBuffer or FloatBuffer, and 8 for DoubleBuffer).
+ The array offset given by Buffer&lt;type&gt;.arrayOffset() is also added
+in the offset for wrapped arrays.<br>
+ <br>
+ This feature is known as "auto-slicing," as it mimics the effect of calling
+slice() on the Buffer object without the overhead of explicit object creation.<br>
+
+<h4>Errors and Exceptions</h4>
+ For performance reasons, OpenGL functions do not return error values directly.
+Instead, applications must query for errors using functions such as glGetError.
+This behavior is largely preserved in the Java language bindings, as described
+below.<br>
+ <br>
+ In the interest of efficiency, the Java API does not generally throw exceptions.
+ However, running an application with the DebugGL composable pipeline, which
+is part of the API, will force an exception to be thrown at the point of failure.<br>
+ <br>
+ Many errors are defined by OpenGL merely to set the error code, rather
+than throwing an exception. For example, passing a bad enumerated parameter
+value may result in the error flag being set to GL.GL_INVALID_VALUE. Attempting
+to check for such errors in the binding layer would require either replicating
+the error-checking logic of the underlying engine, or querying the error state
+after every function. This would greatly impact performance by inhibiting
+the ability of the hardware to pipeline work.<br>
+
+<h4>Security</h4>
+ Exception behavior is defined in cases that could otherwise lead to illegal
+memory accesses in the underlying OpenGL engine. Implementations should take
+necessary steps to prevent the GL from accessing or overwriting memory except
+for properly allocated Buffers and array method arguments.<br>
+ <br>
+ An implementation should take care to validate arguments correctly before
+invoking native methods that could potentially access memory illegally. In
+particular, methods that validate the contents of an array (such as a list
+of GL attributes) or a Buffer should take precautions against exploits in
+which a separate thread attempts to alter the contents of the argument during
+the time interval following validation but preceding passage of the argument
+to the underlying native engine.<br>
+
+<h3><a name="SHARING">Sharing of Server-Side OpenGL Objects between GLContexts</a></h3>
+
+Sharing of server-side OpenGL objects such as textures and display
+lists among OpenGL contexts is supported in this specification.
+However, the specification does not guarantee that a request to share
+objects between two contexts will succeed. Certain OpenGL
+implementations restrict sharing in certain ways. Applications should
+assume that sharing is a request more than an assertion.
+Implementations of this specification should, but are not required to,
+provide timely notification of a failure of a request to share objects
+between two GLContexts, perhaps in the form of a GLException. The
+situation in which sharing is most likely to work on all platforms is
+between two GLContexts associated with the same GLDrawable.
+
+<h3>Criteria Used for Inclusion of APIs into the Java Bindings</h3>
+
+<h4>OpenGL API Inclusion Criteria</h4>
+ OpenGL functions and OpenGL extensions have been included in the Java bindings
+according the following rules: <br>
+
+<ul>
+ <li>
+ <li>All functions in core OpenGL 2.0, inclusive, have been included.</li>
+ <li>If the functionality of the OpenGL extension was subsumed into core
+OpenGL by version 2.0, then the extension was dropped from the Java bindings.
+ However, if the core function name is not available in the native OpenGL implementation,
+ the extension named equivalent is used instead, e.g. <i>GL_ARB_framebuffer_object</i>.</li>
+ <li>Functions that deal with explicit pointer values in such a way that
+they cannot be properly implemented in Java have been excluded.&nbsp; This
+includes retrieval methods with a C void ** in the OpenGL signature like glGetBufferPointerv,
+glGetPointerv, glGetVertexAttribPointerv, as well as functions that require
+persistent pointer to pointer storage across function calls like vertex array
+lists.</li>
+ <li>If the extension is registered in the official OpenGL extension registry
+but the specification was never completed or was discontinued (as indicated
+in the specification and/or lack of inclusion in SGI's official OpenGL header
+files), then the extension was not included.&nbsp; Using these criteria, ARB
+extensions through number 42 (GL_ARB_pixel_buffer_object), inclusive, and
+non-ARB extensions through number 311 (GL_REMEDY_string_marker), inclusive,
+have been included in the Java bindings according to the numbering scheme
+found in the official OpenGL extension registry.</li>
+ <li>Some bindings to several vendor-specific extensions have been included
+that are not found in the OpenGL extension registry.&nbsp; These extensions
+were deemed popular enough and/or were specifically requested by users.</li>
+ <li>Platform-specific extensions, such as those that begin with WGL, GLX,
+CGL, etc., have been excluded from the public API.&nbsp; See the section "Accessing
+platform-specific extensions" for more information about accessing these
+functions on certain implementations.<br>
+ </li>
+
+</ul>
+
+<h4>OpenGL GLU API Inclusion Criteria</h4>
+ Bindings for all core GLU APIs have been included with the exception of
+the GLU NURBS APIs. &nbsp;These APIs may be included in a future maintenance
+release of the Java bindings.<br>
+
+<h3>OpenGL Extensions</h3>
+
+<h4>Creating New Extensions</h4>
+ While the Java APIs for OpenGL extensions are unconditionally exposed, the
+underlying functions may not be present. A program can query whether a potentially
+unavailable function is actually available at runtime by using the method
+GL.isFunctionAvailable.<br>
+ <br>
+ Bindings for OpenGL extensions not covered in this specification may be
+supplied by individual vendors or groups. Such bindings may be considered
+for inclusion in a future version of the JSR. In order to avoid fragmentation,
+vendors creating extension bindings should expose new extensions using the
+method GL.getExtension. This method is intended to provide a mechanism for
+vendors who wish to provide access to new OpenGL extensions without changing
+the public API of the core package. <br>
+ <br>
+ Names for added extension methods and extension-defined constants and Java
+bindings for C parameters should follow the guidelines set forth in this specfication.<br>
+
+<h4>Accessing Platform-Specific Extensions</h4>
+ Platform-specific extensions such as those that begin with WGL, GLX, CGL,
+etc. are not included in the API.&nbsp; Each implementation can choose to
+export all, some, or none of these APIs via the GL.getPlatformGLExtensions
+API which returns an Object whose underlying data type is specific to a given
+implementation.<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<br>
+ Therefore, any usage of these APIs is both platform and implementation specific.<br>
+
+<h3>OpenGL Version on Runtime System</h3>
+ Even though OpenGL extensions whose functionality was included into core
+OpenGL by version 2.0, inclusive, are not included in the bindings, it should
+be noted that OpenGL version 2.0 is not an absolute requirement on the runtime
+system.&nbsp; This is because a user could query whether any particular function
+is available before calling certain core APIs that might not be present.&nbsp;
+Also, if the core function name is not available in the native OpenGL implementation,
+the extension named equivalent is used instead, e.g. <i>GL_ARB_framebuffer_object</i>.&nbsp;
+However, in general, it is reasonable to expect at least OpenGL 2.0 to be
+installed on the runtime system and an implementor of the API is free to require
+the presence of at least OpenGL 2.0 on the target system.<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<br>
+ In future revisions of the API, this minimum standard may be raised.<br>
+
+<h3>Runtime Version Information</h3>
+Any Java Bindings for OpenGL implementation should include version information
+in its jar manifest file. &nbsp;This information can then easily be accessed
+at runtime via the java.lang.Package API. &nbsp;At least the following information
+is included in the Reference Implementation jar file manifest: Specification
+Title, Specification Vendor, Specification Version, Implementation Vendor,
+and Implementation Version.<br>
+<a name="maintenanceupdates"/>
+<h3>Future Maintenance Updates</h3>
+ New core APIs found in future versions of OpenGL, as well as new OpenGL
+extensions, are expected to be added to the bindings and included into the
+javax.media.opengl namespace via future maintenance updates to the API.<br>
+
+<h3>Related Links</h3>
+
+<ul>
+ <li> JSR 231 JCP Web Page</li>
+
+</ul>
+
+<blockquote><a href="http://www.jcp.org/en/jsr/detail?id=231"> http://www.jcp.org/en/jsr/detail?id=231</a></blockquote>
+
+<ul>
+ <li>OpenCL Specification</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.khronos.org/registry/cl/">
+http://www.khronos.org/registry/cl/</a></blockquote>
+
+<ul>
+ <li>OpenGL 3.1 Specification</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.opengl.org/registry/doc/glspec31.20090324.pdf">
+http://www.opengl.org/registry/doc/glspec31.20090324.pdf</a></blockquote>
+
+<ul>
+ <li>OpenGL 2.1 Specification</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.opengl.org/registry/doc/glspec21.20061201.pdf">
+http://www.opengl.org/registry/doc/glspec21.20061201.pdf</a></blockquote>
+
+<ul>
+ <li>OpenGL 2.0 Specification</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf">
+http://www.opengl.org/documentation/specs/version2.0/glspec20.pdf</a></blockquote>
+
+<ul>
+ <li> OpenGL Extension Registry</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.opengl.org/registry/"> http://www.opengl.org/registry/</a></blockquote>
+
+<pre></pre>
+
+<ul>
+ <li>OpenGL ES 2.x Specification </li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.24.pdf">
+http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.24.pdf</a></blockquote>
+
+<ul>
+ <li>OpenGL ES 1.x Specification </li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf">
+http://www.khronos.org/registry/gles/specs/1.1/es_full_spec_1.1.12.pdf</a></blockquote>
+
+<ul>
+ <li>OpenGL ES Registry</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.khronos.org/registry/gles/">
+http://www.khronos.org/registry/gles/</a></blockquote>
+
+<ul>
+ <li>OpenGL Utility Library: GLU 1.3 Specificiation</li>
+
+</ul>
+
+<blockquote><a
+ href="http://www.opengl.org/documentation/specs/glu/glu1_3.pdf"> http://www.opengl.org/documentation/specs/glu/glu1_3.pdf</a></blockquote>
+
+<ul>
+ <li>OpenGL ARB Web site</li>
+
+</ul>
+
+<blockquote><a href="http://www.opengl.org/about/arb/index.html"> http://www.opengl.org/about/arb/index.html</a></blockquote>
+
+<h3><br>
+ </h3>
+
+<h3>Revision History<br>
+ </h3>
+
+<ul>
+<li> Early Draft Review, October/November 2005
+<li> Public Review, December/January 2005
+<li> Proposed Final Draft Review, February/March 2006
+<li> 1.0.0 Final Release, September 2006
+<li> 1.1.0 Maintenance Release, April 2007
+<li> 1.2.0 Maintenance Release, June 2009
+</ul>
+ <br>
+ <br>
+ <br>
+</body>
+</html>
diff --git a/make/jogl.compiler.xml b/make/jogl.compiler.xml
new file mode 100644
index 000000000..1033a2851
--- /dev/null
+++ b/make/jogl.compiler.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="JOGL" basedir="." default="all">
+<target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler">
+ <linker id="linker.cfg.linux.jogl.x11" extends="linker.cfg.linux">
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="X11"/>
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="Xxf86vm"/>
+ </linker>
+
+ <linker id="linker.cfg.linux.jogl.gl2" extends="linker.cfg.linux.jogl.x11">
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="GL"/>
+ <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/>
+ </linker>
+</target>
+</project>
+
diff --git a/make/jogl.properties b/make/jogl.properties
new file mode 100644
index 000000000..bb5e81f87
--- /dev/null
+++ b/make/jogl.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# The host specific properties. The build will inform you of required
+# properties. This file must be copied into your home directory (pointed
+# to by the Java system property user.home) and the copy modified appropriately.
+###############################################################################
+#
+# java.home.dir is usually inferred from the java.home variable.
+# If it appears the build is failing because of an inability to
+# find e.g. JAWT or JNI headers, override this to point to the
+# root directory of your JDK.
+#
+# java.home.dir=C:/jdk1.4.2
+
+#
+# If you are building the Cg binding (by specifying -Djogl.cg=1 to the
+# Ant build) and have installed the Cg SDK in somewhere other than the
+# default location, modify the appropriate variable to point to the
+# absolute path of the lib directory
+#
+windows.cg.lib=C:/Program Files/Nvidia Corporation/Cg/lib
+x11.cg.lib=/usr/lib
diff --git a/make/joglRIversion b/make/joglRIversion
new file mode 100644
index 000000000..af9e41d8d
--- /dev/null
+++ b/make/joglRIversion
@@ -0,0 +1,8 @@
+Specification-Title: Java Bindings for OpenGL API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: Java Bindings for OpenGL Runtime Environment
+Implementation-Version: @BASEVERSION@
+Implementation-Vendor: Sun Microsystems, Inc.
+Extension-Name: javax.media.opengl
+Implementation-Vendor-Id: com.sun
diff --git a/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj b/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj
new file mode 100755
index 000000000..4f459fefd
--- /dev/null
+++ b/make/jogl_wince6_vs9/gluegen-rt/gluegen-rt.vcproj
@@ -0,0 +1,1307 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="gluegen-rt"
+ ProjectGUID="{067965D8-2399-4AAA-B9D9-5F62670BF7AE}"
+ RootNamespace="gluegen-rt"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="STANDARDSDK_500 (ARMV4I)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (x86)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (SH4)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII_FP)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV_FP)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;GLUEGENRT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/gluegen-rt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/gluegen-rt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/gluegen-rt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\..\gluegen\src\native\windows\WindowsDynamicLinkerImpl_JNI.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj b/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj
new file mode 100755
index 000000000..a4477d0e8
--- /dev/null
+++ b/make/jogl_wince6_vs9/jogl_es1/jogl_es1.vcproj
@@ -0,0 +1,1319 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="jogl_es1"
+ ProjectGUID="{FDAF69B7-12E1-4C99-AB11-BFA54F511889}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="STANDARDSDK_500 (ARMV4I)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (x86)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (SH4)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII_FP)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV_FP)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,,..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,,..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ AdditionalDependencies="aygshell.lib"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES1_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es1.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es1.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es1.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\build\gensrc\native\jogl\egl\EGL_JNI.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\build\gensrc\native\jogl\egl\EGLExtImpl_JNI.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\build\gensrc\native\jogl\es1\GLES1Impl_JNI.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\native\jogl\InternalBufferUtils.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj b/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj
new file mode 100755
index 000000000..1a9ad99e2
--- /dev/null
+++ b/make/jogl_wince6_vs9/jogl_es2/jogl_es2.vcproj
@@ -0,0 +1,1329 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="jogl_es2"
+ ProjectGUID="{E1E28813-1879-465D-95AB-F575598B404B}"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="STANDARDSDK_500 (ARMV4I)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (x86)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (SH4)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII_FP)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV_FP)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,,..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\build\gensrc\native\newt\Windows"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ AdditionalDependencies="aygshell.lib"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,..\..\..\make\stub_includes\egl,..\..\..\make\stub_includes\opengl,..\..\..\make\stub_includes\openmax,..\..\..\build\gensrc\native\newt\Windows,..\..\..\build\gensrc\native\openmax"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ AdditionalDependencies="aygshell.lib libKD.lib libnvomx.lib libEGL.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;JOGL_ES2_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/jogl_es2.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/jogl_es2.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/jogl_es2.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\build\gensrc\native\jogl\egl\EGL_JNI.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\build\gensrc\native\jogl\egl\EGLExtImpl_JNI.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\build\gensrc\native\jogl\es2\GLES2Impl_JNI.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\native\jogl\InternalBufferUtils.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\native\openmax\omx_tool.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\native\openmax\com_sun_openmax_OMXInstance.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/make/jogl_wince6_vs9/jogl_wince6.sln b/make/jogl_wince6_vs9/jogl_wince6.sln
new file mode 100755
index 000000000..6e466e653
--- /dev/null
+++ b/make/jogl_wince6_vs9/jogl_wince6.sln
@@ -0,0 +1,202 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jogl_es2", "jogl_es2\jogl_es2.vcproj", "{E1E28813-1879-465D-95AB-F575598B404B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jogl_es1", "jogl_es1\jogl_es1.vcproj", "{FDAF69B7-12E1-4C99-AB11-BFA54F511889}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gluegen-rt", "gluegen-rt\gluegen-rt.vcproj", "{067965D8-2399-4AAA-B9D9-5F62670BF7AE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "newt", "newt\newt.vcproj", "{C508A423-ECD4-430E-8759-EC3A11969FE2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|STANDARDSDK_500 (ARMV4I) = Debug|STANDARDSDK_500 (ARMV4I)
+ Debug|STANDARDSDK_500 (MIPSII) = Debug|STANDARDSDK_500 (MIPSII)
+ Debug|STANDARDSDK_500 (MIPSII_FP) = Debug|STANDARDSDK_500 (MIPSII_FP)
+ Debug|STANDARDSDK_500 (MIPSIV) = Debug|STANDARDSDK_500 (MIPSIV)
+ Debug|STANDARDSDK_500 (MIPSIV_FP) = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ Debug|STANDARDSDK_500 (SH4) = Debug|STANDARDSDK_500 (SH4)
+ Debug|STANDARDSDK_500 (x86) = Debug|STANDARDSDK_500 (x86)
+ Release|STANDARDSDK_500 (ARMV4I) = Release|STANDARDSDK_500 (ARMV4I)
+ Release|STANDARDSDK_500 (MIPSII) = Release|STANDARDSDK_500 (MIPSII)
+ Release|STANDARDSDK_500 (MIPSII_FP) = Release|STANDARDSDK_500 (MIPSII_FP)
+ Release|STANDARDSDK_500 (MIPSIV) = Release|STANDARDSDK_500 (MIPSIV)
+ Release|STANDARDSDK_500 (MIPSIV_FP) = Release|STANDARDSDK_500 (MIPSIV_FP)
+ Release|STANDARDSDK_500 (SH4) = Release|STANDARDSDK_500 (SH4)
+ Release|STANDARDSDK_500 (x86) = Release|STANDARDSDK_500 (x86)
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)
+ {E1E28813-1879-465D-95AB-F575598B404B}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)
+ {FDAF69B7-12E1-4C99-AB11-BFA54F511889}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)
+ {067965D8-2399-4AAA-B9D9-5F62670BF7AE}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (ARMV4I).ActiveCfg = Debug|STANDARDSDK_500 (ARMV4I)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (ARMV4I).Build.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (ARMV4I).Deploy.0 = Debug|STANDARDSDK_500 (ARMV4I)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSII).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSII).Build.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSII).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSII_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSII_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSIV).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSIV).Build.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSIV).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Debug|STANDARDSDK_500 (MIPSIV_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (SH4).ActiveCfg = Debug|STANDARDSDK_500 (SH4)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (SH4).Build.0 = Debug|STANDARDSDK_500 (SH4)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (SH4).Deploy.0 = Debug|STANDARDSDK_500 (SH4)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (x86).ActiveCfg = Debug|STANDARDSDK_500 (x86)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (x86).Build.0 = Debug|STANDARDSDK_500 (x86)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Debug|STANDARDSDK_500 (x86).Deploy.0 = Debug|STANDARDSDK_500 (x86)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (ARMV4I).ActiveCfg = Release|STANDARDSDK_500 (ARMV4I)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (ARMV4I).Build.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (ARMV4I).Deploy.0 = Release|STANDARDSDK_500 (ARMV4I)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSII).ActiveCfg = Release|STANDARDSDK_500 (MIPSII)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSII).Build.0 = Release|STANDARDSDK_500 (MIPSII)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSII).Deploy.0 = Release|STANDARDSDK_500 (MIPSII)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSII_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSII_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSII_FP).Build.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSII_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSII_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSIV).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSIV).Build.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSIV).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSIV_FP).ActiveCfg = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSIV_FP).Build.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (MIPSIV_FP).Deploy.0 = Release|STANDARDSDK_500 (MIPSIV_FP)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (SH4).ActiveCfg = Release|STANDARDSDK_500 (SH4)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (SH4).Build.0 = Release|STANDARDSDK_500 (SH4)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (SH4).Deploy.0 = Release|STANDARDSDK_500 (SH4)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (x86).ActiveCfg = Release|STANDARDSDK_500 (x86)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (x86).Build.0 = Release|STANDARDSDK_500 (x86)
+ {C508A423-ECD4-430E-8759-EC3A11969FE2}.Release|STANDARDSDK_500 (x86).Deploy.0 = Release|STANDARDSDK_500 (x86)
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/make/jogl_wince6_vs9/jogl_wince6.suo b/make/jogl_wince6_vs9/jogl_wince6.suo
new file mode 100755
index 000000000..04fda9711
--- /dev/null
+++ b/make/jogl_wince6_vs9/jogl_wince6.suo
Binary files differ
diff --git a/make/jogl_wince6_vs9/newt/newt.vcproj b/make/jogl_wince6_vs9/newt/newt.vcproj
new file mode 100755
index 000000000..dc3c635ba
--- /dev/null
+++ b/make/jogl_wince6_vs9/newt/newt.vcproj
@@ -0,0 +1,1331 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="newt"
+ ProjectGUID="{C508A423-ECD4-430E-8759-EC3A11969FE2}"
+ RootNamespace="newt"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="STANDARDSDK_500 (ARMV4I)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (x86)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (SH4)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSII_FP)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV)"
+ />
+ <Platform
+ Name="STANDARDSDK_500 (MIPSIV_FP)"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,..\..\..\build\gensrc\native\newt\Windows,..\..\..\build\gensrc\native\newt\KD,..\..\..\make\stub_includes\egl"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="0"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;DEBUG;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ MinimalRebuild="true"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="2"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (ARMV4I)"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ AdditionalIncludeDirectories="..\..\..\..\CVM\cdc\src\share\javavm\export,..\..\..\..\CVM\cdc\src\share,..\..\..\..\CVM\cdc\src\win32,..\..\..\..\CVM\cdc\src\win32-arm,..\..\..\build\gensrc\native\newt\Windows,..\..\..\build\gensrc\native\newt\KD,..\..\..\make\stub_includes\egl"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory="\Storage Card\bin"
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (x86)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (SH4)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="libKD.lib"
+ AdditionalLibraryDirectories="../../../make/lib/wince/arm/nvap"
+ AdditionalOptions=" /subsystem:windowsce,5.00"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSII_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPS"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|STANDARDSDK_500 (MIPSIV_FP)"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ ExecutionBucket="7"
+ Optimization="2"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;_WINDOWS;_USRDLL;NEWT_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ CompileAs="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir)"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions=" /subsystem:windowsce,5.00 /machine:MIPSFPU"
+ OutputFile="$(OutDir)/newt.dll"
+ LinkIncremental="1"
+ DelayLoadDLLs="$(NOINHERIT)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/newt.pdb"
+ SubSystem="0"
+ StackReserveSize="65536"
+ StackCommitSize="4096"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(OutDir)/newt.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCCodeSignTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ <DeploymentTool
+ ForceDirty="-1"
+ RemoteDirectory=""
+ RegisterOutput="0"
+ AdditionalFiles=""
+ />
+ <DebuggerTool
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\src\native\newt\WindowsWindow.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\native\newt\KDWindow.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/make/joglversion b/make/joglversion
new file mode 100644
index 000000000..d013d0967
--- /dev/null
+++ b/make/joglversion
@@ -0,0 +1,8 @@
+Specification-Title: Java Bindings for OpenGL API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: Java Bindings for OpenGL Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Vendor: java.net JOGL community
+Extension-Name: javax.media.opengl
+Implementation-Vendor-Id: com.sun
diff --git a/make/lib/wince/arm/nvap/libEGL.lib b/make/lib/wince/arm/nvap/libEGL.lib
new file mode 100755
index 000000000..46d781770
--- /dev/null
+++ b/make/lib/wince/arm/nvap/libEGL.lib
Binary files differ
diff --git a/make/lib/wince/arm/nvap/libGLESv1_CM.lib b/make/lib/wince/arm/nvap/libGLESv1_CM.lib
new file mode 100755
index 000000000..482ea65d7
--- /dev/null
+++ b/make/lib/wince/arm/nvap/libGLESv1_CM.lib
Binary files differ
diff --git a/make/lib/wince/arm/nvap/libGLESv2.lib b/make/lib/wince/arm/nvap/libGLESv2.lib
new file mode 100755
index 000000000..8cf4c319f
--- /dev/null
+++ b/make/lib/wince/arm/nvap/libGLESv2.lib
Binary files differ
diff --git a/make/lib/wince/arm/nvap/libKD.lib b/make/lib/wince/arm/nvap/libKD.lib
new file mode 100755
index 000000000..820a6d478
--- /dev/null
+++ b/make/lib/wince/arm/nvap/libKD.lib
Binary files differ
diff --git a/make/lib/wince/arm/nvap/libnvkdmain.lib b/make/lib/wince/arm/nvap/libnvkdmain.lib
new file mode 100755
index 000000000..425acfe04
--- /dev/null
+++ b/make/lib/wince/arm/nvap/libnvkdmain.lib
Binary files differ
diff --git a/make/lib/wince/arm/nvap/libnvomx.lib b/make/lib/wince/arm/nvap/libnvomx.lib
new file mode 100755
index 000000000..e669585ee
--- /dev/null
+++ b/make/lib/wince/arm/nvap/libnvomx.lib
Binary files differ
diff --git a/make/lsGL2toGL3_commons.sh b/make/lsGL2toGL3_commons.sh
new file mode 100644
index 000000000..cccfa734c
--- /dev/null
+++ b/make/lsGL2toGL3_commons.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+BUILDDIR=$1
+shift
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+echo GL2 to GL3 enums
+sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep GL_ | awk ' { print $5 } '
+
+echo GL2 to GL3 functions
+sort $idir/GL2.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep "public [a-z0-9_]* gl"
diff --git a/make/lsGLES2toGL3_commons.sh b/make/lsGLES2toGL3_commons.sh
new file mode 100644
index 000000000..d271b7ea2
--- /dev/null
+++ b/make/lsGLES2toGL3_commons.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+BUILDDIR=$1
+shift
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+echo GLES2 to GL3 enums
+sort $idir/GLES2.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep GL_ | awk ' { print $5 } '
+
+echo GLES2 to GL3 functions
+sort $idir/GLES2.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep "public [a-z0-9_]* gl"
diff --git a/make/lsGLtoES1ES2_commons.sh b/make/lsGLtoES1ES2_commons.sh
new file mode 100644
index 000000000..21efb6549
--- /dev/null
+++ b/make/lsGLtoES1ES2_commons.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+BUILDDIR=$1
+shift
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+echo GL to GL2ES1 to GL2ES1 GL2 enums
+sort $idir/GL.java $idir/GL2ES1.java $idir/GL2ES2.java $idir/GL2.java | uniq -d | grep GL_ | awk ' { print $5 } '
+
+echo GL to GL2ES1 to GL2ES1 GL2 functions
+sort $idir/GL.java $idir/GL2ES1.java $idir/GL2ES2.java $idir/GL2.java | uniq -d | grep "public [a-z0-9_]* gl"
diff --git a/make/lsGLtoES1_commons.sh b/make/lsGLtoES1_commons.sh
new file mode 100644
index 000000000..e8a370acb
--- /dev/null
+++ b/make/lsGLtoES1_commons.sh
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+BUILDDIR=$1
+shift
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+echo GL to GL2ES1 to GLES1 enums
+sort $idir/GL.java $idir/GLES1.java $idir/GL2ES1.java | uniq -d | grep GL_ | awk ' { print $5 } '
+
+echo GL to GL2ES1 to GLES1 functions
+sort $idir/GL.java $idir/GLES1.java $idir/GL2ES1.java | uniq -d | grep "public [a-z0-9_]* gl"
+
diff --git a/make/lsGLtoES2_commons.sh b/make/lsGLtoES2_commons.sh
new file mode 100644
index 000000000..bbd0e239c
--- /dev/null
+++ b/make/lsGLtoES2_commons.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+BUILDDIR=$1
+shift
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+echo GL to GL2ES2 to GLES2 enums
+sort $idir/GL.java $idir/GLES2.java $idir/GL2ES2.java | uniq -d | grep GL_ | awk ' { print $5 } '
+
+echo GL to GL2ES2 to GLES2 functions
+sort $idir/GL.java $idir/GLES2.java $idir/GL2ES2.java | uniq -d | grep "public [a-z0-9_]* gl"
diff --git a/make/lsGLtoGL3_commons.sh b/make/lsGLtoGL3_commons.sh
new file mode 100644
index 000000000..44cc34ccd
--- /dev/null
+++ b/make/lsGLtoGL3_commons.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+BUILDDIR=$1
+shift
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+echo GL to GL2ES2 to GL3 enums
+sort $idir/GL.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep GL_ | awk ' { print $5 } '
+
+echo GL to GL2ES2 to GL3 functions
+sort $idir/GL.java $idir/GL3.java $idir/GL2ES2.java | uniq -d | grep "public [a-z0-9_]* gl"
diff --git a/make/lstjars.sh b/make/lstjars.sh
new file mode 100644
index 000000000..d170df308
--- /dev/null
+++ b/make/lstjars.sh
@@ -0,0 +1,105 @@
+#! /bin/sh
+
+THISDIR=$(pwd)
+STATDIR=$THISDIR/../stats
+
+BUILDDIR=$1
+if [ -z "$BUILDDIR" ] ; then
+ echo "usage $0 <BUILDDIR>"
+ exit 1
+fi
+
+idir=$BUILDDIR/jogl/gensrc/classes/javax/media/opengl
+
+
+function report() {
+ #ls -1 -s --block-size=1024 $*
+ #ls -1 -s --block-size=1024 $* | awk ' BEGIN { sum=0 ; } { sum=sum+$1; } END { printf("%d Total\n", sum); }'
+ du -ksc $*
+}
+
+rm -rf $STATDIR
+mkdir -p $STATDIR
+cp -a $BUILDDIR/nativewindow/obj/*.so $STATDIR
+cp -a $BUILDDIR/jogl/obj/*.so $STATDIR
+cp -a $BUILDDIR/newt/obj/*.so $STATDIR
+cp -a $BUILDDIR/nativewindow/*.jar $STATDIR
+cp -a $BUILDDIR/jogl/*.jar $STATDIR
+cp -a $BUILDDIR/newt/*.jar $STATDIR
+
+cd $STATDIR
+
+for i in *.so ; do
+ gzip $i
+done
+
+echo Native Libraries
+report *.gz
+echo
+
+rm -f *.lst
+
+for i in *.jar ; do
+ fname=$i
+ bname=$(basename $fname .jar)
+ echo pack200 $bname.pack.gz $fname
+ pack200 $bname.pack.gz $fname
+ echo list $fname to $bname.lst
+ jar tf $fname | grep class | sort > $bname.lst
+done
+
+rm -rf nope
+mkdir -p nope
+
+rm -f allparts.lst allall.lst
+
+mv jogl.all.lst nope/
+
+mv jogl.gl2es12.*.lst jogl.gl2.*.lst nope/
+echo duplicates - w/o gl2es12.* gl2.*
+echo
+sort jogl*.lst | uniq -d
+mv nope/* .
+
+mv *.all.lst nope/
+cat *.lst | sort -u > allparts.lst
+mv nope/* .
+cat *.all.lst | sort -u > allall.lst
+
+echo all vs allparts delta
+echo
+diff -Nur allparts.lst allall.lst
+
+OSS=x11
+
+echo JOGL ES1 NEWT CORE
+report nativewindow.core.pack.gz jogl.core.pack.gz jogl.util.pack.gz jogl.egl.pack.gz jogl.gles1.pack.gz newt.core.pack.gz newt.ogl.pack.gz libjogl_es1.so.gz libnewt.so.gz
+echo
+
+echo JOGL ES2 NEWT CORE
+report nativewindow.core.pack.gz jogl.core.pack.gz jogl.util.pack.gz jogl.egl.pack.gz jogl.gles2.pack.gz newt.core.pack.gz newt.ogl.pack.gz libjogl_es2.so.gz libnewt.so.gz
+echo
+
+echo JOGL ES2 NEWT CORE FIXED
+report nativewindow.core.pack.gz jogl.core.pack.gz jogl.util.pack.gz jogl.egl.pack.gz jogl.gles2.pack.gz jogl.util.fixedfuncemu.pack.gz newt.core.pack.gz newt.ogl.pack.gz libjogl_es2.so.gz libnewt.so.gz
+echo
+
+echo JOGL GL2ES12 NEWT
+report nativewindow.core.pack.gz jogl.core.pack.gz jogl.util.pack.gz jogl.gl2es12.$OSS.pack.gz newt.core.pack.gz newt.ogl.pack.gz libjogl_gl2es12.so.gz libnewt.so.gz
+echo
+
+echo JOGL GL2 NEWT
+report nativewindow.core.pack.gz jogl.core.pack.gz jogl.util.pack.gz jogl.gl2.$OSS.pack.gz newt.core.pack.gz newt.ogl.pack.gz libjogl_gl2.so.gz libnewt.so.gz
+echo
+
+echo JOGL GL2 AWT
+report nativewindow.core.pack.gz nativewindow.awt.pack.gz jogl.core.pack.gz jogl.util.pack.gz jogl.gl2.$OSS.pack.gz jogl.awt.pack.gz libjogl_gl2.so.gz libjogl_awt.so.gz libnativewindow_$OSS.so.gz libnativewindow_awt.so.gz
+echo
+
+echo JOGL GLU
+report jogl.glu.*pack.gz
+echo
+
+echo JOGL EVERYTHING
+report *.all.pack.gz
+echo
diff --git a/make/make.jogl.all.linux-x86.sh b/make/make.jogl.all.linux-x86.sh
new file mode 100644
index 000000000..0c6cd96f5
--- /dev/null
+++ b/make/make.jogl.all.linux-x86.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+. ../../setenv-build-jogl-x86.sh
+
+# -Dc.compiler.debug=true
+# -DuseOpenMAX=true \
+
+ant \
+ -Drootrel.build=build-x86 \
+ -Dgluegen.cpptasks.detected.os=true \
+ -DisUnix=true \
+ -DisLinux=true \
+ -DisLinuxX86=true \
+ -DisX11=true \
+ -DuseKD=true \
+ $* 2>&1 | tee make.jogl.all.linux-x86.log
diff --git a/make/make.jogl.all.linux-x86_64.sh b/make/make.jogl.all.linux-x86_64.sh
new file mode 100644
index 000000000..1a33f6708
--- /dev/null
+++ b/make/make.jogl.all.linux-x86_64.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../setenv-build-jogl-x86_64.sh
+
+# -Dc.compiler.debug=true
+
+ant \
+ -Drootrel.build=build-x86_64 \
+ -Dgluegen.cpptasks.detected.os=true \
+ -DisUnix=true \
+ -DisLinux=true \
+ -DisLinuxAMD64=true \
+ -DisX11=true \
+ $* 2>&1 | tee make.jogl.all.linux-x86_64.log
diff --git a/make/make.jogl.all.macosx.sh b/make/make.jogl.all.macosx.sh
new file mode 100644
index 000000000..e7a5ee37b
--- /dev/null
+++ b/make/make.jogl.all.macosx.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. /devtools/etc/profile.ant
+
+# -Dc.compiler.debug=true
+
+ant -v \
+ -Drootrel.build=build-macosx \
+ $* 2>&1 | tee make.jogl.all.macosx.log
diff --git a/make/make.jogl.all.win32.bat b/make/make.jogl.all.win32.bat
new file mode 100644
index 000000000..54475db06
--- /dev/null
+++ b/make/make.jogl.all.win32.bat
@@ -0,0 +1,11 @@
+set THISDIR="C:\SUN\JOGL2"
+set J2RE_HOME=c:\jre6
+set JAVA_HOME=c:\jdk6
+set PATH=%JAVA_HOME%\bin;%PATH%
+set LIB_GEN=%THISDIR%\lib
+set CLASSPATH=.;%THISDIR%\build-win32\classes
+REM -Dc.compiler.debug=true
+REM -DuseOpenMAX=true
+REM -DuseKD=true
+
+ant -Drootrel.build=build-win32 > make.jogl.all.win32.log 2>&1
diff --git a/make/make.jogl.cdcfp.linux-x86.sh b/make/make.jogl.cdcfp.linux-x86.sh
new file mode 100644
index 000000000..6d216f65a
--- /dev/null
+++ b/make/make.jogl.cdcfp.linux-x86.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+. ../../setenv-build-jogl.sh
+
+# -Dc.compiler.debug=true
+#
+# -Djavacdebug="false" \
+# -Djavacdebuglevel="none" \
+#
+# -Djava.generate.skip=true \
+
+ant -v \
+ -Drootrel.build=build-cdcfp-x86 \
+ -Djogl.cdcfp=true \
+ -Dgluegen.cpptasks.detected.os=true \
+ -DisUnix=true \
+ -DisLinux=true \
+ -DisLinuxX86=true \
+ -DisX11=true \
+ -DuseKD=true \
+ -DuseOpenMAX=true \
+ $* 2>&1 | tee make.jogl.cdcfp.linux-x86.log
diff --git a/make/make.jogl.doc.all.x86.sh b/make/make.jogl.doc.all.x86.sh
new file mode 100644
index 000000000..ab86fefd0
--- /dev/null
+++ b/make/make.jogl.doc.all.x86.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+. ../../setenv-build-jogl-x86.sh
+
+ant -v \
+ -Drootrel.build=build-x86\
+ -DuseKD=true \
+ javadoc.spec javadoc javadoc.dev.all $* 2>&1 | tee make.jogl.doc.all.x86.log
diff --git a/make/make.jogl.doc.all.x86_64.sh b/make/make.jogl.doc.all.x86_64.sh
new file mode 100644
index 000000000..bab6d4d64
--- /dev/null
+++ b/make/make.jogl.doc.all.x86_64.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+. ../../setenv-build-jogl-x86_64.sh
+
+ant -v \
+ -Drootrel.build=build-x86_64 \
+ javadoc.spec javadoc javadoc.dev $* 2>&1 | tee make.jogl.doc.all.x86_64.log
diff --git a/make/make.jogl.doc.x86_64.sh b/make/make.jogl.doc.x86_64.sh
new file mode 100644
index 000000000..2ed8e67ec
--- /dev/null
+++ b/make/make.jogl.doc.x86_64.sh
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+. ../../setenv-build-jogl-x86_64.sh
+
+ant -v \
+ -Drootrel.build=build-x86_64 \
+ javadoc $* 2>&1 | tee make.jogl.doc.x86_64.log
diff --git a/make/native-taglet.properties b/make/native-taglet.properties
new file mode 100755
index 000000000..22cc2320d
--- /dev/null
+++ b/make/native-taglet.properties
@@ -0,0 +1,355 @@
+##OpenGL Reference Manual method name mapping
+#Fri Apr 06 02:25:27 PDT 2007
+nativetaglet.baseUrl=http://www.opengl.org/sdk/docs/man/xhtml/
+glAccum=glAccum.xml
+glActiveTexture=glActiveTexture.xml
+glAlphaFunc=glAlphaFunc.xml
+glAreTexturesResident=glAreTexturesResident.xml
+glArrayElement=glArrayElement.xml
+glAttachShader=glAttachShader.xml
+glBegin=glBegin.xml
+glBeginQuery=glBeginQuery.xml
+glBindAttribLocation=glBindAttribLocation.xml
+glBindBuffer=glBindBuffer.xml
+glBindTexture=glBindTexture.xml
+glBitmap=glBitmap.xml
+glBlendColor=glBlendColor.xml
+glBlendEquation=glBlendEquation.xml
+glBlendEquationSeparate=glBlendEquationSeparate.xml
+glBlendFunc=glBlendFunc.xml
+glBlendFuncSeparate=glBlendFuncSeparate.xml
+glBufferData=glBufferData.xml
+glBufferSubData=glBufferSubData.xml
+glCallList=glCallList.xml
+glCallLists=glCallLists.xml
+glClear=glClear.xml
+glClearAccum=glClearAccum.xml
+glClearColor=glClearColor.xml
+glClearDepth=glClearDepth.xml
+glClearIndex=glClearIndex.xml
+glClearStencil=glClearStencil.xml
+glClientActiveTexture=glClientActiveTexture.xml
+glClipPlane=glClipPlane.xml
+glColor=glColor.xml
+glColorMask=glColorMask.xml
+glColorMaterial=glColorMaterial.xml
+glColorPointer=glColorPointer.xml
+glColorSubTable=glColorSubTable.xml
+glColorTable=glColorTable.xml
+glColorTableParameter=glColorTableParameter.xml
+glCompileShader=glCompileShader.xml
+glCompressedTexImage1D=glCompressedTexImage1D.xml
+glCompressedTexImage2D=glCompressedTexImage2D.xml
+glCompressedTexImage3D=glCompressedTexImage3D.xml
+glCompressedTexSubImage1D=glCompressedTexSubImage1D.xml
+glCompressedTexSubImage2D=glCompressedTexSubImage2D.xml
+glCompressedTexSubImage3D=glCompressedTexSubImage3D.xml
+glConvolutionFilter1D=glConvolutionFilter1D.xml
+glConvolutionFilter2D=glConvolutionFilter2D.xml
+glConvolutionParameter=glConvolutionParameter.xml
+glCopyColorSubTable=glCopyColorSubTable.xml
+glCopyColorTable=glCopyColorTable.xml
+glCopyConvolutionFilter1D=glCopyConvolutionFilter1D.xml
+glCopyConvolutionFilter2D=glCopyConvolutionFilter2D.xml
+glCopyPixels=glCopyPixels.xml
+glCopyTexImage1D=glCopyTexImage1D.xml
+glCopyTexImage2D=glCopyTexImage2D.xml
+glCopyTexSubImage1D=glCopyTexSubImage1D.xml
+glCopyTexSubImage2D=glCopyTexSubImage2D.xml
+glCopyTexSubImage3D=glCopyTexSubImage3D.xml
+glCreateProgram=glCreateProgram.xml
+glCreateShader=glCreateShader.xml
+glCullFace=glCullFace.xml
+glDeleteBuffers=glDeleteBuffers.xml
+glDeleteLists=glDeleteLists.xml
+glDeleteProgram=glDeleteProgram.xml
+glDeleteQueries=glDeleteQueries.xml
+glDeleteShader=glDeleteShader.xml
+glDeleteTextures=glDeleteTextures.xml
+glDepthFunc=glDepthFunc.xml
+glDepthMask=glDepthMask.xml
+glDepthRange=glDepthRange.xml
+glDetachShader=glDetachShader.xml
+glDisable=glDisable.xml
+glDisableClientState=glDisableClientState.xml
+glDisableVertexAttribArray=glDisableVertexAttribArray.xml
+glDrawArrays=glDrawArrays.xml
+glDrawBuffer=glDrawBuffer.xml
+glDrawBuffers=glDrawBuffers.xml
+glDrawElements=glDrawElements.xml
+glDrawPixels=glDrawPixels.xml
+glDrawRangeElements=glDrawRangeElements.xml
+glEdgeFlag=glEdgeFlag.xml
+glEdgeFlagPointer=glEdgeFlagPointer.xml
+glEnable=glEnable.xml
+glEnableClientState=glEnableClientState.xml
+glEnableVertexAttribArray=glEnableVertexAttribArray.xml
+glEnd=glEnd.xml
+glEndList=glEndList.xml
+glEndQuery=glEndQuery.xml
+glEvalCoord=glEvalCoord.xml
+glEvalMesh=glEvalMesh.xml
+glEvalPoint=glEvalPoint.xml
+glFeedbackBuffer=glFeedbackBuffer.xml
+glFinish=glFinish.xml
+glFlush=glFlush.xml
+glFog=glFog.xml
+glFogCoord=glFogCoord.xml
+glFogCoordPointer=glFogCoordPointer.xml
+glFrontFace=glFrontFace.xml
+glFrustum=glFrustum.xml
+glGenBuffers=glGenBuffers.xml
+glGenLists=glGenLists.xml
+glGenQueries=glGenQueries.xml
+glGenTextures=glGenTextures.xml
+glGet=glGet.xml
+glGetActiveAttrib=glGetActiveAttrib.xml
+glGetActiveUniform=glGetActiveUniform.xml
+glGetAttachedShaders=glGetAttachedShaders.xml
+glGetAttribLocation=glGetAttribLocation.xml
+glGetBufferParameteriv=glGetBufferParameteriv.xml
+glGetBufferPointerv=glGetBufferPointerv.xml
+glGetBufferSubData=glGetBufferSubData.xml
+glGetClipPlane=glGetClipPlane.xml
+glGetColorTable=glGetColorTable.xml
+glGetColorTableParameter=glGetColorTableParameter.xml
+glGetCompressedTexImage=glGetCompressedTexImage.xml
+glGetConvolutionFilter=glGetConvolutionFilter.xml
+glGetConvolutionParameter=glGetConvolutionParameter.xml
+glGetError=glGetError.xml
+glGetHistogram=glGetHistogram.xml
+glGetHistogramParameter=glGetHistogramParameter.xml
+glGetLight=glGetLight.xml
+glGetMap=glGetMap.xml
+glGetMaterial=glGetMaterial.xml
+glGetMinmax=glGetMinmax.xml
+glGetMinmaxParameter=glGetMinmaxParameter.xml
+glGetPixelMap=glGetPixelMap.xml
+glGetPointerv=glGetPointerv.xml
+glGetPolygonStipple=glGetPolygonStipple.xml
+glGetProgram=glGetProgram.xml
+glGetProgramInfoLog=glGetProgramInfoLog.xml
+glGetQueryObject=glGetQueryObject.xml
+glGetQueryiv=glGetQueryiv.xml
+glGetSeparableFilter=glGetSeparableFilter.xml
+glGetShader=glGetShader.xml
+glGetShaderInfoLog=glGetShaderInfoLog.xml
+glGetShaderSource=glGetShaderSource.xml
+glGetString=glGetString.xml
+glGetTexEnv=glGetTexEnv.xml
+glGetTexGen=glGetTexGen.xml
+glGetTexImage=glGetTexImage.xml
+glGetTexLevelParameter=glGetTexLevelParameter.xml
+glGetTexParameter=glGetTexParameter.xml
+glGetUniform=glGetUniform.xml
+glGetUniformLocation=glGetUniformLocation.xml
+glGetVertexAttrib=glGetVertexAttrib.xml
+glGetVertexAttribPointerv=glGetVertexAttribPointerv.xml
+glHint=glHint.xml
+glHistogram=glHistogram.xml
+glIndex=glIndex.xml
+glIndexMask=glIndexMask.xml
+glIndexPointer=glIndexPointer.xml
+glInitNames=glInitNames.xml
+glInterleavedArrays=glInterleavedArrays.xml
+glIsBuffer=glIsBuffer.xml
+glIsEnabled=glIsEnabled.xml
+glIsList=glIsList.xml
+glIsProgram=glIsProgram.xml
+glIsQuery=glIsQuery.xml
+glIsShader=glIsShader.xml
+glIsTexture=glIsTexture.xml
+glLight=glLight.xml
+glLightModel=glLightModel.xml
+glLineStipple=glLineStipple.xml
+glLineWidth=glLineWidth.xml
+glLinkProgram=glLinkProgram.xml
+glListBase=glListBase.xml
+glLoadIdentity=glLoadIdentity.xml
+glLoadMatrix=glLoadMatrix.xml
+glLoadName=glLoadName.xml
+glLoadTransposeMatrix=glLoadTransposeMatrix.xml
+glLogicOp=glLogicOp.xml
+glMap1=glMap1.xml
+glMap2=glMap2.xml
+glMapBuffer=glMapBuffer.xml
+glMapGrid=glMapGrid.xml
+glMaterial=glMaterial.xml
+glMatrixMode=glMatrixMode.xml
+glMinmax=glMinmax.xml
+glMultMatrix=glMultMatrix.xml
+glMultTransposeMatrix=glMultTransposeMatrix.xml
+glMultiDrawArrays=glMultiDrawArrays.xml
+glMultiDrawElements=glMultiDrawElements.xml
+glMultiTexCoord=glMultiTexCoord.xml
+glNewList=glNewList.xml
+glNormal=glNormal.xml
+glNormalPointer=glNormalPointer.xml
+glOrtho=glOrtho.xml
+glPassThrough=glPassThrough.xml
+glPixelMap=glPixelMap.xml
+glPixelStore=glPixelStore.xml
+glPixelTransfer=glPixelTransfer.xml
+glPixelZoom=glPixelZoom.xml
+glPointParameter=glPointParameter.xml
+glPointSize=glPointSize.xml
+glPolygonMode=glPolygonMode.xml
+glPolygonOffset=glPolygonOffset.xml
+glPolygonStipple=glPolygonStipple.xml
+glPopAttrib=glPopAttrib.xml
+glPopClientAttrib=glPopClientAttrib.xml
+glPopMatrix=glPopMatrix.xml
+glPopName=glPopName.xml
+glPrioritizeTextures=glPrioritizeTextures.xml
+glPushAttrib=glPushAttrib.xml
+glPushClientAttrib=glPushClientAttrib.xml
+glPushMatrix=glPushMatrix.xml
+glPushName=glPushName.xml
+glRasterPos=glRasterPos.xml
+glReadBuffer=glReadBuffer.xml
+glReadPixels=glReadPixels.xml
+glRect=glRect.xml
+glRenderMode=glRenderMode.xml
+glResetHistogram=glResetHistogram.xml
+glResetMinmax=glResetMinmax.xml
+glRotate=glRotate.xml
+glSampleCoverage=glSampleCoverage.xml
+glScale=glScale.xml
+glScissor=glScissor.xml
+glSecondaryColor=glSecondaryColor.xml
+glSecondaryColorPointer=glSecondaryColorPointer.xml
+glSelectBuffer=glSelectBuffer.xml
+glSeparableFilter2D=glSeparableFilter2D.xml
+glShadeModel=glShadeModel.xml
+glShaderSource=glShaderSource.xml
+glStencilFunc=glStencilFunc.xml
+glStencilFuncSeparate=glStencilFuncSeparate.xml
+glStencilMask=glStencilMask.xml
+glStencilMaskSeparate=glStencilMaskSeparate.xml
+glStencilOp=glStencilOp.xml
+glStencilOpSeparate=glStencilOpSeparate.xml
+glTexCoord=glTexCoord.xml
+glTexCoordPointer=glTexCoordPointer.xml
+glTexEnv=glTexEnv.xml
+glTexGen=glTexGen.xml
+glTexImage1D=glTexImage1D.xml
+glTexImage2D=glTexImage2D.xml
+glTexImage3D=glTexImage3D.xml
+glTexParameter=glTexParameter.xml
+glTexSubImage1D=glTexSubImage1D.xml
+glTexSubImage2D=glTexSubImage2D.xml
+glTexSubImage3D=glTexSubImage3D.xml
+glTranslate=glTranslate.xml
+glUniform=glUniform.xml
+glUnmapBuffer=glUnmapBuffer.xml
+glUseProgram=glUseProgram.xml
+glValidateProgram=glValidateProgram.xml
+glVertex=glVertex.xml
+glVertexAttrib=glVertexAttrib.xml
+glVertexAttribPointer=glVertexAttribPointer.xml
+glVertexPointer=glVertexPointer.xml
+glViewport=glViewport.xml
+glWindowPos=glWindowPos.xml
+gluBeginCurve=gluBeginCurve.xml
+gluBeginPolygon=gluBeginPolygon.xml
+gluBeginSurface=gluBeginSurface.xml
+gluBeginTrim=gluBeginTrim.xml
+gluBuild1DMipmapLevels=gluBuild1DMipmapLevels.xml
+gluBuild1DMipmaps=gluBuild1DMipmaps.xml
+gluBuild2DMipmapLevels=gluBuild2DMipmapLevels.xml
+gluBuild2DMipmaps=gluBuild2DMipmaps.xml
+gluBuild3DMipmapLevels=gluBuild3DMipmapLevels.xml
+gluBuild3DMipmaps=gluBuild3DMipmaps.xml
+gluCheckExtension=gluCheckExtension.xml
+gluCylinder=gluCylinder.xml
+gluDeleteNurbsRenderer=gluDeleteNurbsRenderer.xml
+gluDeleteQuadric=gluDeleteQuadric.xml
+gluDeleteTess=gluDeleteTess.xml
+gluDisk=gluDisk.xml
+gluEndCurve=gluEndCurve.xml
+gluEndPolygon=gluEndPolygon.xml
+gluEndSurface=gluEndSurface.xml
+gluEndTrim=gluEndTrim.xml
+gluErrorString=gluErrorString.xml
+gluGetNurbsProperty=gluGetNurbsProperty.xml
+gluGetString=gluGetString.xml
+gluGetTessProperty=gluGetTessProperty.xml
+gluLoadSamplingMatrices=gluLoadSamplingMatrices.xml
+gluLookAt=gluLookAt.xml
+gluNewNurbsRenderer=gluNewNurbsRenderer.xml
+gluNewQuadric=gluNewQuadric.xml
+gluNewTess=gluNewTess.xml
+gluNextContour=gluNextContour.xml
+gluNurbsCallback=gluNurbsCallback.xml
+gluNurbsCallbackData=gluNurbsCallbackData.xml
+gluNurbsCallbackDataEXT=gluNurbsCallbackDataEXT.xml
+gluNurbsCurve=gluNurbsCurve.xml
+gluNurbsProperty=gluNurbsProperty.xml
+gluNurbsSurface=gluNurbsSurface.xml
+gluOrtho2D=gluOrtho2D.xml
+gluPartialDisk=gluPartialDisk.xml
+gluPerspective=gluPerspective.xml
+gluPickMatrix=gluPickMatrix.xml
+gluProject=gluProject.xml
+gluPwlCurve=gluPwlCurve.xml
+gluQuadricCallback=gluQuadricCallback.xml
+gluQuadricDrawStyle=gluQuadricDrawStyle.xml
+gluQuadricNormals=gluQuadricNormals.xml
+gluQuadricOrientation=gluQuadricOrientation.xml
+gluQuadricTexture=gluQuadricTexture.xml
+gluScaleImage=gluScaleImage.xml
+gluSphere=gluSphere.xml
+gluTessBeginContour=gluTessBeginContour.xml
+gluTessBeginPolygon=gluTessBeginPolygon.xml
+gluTessCallback=gluTessCallback.xml
+gluTessEndContour=gluTessEndContour.xml
+gluTessEndPolygon=gluTessEndPolygon.xml
+gluTessNormal=gluTessNormal.xml
+gluTessProperty=gluTessProperty.xml
+gluTessVertex=gluTessVertex.xml
+gluUnProject=gluUnProject.xml
+gluUnProject4=gluUnProject4.xml
+glXChooseFBConfig=glXChooseFBConfig.xml
+glXChooseVisual=glXChooseVisual.xml
+glXCopyContext=glXCopyContext.xml
+glXCreateContext=glXCreateContext.xml
+glXCreateGLXPixmap=glXCreateGLXPixmap.xml
+glXCreateNewContext=glXCreateNewContext.xml
+glXCreatePbuffer=glXCreatePbuffer.xml
+glXCreatePixmap=glXCreatePixmap.xml
+glXCreateWindow=glXCreateWindow.xml
+glXDestroyContext=glXDestroyContext.xml
+glXDestroyGLXPixmap=glXDestroyGLXPixmap.xml
+glXDestroyPbuffer=glXDestroyPbuffer.xml
+glXDestroyPixmap=glXDestroyPixmap.xml
+glXDestroyWindow=glXDestroyWindow.xml
+glXFreeContextEXT=glXFreeContextEXT.xml
+glXGetClientString=glXGetClientString.xml
+glXGetConfig=glXGetConfig.xml
+glXGetContextIDEXT=glXGetContextIDEXT.xml
+glXGetCurrentContext=glXGetCurrentContext.xml
+glXGetCurrentDisplay=glXGetCurrentDisplay.xml
+glXGetCurrentDrawable=glXGetCurrentDrawable.xml
+glXGetCurrentReadDrawable=glXGetCurrentReadDrawable.xml
+glXGetFBConfigAttrib=glXGetFBConfigAttrib.xml
+glXGetFBConfigs=glXGetFBConfigs.xml
+glXGetProcAddress=glXGetProcAddress.xml
+glXGetSelectedEvent=glXGetSelectedEvent.xml
+glXGetVisualFromFBConfig=glXGetVisualFromFBConfig.xml
+glXImportContextEXT=glXImportContextEXT.xml
+glXIntro=glXIntro.xml
+glXIsDirect=glXIsDirect.xml
+glXMakeContextCurrent=glXMakeContextCurrent.xml
+glXMakeCurrent=glXMakeCurrent.xml
+glXQueryContext=glXQueryContext.xml
+glXQueryContextInfoEXT=glXQueryContextInfoEXT.xml
+glXQueryDrawable=glXQueryDrawable.xml
+glXQueryExtension=glXQueryExtension.xml
+glXQueryExtensionsString=glXQueryExtensionsString.xml
+glXQueryServerString=glXQueryServerString.xml
+glXQueryVersion=glXQueryVersion.xml
+glXSelectEvent=glXSelectEvent.xml
+glXSwapBuffers=glXSwapBuffers.xml
+glXUseXFont=glXUseXFont.xml
+glXWaitGL=glXWaitGL.xml
+glXWaitX=glXWaitX.xml
diff --git a/make/nativewindow.compiler.xml b/make/nativewindow.compiler.xml
new file mode 100644
index 000000000..b60f9c707
--- /dev/null
+++ b/make/nativewindow.compiler.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="NWI" basedir="." default="all">
+<target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler">
+ <linker id="linker.cfg.linux.nwi.x11" extends="linker.cfg.linux">
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="X11"/>
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="Xxf86vm"/>
+ </linker>
+
+ <linker id="linker.cfg.linux.nwi.gl2" extends="linker.cfg.linux.nwi.x11">
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="GL"/>
+ <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/>
+ </linker>
+</target>
+</project>
+
diff --git a/make/nativewindowRIversion b/make/nativewindowRIversion
new file mode 100644
index 000000000..9bfc9e855
--- /dev/null
+++ b/make/nativewindowRIversion
@@ -0,0 +1,8 @@
+Specification-Title: Native Window Interface API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: Native Window Interface Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Vendor: Sun Microsystems, Inc.
+Extension-Name: javax.media.nativewindow
+Implementation-Vendor-Id: com.sun
diff --git a/make/nativewindowversion b/make/nativewindowversion
new file mode 100644
index 000000000..0180d3368
--- /dev/null
+++ b/make/nativewindowversion
@@ -0,0 +1,8 @@
+Specification-Title: Native Window Interface API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: Native Window Interface Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Vendor: java.net JOGL community
+Extension-Name: javax.media.nativewindow
+Implementation-Vendor-Id: com.sun
diff --git a/make/newt.compiler.xml b/make/newt.compiler.xml
new file mode 100644
index 000000000..973ef9654
--- /dev/null
+++ b/make/newt.compiler.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="NEWT" basedir="." default="all">
+<target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler">
+ <linker id="linker.cfg.linux.newt.x11" extends="linker.cfg.linux">
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="X11"/>
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="Xxf86vm"/>
+ </linker>
+
+ <linker id="linker.cfg.linux.newt.gl2" extends="linker.cfg.linux.newt.x11">
+ <syslibset dir="/devtools/i686-unknown-linux-gnu/xfree86-4.3.0-linux-ix86-glibc23/lib" libs="GL"/>
+ <syslibset dir="${x11.cg.lib}" libs="Cg, CgGL" if="c.compiler.use-cglib"/>
+ </linker>
+</target>
+</project>
+
diff --git a/make/newtRIversion b/make/newtRIversion
new file mode 100644
index 000000000..7b8608290
--- /dev/null
+++ b/make/newtRIversion
@@ -0,0 +1,8 @@
+Specification-Title: NEWT API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: NEWT Runtime Environment
+Implementation-Version: @BASEVERSION@
+Implementation-Vendor: Sun Microsystems, Inc.
+Extension-Name: com.sun.javafx.newt
+Implementation-Vendor-Id: com.sun
diff --git a/make/newtversion b/make/newtversion
new file mode 100644
index 000000000..3c9335cf5
--- /dev/null
+++ b/make/newtversion
@@ -0,0 +1,8 @@
+Specification-Title: NEWT API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: NEWT Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Vendor: java.net JOGL community
+Extension-Name: com.sun.javafx.newt
+Implementation-Vendor-Id: com.sun
diff --git a/make/nwiRIversion b/make/nwiRIversion
new file mode 100644
index 000000000..20600ac28
--- /dev/null
+++ b/make/nwiRIversion
@@ -0,0 +1,8 @@
+Specification-Title: Native Window Interface API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: Sun Microsystems, Inc.
+Implementation-Title: Native Window Interface Runtime Environment
+Implementation-Version: @BASEVERSION@
+Implementation-Vendor: Sun Microsystems, Inc.
+Extension-Name: javax.media.nwi
+Implementation-Vendor-Id: com.sun
diff --git a/make/setvc9-jogl.bat b/make/setvc9-jogl.bat
new file mode 100755
index 000000000..be6f039ad
--- /dev/null
+++ b/make/setvc9-jogl.bat
@@ -0,0 +1,9 @@
+
+
+set PATH=C:\cygwin\devtools\share\apache-ant-1.7.0\bin;%PATH%
+set ANT_PATH=C:\cygwin\devtools\share\apache-ant-1.7.0
+
+c:
+cd C:\SUN\JOGL2\jogl\make
+
+"C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
diff --git a/make/stub_includes/cg/CG/cg.h b/make/stub_includes/cg/CG/cg.h
new file mode 100644
index 000000000..9bc366216
--- /dev/null
+++ b/make/stub_includes/cg/CG/cg.h
@@ -0,0 +1,542 @@
+/*
+ * This is a modified version of the original header as provided by
+ * NVidia; original copyright appears below.
+ *
+ * Modified by Christopher Kline, May 2003: Stripped down and hacked to get
+ * around macro interpretation problems.
+ */
+
+/*
+ *
+ * Copyright (c) 2002-2004, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#ifndef _cg_h
+#define _cg_h
+
+
+#define CG_VERSION_NUM 1400
+
+// Set up for either Win32 import/export/lib.
+#ifndef CGDLL_API
+#ifdef WIN32
+ #ifdef CGDLL_EXPORTS
+ #define CGDLL_API /*__declspec(dllexport) */
+ #elif defined (CG_LIB)
+ #define CGDLL_API
+ #else
+ #define CGDLL_API __declspec(dllimport)
+ #endif
+#else
+ #define CGDLL_API
+#endif
+#endif
+
+/*************************************************************************/
+/*** CG Run-Time Library API ***/
+/*************************************************************************/
+
+/*************************************************************************/
+/*** Data types and enumerants ***/
+/*************************************************************************/
+
+typedef int CGbool;
+
+#define CG_FALSE ((CGbool)0)
+#define CG_TRUE ((CGbool)1)
+
+typedef struct _CGcontext *CGcontext;
+typedef struct _CGprogram *CGprogram;
+typedef struct _CGparameter *CGparameter;
+typedef struct _CGeffect *CGeffect;
+typedef struct _CGtechnique *CGtechnique;
+typedef struct _CGpass *CGpass;
+typedef struct _CGstate *CGstate;
+typedef struct _CGstateassignment *CGstateassignment;
+typedef struct _CGannotation *CGannotation;
+typedef void *CGhandle;
+
+typedef CGbool (*CGstatecallback)(CGstateassignment);
+
+//!!! PREPROCESS BEGIN
+
+typedef enum
+ {
+ CG_UNKNOWN_TYPE,
+ CG_STRUCT,
+ CG_ARRAY,
+
+ CG_TYPE_START_ENUM = 1024,
+// # define CG_DATATYPE_MACRO(name, compiler_name, enum_name, base_name, ncols, nrows, pc) \
+// enum_name ,
+
+#include <CG/cg_datatypes.h>
+
+ } CGtype;
+
+typedef enum
+ {
+// # define CG_BINDLOCATION_MACRO(name,enum_name,compiler_name,\
+// enum_int,addressable,param_type) \
+// enum_name = enum_int,
+
+#include <CG/cg_bindlocations.h>
+
+ CG_UNDEFINED,
+
+ } CGresource;
+
+typedef enum
+ {
+ CG_PROFILE_START = 6144,
+ CG_PROFILE_UNKNOWN,
+
+// # define CG_PROFILE_MACRO(name, compiler_id, compiler_id_caps, compiler_opt,int_id,vertex_profile) \
+// CG_PROFILE_##compiler_id_caps = int_id,
+
+#include <CG/cg_profiles.h>
+
+ CG_PROFILE_MAX = 7100,
+ } CGprofile;
+
+typedef enum
+ {
+// # define CG_ERROR_MACRO(code, enum_name, message) \
+// enum_name = code,
+# include <CG/cg_errors.h>
+ } CGerror;
+
+typedef enum
+ {
+ CG_PARAMETERCLASS_UNKNOWN = 0,
+ CG_PARAMETERCLASS_SCALAR,
+ CG_PARAMETERCLASS_VECTOR,
+ CG_PARAMETERCLASS_MATRIX,
+ CG_PARAMETERCLASS_STRUCT,
+ CG_PARAMETERCLASS_ARRAY,
+ CG_PARAMETERCLASS_SAMPLER,
+ CG_PARAMETERCLASS_OBJECT
+ } CGparameterclass;
+
+//!!! PREPROCESS END
+
+typedef enum
+ {
+// # define CG_ENUM_MACRO(enum_name, enum_val) \
+// enum_name = enum_val,
+# include <CG/cg_enums.h>
+ } CGenum;
+
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*CGerrorCallbackFunc)(void);
+typedef void (*CGerrorHandlerFunc)(CGcontext ctx, CGerror err, void *data);
+
+/*************************************************************************/
+/*** Functions ***/
+/*************************************************************************/
+
+#ifndef CG_EXPLICIT
+
+/*** Context functions ***/
+
+CGDLL_API CGcontext cgCreateContext(void);
+CGDLL_API void cgDestroyContext(CGcontext ctx);
+CGDLL_API CGbool cgIsContext(CGcontext ctx);
+CGDLL_API const char *cgGetLastListing(CGcontext ctx);
+CGDLL_API void cgSetLastListing(CGhandle handle, const char *listing);
+CGDLL_API void cgSetAutoCompile(CGcontext ctx, CGenum flag);
+CGDLL_API CGenum cgGetAutoCompile(CGcontext ctx);
+
+/*** Program functions ***/
+CGDLL_API CGprogram cgCreateProgram(CGcontext ctx,
+ CGenum program_type,
+ const char *program,
+ CGprofile profile,
+ const char *entry,
+ const char **args);
+CGDLL_API CGprogram cgCreateProgramFromFile(CGcontext ctx,
+ CGenum program_type,
+ const char *program_file,
+ CGprofile profile,
+ const char *entry,
+ const char **args);
+CGDLL_API CGprogram cgCopyProgram(CGprogram program);
+CGDLL_API void cgDestroyProgram(CGprogram program);
+
+CGDLL_API CGprogram cgGetFirstProgram(CGcontext ctx);
+CGDLL_API CGprogram cgGetNextProgram(CGprogram current);
+CGDLL_API CGcontext cgGetProgramContext(CGprogram prog);
+CGDLL_API CGbool cgIsProgram(CGprogram program);
+
+CGDLL_API void cgCompileProgram(CGprogram program);
+CGDLL_API CGbool cgIsProgramCompiled(CGprogram program);
+CGDLL_API const char *cgGetProgramString(CGprogram prog, CGenum pname);
+CGDLL_API CGprofile cgGetProgramProfile(CGprogram prog);
+CGDLL_API char const * const *cgGetProgramOptions(CGprogram prog);
+CGDLL_API void cgSetProgramProfile(CGprogram prog, CGprofile profile);
+
+CGDLL_API void cgSetPassProgramParameters(CGprogram);
+
+/*** Parameter functions ***/
+
+CGDLL_API CGparameter cgCreateParameter(CGcontext ctx, CGtype type);
+CGDLL_API CGparameter cgCreateParameterArray(CGcontext ctx,
+ CGtype type,
+ int length);
+CGDLL_API CGparameter cgCreateParameterMultiDimArray(CGcontext ctx,
+ CGtype type,
+ int dim,
+ const int *lengths);
+CGDLL_API void cgDestroyParameter(CGparameter param);
+CGDLL_API void cgConnectParameter(CGparameter from, CGparameter to);
+CGDLL_API void cgDisconnectParameter(CGparameter param);
+CGDLL_API CGparameter cgGetConnectedParameter(CGparameter param);
+
+CGDLL_API int cgGetNumConnectedToParameters(CGparameter param);
+CGDLL_API CGparameter cgGetConnectedToParameter(CGparameter param, int index);
+
+CGDLL_API CGparameter cgGetNamedParameter(CGprogram prog, const char *name);
+CGDLL_API CGparameter cgGetNamedProgramParameter(CGprogram prog,
+ CGenum name_space,
+ const char *name);
+
+CGDLL_API CGparameter cgGetFirstParameter(CGprogram prog, CGenum name_space);
+CGDLL_API CGparameter cgGetNextParameter(CGparameter current);
+CGDLL_API CGparameter cgGetFirstLeafParameter(CGprogram prog, CGenum name_space);
+CGDLL_API CGparameter cgGetNextLeafParameter(CGparameter current);
+
+CGDLL_API CGparameter cgGetFirstStructParameter(CGparameter param);
+CGDLL_API CGparameter cgGetNamedStructParameter(CGparameter param,
+ const char *name);
+
+CGDLL_API CGparameter cgGetFirstDependentParameter(CGparameter param);
+
+CGDLL_API CGparameter cgGetArrayParameter(CGparameter aparam, int index);
+CGDLL_API int cgGetArrayDimension(CGparameter param);
+CGDLL_API CGtype cgGetArrayType(CGparameter param);
+CGDLL_API int cgGetArraySize(CGparameter param, int dimension);
+CGDLL_API int cgGetArrayTotalSize(CGparameter param);
+CGDLL_API void cgSetArraySize(CGparameter param, int size);
+CGDLL_API void cgSetMultiDimArraySize(CGparameter param, const int *sizes);
+
+CGDLL_API CGprogram cgGetParameterProgram(CGparameter param);
+CGDLL_API CGcontext cgGetParameterContext(CGparameter param);
+CGDLL_API CGbool cgIsParameter(CGparameter param);
+CGDLL_API const char *cgGetParameterName(CGparameter param);
+CGDLL_API CGtype cgGetParameterType(CGparameter param);
+CGDLL_API CGtype cgGetParameterBaseType(CGparameter param);
+CGDLL_API CGparameterclass cgGetParameterClass(CGparameter param);
+CGDLL_API int cgGetParameterRows(CGparameter param);
+CGDLL_API int cgGetParameterColumns(CGparameter param);
+CGDLL_API CGtype cgGetParameterNamedType(CGparameter param);
+CGDLL_API const char *cgGetParameterSemantic(CGparameter param);
+CGDLL_API CGresource cgGetParameterResource(CGparameter param);
+CGDLL_API CGresource cgGetParameterBaseResource(CGparameter param);
+CGDLL_API unsigned long cgGetParameterResourceIndex(CGparameter param);
+CGDLL_API CGenum cgGetParameterVariability(CGparameter param);
+CGDLL_API CGenum cgGetParameterDirection(CGparameter param);
+CGDLL_API CGbool cgIsParameterReferenced(CGparameter param);
+CGDLL_API CGbool cgIsParameterUsed(CGparameter param, CGhandle handle);
+CGDLL_API const double *cgGetParameterValues(CGparameter param,
+ CGenum value_type,
+ int *nvalues);
+CGDLL_API void cgSetParameterValuedr(CGparameter param, int n, const double *vals);
+CGDLL_API void cgSetParameterValuedc(CGparameter param, int n, const double *vals);
+CGDLL_API void cgSetParameterValuefr(CGparameter param, int n, const float *vals);
+CGDLL_API void cgSetParameterValuefc(CGparameter param, int n, const float *vals);
+CGDLL_API void cgSetParameterValueir(CGparameter param, int n, const int *vals);
+CGDLL_API void cgSetParameterValueic(CGparameter param, int n, const int *vals);
+CGDLL_API int cgGetParameterValuedr(CGparameter param, int n, double *vals);
+CGDLL_API int cgGetParameterValuedc(CGparameter param, int n, double *vals);
+CGDLL_API int cgGetParameterValuefr(CGparameter param, int n, float *vals);
+CGDLL_API int cgGetParameterValuefc(CGparameter param, int n, float *vals);
+CGDLL_API int cgGetParameterValueir(CGparameter param, int n, int *vals);
+CGDLL_API int cgGetParameterValueic(CGparameter param, int n, int *vals);
+CGDLL_API const char *cgGetStringParameterValue(CGparameter param);
+CGDLL_API void cgSetStringParameterValue(CGparameter param, const char *str);
+
+CGDLL_API int cgGetParameterOrdinalNumber(CGparameter param);
+CGDLL_API CGbool cgIsParameterGlobal(CGparameter param);
+CGDLL_API int cgGetParameterIndex(CGparameter param);
+
+CGDLL_API void cgSetParameterVariability(CGparameter param, CGenum vary);
+CGDLL_API void cgSetParameterSemantic(CGparameter param, const char *semantic);
+
+CGDLL_API void cgSetParameter1f(CGparameter param, float x);
+CGDLL_API void cgSetParameter2f(CGparameter param, float x, float y);
+CGDLL_API void cgSetParameter3f(CGparameter param, float x, float y, float z);
+CGDLL_API void cgSetParameter4f(CGparameter param,
+ float x,
+ float y,
+ float z,
+ float w);
+CGDLL_API void cgSetParameter1d(CGparameter param, double x);
+CGDLL_API void cgSetParameter2d(CGparameter param, double x, double y);
+CGDLL_API void cgSetParameter3d(CGparameter param,
+ double x,
+ double y,
+ double z);
+CGDLL_API void cgSetParameter4d(CGparameter param,
+ double x,
+ double y,
+ double z,
+ double w);
+CGDLL_API void cgSetParameter1i(CGparameter param, int x);
+CGDLL_API void cgSetParameter2i(CGparameter param, int x, int y);
+CGDLL_API void cgSetParameter3i(CGparameter param, int x, int y, int z);
+CGDLL_API void cgSetParameter4i(CGparameter param,
+ int x,
+ int y,
+ int z,
+ int w);
+
+
+CGDLL_API void cgSetParameter1iv(CGparameter param, const int *v);
+CGDLL_API void cgSetParameter2iv(CGparameter param, const int *v);
+CGDLL_API void cgSetParameter3iv(CGparameter param, const int *v);
+CGDLL_API void cgSetParameter4iv(CGparameter param, const int *v);
+CGDLL_API void cgSetParameter1fv(CGparameter param, const float *v);
+CGDLL_API void cgSetParameter2fv(CGparameter param, const float *v);
+CGDLL_API void cgSetParameter3fv(CGparameter param, const float *v);
+CGDLL_API void cgSetParameter4fv(CGparameter param, const float *v);
+CGDLL_API void cgSetParameter1dv(CGparameter param, const double *v);
+CGDLL_API void cgSetParameter2dv(CGparameter param, const double *v);
+CGDLL_API void cgSetParameter3dv(CGparameter param, const double *v);
+CGDLL_API void cgSetParameter4dv(CGparameter param, const double *v);
+
+CGDLL_API void cgSetMatrixParameterir(CGparameter param, const int *matrix);
+CGDLL_API void cgSetMatrixParameterdr(CGparameter param, const double *matrix);
+CGDLL_API void cgSetMatrixParameterfr(CGparameter param, const float *matrix);
+CGDLL_API void cgSetMatrixParameteric(CGparameter param, const int *matrix);
+CGDLL_API void cgSetMatrixParameterdc(CGparameter param, const double *matrix);
+CGDLL_API void cgSetMatrixParameterfc(CGparameter param, const float *matrix);
+
+CGDLL_API void cgGetMatrixParameterir(CGparameter param, int *matrix);
+CGDLL_API void cgGetMatrixParameterdr(CGparameter param, double *matrix);
+CGDLL_API void cgGetMatrixParameterfr(CGparameter param, float *matrix);
+CGDLL_API void cgGetMatrixParameteric(CGparameter param, int *matrix);
+CGDLL_API void cgGetMatrixParameterdc(CGparameter param, double *matrix);
+CGDLL_API void cgGetMatrixParameterfc(CGparameter param, float *matrix);
+
+/*** Type Functions ***/
+
+CGDLL_API const char *cgGetTypeString(CGtype type);
+CGDLL_API CGtype cgGetType(const char *type_string);
+
+CGDLL_API CGtype cgGetNamedUserType(CGhandle handle, const char *name);
+
+CGDLL_API int cgGetNumUserTypes(CGhandle handle);
+CGDLL_API CGtype cgGetUserType(CGhandle handle, int index);
+
+CGDLL_API int cgGetNumParentTypes(CGtype type);
+CGDLL_API CGtype cgGetParentType(CGtype type, int index);
+
+CGDLL_API CGbool cgIsParentType(CGtype parent, CGtype child);
+CGDLL_API CGbool cgIsInterfaceType(CGtype type);
+
+/*** Resource Functions ***/
+
+CGDLL_API const char *cgGetResourceString(CGresource resource);
+CGDLL_API CGresource cgGetResource(const char *resource_string);
+
+/*** Enum Functions ***/
+
+CGDLL_API const char *cgGetEnumString(CGenum en);
+CGDLL_API CGenum cgGetEnum(const char *enum_string);
+
+/*** Profile Functions ***/
+
+CGDLL_API const char *cgGetProfileString(CGprofile profile);
+CGDLL_API CGprofile cgGetProfile(const char *profile_string);
+
+/*** Error Functions ***/
+
+CGDLL_API CGerror cgGetError(void);
+CGDLL_API CGerror cgGetFirstError(void);
+CGDLL_API const char *cgGetErrorString(CGerror error);
+CGDLL_API const char *cgGetLastErrorString(CGerror *error);
+CGDLL_API void cgSetErrorCallback(CGerrorCallbackFunc func);
+CGDLL_API CGerrorCallbackFunc cgGetErrorCallback(void);
+CGDLL_API void cgSetErrorHandler(CGerrorHandlerFunc func, void *data);
+CGDLL_API CGerrorHandlerFunc cgGetErrorHandler(void **data);
+
+/*** Misc Functions ***/
+
+CGDLL_API const char *cgGetString(CGenum sname);
+
+
+/*** CgFX Functions ***/
+
+CGDLL_API CGeffect cgCreateEffect(CGcontext, const char *code, const char **args);
+CGDLL_API CGeffect cgCreateEffectFromFile(CGcontext, const char *filename,
+ const char **args);
+CGDLL_API void cgDestroyEffect(CGeffect);
+CGDLL_API CGcontext cgGetEffectContext(CGeffect);
+CGDLL_API CGbool cgIsEffect(CGeffect effect);
+
+CGDLL_API CGeffect cgGetFirstEffect(CGcontext);
+CGDLL_API CGeffect cgGetNextEffect(CGeffect);
+
+CGDLL_API CGprogram cgCreateProgramFromEffect(CGeffect effect,
+ CGprofile profile,
+ const char *entry,
+ const char **args);
+
+CGDLL_API CGtechnique cgGetFirstTechnique(CGeffect);
+CGDLL_API CGtechnique cgGetNextTechnique(CGtechnique);
+CGDLL_API CGtechnique cgGetNamedTechnique(CGeffect, const char *name);
+CGDLL_API const char *cgGetTechniqueName(CGtechnique);
+CGDLL_API CGbool cgIsTechnique(CGtechnique);
+CGDLL_API CGbool cgValidateTechnique(CGtechnique);
+CGDLL_API CGbool cgIsTechniqueValidated(CGtechnique);
+CGDLL_API CGeffect cgGetTechniqueEffect(CGtechnique);
+
+CGDLL_API CGpass cgGetFirstPass(CGtechnique);
+CGDLL_API CGpass cgGetNamedPass(CGtechnique, const char *name);
+CGDLL_API CGpass cgGetNextPass(CGpass);
+CGDLL_API CGbool cgIsPass(CGpass);
+CGDLL_API const char *cgGetPassName(CGpass);
+CGDLL_API CGtechnique cgGetPassTechnique(CGpass);
+
+CGDLL_API void cgSetPassState(CGpass);
+CGDLL_API void cgResetPassState(CGpass);
+
+CGDLL_API CGstateassignment cgGetFirstStateAssignment(CGpass);
+CGDLL_API CGstateassignment cgGetNamedStateAssignment(CGpass, const char *name);
+CGDLL_API CGstateassignment cgGetNextStateAssignment(CGstateassignment);
+CGDLL_API CGbool cgIsStateAssignment(CGstateassignment);
+CGDLL_API CGbool cgCallStateSetCallback(CGstateassignment);
+CGDLL_API CGbool cgCallStateValidateCallback(CGstateassignment);
+CGDLL_API CGbool cgCallStateResetCallback(CGstateassignment);
+CGDLL_API CGpass cgGetStateAssignmentPass(CGstateassignment);
+CGDLL_API CGparameter cgGetSamplerStateAssignmentParameter(CGstateassignment);
+
+CGDLL_API const float *cgGetFloatStateAssignmentValues(CGstateassignment, int *nVals);
+CGDLL_API const int *cgGetIntStateAssignmentValues(CGstateassignment, int *nVals);
+CGDLL_API const CGbool *cgGetBoolStateAssignmentValues(CGstateassignment, int *nVals);
+CGDLL_API const char *cgGetStringStateAssignmentValue(CGstateassignment);
+CGDLL_API CGprogram cgGetProgramStateAssignmentValue(CGstateassignment);
+CGDLL_API CGparameter cgGetTextureStateAssignmentValue(CGstateassignment);
+CGDLL_API CGparameter cgGetSamplerStateAssignmentValue(CGstateassignment);
+CGDLL_API int cgGetStateAssignmentIndex(CGstateassignment);
+
+CGDLL_API int cgGetNumDependentStateAssignmentParameters(CGstateassignment);
+CGDLL_API CGparameter cgGetDependentStateAssignmentParameter(CGstateassignment, int index);
+
+CGDLL_API CGstate cgGetStateAssignmentState(CGstateassignment);
+CGDLL_API CGstate cgGetSamplerStateAssignmentState(CGstateassignment);
+
+CGDLL_API CGstate cgCreateState(CGcontext, const char *name, CGtype);
+CGDLL_API CGstate cgCreateArrayState(CGcontext, const char *name, CGtype, int nelems);
+CGDLL_API void cgSetStateCallbacks(CGstate, CGstatecallback set, CGstatecallback reset,
+ CGstatecallback validate);
+CGDLL_API CGstatecallback cgGetStateSetCallback(CGstate);
+CGDLL_API CGstatecallback cgGetStateResetCallback(CGstate);
+CGDLL_API CGstatecallback cgGetStateValidateCallback(CGstate);
+CGDLL_API CGtype cgGetStateType(CGstate);
+CGDLL_API const char *cgGetStateName(CGstate);
+CGDLL_API CGstate cgGetNamedState(CGcontext, const char *name);
+CGDLL_API CGstate cgGetFirstState(CGcontext);
+CGDLL_API CGstate cgGetNextState(CGstate);
+CGDLL_API CGbool cgIsState(CGstate);
+CGDLL_API void cgAddStateEnumerant(CGstate, const char *name, int value);
+
+CGDLL_API CGstate cgCreateSamplerState(CGcontext, const char *name, CGtype);
+CGDLL_API CGstate cgCreateArraySamplerState(CGcontext, const char *name, CGtype, int nelems);
+CGDLL_API CGstate cgGetNamedSamplerState(CGcontext, const char *name);
+CGDLL_API CGstate cgGetFirstSamplerState(CGcontext);
+
+CGDLL_API CGstateassignment cgGetFirstSamplerStateAssignment(CGparameter);
+CGDLL_API CGstateassignment cgGetNamedSamplerStateAssignment(CGparameter, const char *);
+CGDLL_API void cgSetSamplerState(CGparameter);
+
+CGDLL_API CGparameter cgGetNamedEffectParameter(CGeffect, const char *);
+CGDLL_API CGparameter cgGetFirstLeafEffectParameter(CGeffect);
+CGDLL_API CGparameter cgGetFirstEffectParameter(CGeffect);
+CGDLL_API CGparameter cgGetEffectParameterBySemantic(CGeffect, const char *);
+
+CGDLL_API CGannotation cgGetFirstTechniqueAnnotation(CGtechnique);
+CGDLL_API CGannotation cgGetFirstPassAnnotation(CGpass);
+CGDLL_API CGannotation cgGetFirstParameterAnnotation(CGparameter);
+CGDLL_API CGannotation cgGetFirstProgramAnnotation(CGprogram);
+CGDLL_API CGannotation cgGetNextAnnotation(CGannotation);
+
+CGDLL_API CGannotation cgGetNamedTechniqueAnnotation(CGtechnique, const char *);
+CGDLL_API CGannotation cgGetNamedPassAnnotation(CGpass, const char *);
+CGDLL_API CGannotation cgGetNamedParameterAnnotation(CGparameter, const char *);
+CGDLL_API CGannotation cgGetNamedProgramAnnotation(CGprogram, const char *);
+
+CGDLL_API CGbool cgIsAnnotation(CGannotation);
+
+CGDLL_API const char *cgGetAnnotationName(CGannotation);
+CGDLL_API CGtype cgGetAnnotationType(CGannotation);
+
+CGDLL_API const float *cgGetFloatAnnotationValues(CGannotation, int *nvalues);
+CGDLL_API const int *cgGetIntAnnotationValues(CGannotation, int *nvalues);
+CGDLL_API const char *cgGetStringAnnotationValue(CGannotation);
+CGDLL_API const int *cgGetBooleanAnnotationValues(CGannotation, int *nvalues);
+
+CGDLL_API int cgGetNumDependentAnnotationParameters(CGannotation);
+CGDLL_API CGparameter cgGetDependentAnnotationParameter(CGannotation, int index);
+
+CGDLL_API void cgEvaluateProgram(CGprogram, float *, int ncomps, int nx, int ny, int nz);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/make/stub_includes/cg/CG/cgGL.h b/make/stub_includes/cg/CG/cgGL.h
new file mode 100644
index 000000000..f66ec0685
--- /dev/null
+++ b/make/stub_includes/cg/CG/cgGL.h
@@ -0,0 +1,378 @@
+/*
+ *
+ * Copyright (c) 2002, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _cggl_h
+#define _cggl_h
+
+
+
+#include <CG/cg.h>
+
+/* Set up for either Win32 import/export/lib. */
+#ifndef CGGLDLL_API
+#if WIN32
+ # include <windows.h>
+ #ifdef CGGLDLL_EXPORTS
+ #define CGGLDLL_API __declspec(dllexport)
+ #elif defined (CG_LIB)
+ #define CGGLDLL_API
+ #else
+ #define CGGLDLL_API __declspec(dllimport)
+ #endif
+#else
+ #define CGGLDLL_API
+#endif
+#endif
+
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#else
+#include <GL/gl.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*****************************************************************************/
+/*** cgGL Type Definitions ***/
+/*****************************************************************************/
+
+typedef enum
+ {
+ CG_GL_MATRIX_IDENTITY = 0,
+ CG_GL_MATRIX_TRANSPOSE = 1,
+ CG_GL_MATRIX_INVERSE = 2,
+ CG_GL_MATRIX_INVERSE_TRANSPOSE = 3,
+
+ CG_GL_MODELVIEW_MATRIX,
+ CG_GL_PROJECTION_MATRIX,
+ CG_GL_TEXTURE_MATRIX,
+ CG_GL_MODELVIEW_PROJECTION_MATRIX,
+
+ CG_GL_VERTEX,
+ CG_GL_FRAGMENT,
+
+ } CGGLenum;
+
+
+#ifndef CGGL_EXPLICIT
+
+/******************************************************************************
+ *** Profile Functions
+ *****************************************************************************/
+
+CGGLDLL_API CGbool cgGLIsProfileSupported(CGprofile profile);
+
+CGGLDLL_API void cgGLEnableProfile(CGprofile profile);
+CGGLDLL_API void cgGLDisableProfile(CGprofile profile);
+
+CGGLDLL_API CGprofile cgGLGetLatestProfile(CGGLenum profile_type);
+CGGLDLL_API void cgGLSetOptimalOptions(CGprofile profile);
+
+/******************************************************************************
+ *** Program Managment Functions
+ *****************************************************************************/
+
+CGGLDLL_API void cgGLLoadProgram(CGprogram program);
+CGGLDLL_API CGbool cgGLIsProgramLoaded(CGprogram program);
+CGGLDLL_API void cgGLBindProgram(CGprogram program);
+CGGLDLL_API void cgGLUnbindProgram(CGprofile profile);
+CGGLDLL_API GLuint cgGLGetProgramID(CGprogram program);
+
+/******************************************************************************
+ *** Parameter Managment Functions
+ *****************************************************************************/
+
+CGGLDLL_API void cgGLSetParameter1f(CGparameter param,
+ float x);
+
+CGGLDLL_API void cgGLSetParameter2f(CGparameter param,
+ float x,
+ float y);
+
+CGGLDLL_API void cgGLSetParameter3f(CGparameter param,
+ float x,
+ float y,
+ float z);
+
+CGGLDLL_API void cgGLSetParameter4f(CGparameter param,
+ float x,
+ float y,
+ float z,
+ float w);
+
+CGGLDLL_API void cgGLSetParameter1fv(CGparameter param, const float *v);
+
+CGGLDLL_API void cgGLSetParameter2fv(CGparameter param, const float *v);
+
+CGGLDLL_API void cgGLSetParameter3fv(CGparameter param, const float *v);
+
+CGGLDLL_API void cgGLSetParameter4fv(CGparameter param, const float *v);
+
+CGGLDLL_API void cgGLSetParameter1d(CGparameter param,
+ double x);
+
+CGGLDLL_API void cgGLSetParameter2d(CGparameter param,
+ double x,
+ double y);
+
+CGGLDLL_API void cgGLSetParameter3d(CGparameter param,
+ double x,
+ double y,
+ double z);
+
+CGGLDLL_API void cgGLSetParameter4d(CGparameter param,
+ double x,
+ double y,
+ double z,
+ double w);
+
+CGGLDLL_API void cgGLSetParameter1dv(CGparameter param, const double *v);
+
+CGGLDLL_API void cgGLSetParameter2dv(CGparameter param, const double *v);
+
+CGGLDLL_API void cgGLSetParameter3dv(CGparameter param, const double *v);
+
+CGGLDLL_API void cgGLSetParameter4dv(CGparameter param, const double *v);
+
+CGGLDLL_API void cgGLSetParameter4dv(CGparameter param, const double *v);
+
+CGGLDLL_API void cgGLGetParameter1f(CGparameter param, float *v);
+
+CGGLDLL_API void cgGLGetParameter2f(CGparameter param, float *v);
+
+CGGLDLL_API void cgGLGetParameter3f(CGparameter param, float *v);
+
+CGGLDLL_API void cgGLGetParameter4f(CGparameter param, float *v);
+
+CGGLDLL_API void cgGLGetParameter1d(CGparameter param, double *v);
+
+CGGLDLL_API void cgGLGetParameter2d(CGparameter param, double *v);
+
+CGGLDLL_API void cgGLGetParameter3d(CGparameter param, double *v);
+
+CGGLDLL_API void cgGLGetParameter4d(CGparameter param, double *v);
+
+CGGLDLL_API void cgGLSetParameterArray1f(CGparameter param,
+ long offset,
+ long nelements,
+ const float *v);
+
+CGGLDLL_API void cgGLSetParameterArray2f(CGparameter param,
+ long offset,
+ long nelements,
+ const float *v);
+
+CGGLDLL_API void cgGLSetParameterArray3f(CGparameter param,
+ long offset,
+ long nelements,
+ const float *v);
+
+CGGLDLL_API void cgGLSetParameterArray4f(CGparameter param,
+ long offset,
+ long nelements,
+ const float *v);
+
+CGGLDLL_API void cgGLSetParameterArray1d(CGparameter param,
+ long offset,
+ long nelements,
+ const double *v);
+
+CGGLDLL_API void cgGLSetParameterArray2d(CGparameter param,
+ long offset,
+ long nelements,
+ const double *v);
+
+CGGLDLL_API void cgGLSetParameterArray3d(CGparameter param,
+ long offset,
+ long nelements,
+ const double *v);
+
+CGGLDLL_API void cgGLSetParameterArray4d(CGparameter param,
+ long offset,
+ long nelements,
+ const double *v);
+
+CGGLDLL_API void cgGLGetParameterArray1f(CGparameter param,
+ long offset,
+ long nelements,
+ float *v);
+
+CGGLDLL_API void cgGLGetParameterArray2f(CGparameter param,
+ long offset,
+ long nelements,
+ float *v);
+
+CGGLDLL_API void cgGLGetParameterArray3f(CGparameter param,
+ long offset,
+ long nelements,
+ float *v);
+
+CGGLDLL_API void cgGLGetParameterArray4f(CGparameter param,
+ long offset,
+ long nelements,
+ float *v);
+
+CGGLDLL_API void cgGLGetParameterArray1d(CGparameter param,
+ long offset,
+ long nelements,
+ double *v);
+
+CGGLDLL_API void cgGLGetParameterArray2d(CGparameter param,
+ long offset,
+ long nelements,
+ double *v);
+
+CGGLDLL_API void cgGLGetParameterArray3d(CGparameter param,
+ long offset,
+ long nelements,
+ double *v);
+
+CGGLDLL_API void cgGLGetParameterArray4d(CGparameter param,
+ long offset,
+ long nelements,
+ double *v);
+
+CGGLDLL_API void cgGLSetParameterPointer(CGparameter param,
+ GLint fsize,
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer);
+
+CGGLDLL_API void cgGLEnableClientState(CGparameter param);
+CGGLDLL_API void cgGLDisableClientState(CGparameter param);
+
+/******************************************************************************
+ *** Matrix Parameter Managment Functions
+ *****************************************************************************/
+
+CGGLDLL_API void cgGLSetMatrixParameterdr(CGparameter param,
+ const double *matrix);
+CGGLDLL_API void cgGLSetMatrixParameterfr(CGparameter param,
+ const float *matrix);
+CGGLDLL_API void cgGLSetMatrixParameterdc(CGparameter param,
+ const double *matrix);
+CGGLDLL_API void cgGLSetMatrixParameterfc(CGparameter param,
+ const float *matrix);
+
+CGGLDLL_API void cgGLGetMatrixParameterdr(CGparameter param, double *matrix);
+CGGLDLL_API void cgGLGetMatrixParameterfr(CGparameter param, float *matrix);
+CGGLDLL_API void cgGLGetMatrixParameterdc(CGparameter param, double *matrix);
+CGGLDLL_API void cgGLGetMatrixParameterfc(CGparameter param, float *matrix);
+
+CGGLDLL_API void cgGLSetStateMatrixParameter(CGparameter param,
+ CGGLenum matrix,
+ CGGLenum transform);
+
+CGGLDLL_API void cgGLSetMatrixParameterArrayfc(CGparameter param,
+ long offset,
+ long nelements,
+ const float *matrices);
+
+CGGLDLL_API void cgGLSetMatrixParameterArrayfr(CGparameter param,
+ long offset,
+ long nelements,
+ const float *matrices);
+
+CGGLDLL_API void cgGLSetMatrixParameterArraydc(CGparameter param,
+ long offset,
+ long nelements,
+ const double *matrices);
+
+CGGLDLL_API void cgGLSetMatrixParameterArraydr(CGparameter param,
+ long offset,
+ long nelements,
+ const double *matrices);
+
+CGGLDLL_API void cgGLGetMatrixParameterArrayfc(CGparameter param,
+ long offset,
+ long nelements,
+ float *matrices);
+
+CGGLDLL_API void cgGLGetMatrixParameterArrayfr(CGparameter param,
+ long offset,
+ long nelements,
+ float *matrices);
+
+CGGLDLL_API void cgGLGetMatrixParameterArraydc(CGparameter param,
+ long offset,
+ long nelements,
+ double *matrices);
+
+CGGLDLL_API void cgGLGetMatrixParameterArraydr(CGparameter param,
+ long offset,
+ long nelements,
+ double *matrices);
+
+/******************************************************************************
+ *** Texture Parameter Managment Functions
+ *****************************************************************************/
+
+CGGLDLL_API void cgGLSetTextureParameter(CGparameter param, GLuint texobj);
+CGGLDLL_API GLuint cgGLGetTextureParameter(CGparameter param);
+CGGLDLL_API void cgGLEnableTextureParameter(CGparameter param);
+CGGLDLL_API void cgGLDisableTextureParameter(CGparameter param);
+CGGLDLL_API GLenum cgGLGetTextureEnum(CGparameter param);
+CGGLDLL_API void cgGLSetManageTextureParameters(CGcontext ctx, CGbool flag);
+CGGLDLL_API CGbool cgGLGetManageTextureParameters(CGcontext ctx);
+
+CGGLDLL_API void cgGLSetupSampler(CGparameter param, GLuint texobj);
+CGGLDLL_API void cgGLRegisterStates(CGcontext);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/make/stub_includes/cg/CG/cgGL_profiles.h b/make/stub_includes/cg/CG/cgGL_profiles.h
new file mode 100644
index 000000000..105748f1d
--- /dev/null
+++ b/make/stub_includes/cg/CG/cgGL_profiles.h
@@ -0,0 +1,64 @@
+/*
+ *
+ * Copyright (c) 2002, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/*CG_PROFILE_MACRO(Vertex,vp20,*/CG_PROFILE_VP20=/*,"vp20",*/6146,//1)
+/*CG_PROFILE_MACRO(Fragment20,fp20,*/CG_PROFILE_FP20=/*,"fp20",*/6147,//0)
+/*CG_PROFILE_MACRO(Vertex30,vp30,*/CG_PROFILE_VP30=/*,"vp30",*/6148,//1)
+/*CG_PROFILE_MACRO(Fragment,fp30,*/CG_PROFILE_FP30=/*,"fp30",*/6149,//0)
+/*CG_PROFILE_MACRO(ARBVertex,arbvp1,*/CG_PROFILE_ARBVP1=/*,"arbvp1",*/6150,//1)
+/*CG_PROFILE_MACRO(Fragment40,fp40,*/CG_PROFILE_FP40=/*,"fp40",*/6151,//0)
+/*CG_PROFILE_MACRO(ARBFragment,arbfp1,*/CG_PROFILE_ARBFP1=/*,"arbfp1",*/7000,//0)
+/*CG_PROFILE_MACRO(Vertex40,vp40,*/CG_PROFILE_VP40=/*,"vp40",*/7001,//1)
+
+#ifndef CG_IN_PROFILES_INCLUDE
+# undef CG_PROFILE_MACRO
+#endif
diff --git a/make/stub_includes/cg/CG/cg_bindlocations.h b/make/stub_includes/cg/CG/cg_bindlocations.h
new file mode 100644
index 000000000..2bb714f26
--- /dev/null
+++ b/make/stub_includes/cg/CG/cg_bindlocations.h
@@ -0,0 +1,339 @@
+/*
+ * This is a modified version of the original header as provided by
+ * NVidia; original copyright appears below.
+ *
+ * Modified by Christopher Kline, May 2003: Stripped down and hacked to get
+ * around macro interpretation problems.
+ */
+
+
+/*
+ *
+ * Copyright (c) 2002, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/*
+ * The following macro invocations define the supported CG basic hardware
+ * bind locations.
+ *
+ * The macros have the form :
+ *
+ * CG_BINDLOCATION_MACRO(name, compiler_name, enum_int)
+ *
+ * name : The name of the location.
+ * enum_name : The C enumerant.
+ * compiler_name : The name of the location within the compiler syntax.
+ * int_id : Integer enumerant associated with this bind location.
+ * addressable : The bind location must have an integer address
+ * associated with it.
+ * ParamType : the cgParamType of this register.
+ *
+ */
+
+
+/*CG_BINDLOCATION_MACRO(TexUnit0,*/CG_TEXUNIT0=/*,"texunit 0",*/2048,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit1,*/CG_TEXUNIT1=/*,"texunit 1",*/2049,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit2,*/CG_TEXUNIT2=/*,"texunit 2",*/2050,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit3,*/CG_TEXUNIT3=/*,"texunit 3",*/2051,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit4,*/CG_TEXUNIT4=/*,"texunit 4",*/2052,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit5,*/CG_TEXUNIT5=/*,"texunit 5",*/2053,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit6,*/CG_TEXUNIT6=/*,"texunit 6",*/2054,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit7,*/CG_TEXUNIT7=/*,"texunit 7",*/2055,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit8,*/CG_TEXUNIT8=/*,"texunit 8",*/2056,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit9,*/CG_TEXUNIT9=/*,"texunit 9",*/2057,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit10,*/CG_TEXUNIT10=/*,"texunit 10",*/2058,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit11,*/CG_TEXUNIT11=/*,"texunit 11",*/2059,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit12,*/CG_TEXUNIT12=/*,"texunit 12",*/2060,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit13,*/CG_TEXUNIT13=/*,"texunit 13",*/2061,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit14,*/CG_TEXUNIT14=/*,"texunit 14",*/2062,//0,CG_TEXOBJ_PARAM)
+/*CG_BINDLOCATION_MACRO(TexUnit15,*/CG_TEXUNIT15=/*,"texunit 15",*/2063,//0,CG_TEXOBJ_PARAM)
+
+/*CG_BINDLOCATION_MACRO(Attr0,*/CG_ATTR0=/*,"ATTR0",*/2113,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr1,*/CG_ATTR1=/*,"ATTR1",*/2114,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr2,*/CG_ATTR2=/*,"ATTR2",*/2115,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr3,*/CG_ATTR3=/*,"ATTR3",*/2116,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr4,*/CG_ATTR4=/*,"ATTR4",*/2117,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr5,*/CG_ATTR5=/*,"ATTR5",*/2118,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr6,*/CG_ATTR6=/*,"ATTR6",*/2119,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr7,*/CG_ATTR7=/*,"ATTR7",*/2120,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr8,*/CG_ATTR8=/*,"ATTR8",*/2121,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr9,*/CG_ATTR9=/*,"ATTR9",*/2122,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr10,*/CG_ATTR10=/*,"ATTR10",*/2123,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr11,*/CG_ATTR11=/*,"ATTR11",*/2124,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr12,*/CG_ATTR12=/*,"ATTR12",*/2125,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr13,*/CG_ATTR13=/*,"ATTR13",*/2126,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr14,*/CG_ATTR14=/*,"ATTR14",*/2127,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Attr15,*/CG_ATTR15=/*,"ATTR15",*/2128,//0,CG_VARYING_PARAM)
+
+/*CG_BINDLOCATION_MACRO(VertUniform,*/CG_C=/*,"c",*/2178,//1,CGI_UNIFORM_PARAM)
+
+/*CG_BINDLOCATION_MACRO(Tex0,*/CG_TEX0=/*,"TEX0",*/2179,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex1,*/CG_TEX1=/*,"TEX1",*/2180,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex2,*/CG_TEX2=/*,"TEX2",*/2181,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex3,*/CG_TEX3=/*,"TEX3",*/2192,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex4,*/CG_TEX4=/*,"TEX4",*/2193,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex5,*/CG_TEX5=/*,"TEX5",*/2194,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex6,*/CG_TEX6=/*,"TEX6",*/2195,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tex7,*/CG_TEX7=/*,"TEX7",*/2196,//0,CG_VARYING_PARAM)
+
+/*CG_BINDLOCATION_MACRO(HPos,*/CG_HPOS=/*,"HPOS",*/2243,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Col0,*/CG_COL0=/*,"COL0",*/2245,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Col1,*/CG_COL1=/*,"COL1",*/2246,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Col2,*/CG_COL2=/*,"COL2",*/2247,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Col3,*/CG_COL3=/*,"COL3",*/2248,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSiz,*/CG_PSIZ=/*,"PSIZ",*/2309,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(WPos,*/CG_WPOS=/*,"WPOS",*/2373,//0,CG_VARYING_PARAM)
+
+/*CG_BINDLOCATION_MACRO(Position0,*/CG_POSITION0=/*,"POSITION0",*/2437,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position1,*/CG_POSITION1=/*,"POSITION1",*/2438,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position2,*/CG_POSITION2=/*,"POSITION2",*/2439,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position3,*/CG_POSITION3=/*,"POSITION3",*/2440,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position4,*/CG_POSITION4=/*,"POSITION4",*/2441,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position5,*/CG_POSITION5=/*,"POSITION5",*/2442,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position6,*/CG_POSITION6=/*,"POSITION6",*/2443,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position7,*/CG_POSITION7=/*,"POSITION7",*/2444,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position8,*/CG_POSITION8=/*,"POSITION8",*/2445,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position9,*/CG_POSITION9=/*,"POSITION9",*/2446,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position10,*/CG_POSITION10=/*,"POSITION10",*/2447,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position11,*/CG_POSITION11=/*,"POSITION11",*/2448,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position12,*/CG_POSITION12=/*,"POSITION12",*/2449,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position13,*/CG_POSITION13=/*,"POSITION13",*/2450,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position14,*/CG_POSITION14=/*,"POSITION14",*/2451,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Position15,*/CG_POSITION15=/*,"POSITION15",*/2452,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Diffuse0,*/CG_DIFFUSE0=/*,"DIFFUSE0",*/2501,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent0,*/CG_TANGENT0=/*,"TANGENT0",*/2565,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent1,*/CG_TANGENT1=/*,"TANGENT1",*/2566,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent2,*/CG_TANGENT2=/*,"TANGENT2",*/2567,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent3,*/CG_TANGENT3=/*,"TANGENT3",*/2568,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent4,*/CG_TANGENT4=/*,"TANGENT4",*/2569,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent5,*/CG_TANGENT5=/*,"TANGENT5",*/2570,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent6,*/CG_TANGENT6=/*,"TANGENT6",*/2571,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent7,*/CG_TANGENT7=/*,"TANGENT7",*/2572,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent8,*/CG_TANGENT8=/*,"TANGENT8",*/2573,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent9,*/CG_TANGENT9=/*,"TANGENT9",*/2574,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent10,*/CG_TANGENT10=/*,"TANGENT10",*/2575,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent11,*/CG_TANGENT11=/*,"TANGENT11",*/2576,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent12,*/CG_TANGENT12=/*,"TANGENT12",*/2577,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent13,*/CG_TANGENT13=/*,"TANGENT13",*/2578,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent14,*/CG_TANGENT14=/*,"TANGENT14",*/2579,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Tangent15,*/CG_TANGENT15=/*,"TANGENT15",*/2580,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Specular0,*/CG_SPECULAR0=/*,"SPECULAR0",*/2629,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices0,*/CG_BLENDINDICES0=/*,"BLENDINDICES0",*/2693,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices1,*/CG_BLENDINDICES1=/*,"BLENDINDICES1",*/2694,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices2,*/CG_BLENDINDICES2=/*,"BLENDINDICES2",*/2695,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices3,*/CG_BLENDINDICES3=/*,"BLENDINDICES3",*/2696,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices4,*/CG_BLENDINDICES4=/*,"BLENDINDICES4",*/2697,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices5,*/CG_BLENDINDICES5=/*,"BLENDINDICES5",*/2698,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices6,*/CG_BLENDINDICES6=/*,"BLENDINDICES6",*/2699,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices7,*/CG_BLENDINDICES7=/*,"BLENDINDICES7",*/2700,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices8,*/CG_BLENDINDICES8=/*,"BLENDINDICES8",*/2701,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices9,*/CG_BLENDINDICES9=/*,"BLENDINDICES9",*/2702,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices10,*/CG_BLENDINDICES10=/*,"BLENDINDICES10",*/2703,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices11,*/CG_BLENDINDICES11=/*,"BLENDINDICES11",*/2704,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices12,*/CG_BLENDINDICES12=/*,"BLENDINDICES12",*/2705,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices13,*/CG_BLENDINDICES13=/*,"BLENDINDICES13",*/2706,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices14,*/CG_BLENDINDICES14=/*,"BLENDINDICES14",*/2707,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendIndices15,*/CG_BLENDINDICES15=/*,"BLENDINDICES15",*/2708,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color0,*/CG_COLOR0=/*,"COLOR0",*/2757,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color1,*/CG_COLOR1=/*,"COLOR1",*/2758,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color2,*/CG_COLOR2=/*,"COLOR2",*/2759,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color3,*/CG_COLOR3=/*,"COLOR3",*/2760,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color4,*/CG_COLOR4=/*,"COLOR4",*/2761,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color5,*/CG_COLOR5=/*,"COLOR5",*/2762,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color6,*/CG_COLOR6=/*,"COLOR6",*/2763,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color7,*/CG_COLOR7=/*,"COLOR7",*/2764,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color8,*/CG_COLOR8=/*,"COLOR8",*/2765,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color9,*/CG_COLOR9=/*,"COLOR9",*/2766,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color10,*/CG_COLOR10=/*,"COLOR10",*/2767,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color11,*/CG_COLOR11=/*,"COLOR11",*/2768,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color12,*/CG_COLOR12=/*,"COLOR12",*/2769,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color13,*/CG_COLOR13=/*,"COLOR13",*/2770,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color14,*/CG_COLOR14=/*,"COLOR14",*/2771,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Color15,*/CG_COLOR15=/*,"COLOR15",*/2772,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize0,*/CG_PSIZE0=/*,"PSIZE0",*/2821,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize1,*/CG_PSIZE1=/*,"PSIZE1",*/2822,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize2,*/CG_PSIZE2=/*,"PSIZE2",*/2823,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize3,*/CG_PSIZE3=/*,"PSIZE3",*/2824,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize4,*/CG_PSIZE4=/*,"PSIZE4",*/2825,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize5,*/CG_PSIZE5=/*,"PSIZE5",*/2826,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize6,*/CG_PSIZE6=/*,"PSIZE6",*/2827,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize7,*/CG_PSIZE7=/*,"PSIZE7",*/2828,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize8,*/CG_PSIZE8=/*,"PSIZE8",*/2829,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize9,*/CG_PSIZE9=/*,"PSIZE9",*/2830,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize10,*/CG_PSIZE10=/*,"PSIZE10",*/2831,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize11,*/CG_PSIZE11=/*,"PSIZE11",*/2832,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize12,*/CG_PSIZE12=/*,"PSIZE12",*/2833,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize13,*/CG_PSIZE13=/*,"PSIZE13",*/2834,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize14,*/CG_PSIZE14=/*,"PSIZE14",*/2835,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(PSize15,*/CG_PSIZE15=/*,"PSIZE15",*/2836,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal0,*/CG_BINORMAL0=/*,"BINORMAL0",*/2885,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal1,*/CG_BINORMAL1=/*,"BINORMAL1",*/2886,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal2,*/CG_BINORMAL2=/*,"BINORMAL2",*/2887,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal3,*/CG_BINORMAL3=/*,"BINORMAL3",*/2888,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal4,*/CG_BINORMAL4=/*,"BINORMAL4",*/2889,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal5,*/CG_BINORMAL5=/*,"BINORMAL5",*/2890,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal6,*/CG_BINORMAL6=/*,"BINORMAL6",*/2891,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal7,*/CG_BINORMAL7=/*,"BINORMAL7",*/2892,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal8,*/CG_BINORMAL8=/*,"BINORMAL8",*/2893,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal9,*/CG_BINORMAL9=/*,"BINORMAL9",*/2894,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal10,*/CG_BINORMAL10=/*,"BINORMAL10",*/2895,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal11,*/CG_BINORMAL11=/*,"BINORMAL11",*/2896,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal12,*/CG_BINORMAL12=/*,"BINORMAL12",*/2897,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal13,*/CG_BINORMAL13=/*,"BINORMAL13",*/2898,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal14,*/CG_BINORMAL14=/*,"BINORMAL14",*/2899,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BiNormal15,*/CG_BINORMAL15=/*,"BINORMAL15",*/2900,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG0,*/CG_FOG0=/*,"FOG0",*/2917,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG1,*/CG_FOG1=/*,"FOG1",*/2918,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG2,*/CG_FOG2=/*,"FOG2",*/2919,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG3,*/CG_FOG3=/*,"FOG3",*/2920,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG4,*/CG_FOG4=/*,"FOG4",*/2921,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG5,*/CG_FOG5=/*,"FOG5",*/2922,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG6,*/CG_FOG6=/*,"FOG6",*/2923,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG7,*/CG_FOG7=/*,"FOG7",*/2924,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG8,*/CG_FOG8=/*,"FOG8",*/2925,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG9,*/CG_FOG9=/*,"FOG9",*/2926,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG10,*/CG_FOG10=/*,"FOG10",*/2927,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG11,*/CG_FOG11=/*,"FOG11",*/2928,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG12,*/CG_FOG12=/*,"FOG12",*/2929,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG13,*/CG_FOG13=/*,"FOG13",*/2930,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG14,*/CG_FOG14=/*,"FOG14",*/2931,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FOG15,*/CG_FOG15=/*,"FOG15",*/2932,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH0,*/CG_DEPTH0=/*,"DEPTH0",*/2933,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH1,*/CG_DEPTH1=/*,"DEPTH1",*/2934,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH2,*/CG_DEPTH2=/*,"DEPTH2",*/2935,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH3,*/CG_DEPTH3=/*,"DEPTH3",*/2936,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH4,*/CG_DEPTH4=/*,"DEPTH4",*/2937,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH5,*/CG_DEPTH5=/*,"DEPTH5",*/2938,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH6,*/CG_DEPTH6=/*,"DEPTH6",*/2939,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH7,*/CG_DEPTH7=/*,"DEPTH7",*/2940,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH8,*/CG_DEPTH8=/*,"DEPTH8",*/2941,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH9,*/CG_DEPTH9=/*,"DEPTH9",*/29542,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH10,*/CG_DEPTH10=/*,"DEPTH10",*/2943,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH11,*/CG_DEPTH11=/*,"DEPTH11",*/2944,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH12,*/CG_DEPTH12=/*,"DEPTH12",*/2945,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH13,*/CG_DEPTH13=/*,"DEPTH13",*/2946,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH14,*/CG_DEPTH14=/*,"DEPTH14",*/2947,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(DEPTH15,*/CG_DEPTH15=/*,"DEPTH15",*/2948,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE0,*/CG_SAMPLE0=/*,"SAMPLE0",*/2949,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE1,*/CG_SAMPLE1=/*,"SAMPLE1",*/2950,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE2,*/CG_SAMPLE2=/*,"SAMPLE2",*/2951,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE3,*/CG_SAMPLE3=/*,"SAMPLE3",*/2952,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE4,*/CG_SAMPLE4=/*,"SAMPLE4",*/2953,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE5,*/CG_SAMPLE5=/*,"SAMPLE5",*/2954,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE6,*/CG_SAMPLE6=/*,"SAMPLE6",*/2955,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE7,*/CG_SAMPLE7=/*,"SAMPLE7",*/2956,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE8,*/CG_SAMPLE8=/*,"SAMPLE8",*/2957,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE9,*/CG_SAMPLE9=/*,"SAMPLE9",*/2958,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE10,*/CG_SAMPLE10=/*,"SAMPLE10",*/2959,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE11,*/CG_SAMPLE11=/*,"SAMPLE11",*/2960,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE12,*/CG_SAMPLE12=/*,"SAMPLE12",*/2961,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE13,*/CG_SAMPLE13=/*,"SAMPLE13",*/2962,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE14,*/CG_SAMPLE14=/*,"SAMPLE14",*/2963,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(SAMPLE15,*/CG_SAMPLE15=/*,"SAMPLE15",*/2964,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight0,*/CG_BLENDWEIGHT0=/*,"BLENDWEIGHT0",*/3028,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight1,*/CG_BLENDWEIGHT1=/*,"BLENDWEIGHT1",*/3029,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight2,*/CG_BLENDWEIGHT2=/*,"BLENDWEIGHT2",*/3030,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight3,*/CG_BLENDWEIGHT3=/*,"BLENDWEIGHT3",*/3031,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight4,*/CG_BLENDWEIGHT4=/*,"BLENDWEIGHT4",*/3032,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight5,*/CG_BLENDWEIGHT5=/*,"BLENDWEIGHT5",*/3033,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight6,*/CG_BLENDWEIGHT6=/*,"BLENDWEIGHT6",*/3034,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight7,*/CG_BLENDWEIGHT7=/*,"BLENDWEIGHT7",*/3035,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight8,*/CG_BLENDWEIGHT8=/*,"BLENDWEIGHT8",*/3036,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight9,*/CG_BLENDWEIGHT9=/*,"BLENDWEIGHT9",*/3037,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight10,*/CG_BLENDWEIGHT10=/*,"BLENDWEIGHT10",*/3038,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight11,*/CG_BLENDWEIGHT11=/*,"BLENDWEIGHT11",*/3039,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight12,*/CG_BLENDWEIGHT12=/*,"BLENDWEIGHT12",*/3040,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight13,*/CG_BLENDWEIGHT13=/*,"BLENDWEIGHT13",*/3041,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight14,*/CG_BLENDWEIGHT14=/*,"BLENDWEIGHT14",*/3042,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(BlendWeight15,*/CG_BLENDWEIGHT15=/*,"BLENDWEIGHT15",*/3043,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal0,*/CG_NORMAL0=/*,"NORMAL0",*/3092,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal1,*/CG_NORMAL1=/*,"NORMAL1",*/3093,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal2,*/CG_NORMAL2=/*,"NORMAL2",*/3094,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal3,*/CG_NORMAL3=/*,"NORMAL3",*/3095,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal4,*/CG_NORMAL4=/*,"NORMAL4",*/3096,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal5,*/CG_NORMAL5=/*,"NORMAL5",*/3097,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal6,*/CG_NORMAL6=/*,"NORMAL6",*/3098,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal7,*/CG_NORMAL7=/*,"NORMAL7",*/3099,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal8,*/CG_NORMAL8=/*,"NORMAL8",*/3100,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal9,*/CG_NORMAL9=/*,"NORMAL9",*/3101,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal10,*/CG_NORMAL10=/*,"NORMAL10",*/3102,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal11,*/CG_NORMAL11=/*,"NORMAL11",*/3103,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal12,*/CG_NORMAL12=/*,"NORMAL12",*/3104,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal13,*/CG_NORMAL13=/*,"NORMAL13",*/3105,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal14,*/CG_NORMAL14=/*,"NORMAL14",*/3106,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(Normal15,*/CG_NORMAL15=/*,"NORMAL15",*/3107,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(FogCoord,*/CG_FOGCOORD=/*,"FOGCOORD",*/3156,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord0,*/CG_TEXCOORD0=/*,"TEXCOORD0",*/3220,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord1,*/CG_TEXCOORD1=/*,"TEXCOORD1",*/3221,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord2,*/CG_TEXCOORD2=/*,"TEXCOORD2",*/3222,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord3,*/CG_TEXCOORD3=/*,"TEXCOORD3",*/3223,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord4,*/CG_TEXCOORD4=/*,"TEXCOORD4",*/3224,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord5,*/CG_TEXCOORD5=/*,"TEXCOORD5",*/3225,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord6,*/CG_TEXCOORD6=/*,"TEXCOORD6",*/3226,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord7,*/CG_TEXCOORD7=/*,"TEXCOORD7",*/3227,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord8,*/CG_TEXCOORD8=/*,"TEXCOORD8",*/3228,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord9,*/CG_TEXCOORD9=/*,"TEXCOORD9",*/3229,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord10,*/CG_TEXCOORD10=/*,"TEXCOORD10",*/3230,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord11,*/CG_TEXCOORD11=/*,"TEXCOORD11",*/3231,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord12,*/CG_TEXCOORD12=/*,"TEXCOORD12",*/3232,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord13,*/CG_TEXCOORD13=/*,"TEXCOORD13",*/3233,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord14,*/CG_TEXCOORD14=/*,"TEXCOORD14",*/3234,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(TexCoord15,*/CG_TEXCOORD15=/*,"TEXCOORD15",*/3235,//0,CG_VARYING_PARAM)
+/*CG_BINDLOCATION_MACRO(CombinerConst0,*/CG_COMBINER_CONST0=/*,"COMBINER_CONST0",*/3284,//0,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(CombinerConst1,*/CG_COMBINER_CONST1=/*,"COMBINER_CONST1",*/3285,//0,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(CombinerStageConst0,*/CG_COMBINER_STAGE_CONST0=/*,"COMBINER_STAGE_CONST0",*/3286,//1,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(CombinerStageConst1,*/CG_COMBINER_STAGE_CONST1=/*,"COMBINER_STAGE_CONST1",*/3287,//1,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(OffsetTextureMatrix,*/CG_OFFSET_TEXTURE_MATRIX=/*,"OFFSET_TEXTURE_MATRIX",*/3288,//0,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(OffsetTextureScale,*/CG_OFFSET_TEXTURE_SCALE=/*,"OFFSET_TEXTURE_SCALE",*/3289,//0,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(OffsetTextureBias,*/CG_OFFSET_TEXTURE_BIAS=/*,"OFFSET_TEXTURE_BIAS",*/3290,//0,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(ConstEye,*/CG_CONST_EYE=/*,"CONST_EYE",*/3291,//0,CGI_UNIFORM_PARAM)
+/*CG_BINDLOCATION_MACRO(TessFactor,*/CG_TESSFACTOR=/*,"TESSFACTOR",*/3255,//0,CG_VARYING_PARAM)
+
+//#undef CG_BINDLOCATION_MACRO
diff --git a/make/stub_includes/cg/CG/cg_datatypes.h b/make/stub_includes/cg/CG/cg_datatypes.h
new file mode 100644
index 000000000..2eb0ff85a
--- /dev/null
+++ b/make/stub_includes/cg/CG/cg_datatypes.h
@@ -0,0 +1,192 @@
+/*
+ * This is a modified version of the original header as provided by
+ * NVidia; original copyright appears below.
+ *
+ * Modified by Christopher Kline, May 2003: Stripped down and hacked to get
+ * around macro interpretation problems.
+ */
+
+/*
+ *
+ * Copyright (c) 2002, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/*
+ * The following macro invocations define the supported CG basic data types.
+ *
+ * The macros have the form :
+ *
+ * CG_DATATYPE_MACRO(name, compiler_name, nrows, ncols)
+ *
+ * name : The name of the data type.
+ * compiler_name : The name of the data type within the compiler syntax.
+ * enum_name : The C enumerant.
+ * nrows : Number of rows for matrix types. Should be 0 other-wise.
+ * ncols : Number of columns for scalar, vector, and matrix types.
+ *
+ */
+
+
+
+/*CG_DATATYPE_MACRO(Half,half,*/CG_HALF,//CG_HALF,0,1,CG_PARAMETERCLASS_SCALAR)
+/*CG_DATATYPE_MACRO(Half2,half2,*/CG_HALF2,//CG_HALF,0,2,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Half3,half3,*/CG_HALF3,//CG_HALF,0,3,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Half4,half4,*/CG_HALF4,//CG_HALF,0,4,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Half1x1,half1x1,*/CG_HALF1x1,//CG_HALF,1,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half1x2,half1x2,*/CG_HALF1x2,//CG_HALF,1,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half1x3,half1x3,*/CG_HALF1x3,//CG_HALF,1,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half1x4,half1x4,*/CG_HALF1x4,//CG_HALF,1,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half2x1,half2x1,*/CG_HALF2x1,//CG_HALF,2,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half2x2,half2x2,*/CG_HALF2x2,//CG_HALF,2,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half2x3,half2x3,*/CG_HALF2x3,//CG_HALF,2,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half2x4,half2x4,*/CG_HALF2x4,//CG_HALF,2,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half3x1,half3x1,*/CG_HALF3x1,//CG_HALF,3,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half3x2,half3x2,*/CG_HALF3x2,//CG_HALF,3,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half3x3,half3x3,*/CG_HALF3x3,//CG_HALF,3,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half3x4,half3x4,*/CG_HALF3x4,//CG_HALF,3,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half4x1,half4x1,*/CG_HALF4x1,//CG_HALF,4,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half4x2,half4x2,*/CG_HALF4x2,//CG_HALF,4,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half4x3,half4x3,*/CG_HALF4x3,//CG_HALF,4,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half4x4,half4x4,*/CG_HALF4x4,//CG_HALF,4,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float,float,*/CG_FLOAT,//CG_FLOAT,0,1,CG_PARAMETERCLASS_SCALAR)
+/*CG_DATATYPE_MACRO(Float2,float2,*/CG_FLOAT2,//CG_FLOAT,0,2,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Float3,float3,*/CG_FLOAT3,//CG_FLOAT,0,3,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Float4,float4,*/CG_FLOAT4,//CG_FLOAT,0,4,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Float1x1,float1x1,*/CG_FLOAT1x1,//CG_FLOAT,1,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float1x2,float1x2,*/CG_FLOAT1x2,//CG_FLOAT,1,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float1x3,float1x3,*/CG_FLOAT1x3,//CG_FLOAT,1,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float1x4,float1x4,*/CG_FLOAT1x4,//CG_FLOAT,1,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float2x1,float2x1,*/CG_FLOAT2x1,//CG_FLOAT,2,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float2x2,float2x2,*/CG_FLOAT2x2,//CG_FLOAT,2,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float2x3,float2x3,*/CG_FLOAT2x3,//CG_FLOAT,2,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float2x4,float2x4,*/CG_FLOAT2x4,//CG_FLOAT,2,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float3x1,float3x1,*/CG_FLOAT3x1,//CG_FLOAT,3,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float3x2,float3x2,*/CG_FLOAT3x2,//CG_FLOAT,3,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float3x3,float3x3,*/CG_FLOAT3x3,//CG_FLOAT,3,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float3x4,float3x4,*/CG_FLOAT3x4,//CG_FLOAT,3,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float4x1,float4x1,*/CG_FLOAT4x1,//CG_FLOAT,4,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float4x2,float4x2,*/CG_FLOAT4x2,//CG_FLOAT,4,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float4x3,float4x3,*/CG_FLOAT4x3,//CG_FLOAT,4,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Float4x4,float4x4,*/CG_FLOAT4x4,//CG_FLOAT,4,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Sampler1D,sampler1D,*/CG_SAMPLER1D,//CG_SAMPLER1D,0,0,CG_PARAMETERCLASS_SAMPLER)
+/*CG_DATATYPE_MACRO(Sampler2D,sampler2D,*/CG_SAMPLER2D,//CG_SAMPLER2D,0,0,CG_PARAMETERCLASS_SAMPLER)
+/*CG_DATATYPE_MACRO(Sampler3D,sampler3D,*/CG_SAMPLER3D,//CG_SAMPLER3D,0,0,CG_PARAMETERCLASS_SAMPLER)
+/*CG_DATATYPE_MACRO(SamplerRECT,samplerRECT,*/CG_SAMPLERRECT,//CG_SAMPLERRECT,0,0,CG_PARAMETERCLASS_SAMPLER)
+/*CG_DATATYPE_MACRO(SamplerCUBE,samplerCUBE,*/CG_SAMPLERCUBE,//CG_SAMPLERCUBE,0,0,CG_PARAMETERCLASS_SAMPLER)
+/*CG_DATATYPE_MACRO(Fixed,fixed,*/CG_FIXED,//CG_FIXED,0,1,CG_PARAMETERCLASS_SCALAR)
+/*CG_DATATYPE_MACRO(Fixed2,fixed2,*/CG_FIXED2,//CG_FIXED,0,2,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Fixed3,fixed3,*/CG_FIXED3,//CG_FIXED,0,3,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Fixed4,fixed4,*/CG_FIXED4,//CG_FIXED,0,4,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Fixed1x1,fixed1x1,*/CG_FIXED1x1,//CG_FIXED,1,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed1x2,fixed1x2,*/CG_FIXED1x2,//CG_FIXED,1,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed1x3,fixed1x3,*/CG_FIXED1x3,//CG_FIXED,1,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed1x4,fixed1x4,*/CG_FIXED1x4,//CG_FIXED,1,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed2x1,fixed2x1,*/CG_FIXED2x1,//CG_FIXED,2,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed2x2,fixed2x2,*/CG_FIXED2x2,//CG_FIXED,2,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed2x3,fixed2x3,*/CG_FIXED2x3,//CG_FIXED,2,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed2x4,fixed2x4,*/CG_FIXED2x4,//CG_FIXED,2,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed3x1,fixed3x1,*/CG_FIXED3x1,//CG_FIXED,3,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed3x2,fixed3x2,*/CG_FIXED3x2,//CG_FIXED,3,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed3x3,fixed3x3,*/CG_FIXED3x3,//CG_FIXED,3,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed3x4,fixed3x4,*/CG_FIXED3x4,//CG_FIXED,3,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed4x1,fixed4x1,*/CG_FIXED4x1,//CG_FIXED,4,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed4x2,fixed4x2,*/CG_FIXED4x2,//CG_FIXED,4,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed4x3,fixed4x3,*/CG_FIXED4x3,//CG_FIXED,4,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Fixed4x4,fixed4x4,*/CG_FIXED4x4,//CG_FIXED,4,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Half1,half1,*/CG_HALF1,//CG_HALF,0,1,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Float1,float1,*/CG_FLOAT1,//CG_FLOAT,0,1,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Fixed1,fixed1,*/CG_FIXED1,//CG_FIXED,0,1,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Int,int,*/CG_INT,//CG_INT,0,1,CG_PARAMETERCLASS_SCALAR)
+/*CG_DATATYPE_MACRO(Int1,int1,*/CG_INT1,//CG_INT,0,1,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Int2,int2,*/CG_INT2,//CG_INT,0,2,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Int3,int3,*/CG_INT3,//CG_INT,0,3,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Int4,int4,*/CG_INT4,//CG_INT,0,4,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Int1x1,int1x1,*/CG_INT1x1,//CG_INT,1,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int1x2,int1x2,*/CG_INT1x2,//CG_INT,1,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int1x3,int1x3,*/CG_INT1x3,//CG_INT,1,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int1x4,int1x4,*/CG_INT1x4,//CG_INT,1,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int2x1,int2x1,*/CG_INT2x1,//CG_INT,2,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int2x2,int2x2,*/CG_INT2x2,//CG_INT,2,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int2x3,int2x3,*/CG_INT2x3,//CG_INT,2,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int2x4,int2x4,*/CG_INT2x4,//CG_INT,2,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int3x1,int3x1,*/CG_INT3x1,//CG_INT,3,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int3x2,int3x2,*/CG_INT3x2,//CG_INT,3,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int3x3,int3x3,*/CG_INT3x3,//CG_INT,3,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int3x4,int3x4,*/CG_INT3x4,//CG_INT,3,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int4x1,int4x1,*/CG_INT4x1,//CG_INT,4,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int4x2,int4x2,*/CG_INT4x2,//CG_INT,4,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int4x3,int4x3,*/CG_INT4x3,//CG_INT,4,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Int4x4,int4x4,*/CG_INT4x4,//CG_INT,4,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool,bool,*/CG_BOOL,//CG_BOOL,0,1,CG_PARAMETERCLASS_SCALAR)
+/*CG_DATATYPE_MACRO(Bool1,bool1,*/CG_BOOL1,//CG_BOOL,0,1,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Bool2,bool2,*/CG_BOOL2,//CG_BOOL,0,2,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Bool3,bool3,*/CG_BOOL3,//CG_BOOL,0,3,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Bool4,bool4,*/CG_BOOL4,//CG_BOOL,0,4,CG_PARAMETERCLASS_VECTOR)
+/*CG_DATATYPE_MACRO(Bool1x1,bool1x1,*/CG_BOOL1x1,//CG_BOOL,1,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool1x2,bool1x2,*/CG_BOOL1x2,//CG_BOOL,1,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool1x3,bool1x3,*/CG_BOOL1x3,//CG_BOOL,1,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool1x4,bool1x4,*/CG_BOOL1x4,//CG_BOOL,1,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool2x1,bool2x1,*/CG_BOOL2x1,//CG_BOOL,2,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool2x2,bool2x2,*/CG_BOOL2x2,//CG_BOOL,2,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool2x3,bool2x3,*/CG_BOOL2x3,//CG_BOOL,2,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool2x4,bool2x4,*/CG_BOOL2x4,//CG_BOOL,2,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool3x1,bool3x1,*/CG_BOOL3x1,//CG_BOOL,3,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool3x2,bool3x2,*/CG_BOOL3x2,//CG_BOOL,3,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool3x3,bool3x3,*/CG_BOOL3x3,//CG_BOOL,3,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool3x4,bool3x4,*/CG_BOOL3x4,//CG_BOOL,3,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool4x1,bool4x1,*/CG_BOOL4x1,//CG_BOOL,4,1,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool4x2,bool4x2,*/CG_BOOL4x2,//CG_BOOL,4,2,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool4x3,bool4x3,*/CG_BOOL4x3,//CG_BOOL,4,3,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(Bool4x4,bool4x4,*/CG_BOOL4x4,//CG_BOOL,4,4,CG_PARAMETERCLASS_MATRIX)
+/*CG_DATATYPE_MACRO(String,string,*/CG_STRING,//CG_STRING,0,1,CG_PARAMETERCLASS_OBJECT)
+/*CG_DATATYPE_MACRO(Program,program,*/CG_PROGRAM_TYPE,//CG_PROGRAM_TYPE,0,0,CG_PARAMETERCLASS_OBJECT)
+/*CG_DATATYPE_MACRO(Texture,texture,*/CG_TEXTURE,//CG_TEXTURE,0,0,CG_PARAMETERCLASS_OBJECT)
+
+//#undef CG_DATATYPE_MACRO
diff --git a/make/stub_includes/cg/CG/cg_enums.h b/make/stub_includes/cg/CG/cg_enums.h
new file mode 100755
index 000000000..cb7262feb
--- /dev/null
+++ b/make/stub_includes/cg/CG/cg_enums.h
@@ -0,0 +1,97 @@
+
+/*
+ *
+ * Copyright (c) 2002, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/*
+ * The following macro invocations define the supported CG basic data types.
+ *
+ * The macros have the form :
+ *
+ * CG_DATATYPE_MACRO(enum_name, enum_val)
+ *
+ * enum_name : The C enumerant name.
+ * enum_val : The enumerant value.
+ *
+ */
+
+
+
+/*CG_ENUM_MACRO(*/CG_UNKNOWN=/*, */4096,//)
+/*CG_ENUM_MACRO(*/CG_IN=/*, */4097,//)
+/*CG_ENUM_MACRO(*/CG_OUT=/*, */4098,//)
+/*CG_ENUM_MACRO(*/CG_INOUT=/*, */4099,//)
+/*CG_ENUM_MACRO(*/CG_MIXED=/*, */4100,//)
+/*CG_ENUM_MACRO(*/CG_VARYING=/*, */4101,//)
+/*CG_ENUM_MACRO(*/CG_UNIFORM=/*, */4102,//)
+/*CG_ENUM_MACRO(*/CG_CONSTANT=/*, */4103,//)
+/*CG_ENUM_MACRO(*/CG_PROGRAM_SOURCE=/*, */4104,//)
+/*CG_ENUM_MACRO(*/CG_PROGRAM_ENTRY=/*, */4105,//)
+/*CG_ENUM_MACRO(*/CG_COMPILED_PROGRAM=/*, */4106,//)
+/*CG_ENUM_MACRO(*/CG_PROGRAM_PROFILE=/*, */4107,//)
+/*CG_ENUM_MACRO(*/CG_GLOBAL=/*, */4108,//)
+/*CG_ENUM_MACRO(*/CG_PROGRAM=/*, */4109,//)
+/*CG_ENUM_MACRO(*/CG_DEFAULT=/*, */4110,//)
+/*CG_ENUM_MACRO(*/CG_ERROR=/*, */4111,//)
+/*CG_ENUM_MACRO(*/CG_SOURCE=/*, */4112,//)
+/*CG_ENUM_MACRO(*/CG_OBJECT=/*, */4113,//)
+/*CG_ENUM_MACRO(*/CG_COMPILE_MANUAL=/*, */4114,//)
+/*CG_ENUM_MACRO(*/CG_COMPILE_IMMEDIATE=/*, */4115,//)
+/*CG_ENUM_MACRO(*/CG_COMPILE_LAZY=/*, */4116,//)
+/*CG_ENUM_MACRO(*/CG_CURRENT=/*, */4117,//)
+/*CG_ENUM_MACRO(*/CG_LITERAL=/*, */4118,//)
+/*CG_ENUM_MACRO(*/CG_VERSION=/*, */4119,//)
+/*CG_ENUM_MACRO(*/CG_ROW_MAJOR=/*, */4120,//)
+/*CG_ENUM_MACRO(*/CG_COLUMN_MAJOR=/*, */4121,//)
+
+// #undef CG_ENUM_MACRO
+
+
diff --git a/make/stub_includes/cg/CG/cg_errors.h b/make/stub_includes/cg/CG/cg_errors.h
new file mode 100644
index 000000000..25c120a5a
--- /dev/null
+++ b/make/stub_includes/cg/CG/cg_errors.h
@@ -0,0 +1,352 @@
+/*
+ * This is a modified version of the original header as provided by
+ * NVidia; original copyright appears below.
+ *
+ * Modified by Christopher Kline, May 2003: Stripped down and hacked to get
+ * around macro interpretation problems.
+ */
+
+/*
+ *
+ * Copyright (c) 2002-2004, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * The following macro invocations define error codes returned by various cg
+ * API functions.
+ *
+ * The macros have the form :
+ *
+ * CG_ERROR_MACRO(code, enum_name, message)
+ *
+ * code : The integer error code associated with the error.
+ * enum_name : The name of enumerant of the error code in the API.
+ * message : A description string associated with the error.
+ *
+ */
+
+CG_NO_ERROR=
+/*CG_ERROR_MACRO(*/0,/*
+ CG_NO_ERROR,
+ "No error has occurred.")*/
+
+CG_COMPILER_ERROR=
+/*CG_ERROR_MACRO(*/1,/*
+ CG_COMPILER_ERROR,
+ "The compile returned an error.")*/
+
+CG_INVALID_PARAMETER_ERROR=
+/*CG_ERROR_MACRO(*/2,/*
+ CG_INVALID_PARAMETER_ERROR,
+ "The parameter used is invalid.")*/
+
+CG_INVALID_PROFILE_ERROR=
+/*CG_ERROR_MACRO(*/3,/*
+ CG_INVALID_PROFILE_ERROR,
+ "The profile is not supported.")*/
+
+CG_PROGRAM_LOAD_ERROR=
+/*CG_ERROR_MACRO(*/4,/*
+ CG_PROGRAM_LOAD_ERROR,
+ "The program could not load.")*/
+
+CG_PROGRAM_BIND_ERROR=
+/*CG_ERROR_MACRO(*/5,/*
+ CG_PROGRAM_BIND_ERROR,
+ "The program could not bind.")*/
+
+CG_PROGRAM_NOT_LOADED_ERROR=
+/*CG_ERROR_MACRO(*/6,/*
+ CG_PROGRAM_NOT_LOADED_ERROR,
+ "The program must be loaded before this operation may be used.")*/
+
+CG_UNSUPPORTED_GL_EXTENSION_ERROR=
+/*CG_ERROR_MACRO(*/7,/*
+ CG_UNSUPPORTED_GL_EXTENSION_ERROR,
+ "An unsupported GL extension was required to perform this operation.")*/
+
+CG_INVALID_VALUE_TYPE_ERROR=
+/*CG_ERROR_MACRO(*/8,/*
+ CG_INVALID_VALUE_TYPE_ERROR,
+ "An unknown value type was assigned to a parameter.")*/
+
+CG_NOT_MATRIX_PARAM_ERROR=
+/*CG_ERROR_MACRO(*/9,/*
+ CG_NOT_MATRIX_PARAM_ERROR,
+ "The parameter is not of matrix type.")*/
+
+CG_INVALID_ENUMERANT_ERROR=
+/*CG_ERROR_MACRO(*/10,/*
+ CG_INVALID_ENUMERANT_ERROR,
+ "The enumerant parameter has an invalid value.")*/
+
+CG_NOT_4x4_MATRIX_ERROR=
+/*CG_ERROR_MACRO(*/11,/*
+ CG_NOT_4x4_MATRIX_ERROR,
+ "The parameter must be a 4x4 matrix type.")*/
+
+CG_FILE_READ_ERROR=
+/*CG_ERROR_MACRO(*/12,/*
+ CG_FILE_READ_ERROR,
+ "The file could not be read.")*/
+
+CG_FILE_WRITE_ERROR=
+/*CG_ERROR_MACRO(*/13,/*
+ CG_FILE_WRITE_ERROR,
+ "The file could not be written.")*/
+
+CG_NVPARSE_ERROR=
+/*CG_ERROR_MACRO(*/14,/*
+ CG_NVPARSE_ERROR,
+ "nvparse could not successfully parse the output from the Cg "
+ "compiler backend.")*/
+
+CG_MEMORY_ALLOC_ERROR=
+/*CG_ERROR_MACRO(*/15,/*
+ CG_MEMORY_ALLOC_ERROR,
+ "Memory allocation failed.")*/
+
+CG_INVALID_CONTEXT_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/16,/*
+ CG_INVALID_CONTEXT_HANDLE_ERROR,
+ "Invalid context handle.")*/
+
+CG_INVALID_PROGRAM_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/17,/*
+ CG_INVALID_PROGRAM_HANDLE_ERROR,
+ "Invalid program handle.")*/
+
+CG_INVALID_PARAM_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/18,/*
+ CG_INVALID_PARAM_HANDLE_ERROR,
+ "Invalid parameter handle.")*/
+
+CG_UNKNOWN_PROFILE_ERROR=
+/*CG_ERROR_MACRO(*/19,/*
+ CG_UNKNOWN_PROFILE_ERROR,
+ "The specified profile is unknown.")*/
+
+CG_VAR_ARG_ERROR=
+/*CG_ERROR_MACRO(*/20,/*
+ CG_VAR_ARG_ERROR,
+ "The variable arguments were specified incorrectly.")*/
+
+CG_INVALID_DIMENSION_ERROR=
+/*CG_ERROR_MACRO(*/21,/*
+ CG_INVALID_DIMENSION_ERROR,
+ "The dimension value is invalid.")*/
+
+CG_ARRAY_PARAM_ERROR=
+/*CG_ERROR_MACRO(*/22,/*
+ CG_ARRAY_PARAM_ERROR,
+ "The parameter must be an array.")*/
+
+CG_OUT_OF_ARRAY_BOUNDS_ERROR=
+/*CG_ERROR_MACRO(*/23,/*
+ CG_OUT_OF_ARRAY_BOUNDS_ERROR,
+ "Index into the array is out of bounds.")*/
+
+CG_CONFLICTING_TYPES_ERROR=
+/*CG_ERROR_MACRO(*/24,/*
+ CG_CONFLICTING_TYPES_ERROR,
+ "A type being added to the context conflicts with an "
+ "existing type.")*/
+
+CG_CONFLICTING_PARAMETER_TYPES_ERROR=
+/*CG_ERROR_MACRO(*/25,/*
+ CG_CONFLICTING_PARAMETER_TYPES_ERROR,
+ "The parameters being bound have conflicting types.")*/
+
+CG_PARAMETER_IS_NOT_SHARED_ERROR=
+/*CG_ERROR_MACRO(*/26,/*
+ CG_PARAMETER_IS_NOT_SHARED_ERROR,
+ "The parameter must be global.")*/
+
+CG_INVALID_PARAMETER_VARIABILITY_ERROR=
+/*CG_ERROR_MACRO(*/27,/*
+ CG_INVALID_PARAMETER_VARIABILITY_ERROR,
+ "The parameter could not be changed to the given variability.")*/
+
+CG_CANNOT_DESTROY_PARAMETER_ERROR=
+/*CG_ERROR_MACRO(*/28,/*
+ CG_CANNOT_DESTROY_PARAMETER_ERROR,
+ "Cannot destroy the parameter. It is bound to other parameters "
+ "or is not a root parameter.")*/
+
+
+CG_NOT_ROOT_PARAMETER_ERROR=
+/*CG_ERROR_MACRO(*/29,/*
+ CG_NOT_ROOT_PARAMETER_ERROR,
+ "The parameter is not a root parameter.")*/
+
+CG_PARAMETERS_DO_NOT_MATCH_ERROR=
+/*CG_ERROR_MACRO(*/30,/*
+ CG_PARAMETERS_DO_NOT_MATCH_ERROR,
+ "The two parameters being bound do not match.")*/
+
+CG_IS_NOT_PROGRAM_PARAMETER_ERROR=
+/*CG_ERROR_MACRO(*/31,/*
+ CG_IS_NOT_PROGRAM_PARAMETER_ERROR,
+ "The parameter is not a program parameter.")*/
+
+CG_INVALID_PARAMETER_TYPE_ERROR=
+/*CG_ERROR_MACRO(*/32,/*
+ CG_INVALID_PARAMETER_TYPE_ERROR,
+ "The type of the parameter is invalid.")*/
+
+CG_PARAMETER_IS_NOT_RESIZABLE_ARRAY_ERROR=
+/*CG_ERROR_MACRO(*/33,/*
+ CG_PARAMETER_IS_NOT_RESIZABLE_ARRAY_ERROR,
+ "The parameter must be a resizable array.")*/
+
+CG_INVALID_SIZE_ERROR=
+/*CG_ERROR_MACRO(*/34,/*
+ CG_INVALID_SIZE_ERROR,
+ "The size value is invalid.")*/
+
+CG_BIND_CREATES_CYCLE_ERROR=
+/*CG_ERROR_MACRO(*/35,/*
+ CG_BIND_CREATES_CYCLE_ERROR,
+ "Cannot bind the given parameters. Binding will form a cycle.")*/
+
+CG_ARRAY_TYPES_DO_NOT_MATCH_ERROR=
+/*CG_ERROR_MACRO(*/36,/*
+ CG_ARRAY_TYPES_DO_NOT_MATCH_ERROR,
+ "Cannot bind the given parameters. Array types do not match.")*/
+
+CG_ARRAY_DIMENSIONS_DO_NOT_MATCH_ERROR=
+/*CG_ERROR_MACRO(*/37,/*
+ CG_ARRAY_DIMENSIONS_DO_NOT_MATCH_ERROR,
+ "Cannot bind the given parameters. "
+ "Array dimensions do not match.")*/
+
+CG_ARRAY_HAS_WRONG_DIMENSION_ERROR=
+/*CG_ERROR_MACRO(*/38,/*
+ CG_ARRAY_HAS_WRONG_DIMENSION_ERROR,
+ "The array is has the wrong dimension.")*/
+
+CG_TYPE_IS_NOT_DEFINED_IN_PROGRAM_ERROR=
+/*CG_ERROR_MACRO(*/39,/*
+ CG_TYPE_IS_NOT_DEFINED_IN_PROGRAM_ERROR,
+ "Connecting the parameters failed because The type of the "
+ "source parameter is not defined within the given program "
+ "or does not match the type with the same name in the program.")*/
+
+CG_INVALID_EFFECT_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/40,/*
+ CG_INVALID_EFFECT_HANDLE_ERROR,
+ "Invalid effect handle.")*/
+
+CG_INVALID_STATE_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/41,/*
+ CG_INVALID_STATE_HANDLE_ERROR,
+ "Invalid state handle.")*/
+
+CG_INVALID_STATE_ASSIGNMENT_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/42,/*
+ CG_INVALID_STATE_ASSIGNMENT_HANDLE_ERROR,
+ "Invalid stateassignment handle.")*/
+
+CG_INVALID_PASS_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/43,/*
+ CG_INVALID_PASS_HANDLE_ERROR,
+ "Invalid pass handle.")*/
+
+CG_INVALID_ANNOTATION_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/44,/*
+ CG_INVALID_ANNOTATION_HANDLE_ERROR,
+ "Invalid annotation handle.")*/
+
+CG_INVALID_TECHNIQUE_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/45,/*
+ CG_INVALID_TECHNIQUE_HANDLE_ERROR,
+ "Invalid technique handle.")*/
+
+CG_INVALID_PARAMETER_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/46,/*
+ CG_INVALID_PARAMETER_HANDLE_ERROR,
+ "Invalid parameter handle.")*/
+
+CG_STATE_ASSIGNMENT_TYPE_MISMATCH_ERROR=
+/*CG_ERROR_MACRO(*/47,/*
+ CG_STATE_ASSIGNMENT_TYPE_MISMATCH_ERROR,
+ "Invalid parameter handle.")*/
+
+CG_INVALID_FUNCTION_HANDLE_ERROR=
+/*CG_ERROR_MACRO(*/48,/*
+ CG_INVALID_FUNCTION_HANDLE_ERROR,
+ "Invalid function handle.")*/
+
+CG_INVALID_TECHNIQUE_ERROR=
+/*CG_ERROR_MACRO(*/49,/*
+ CG_INVALID_TECHNIQUE_ERROR,
+ "Technique did not pass validation.")*/
+
+CG_INVALID_POINTER_ERROR=
+/*CG_ERROR_MACRO(*/50,/*
+ CG_INVALID_POINTER_ERROR,
+ "The supplied pointer is NULL.")*/
+
+CG_NOT_ENOUGH_DATA_ERROR=
+/*CG_ERROR_MACRO(*/51,/*
+ CG_NOT_ENOUGH_DATA_ERROR,
+ "Not enough data was provided.")*/
+
+CG_NON_NUMERIC_PARAMETER_ERROR=
+/*CG_ERROR_MACRO(*/52,/*
+ CG_NON_NUMERIC_PARAMETER_ERROR,
+ "The parameter is not of a numeric type.")*/
+
+CG_ARRAY_SIZE_MISMATCH_ERROR=
+/*CG_ERROR_MACRO(*/53,/*
+ CG_ARRAY_SIZE_MISMATCH_ERROR,
+ "The specified array sizes are not compatible with the given array.")*/
+
+//#undef CG_ERROR_MACRO
+
diff --git a/make/stub_includes/cg/CG/cg_profiles.h b/make/stub_includes/cg/CG/cg_profiles.h
new file mode 100644
index 000000000..8217a569a
--- /dev/null
+++ b/make/stub_includes/cg/CG/cg_profiles.h
@@ -0,0 +1,97 @@
+/*
+ * This is a modified version of the original header as provided by
+ * NVidia; original copyright appears below.
+ *
+ * Modified by Christopher Kline, May 2003: Stripped down and hacked to get
+ * around macro interpretation problems.
+ */
+
+/*
+ *
+ * Copyright (c) 2002, NVIDIA Corporation.
+ *
+ *
+ *
+ * NVIDIA Corporation("NVIDIA") supplies this software to you in consideration
+ * of your agreement to the following terms, and your use, installation,
+ * modification or redistribution of this NVIDIA software constitutes
+ * acceptance of these terms. If you do not agree with these terms, please do
+ * not use, install, modify or redistribute this NVIDIA software.
+ *
+ *
+ *
+ * In consideration of your agreement to abide by the following terms, and
+ * subject to these terms, NVIDIA grants you a personal, non-exclusive license,
+ * under NVIDIA�s copyrights in this original NVIDIA software (the "NVIDIA
+ * Software"), to use, reproduce, modify and redistribute the NVIDIA
+ * Software, with or without modifications, in source and/or binary forms;
+ * provided that if you redistribute the NVIDIA Software, you must retain the
+ * copyright notice of NVIDIA, this notice and the following text and
+ * disclaimers in all such redistributions of the NVIDIA Software. Neither the
+ * name, trademarks, service marks nor logos of NVIDIA Corporation may be used
+ * to endorse or promote products derived from the NVIDIA Software without
+ * specific prior written permission from NVIDIA. Except as expressly stated
+ * in this notice, no other rights or licenses express or implied, are granted
+ * by NVIDIA herein, including but not limited to any patent rights that may be
+ * infringed by your derivative works or by other works in which the NVIDIA
+ * Software may be incorporated. No hardware is licensed hereunder.
+ *
+ *
+ *
+ * THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR ITS USE AND OPERATION
+ * EITHER ALONE OR IN COMBINATION WITH OTHER PRODUCTS.
+ *
+ *
+ *
+ * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+ * EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOST
+ * PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY OUT OF THE USE,
+ * REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE NVIDIA SOFTWARE,
+ * HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
+ * NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF NVIDIA HAS BEEN ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*
+ * The following macro invocations define the supported CG profiles.
+ *
+ * The macros have the form :
+ *
+ * CG_PROFILE_MACRO(name, compiler_id, compiler_opt)
+ *
+ * name : The name of the profile. Used consistently with the API.
+ * compiler_id : The identifier string for the profile used by the compiler.
+ * compiler_id_caps : compiler_id in caps.
+ * compiler_opt : The command-line switch used to force compilation into
+ * the profile.
+ * int_id : Integer enumerant associated with this bind location.
+ * vertex_profile : Non-zero if this is a vertex profile, otherwise it
+ * is considered to be a fragment profile.
+ *
+ *
+ */
+
+#define CG_IN_PROFILES_INCLUDE
+
+#include <CG/cgGL_profiles.h>
+
+
+/*CG_PROFILE_MACRO(DX9Vertex11,vs_1_1,*/CG_PROFILE_VS_1_1=/*,"vs_1_1",*/6153,//1)
+/*CG_PROFILE_MACRO(DX9Vertex20,vs_2_0,*/CG_PROFILE_VS_2_0=/*,"vs_2_0",*/6154,//1)
+/*CG_PROFILE_MACRO(DX9Vertex2x,vs_2_x,*/CG_PROFILE_VS_2_X=/*,"vs_2_x",*/6155,//1)
+
+/*CG_PROFILE_MACRO(DX9Pixel11,ps_1_1,*/CG_PROFILE_PS_1_1=/*,"ps_1_1",*/6159,//0)
+/*CG_PROFILE_MACRO(DX9Pixel12,ps_1_2,*/CG_PROFILE_PS_1_2=/*,"ps_1_2",*/6160,//0)
+/*CG_PROFILE_MACRO(DX9Pixel13,ps_1_3,*/CG_PROFILE_PS_1_3=/*,"ps_1_3",*/6161,//0)
+/*CG_PROFILE_MACRO(DX9Pixel20,ps_2_0,*/CG_PROFILE_PS_2_0=/*,"ps_2_0",*/6162,//0)
+/*CG_PROFILE_MACRO(DX9Pixel2x,ps_2_x,*/CG_PROFILE_PS_2_X=/*,"ps_2_x",*/6163,//0)
+
+/*CG_PROFILE_MACRO(Generic, generic,*/ GENERIC=/*, "generic",*/ 7002,//0)
+
+//#undef CG_PROFILE_MACRO
+#undef CG_IN_PROFILES_INCLUDE
diff --git a/make/stub_includes/common/stddef.h b/make/stub_includes/common/stddef.h
new file mode 100644
index 000000000..8aa70051e
--- /dev/null
+++ b/make/stub_includes/common/stddef.h
@@ -0,0 +1,7 @@
+#if defined(_WIN64)
+ typedef __int64 ptrdiff_t;
+#elif defined(__ia64__) || defined(__x86_64__)
+ typedef long int ptrdiff_t;
+#else
+ typedef int ptrdiff_t;
+#endif
diff --git a/make/stub_includes/common/stdint.h b/make/stub_includes/common/stdint.h
new file mode 100644
index 000000000..65e7fc22c
--- /dev/null
+++ b/make/stub_includes/common/stdint.h
@@ -0,0 +1,17 @@
+#if defined(_WIN32)
+ #error windows does not support stdint.h
+ // typedef signed __int32 int32_t;
+ // typedef unsigned __int32 uint32_t;
+ // typedef signed __int64 int64_t;
+ // typedef unsigned __int64 uint64_t;
+#else
+ typedef signed int int32_t;
+ typedef unsigned int uint32_t;
+ #if defined(__ia64__) || defined(__x86_64__)
+ typedef signed long int int64_t;
+ typedef unsigned long int uint64_t;
+ #else
+ typedef signed long long int int64_t;
+ typedef unsigned long long int uint64_t;
+ #endif
+#endif
diff --git a/make/stub_includes/egl/EGL/egl.h b/make/stub_includes/egl/EGL/egl.h
new file mode 100755
index 000000000..86ca4818f
--- /dev/null
+++ b/make/stub_includes/egl/EGL/egl.h
@@ -0,0 +1,307 @@
+/* -*- mode: c; tab-width: 8; -*- */
+/* vi: set sw=4 ts=8: */
+/* Reference version of egl.h for EGL 1.4.
+ * Last modified 2008/05/02
+ */
+
+#ifndef __egl_h_
+#define __egl_h_
+
+/* All platform-dependent types and macro boilerplate (such as EGLAPI
+ * and EGLAPIENTRY) should go in eglplatform.h.
+ */
+#include <EGL/eglplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* EGL Types */
+typedef int32_t EGLint;
+typedef unsigned int EGLBoolean;
+typedef unsigned int EGLenum;
+#ifdef USE_GLUEGEN
+ /* GlueGen currently needs this form of typedef to produce distinct
+ types for each of these pointer types */
+ typedef struct {} _EGLConfig, *EGLConfig;
+#else
+ typedef void *EGLConfig;
+#endif
+typedef void *EGLContext;
+typedef void *EGLDisplay;
+typedef void *EGLSurface;
+typedef void *EGLClientBuffer;
+
+/* EGL Versioning */
+#define EGL_VERSION_1_0 1
+#define EGL_VERSION_1_1 1
+#define EGL_VERSION_1_2 1
+#define EGL_VERSION_1_3 1
+#define EGL_VERSION_1_4 1
+
+/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
+ * enums are assigned unique values starting at 0x3000.
+ */
+
+/* EGL aliases */
+#define EGL_FALSE 0
+#define EGL_TRUE 1
+
+/* Out-of-band handle values */
+#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
+#define EGL_NO_CONTEXT ((EGLContext)0)
+#define EGL_NO_DISPLAY ((EGLDisplay)0)
+#define EGL_NO_SURFACE ((EGLSurface)0)
+
+/* Out-of-band attribute value */
+#define EGL_DONT_CARE ((EGLint)-1)
+
+/* Errors / GetError return values */
+#define EGL_SUCCESS 0x3000
+#define EGL_NOT_INITIALIZED 0x3001
+#define EGL_BAD_ACCESS 0x3002
+#define EGL_BAD_ALLOC 0x3003
+#define EGL_BAD_ATTRIBUTE 0x3004
+#define EGL_BAD_CONFIG 0x3005
+#define EGL_BAD_CONTEXT 0x3006
+#define EGL_BAD_CURRENT_SURFACE 0x3007
+#define EGL_BAD_DISPLAY 0x3008
+#define EGL_BAD_MATCH 0x3009
+#define EGL_BAD_NATIVE_PIXMAP 0x300A
+#define EGL_BAD_NATIVE_WINDOW 0x300B
+#define EGL_BAD_PARAMETER 0x300C
+#define EGL_BAD_SURFACE 0x300D
+#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
+
+/* Reserved 0x300F-0x301F for additional errors */
+
+/* Config attributes */
+#define EGL_BUFFER_SIZE 0x3020
+#define EGL_ALPHA_SIZE 0x3021
+#define EGL_BLUE_SIZE 0x3022
+#define EGL_GREEN_SIZE 0x3023
+#define EGL_RED_SIZE 0x3024
+#define EGL_DEPTH_SIZE 0x3025
+#define EGL_STENCIL_SIZE 0x3026
+#define EGL_CONFIG_CAVEAT 0x3027
+#define EGL_CONFIG_ID 0x3028
+#define EGL_LEVEL 0x3029
+#define EGL_MAX_PBUFFER_HEIGHT 0x302A
+#define EGL_MAX_PBUFFER_PIXELS 0x302B
+#define EGL_MAX_PBUFFER_WIDTH 0x302C
+#define EGL_NATIVE_RENDERABLE 0x302D
+#define EGL_NATIVE_VISUAL_ID 0x302E
+#define EGL_NATIVE_VISUAL_TYPE 0x302F
+#define EGL_PRESERVED_RESOURCES 0x3030
+#define EGL_SAMPLES 0x3031
+#define EGL_SAMPLE_BUFFERS 0x3032
+#define EGL_SURFACE_TYPE 0x3033
+#define EGL_TRANSPARENT_TYPE 0x3034
+#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
+#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
+#define EGL_TRANSPARENT_RED_VALUE 0x3037
+#define EGL_NONE 0x3038 /* Attrib list terminator */
+#define EGL_BIND_TO_TEXTURE_RGB 0x3039
+#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
+#define EGL_MIN_SWAP_INTERVAL 0x303B
+#define EGL_MAX_SWAP_INTERVAL 0x303C
+#define EGL_LUMINANCE_SIZE 0x303D
+#define EGL_ALPHA_MASK_SIZE 0x303E
+#define EGL_COLOR_BUFFER_TYPE 0x303F
+#define EGL_RENDERABLE_TYPE 0x3040
+#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
+#define EGL_CONFORMANT 0x3042
+
+/* Reserved 0x3041-0x304F for additional config attributes */
+
+/* Config attribute values */
+#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
+#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
+#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
+#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
+#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
+
+/* More config attribute values, for EGL_TEXTURE_FORMAT */
+#define EGL_NO_TEXTURE 0x305C
+#define EGL_TEXTURE_RGB 0x305D
+#define EGL_TEXTURE_RGBA 0x305E
+#define EGL_TEXTURE_2D 0x305F
+
+/* Config attribute mask bits */
+#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
+#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
+
+#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
+
+/* QueryString targets */
+#define EGL_VENDOR 0x3053
+#define EGL_VERSION 0x3054
+#define EGL_EXTENSIONS 0x3055
+#define EGL_CLIENT_APIS 0x308D
+
+/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
+#define EGL_HEIGHT 0x3056
+#define EGL_WIDTH 0x3057
+#define EGL_LARGEST_PBUFFER 0x3058
+#define EGL_TEXTURE_FORMAT 0x3080
+#define EGL_TEXTURE_TARGET 0x3081
+#define EGL_MIPMAP_TEXTURE 0x3082
+#define EGL_MIPMAP_LEVEL 0x3083
+#define EGL_RENDER_BUFFER 0x3086
+#define EGL_VG_COLORSPACE 0x3087
+#define EGL_VG_ALPHA_FORMAT 0x3088
+#define EGL_HORIZONTAL_RESOLUTION 0x3090
+#define EGL_VERTICAL_RESOLUTION 0x3091
+#define EGL_PIXEL_ASPECT_RATIO 0x3092
+#define EGL_SWAP_BEHAVIOR 0x3093
+#define EGL_MULTISAMPLE_RESOLVE 0x3099
+
+/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
+#define EGL_BACK_BUFFER 0x3084
+#define EGL_SINGLE_BUFFER 0x3085
+
+/* OpenVG color spaces */
+#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
+#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
+
+/* OpenVG alpha formats */
+#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
+#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
+
+/* Constant scale factor by which fractional display resolutions &
+ * aspect ratio are scaled when queried as integer values.
+ */
+#define EGL_DISPLAY_SCALING 10000
+
+/* Unknown display resolution/aspect ratio */
+#define EGL_UNKNOWN ((EGLint)-1)
+
+/* Back buffer swap behaviors */
+#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
+#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
+
+/* CreatePbufferFromClientBuffer buffer types */
+#define EGL_OPENVG_IMAGE 0x3096
+
+/* QueryContext targets */
+#define EGL_CONTEXT_CLIENT_TYPE 0x3097
+
+/* CreateContext attributes */
+#define EGL_CONTEXT_CLIENT_VERSION 0x3098
+
+/* Multisample resolution behaviors */
+#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
+#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
+
+/* BindAPI/QueryAPI targets */
+#define EGL_OPENGL_ES_API 0x30A0
+#define EGL_OPENVG_API 0x30A1
+#define EGL_OPENGL_API 0x30A2
+
+/* GetCurrentSurface targets */
+#define EGL_DRAW 0x3059
+#define EGL_READ 0x305A
+
+/* WaitNative engines */
+#define EGL_CORE_NATIVE_ENGINE 0x305B
+
+/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
+#define EGL_COLORSPACE EGL_VG_COLORSPACE
+#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
+#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
+#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
+#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
+#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
+
+/* EGL extensions must request enum blocks from the Khronos
+ * API Registrar, who maintains the enumerant registry. Submit
+ * a bug in Khronos Bugzilla against task "Registry".
+ */
+
+
+
+/* EGL Functions */
+
+EGLAPI EGLint EGLAPIENTRY eglGetError(void);
+
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+
+EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
+ EGLint config_size, EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
+ EGLConfig *configs, EGLint config_size,
+ EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
+ EGLint attribute, EGLint *value);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
+ EGLNativeWindowType win,
+ const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
+ const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
+ EGLNativePixmapType pixmap,
+ const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
+ EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
+ EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
+ EGLConfig config, const EGLint *attrib_list);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
+ EGLint attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
+
+
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
+ EGLContext share_context,
+ const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
+ EGLSurface read, EGLContext ctx);
+
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
+ EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
+ EGLNativePixmapType target);
+
+typedef void (* EGLAPIENTRY __EGLFuncPtr)(void);
+EGLAPI __EGLFuncPtr eglGetProcAddress(const char *procname);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __egl_h_ */
diff --git a/make/stub_includes/egl/EGL/eglext.h b/make/stub_includes/egl/EGL/eglext.h
new file mode 100755
index 000000000..5b41bfae6
--- /dev/null
+++ b/make/stub_includes/egl/EGL/eglext.h
@@ -0,0 +1,338 @@
+#ifndef __eglext_h_
+#define __eglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/*
+ * Copyright (c) 2008 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#include <EGL/egl.h>
+#include <EGL/eglplatform.h>
+
+/*************************************************************/
+
+/* Header file version number */
+/* eglext.h last updated 2007/11/20 */
+/* Current version at http://www.khronos.org/registry/egl/ */
+#define EGL_EGLEXT_VERSION 1
+
+#ifndef EGL_KHR_config_attribs
+#define EGL_KHR_config_attribs 1
+#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
+#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
+#endif
+
+#ifndef EGL_KHR_lock_surface
+#define EGL_KHR_lock_surface 1
+#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
+#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
+#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
+#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
+#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
+#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
+#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
+#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
+#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
+#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
+#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
+#endif
+
+#ifndef EGL_KHR_image
+#define EGL_KHR_image 1
+#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
+typedef void *EGLImageKHR;
+#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, EGLint *attr_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, EGLint *attr_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
+#endif
+
+#ifndef EGL_KHR_vg_parent_image
+#define EGL_KHR_vg_parent_image 1
+#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_gl_texture_2D_image
+#define EGL_KHR_gl_texture_2D_image 1
+#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_gl_texture_cubemap_image
+#define EGL_KHR_gl_texture_cubemap_image 1
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_gl_texture_3D_image
+#define EGL_KHR_gl_texture_3D_image 1
+#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_gl_renderbuffer_image
+#define EGL_KHR_gl_renderbuffer_image 1
+#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
+#endif
+
+// Supported NV Extensions
+
+// NOTE: EGL_KHR_bind_client_buffer == EGL_create_pbuffer_from_client_buffer
+/* EGL_KHR_bind_client_buffer */
+#ifndef EGL_KHR_bind_client_buffer
+#define EGL_create_pbuffer_from_client_buffer 1
+#define EGL_KHR_bind_client_buffer 1
+#define EGL_OPENVG_IMAGE_KHR EGL_OPENVG_IMAGE
+#endif
+
+/* eglCreateImageKHR targets */
+/* eglCreateImageKHR target and eglCreatePbufferFromClientBuffer buftype */
+
+/* EGL_NV_perfmon */
+#if 0
+#ifndef EGL_NV_perfmon
+#define EGL_NV_perfmon 1
+#define EGL_PERFMONITOR_HARDWARE_COUNTERS_BIT_NV 0x00000001
+#define EGL_PERFMONITOR_OPENGL_ES_API_BIT_NV 0x00000010
+#define EGL_PERFMONITOR_OPENVG_API_BIT_NV 0x00000020
+#define EGL_PERFMONITOR_OPENGL_ES2_API_BIT_NV 0x00000040
+#define EGL_COUNTER_NAME_NV 0x1234
+#define EGL_COUNTER_DESCRIPTION_NV 0x1235
+#define EGL_IS_HARDWARE_COUNTER_NV 0x1236
+#define EGL_COUNTER_MAX_NV 0x1237
+#define EGL_COUNTER_VALUE_TYPE_NV 0x1238
+#define EGL_RAW_VALUE_NV 0x1239
+#define EGL_PERCENTAGE_VALUE_NV 0x1240
+#define EGL_BAD_CURRENT_PERFMONITOR_NV 0x1241
+#define EGL_NO_PERFMONITOR_NV ((EGLPerfMonitorNV)0)
+#define EGL_DEFAULT_PERFMARKER_NV ((EGLPerfMarkerNV)0)
+typedef void *EGLPerfMonitorNV;
+typedef void *EGLPerfMarkerNV;
+#ifdef USE_GLUEGEN
+ /* GlueGen currently needs this form of typedef to produce distinct
+ types for each of these pointer types */
+ typedef struct {} _EGLPerfCounterNV, *EGLPerfCounterNV;
+#else
+ typedef void *EGLPerfCounterNV;
+#endif
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLPerfMonitorNV EGLAPIENTRY eglCreatePerfMonitorNV(EGLDisplay dpy, EGLint mask);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyPerfMonitorNV(EGLDisplay dpy, EGLPerfMonitorNV monitor);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrentPerfMonitorNV(EGLPerfMonitorNV monitor);
+EGLAPI EGLPerfMonitorNV EGLAPIENTRY eglGetCurrentPerfMonitorNV(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetPerfCountersNV(EGLPerfMonitorNV monitor, EGLPerfCounterNV *counters, EGLint counter_size, EGLint *num_counter);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetPerfCounterAttribNV(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname, EGLint *value);
+EGLAPI const char * EGLAPIENTRY eglQueryPerfCounterStringNV(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorAddCountersNV(EGLint n, const EGLPerfCounterNV *counters);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorRemoveCountersNV(EGLint n, const EGLPerfCounterNV *counters);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorRemoveAllCountersNV(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorBeginExperimentNV(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorEndExperimentNV(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorBeginPassNV(EGLint n);
+EGLAPI EGLBoolean EGLAPIENTRY eglPerfMonitorEndPassNV(void);
+EGLAPI EGLPerfMarkerNV EGLAPIENTRY eglCreatePerfMarkerNV(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyPerfMarkerNV(EGLPerfMarkerNV marker);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrentPerfMarkerNV(EGLPerfMarkerNV marker);
+EGLAPI EGLPerfMarkerNV EGLAPIENTRY eglGetCurrentPerfMarkerNV(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetPerfMarkerCounterNV(EGLPerfMarkerNV marker, EGLPerfCounterNV counter, EGLuint64NV *value, EGLuint64NV *cycles);
+EGLAPI EGLBoolean EGLAPIENTRY eglValidatePerfMonitorNV(EGLint *num_passes);
+#endif
+typedef EGLPerfMonitorNV (EGLAPIENTRYP PFNEGLCREATEPERFMONITORNVPROC)(EGLDisplay dpy, EGLint mask);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYPERFMONITORNVPROC)(EGLDisplay dpy, EGLPerfMonitorNV monitor);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPERFMONITORNVPROC)(EGLPerfMonitorNV monitor);
+typedef EGLPerfMonitorNV (EGLAPIENTRYP PFNEGLGETCURRENTPERFMONITORNVPROC)(void);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETPERFCOUNTERSNVPROC)(EGLPerfMonitorNV monitor, EGLPerfCounterNV *counters, EGLint counter_size, EGLint *num_counter);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETPERFCOUNTERATTRIBNVPROC)(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname, EGLint *value);
+typedef const char * (EGLAPIENTRYP PFNEGLQUERYPERFCOUNTERSTRINGNVPROC)(EGLPerfMonitorNV monitor, EGLPerfCounterNV counter, EGLint pname);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORADDCOUNTERSNVPROC)(EGLint n, const EGLPerfCounterNV *counters);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORREMOVECOUNTERSNVPROC)(EGLint n, const EGLPerfCounterNV *counters);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORREMOVEALLCOUNTERSNVPROC)(void);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORBEGINEXPERIMENTNVPROC)(void);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORENDEXPERIMENTNVPROC)(void);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORBEGINPASSNVPROC)(EGLint n);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPERFMONITORENDPASSNVPROC)(void);
+typedef EGLPerfMarkerNV (EGLAPIENTRYP PFNEGLCREATEPERFMARKERNVPROC)(void);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYPERFMARKERNVPROC)(EGLPerfMarkerNV marker);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPERFMARKERNVPROC)(EGLPerfMarkerNV marker);
+typedef EGLPerfMarkerNV (EGLAPIENTRYP PFNEGLGETCURRENTPERFMARKERNVPROC)(void);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETPERFMARKERCOUNTERNVPROC)(EGLPerfMarkerNV marker, EGLPerfCounterNV counter, EGLuint64NV *value, EGLuint64NV *cycles);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLVALIDATEPERFMONITORNVPROC)(EGLint *num_passes);
+#endif
+#endif // exclude EGL_NV_perfmon
+
+/* EGL_NV_texture_rectangle (reuse analagous WGL enum) */
+#ifndef EGL_NV_texture_rectangle
+#define EGL_NV_texture_rectangle 1
+#define EGL_GL_TEXTURE_RECTANGLE_NV_KHR 0x30BB
+#define EGL_TEXTURE_RECTANGLE_NV 0x20A2
+#endif
+
+#ifndef EGL_NV_system_time
+#define EGL_NV_system_time 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
+#endif
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void);
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void);
+#endif
+
+/* EGL_NV_coverage_sample (reuse GLX_VIDEO_OUT_DEPTH_NV and
+ * GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV)
+ */
+#ifndef EGL_NV_coverage_sample
+#define EGL_NV_coverage_sample 1
+#define EGL_COVERAGE_BUFFERS_NV 0x30E0
+#define EGL_COVERAGE_SAMPLES_NV 0x30E1
+#endif
+
+/* EGL_NV_depth_nonlinear
+ */
+#ifndef EGL_NV_depth_nonlinear
+#define EGL_NV_depth_nonlinear 1
+#define EGL_DEPTH_ENCODING_NV 0x30E2
+#define EGL_DEPTH_ENCODING_NONE_NV 0
+#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
+#endif
+
+#ifndef EGL_NV_nvva_image
+#define EGL_NV_nvva_image 1
+#define EGL_NVVA_OUTPUT_SURFACE_NV 0x30BE
+EGLAPI EGLBoolean EGLAPIENTRY eglVideoImageLockNV(EGLDisplay dpy, EGLImageKHR image, EGLenum api);
+EGLAPI EGLBoolean EGLAPIENTRY eglVideoImageUnlockNV(EGLDisplay dpy, EGLImageKHR image);
+#endif
+
+#ifndef EGL_NV_nvma_image
+#define EGL_NV_nvma_image 1
+#define EGL_NVMA_OUTPUT_SURFACE_NV 0x30BE /* eglCreateImageKHR target and eglCreatePbufferFromClientBuffer buftype */
+#endif
+
+#ifndef EGL_NV_client_api_nvma
+#define EGL_NV_client_api_nvma 1
+EGLAPI EGLBoolean EGLAPIENTRY eglNvmaOutputSurfacePbufferLock(EGLDisplay display,
+ EGLSurface pbuffer);
+EGLAPI EGLBoolean EGLAPIENTRY eglNvmaOutputSurfacePbufferUnlock(EGLDisplay display,
+ EGLSurface pbuffer);
+#endif
+
+
+/* EGL_KHR_sync
+ */
+#ifndef EGL_KHR_sync
+#define EGL_KHR_sync 1
+typedef void* EGLSyncKHR;
+typedef void* NativeSyncKHR;
+typedef unsigned long long EGLTimeKHR;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLSyncKHR eglCreateFenceSyncKHR( EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list );
+NativeSyncKHR eglCreateNativeSyncKHR( EGLSyncKHR sync );
+EGLBoolean eglDestroySyncKHR( EGLSyncKHR sync );
+EGLBoolean eglFenceKHR( EGLSyncKHR sync );
+EGLint eglClientWaitSyncKHR( EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout );
+EGLBoolean eglSignalSyncKHR( EGLSyncKHR sync, EGLenum mode );
+EGLBoolean eglGetSyncAttribKHR( EGLSyncKHR sync, EGLint attribute, EGLint *value );
+#else
+typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATEFENCESYNCKHRPROC)( EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list );
+typedef NativeSyncKHR (EGLAPIENTRYP PFNEGLCREATENATIVESYNCKHRPROC)( EGLSyncKHR sync );
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC)( EGLSyncKHR sync );
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCEKHRPROC)( EGLSyncKHR sync );
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC)( EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout );
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC)( EGLSyncKHR sync, EGLenum mode );
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC)( EGLSyncKHR sync, EGLint attribute, EGLint *value );
+#endif
+
+/* !!!!! TODO: Get correct values for these defines !!!!
+ Do not rely on these values...THEY WILL CHANGE!
+ And it WILL BREAK binary compatibility when they do! */
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x3100
+#define EGL_SYNC_NATIVE_SYNC_KHR 0x3101
+#define EGL_SYNC_STATUS_KHR 0x3102
+#define EGL_SIGNALED_KHR 0x3103
+#define EGL_UNSIGNALED_KHR 0x3104
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001
+#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
+#define EGL_ALREADY_SIGNALED_KHR 0x3105
+#define EGL_TIMEOUT_EXPIRED_KHR 0x3106
+#define EGL_CONDITION_SATISFIED_KHR 0x3107
+#define EGL_SYNC_TYPE_KHR 0x3108
+#define EGL_SYNC_CONDITION_KHR 0x3109
+#define EGL_SYNC_FENCE_KHR 0x310A
+#define EGL_NO_SYNC_KHR 0x0000
+#endif
+
+
+
+/* EGL_NV_omx_il_sink
+ */
+#ifndef EGL_NV_omx_il_sink
+#define EGL_NV_omx_il_sink
+#define EGL_OPENMAX_IL_BIT_NV 0x0010 /* EGL_RENDERABLE_TYPE bit */
+#define EGL_SURFACE_OMX_IL_EVENT_CALLBACK_NV 0x309A /* eglCreate*Surface attribute */
+#define EGL_SURFACE_OMX_IL_EMPTY_BUFFER_DONE_CALLBACK_NV 0x309B /* eglCreate*Surface attribute */
+#define EGL_SURFACE_OMX_IL_CALLBACK_DATA_NV 0x309C /* eglCreate*Surface attribute */
+#define EGL_SURFACE_COMPONENT_HANDLE_NV 0x309D /* eglQuerySurface attribute */
+#endif
+
+#define EGL_RMSURFACE_NV 0x30EF /* eglCreateImageKHR target */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/make/stub_includes/egl/EGL/eglplatform.h b/make/stub_includes/egl/EGL/eglplatform.h
new file mode 100755
index 000000000..f763d98e3
--- /dev/null
+++ b/make/stub_includes/egl/EGL/eglplatform.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef EGLPLATFORM_H
+#define EGLPLATFORM_H
+
+/*
+** eglplatform.h is platform dependent. It defines:
+**
+** - Native types
+** - EGL and native handle values
+**
+** EGLNativeDisplayType, EGLNativeWindowType and EGLNativePixmapType are to be
+** replaced with corresponding types of the native window system in egl.h.
+**
+** EGL and native handle values must match their types.
+*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(__GNUC__)
+ typedef signed __int32 int32_t;
+ typedef unsigned __int32 uint32_t;
+ typedef signed __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
+#else
+ #include <stdint.h>
+#endif
+
+// Define storage class specifiers
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+
+#ifndef EGLAPIENTRY
+#define EGLAPIENTRY
+#endif
+#ifndef EGLAPIENTRYP
+#define EGLAPIENTRYP EGLAPIENTRY *
+#endif
+
+#define EGLAPI
+
+// Define native window system types
+typedef int EGLNativeDisplayType;
+typedef void* EGLNativePointerType;
+typedef void* EGLNativeWindowType;
+typedef void* EGLNativePixmapType;
+
+// Define 64-bit integer extensions
+typedef int64_t EGLint64NV;
+typedef uint64_t EGLuint64NV;
+
+// Define the pre-EGL 1.3 Native handle types for backwards compatibility
+typedef EGLNativeDisplayType NativeDisplayType;
+typedef EGLNativePixmapType NativePixmapType;
+typedef EGLNativeWindowType NativeWindowType;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EGLPLATFORM_H */
diff --git a/make/stub_includes/egl/KD/NV_extwindowprops.h b/make/stub_includes/egl/KD/NV_extwindowprops.h
new file mode 100755
index 000000000..e7a16c727
--- /dev/null
+++ b/make/stub_includes/egl/KD/NV_extwindowprops.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+
+#ifndef __kd_NV_extwindowprops_h_
+#define __kd_NV_extwindowprops_h_
+#include <KD/kd.h>
+#include <EGL/eglext.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+/* KD_WINDOWPROPERTY_FULLSCREEN: Control over resizing a window to fill the complete screen */
+
+#define KD_WINDOWPROPERTY_FULLSCREEN_NV 9999
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __kd_NV_extwindowprops_h_ */
diff --git a/make/stub_includes/egl/KD/NV_multitouch.h b/make/stub_includes/egl/KD/NV_multitouch.h
new file mode 100755
index 000000000..5a9b9243b
--- /dev/null
+++ b/make/stub_includes/egl/KD/NV_multitouch.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+
+#ifndef __kd_NV_multitouch_h_
+#define __kd_NV_multitouch_h_
+#include <KD/kd.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+/* KD_IOGROUP_MULTITOUCH: I/O group for Multitouch input devices. */
+#define KD_IOGROUP_MULTITOUCH_NV 0x40004000
+#define KD_STATE_MULTITOUCH_AVAILABILITY_NV (KD_IOGROUP_MULTITOUCH_NV + 0)
+#define KD_INPUT_MULTITOUCH_FINGERS_NV (KD_IOGROUP_MULTITOUCH_NV + 1)
+#define KD_INPUT_MULTITOUCH_WIDTH_NV (KD_IOGROUP_MULTITOUCH_NV + 2)
+#define KD_INPUT_MULTITOUCH_X_NV (KD_IOGROUP_MULTITOUCH_NV + 3)
+#define KD_INPUT_MULTITOUCH_Y_NV (KD_IOGROUP_MULTITOUCH_NV + 4)
+#define KD_INPUT_MULTITOUCH_X2_NV (KD_IOGROUP_MULTITOUCH_NV + 5)
+#define KD_INPUT_MULTITOUCH_Y2_NV (KD_IOGROUP_MULTITOUCH_NV + 6)
+#define KD_INPUT_MULTITOUCH_PRESSURE_NV (KD_IOGROUP_MULTITOUCH_NV + 7)
+#define KD_INPUT_MULTITOUCH_GESTURES_NV (KD_IOGROUP_MULTITOUCH_NV + 8)
+#define KD_INPUT_MULTITOUCH_RELX_NV (KD_IOGROUP_MULTITOUCH_NV + 9)
+#define KD_INPUT_MULTITOUCH_RELY_NV (KD_IOGROUP_MULTITOUCH_NV + 10)
+
+
+
+/* KD_EVENT_INPUT_MULTITOUCH_NV: Multitouch event. */
+#define KD_EVENT_INPUT_MULTITOUCH_NV 1001
+typedef struct KDEventInputMultitouchDataNV {
+ KDint32 index;
+ KDint8 fingers;
+ KDint8 width;
+ KDint16 x;
+ KDint16 y;
+ KDint16 x2;
+ KDint16 y2;
+ KDint16 pressure;
+} KDEventInputMultitouchDataNV;
+
+
+/* KD_EVENT_INPUT_MULTITOUCH_GESTURE_NV: Multitouch gesture event. */
+#define KD_EVENT_INPUT_MULTITOUCH_GESTURE_NV 1002
+
+
+/* kdGetEventInputMultitouchDataNV: Get auxiliary event data for multitouch input. */
+KD_API KDint KD_APIENTRY kdGetEventInputMultitouchDataNV(const KDEvent * event, KDEventInputMultitouchDataNV * data);
+
+/* kdSetEventInputMultitouchActiveNV: Activate Multitouch input events */
+KD_API KDint KD_APIENTRY kdSetEventInputMultitouchActiveNV(KDboolean activate);
+
+/* kdEnableEventInputMultitouchMergeNV: Activate merging of Multitouch input events */
+KD_API void KD_APIENTRY kdEnableEventInputMultitouchMergeNV(KDboolean enable);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __kd_NV_multitouch_h_ */
+
diff --git a/make/stub_includes/egl/KD/kd.h b/make/stub_includes/egl/KD/kd.h
new file mode 100755
index 000000000..c82385b86
--- /dev/null
+++ b/make/stub_includes/egl/KD/kd.h
@@ -0,0 +1,1014 @@
+/*
+* Copyright (c) 2007 The Khronos Group Inc.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* "Software"), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sublicense, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+* The above copyright notice and this permission notice shall be included
+* in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*/
+
+#ifndef __kd_h_
+#define __kd_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "kdplatform.h"
+
+
+
+/*******************************************************
+ * Introduction
+ *******************************************************/
+
+/*******************************************************
+ * OpenKODE conformance
+ *******************************************************/
+
+/*******************************************************
+ * Overview
+ *******************************************************/
+
+/*******************************************************
+ * Programming environment
+ *******************************************************/
+#define KD_VERSION_1_0 1
+typedef char KDchar;
+typedef signed char KDint8;
+typedef unsigned char KDuint8;
+typedef int KDint;
+typedef unsigned int KDuint;
+typedef float KDfloat32;
+typedef KDint KDboolean;
+typedef KDint64 KDtime;
+typedef KDint64 KDust;
+typedef KDint64 KDoff;
+typedef KDuint32 KDmode;
+#define KDINT32_MIN (-0x7fffffff-1)
+#define KDINT32_MAX 0x7fffffff
+#define KDUINT32_MAX 0xffffffffU
+#define KD_TRUE 1
+#define KD_FALSE 0
+#ifdef __cplusplus
+ const int KD_NULL = 0; /* Yes, int. See Stroustrup 3rd edition. */
+#else
+ #define KD_NULL ((void *)0)
+#endif
+
+/*******************************************************
+ * Errors
+ *******************************************************/
+#define KD_EACCES 1
+#define KD_EADDRINUSE 2
+#define KD_EADDRNOTAVAIL 3
+#define KD_EAFNOSUPPORT 4
+#define KD_EAGAIN (5)
+#define KD_EALREADY 6
+#define KD_EBADF 7
+#define KD_EBUSY 8
+#define KD_ECONNREFUSED 9
+#define KD_ECONNRESET 10
+#define KD_EDEADLK 11
+#define KD_EDESTADDRREQ 12
+#define KD_EEXIST 13
+#define KD_EFBIG 14
+#define KD_EHOSTUNREACH 15
+#define KD_EHOST_NOT_FOUND 16
+#define KD_EINVAL 17
+#define KD_EIO 18
+#define KD_EILSEQ 19
+#define KD_EISCONN 20
+#define KD_EISDIR 21
+#define KD_EMFILE 22
+#define KD_ENAMETOOLONG 23
+#define KD_ENOENT 24
+#define KD_ENOMEM 25
+#define KD_ENOSPC 26
+#define KD_ENOSYS 27
+#define KD_ENOTCONN 28
+#define KD_ENO_DATA 29
+#define KD_ENO_RECOVERY 30
+#define KD_EOPNOTSUPP 31
+#define KD_EOVERFLOW 32
+#define KD_EPERM 33
+#define KD_EPIPE 34
+#define KD_ERANGE 35
+#define KD_ETIMEDOUT (36)
+#define KD_ETRY_AGAIN 37
+
+/* kdGetError: Get last error indication. */
+KD_API KDint KD_APIENTRY kdGetError(void);
+
+/* kdSetError: Set last error indication. */
+KD_API void KD_APIENTRY kdSetError(KDint error);
+
+/*******************************************************
+ * Versioning and attribute queries
+ *******************************************************/
+
+/* kdQueryAttribi: Obtain the value of a numeric OpenKODE Core attribute. */
+KD_API KDint KD_APIENTRY kdQueryAttribi(KDint attribute, KDint *value);
+
+/* kdQueryAttribcv: Obtain the value of a string OpenKODE Core attribute. */
+KD_API const KDchar *KD_APIENTRY kdQueryAttribcv(KDint attribute);
+#define KD_ATTRIB_VENDOR 39
+#define KD_ATTRIB_VERSION 40
+#define KD_ATTRIB_PLATFORM 41
+
+/* kdQueryIndexedAttribcv: Obtain the value of an indexed string OpenKODE Core attribute. */
+KD_API const KDchar *KD_APIENTRY kdQueryIndexedAttribcv(KDint attribute, KDint index);
+
+/*******************************************************
+ * Threads and synchronization
+ *******************************************************/
+
+/* kdThreadAttrCreate: Create a thread attribute object. */
+typedef struct KDThreadAttr KDThreadAttr;
+KD_API KDThreadAttr *KD_APIENTRY kdThreadAttrCreate(void);
+
+/* kdThreadAttrFree: Free a thread attribute object. */
+KD_API KDint KD_APIENTRY kdThreadAttrFree(KDThreadAttr *attr);
+
+/* kdThreadAttrSetDetachState: Set detachstate attribute. */
+#define KD_THREAD_CREATE_JOINABLE 0
+#define KD_THREAD_CREATE_DETACHED 1
+KD_API KDint KD_APIENTRY kdThreadAttrSetDetachState(KDThreadAttr *attr, KDint detachstate);
+
+/* kdThreadAttrSetStackSize: Set stacksize attribute. */
+KD_API KDint KD_APIENTRY kdThreadAttrSetStackSize(KDThreadAttr *attr, KDsize stacksize);
+
+/* kdThreadCreate: Create a new thread. */
+typedef struct KDThread KDThread;
+KD_API KDThread *KD_APIENTRY kdThreadCreate(const KDThreadAttr *attr, void *(*start_routine)(void *), void *arg);
+
+/* kdThreadExit: Terminate this thread. */
+KD_API KD_NORETURN void KD_APIENTRY kdThreadExit(void *retval);
+
+/* kdThreadJoin: Wait for termination of another thread. */
+KD_API KDint KD_APIENTRY kdThreadJoin(KDThread *thread, void **retval);
+
+/* kdThreadDetach: Allow resources to be freed as soon as a thread terminates. */
+KD_API KDint KD_APIENTRY kdThreadDetach(KDThread *thread);
+
+/* kdThreadSelf: Return calling thread&#8217;s ID. */
+KD_API KDThread *KD_APIENTRY kdThreadSelf(void);
+
+/* kdThreadOnce: Wrap initialization code so it is executed only once. */
+#ifndef KD_NO_STATIC_DATA
+typedef struct KDThreadOnce {
+ void *impl;
+} KDThreadOnce;
+#define KD_THREAD_ONCE_INIT { 0 }
+KD_API KDint KD_APIENTRY kdThreadOnce(KDThreadOnce *once_control, void (*init_routine)(void));
+#endif /* ndef KD_NO_STATIC_DATA */
+
+/* kdThreadMutexCreate: Create a mutex. */
+typedef struct KDThreadMutex KDThreadMutex;
+KD_API KDThreadMutex *KD_APIENTRY kdThreadMutexCreate(const void *mutexattr);
+
+/* kdThreadMutexFree: Free a mutex. */
+KD_API KDint KD_APIENTRY kdThreadMutexFree(KDThreadMutex *mutex);
+
+/* kdThreadMutexLock: Lock a mutex. */
+KD_API KDint KD_APIENTRY kdThreadMutexLock(KDThreadMutex *mutex);
+
+/* kdThreadMutexUnlock: Unlock a mutex. */
+KD_API KDint KD_APIENTRY kdThreadMutexUnlock(KDThreadMutex *mutex);
+
+/* kdThreadCondCreate: Create a condition variable. */
+typedef struct KDThreadCond KDThreadCond;
+KD_API KDThreadCond *KD_APIENTRY kdThreadCondCreate(const void *attr);
+
+/* kdThreadCondFree: Free a condition variable. */
+KD_API KDint KD_APIENTRY kdThreadCondFree(KDThreadCond *cond);
+
+/* kdThreadCondSignal, kdThreadCondBroadcast: Signal a condition variable. */
+KD_API KDint KD_APIENTRY kdThreadCondSignal(KDThreadCond *cond);
+KD_API KDint KD_APIENTRY kdThreadCondBroadcast(KDThreadCond *cond);
+
+/* kdThreadCondWait: Wait for a condition variable to be signalled. */
+KD_API KDint KD_APIENTRY kdThreadCondWait(KDThreadCond *cond, KDThreadMutex *mutex);
+
+/* kdThreadSemCreate: Create a semaphore. */
+typedef struct KDThreadSem KDThreadSem;
+KD_API KDThreadSem *KD_APIENTRY kdThreadSemCreate(KDuint value);
+
+/* kdThreadSemFree: Free a semaphore. */
+KD_API KDint KD_APIENTRY kdThreadSemFree(KDThreadSem *sem);
+
+/* kdThreadSemWait: Lock a semaphore. */
+KD_API KDint KD_APIENTRY kdThreadSemWait(KDThreadSem *sem);
+
+/* kdThreadSemPost: Unlock a semaphore. */
+KD_API KDint KD_APIENTRY kdThreadSemPost(KDThreadSem *sem);
+
+/*******************************************************
+ * Events
+ *******************************************************/
+
+/* KDEvent: Struct type containing an event. */
+typedef struct KDEvent KDEvent;
+#define KD_EVENT_USER 0x40000000
+
+/* kdWaitEvent: Get next event from thread&#8217;s event queue. */
+KD_API const KDEvent *KD_APIENTRY kdWaitEvent(KDust timeout);
+
+/* kdSetEventUserptr: Set the userptr for global events. */
+KD_API void KD_APIENTRY kdSetEventUserptr(void *userptr);
+
+/* kdDefaultEvent: Perform default processing on an unrecognized event. */
+KD_API void KD_APIENTRY kdDefaultEvent(const KDEvent *event);
+
+/* kdPumpEvents: Pump the thread&#8217;s event queue, performing callbacks. */
+KD_API KDint KD_APIENTRY kdPumpEvents(void);
+
+/* kdInstallCallback: Install or remove a callback function for event processing. */
+typedef void (KD_APIENTRY KDCallbackFunc)(const KDEvent *event);
+KD_API KDint KD_APIENTRY kdInstallCallback(KDCallbackFunc *func, KDint eventtype, void *eventuserptr);
+
+/* kdCreateEvent: Create an event for posting. */
+KD_API KDEvent *KD_APIENTRY kdCreateEvent(void);
+
+/* kdPostEvent, kdPostThreadEvent: Post an event into a queue. */
+KD_API KDint KD_APIENTRY kdPostEvent(KDEvent *event);
+KD_API KDint KD_APIENTRY kdPostThreadEvent(KDEvent *event, KDThread *thread);
+typedef struct KDEventUser {
+ union {
+ KDint64 i64;
+ void *p;
+ struct {
+ KDint32 a;
+ KDint32 b;
+ } i32pair;
+ } value1;
+ union {
+ KDint64 i64;
+ struct {
+ union {
+ KDint32 i32;
+ void *p;
+ } value2;
+ union {
+ KDint32 i32;
+ void *p;
+ } value3;
+ } i32orp;
+ } value23;
+} KDEventUser;
+
+/* kdFreeEvent: Abandon an event instead of posting it. */
+KD_API void KD_APIENTRY kdFreeEvent(KDEvent *event);
+
+/*******************************************************
+ * System events
+ *******************************************************/
+
+/* KD_EVENT_QUIT: Event to request to quit application. */
+#define KD_EVENT_QUIT 43
+
+/* KD_EVENT_PAUSE: Application pause event. */
+#define KD_EVENT_PAUSE 45
+
+/* KD_EVENT_RESUME: Application resume event. */
+#define KD_EVENT_RESUME 46
+
+/* KD_EVENT_ORIENTATION: Orientation change event. */
+#define KD_EVENT_ORIENTATION 48
+
+/* KD_IOGROUP_EVENT: I/O group for OpenKODE Core system events implemented as state values. */
+#define KD_IOGROUP_EVENT 0x100
+#define KD_STATE_EVENT_USING_BATTERY (KD_IOGROUP_EVENT + 0)
+#define KD_STATE_EVENT_LOW_BATTERY (KD_IOGROUP_EVENT + 1)
+
+
+/* KD_IOGROUP_ORIENTATION: I/O group for OpenKODE Core orientation state. */
+#define KD_IOGROUP_ORIENTATION 0x200
+#define KD_STATE_ORIENTATION_OVERALL (KD_IOGROUP_ORIENTATION + 0)
+#define KD_STATE_ORIENTATION_SCREEN (KD_IOGROUP_ORIENTATION + 1)
+#define KD_STATE_ORIENTATION_RENDERING (KD_IOGROUP_ORIENTATION + 2)
+#define KD_STATE_ORIENTATION_LOCKSURFACE (KD_IOGROUP_ORIENTATION + 3)
+
+
+/*******************************************************
+ * Application startup and exit.
+ *******************************************************/
+
+/* kdMain: The application-defined main function. */
+KD_API KDint KD_APIENTRY kdMain(KDint argc, const KDchar *const *argv);
+
+/* kdExit: Exit the application. */
+KD_API KD_NORETURN void KD_APIENTRY kdExit(KDint status);
+
+/*******************************************************
+ * Utility library functions
+ *******************************************************/
+
+/* kdAbs: Compute the absolute value of an integer. */
+KD_API KDint KD_APIENTRY kdAbs(KDint i);
+
+/* kdStrtof: Convert a string to a floating point number. */
+KD_API KDfloat32 KD_APIENTRY kdStrtof(const KDchar *s, KDchar **endptr);
+
+/* kdStrtol, kdStrtoul: Convert a string to an integer. */
+KD_API KDint KD_APIENTRY kdStrtol(const KDchar *s, KDchar **endptr, KDint base);
+KD_API KDuint KD_APIENTRY kdStrtoul(const KDchar *s, KDchar **endptr, KDint base);
+
+/* kdLtostr, kdUltostr: Convert an integer to a string. */
+#define KD_LTOSTR_MAXLEN ((sizeof(KDint)*8*3+6)/10+2)
+#define KD_ULTOSTR_MAXLEN ((sizeof(KDint)*8+2)/3+1)
+KD_API KDssize KD_APIENTRY kdLtostr(KDchar *buffer, KDsize buflen, KDint number);
+KD_API KDssize KD_APIENTRY kdUltostr(KDchar *buffer, KDsize buflen, KDuint number, KDint base);
+
+/* kdFtostr: Convert a float to a string. */
+#define KD_FTOSTR_MAXLEN 16
+KD_API KDssize KD_APIENTRY kdFtostr(KDchar *buffer, KDsize buflen, KDfloat32 number);
+
+/* kdCryptoRandom: Return random data. */
+KD_API KDint KD_APIENTRY kdCryptoRandom(KDuint8 *buf, KDsize buflen);
+
+/*******************************************************
+ * Locale specific functions
+ *******************************************************/
+
+/* kdGetLocale: Determine the current language and locale. */
+KD_API const KDchar *KD_APIENTRY kdGetLocale(void);
+
+/*******************************************************
+ * Memory allocation
+ *******************************************************/
+
+/* kdMalloc: Allocate memory. */
+KD_API void *KD_APIENTRY kdMalloc(KDsize size);
+
+/* kdFree: Free allocated memory block. */
+KD_API void KD_APIENTRY kdFree(void *ptr);
+
+/* kdRealloc: Resize memory block. */
+KD_API void *KD_APIENTRY kdRealloc(void *ptr, KDsize size);
+
+/*******************************************************
+ * Thread-local storage.
+ *******************************************************/
+
+/* kdGetTLS: Get the thread-local storage pointer. */
+KD_API void *KD_APIENTRY kdGetTLS(void);
+
+/* kdSetTLS: Set the thread-local storage pointer. */
+KD_API void KD_APIENTRY kdSetTLS(void *ptr);
+
+/*******************************************************
+ * Mathematical functions
+ *******************************************************/
+#define KD_E_F 2.71828175F
+#define KD_PI_F 3.14159274F
+#define KD_PI_2_F 1.57079637F
+#define KD_2PI_F 6.28318548F
+#define KD_LOG2E_F 1.44269502F
+#define KD_LOG10E_F 0.434294492F
+#define KD_LN2_F 0.693147182F
+#define KD_LN10_F 2.30258512F
+#define KD_PI_4_F 0.785398185F
+#define KD_1_PI_F 0.318309873F
+#define KD_2_PI_F 0.636619747F
+#define KD_2_SQRTPI_F 1.12837923F
+#define KD_SQRT2_F 1.41421354F
+#define KD_SQRT1_2_F 0.707106769F
+#define KD_FLT_EPSILON 1.19209290E-07F
+#define KD_FLT_MAX 3.40282346638528860e+38F
+#define KD_FLT_MIN 1.17549435e-38F
+/* KD_INFINITY is defined in kdplatform.h since no portable definition
+ * is possible. */
+#define kdIsNan(x) (((x) != (x)) ? 1 : 0)
+#define KD_HUGE_VALF KD_INFINITY
+#define KD_DEG_TO_RAD_F 0.0174532924F
+#define KD_RAD_TO_DEG_F 57.2957802F
+
+/* kdAcosf: Arc cosine function. */
+KD_API KDfloat32 KD_APIENTRY kdAcosf(KDfloat32 x);
+
+/* kdAsinf: Arc sine function. */
+KD_API KDfloat32 KD_APIENTRY kdAsinf(KDfloat32 x);
+
+/* kdAtanf: Arc tangent function. */
+KD_API KDfloat32 KD_APIENTRY kdAtanf(KDfloat32 x);
+
+/* kdAtan2f: Arc tangent function. */
+KD_API KDfloat32 KD_APIENTRY kdAtan2f(KDfloat32 y, KDfloat32 x);
+
+/* kdCosf: Cosine function. */
+KD_API KDfloat32 KD_APIENTRY kdCosf(KDfloat32 x);
+
+/* kdSinf: Sine function. */
+KD_API KDfloat32 KD_APIENTRY kdSinf(KDfloat32 x);
+
+/* kdTanf: Tangent function. */
+KD_API KDfloat32 KD_APIENTRY kdTanf(KDfloat32 x);
+
+/* kdExpf: Exponential function. */
+KD_API KDfloat32 KD_APIENTRY kdExpf(KDfloat32 x);
+
+/* kdLogf: Natural logarithm function. */
+KD_API KDfloat32 KD_APIENTRY kdLogf(KDfloat32 x);
+
+/* kdFabsf: Absolute value. */
+KD_API KDfloat32 KD_APIENTRY kdFabsf(KDfloat32 x);
+
+/* kdPowf: Power function. */
+KD_API KDfloat32 KD_APIENTRY kdPowf(KDfloat32 x, KDfloat32 y);
+
+/* kdSqrtf: Square root function. */
+KD_API KDfloat32 KD_APIENTRY kdSqrtf(KDfloat32 x);
+
+/* kdCeilf: Return ceiling value. */
+KD_API KDfloat32 KD_APIENTRY kdCeilf(KDfloat32 x);
+
+/* kdFloorf: Return floor value. */
+KD_API KDfloat32 KD_APIENTRY kdFloorf(KDfloat32 x);
+
+/* kdRoundf: Round value to nearest integer. */
+KD_API KDfloat32 KD_APIENTRY kdRoundf(KDfloat32 x);
+
+/* kdInvsqrtf: Inverse square root function. */
+KD_API KDfloat32 KD_APIENTRY kdInvsqrtf(KDfloat32 x);
+
+/* kdFmodf: Calculate floating point remainder. */
+KD_API KDfloat32 KD_APIENTRY kdFmodf(KDfloat32 x, KDfloat32 y);
+
+/*******************************************************
+ * String and memory functions
+ *******************************************************/
+
+/* kdMemchr: Scan memory for a byte value. */
+KD_API void *KD_APIENTRY kdMemchr(const void *src, KDint byte, KDsize len);
+
+/* kdMemcmp: Compare two memory regions. */
+KD_API KDint KD_APIENTRY kdMemcmp(const void *src1, const void *src2, KDsize len);
+
+/* kdMemcpy: Copy a memory region, no overlapping. */
+KD_API void *KD_APIENTRY kdMemcpy(void *buf, const void *src, KDsize len);
+
+/* kdMemmove: Copy a memory region, overlapping allowed. */
+KD_API void *KD_APIENTRY kdMemmove(void *buf, const void *src, KDsize len);
+
+/* kdMemset: Set bytes in memory to a value. */
+KD_API void *KD_APIENTRY kdMemset(void *buf, KDint byte, KDsize len);
+
+/* kdStrchr: Scan string for a byte value. */
+KD_API KDchar *KD_APIENTRY kdStrchr(const KDchar *str, KDint ch);
+
+/* kdStrcmp: Compares two strings. */
+KD_API KDint KD_APIENTRY kdStrcmp(const KDchar *str1, const KDchar *str2);
+
+/* kdStrlen: Determine the length of a string. */
+KD_API KDsize KD_APIENTRY kdStrlen(const KDchar *str);
+
+/* kdStrnlen: Determine the length of a string. */
+KD_API KDsize KD_APIENTRY kdStrnlen(const KDchar *str, KDsize maxlen);
+
+/* kdStrncat_s: Concatenate two strings. */
+KD_API KDint KD_APIENTRY kdStrncat_s(KDchar *buf, KDsize buflen, const KDchar *src, KDsize srcmaxlen);
+
+/* kdStrncmp: Compares two strings with length limit. */
+KD_API KDint KD_APIENTRY kdStrncmp(const KDchar *str1, const KDchar *str2, KDsize maxlen);
+
+/* kdStrcpy_s: Copy a string with an overrun check. */
+KD_API KDint KD_APIENTRY kdStrcpy_s(KDchar *buf, KDsize buflen, const KDchar *src);
+
+/* kdStrncpy_s: Copy a string with an overrun check. */
+KD_API KDint KD_APIENTRY kdStrncpy_s(KDchar *buf, KDsize buflen, const KDchar *src, KDsize srclen);
+
+/*******************************************************
+ * Time functions
+ *******************************************************/
+
+/* kdGetTimeUST: Get the current unadjusted system time. */
+KD_API KDust KD_APIENTRY kdGetTimeUST(void);
+
+/* kdTime: Get the current wall clock time. */
+KD_API KDtime KD_APIENTRY kdTime(KDtime *timep);
+
+/* kdGmtime_r, kdLocaltime_r: Convert a seconds-since-epoch time into broken-down time. */
+typedef struct KDTm {
+ KDint32 tm_sec;
+ KDint32 tm_min;
+ KDint32 tm_hour;
+ KDint32 tm_mday;
+ KDint32 tm_mon;
+ KDint32 tm_year;
+ KDint32 tm_wday;
+ KDint32 tm_yday;
+} KDTm;
+KD_API KDTm *KD_APIENTRY kdGmtime_r(const KDtime *timep, KDTm *result);
+KD_API KDTm *KD_APIENTRY kdLocaltime_r(const KDtime *timep, KDTm *result);
+
+/* kdUSTAtEpoch: Get the UST corresponding to KDtime 0. */
+KD_API KDust KD_APIENTRY kdUSTAtEpoch(void);
+
+/*******************************************************
+ * Timer functions
+ *******************************************************/
+
+/* kdSetTimer: Set timer. */
+#define KD_TIMER_ONESHOT 61
+#define KD_TIMER_PERIODIC_AVERAGE 62
+#define KD_TIMER_PERIODIC_MINIMUM 63
+typedef struct KDTimer KDTimer;
+KD_API KDTimer *KD_APIENTRY kdSetTimer(KDint64 interval, KDint periodic, void *eventuserptr);
+
+/* kdCancelTimer: Cancel and free a timer. */
+KD_API KDint KD_APIENTRY kdCancelTimer(KDTimer *timer);
+
+/* KD_EVENT_TIMER: Timer fire event. */
+#define KD_EVENT_TIMER 42
+
+/*******************************************************
+ * File system
+ *******************************************************/
+#define KD_EOF (-1)
+
+/* kdFopen: Open a file from the file system. */
+typedef struct KDFile KDFile;
+KD_API KDFile *KD_APIENTRY kdFopen(const KDchar *pathname, const KDchar *mode);
+
+/* kdFclose: Close an open file. */
+KD_API KDint KD_APIENTRY kdFclose(KDFile *file);
+
+/* kdFflush: Flush an open file. */
+KD_API KDint KD_APIENTRY kdFflush(KDFile *file);
+
+/* kdFread: Read from a file. */
+KD_API KDsize KD_APIENTRY kdFread(void *buffer, KDsize size, KDsize count, KDFile *file);
+
+/* kdFwrite: Write to a file. */
+KD_API KDsize KD_APIENTRY kdFwrite(const void *buffer, KDsize size, KDsize count, KDFile *file);
+
+/* kdGetc: Read next byte from an open file. */
+KD_API KDint KD_APIENTRY kdGetc(KDFile *file);
+
+/* kdPutc: Write a byte to an open file. */
+KD_API KDint KD_APIENTRY kdPutc(KDint c, KDFile *file);
+
+/* kdFgets: Read a line of text from an open file. */
+KD_API KDchar *KD_APIENTRY kdFgets(KDchar *buffer, KDsize buflen, KDFile *file);
+
+/* kdFEOF: Check for end of file. */
+KD_API KDint KD_APIENTRY kdFEOF(KDFile *file);
+
+/* kdFerror: Check for an error condition on an open file. */
+KD_API KDint KD_APIENTRY kdFerror(KDFile *file);
+
+/* kdClearerr: Clear a file&#8217;s error and end-of-file indicators. */
+KD_API void KD_APIENTRY kdClearerr(KDFile *file);
+
+/* kdFseek: Reposition the file position indicator in a file. */
+typedef enum {
+ KD_SEEK_SET = 0,
+ KD_SEEK_CUR = 1,
+ KD_SEEK_END = 2
+} KDfileSeekOrigin;
+KD_API KDint KD_APIENTRY kdFseek(KDFile *file, KDoff offset, KDfileSeekOrigin origin);
+
+/* kdFtell: Get the file position of an open file. */
+KD_API KDoff KD_APIENTRY kdFtell(KDFile *file);
+
+/* kdMkdir: Create new directory. */
+KD_API KDint KD_APIENTRY kdMkdir(const KDchar *pathname);
+
+/* kdRmdir: Delete a directory. */
+KD_API KDint KD_APIENTRY kdRmdir(const KDchar *pathname);
+
+/* kdRename: Rename a file. */
+KD_API KDint KD_APIENTRY kdRename(const KDchar *src, const KDchar *dest);
+
+/* kdRemove: Delete a file. */
+KD_API KDint KD_APIENTRY kdRemove(const KDchar *pathname);
+
+/* kdTruncate: Truncate or extend a file. */
+KD_API KDint KD_APIENTRY kdTruncate(const KDchar *pathname, KDoff length);
+
+/* kdStat, kdFstat: Return information about a file. */
+typedef struct KDStat {
+ KDmode st_mode;
+ KDoff st_size;
+ KDtime st_mtime;
+} KDStat;
+KD_API KDint KD_APIENTRY kdStat(const KDchar *pathname, struct KDStat *buf);
+KD_API KDint KD_APIENTRY kdFstat(KDFile *file, struct KDStat *buf);
+#define KD_ISREG(m) ((m) & 0x8000)
+#define KD_ISDIR(m) ((m) & 0x4000)
+
+/* kdAccess: Determine whether the application can access a file or directory. */
+KD_API KDint KD_APIENTRY kdAccess(const KDchar *pathname, KDint amode);
+#define KD_R_OK 4
+#define KD_W_OK 2
+#define KD_X_OK 1
+
+/* kdOpenDir: Open a directory ready for listing. */
+typedef struct KDDir KDDir;
+KD_API KDDir *KD_APIENTRY kdOpenDir(const KDchar *pathname);
+
+/* kdReadDir: Return the next file in a directory. */
+typedef struct KDDirent {
+ const KDchar *d_name;
+} KDDirent;
+KD_API KDDirent *KD_APIENTRY kdReadDir(KDDir *dir);
+
+/* kdCloseDir: Close a directory. */
+KD_API KDint KD_APIENTRY kdCloseDir(KDDir *dir);
+
+/* kdGetFree: Get free space on a drive. */
+KD_API KDoff KD_APIENTRY kdGetFree(const KDchar *pathname);
+
+/*******************************************************
+ * Network sockets
+ *******************************************************/
+
+/* KDSockaddr: Struct type for socket address. */
+typedef struct KDSockaddr {
+ KDuint16 family;
+ union {
+#define KD_AF_INET 70
+ struct {
+ KDuint16 port;
+ KDuint32 address;
+ } sin;
+ } data;
+} KDSockaddr;
+
+/* kdNameLookup: Look up a hostname. */
+KD_API KDint KD_APIENTRY kdNameLookup(KDint af, const KDchar *hostname, void *eventuserptr);
+
+/* kdNameLookupCancel: Selectively cancels ongoing kdNameLookup operations. */
+KD_API void KD_APIENTRY kdNameLookupCancel(void *eventuserptr);
+
+/* kdSocketCreate: Creates a socket. */
+typedef struct KDSocket KDSocket;
+KD_API KDSocket *KD_APIENTRY kdSocketCreate(KDint type, void *eventuserptr);
+#define KD_SOCK_TCP 64
+#define KD_SOCK_UDP 65
+
+/* kdSocketClose: Closes a socket. */
+KD_API KDint KD_APIENTRY kdSocketClose(KDSocket *socket);
+
+/* kdSocketBind: Bind a socket. */
+KD_API KDint KD_APIENTRY kdSocketBind(KDSocket *socket, const struct KDSockaddr *addr, KDboolean reuse);
+#define KD_INADDR_ANY 0
+
+/* kdSocketGetName: Get the local address of a socket. */
+KD_API KDint KD_APIENTRY kdSocketGetName(KDSocket *socket, struct KDSockaddr *addr);
+
+/* kdSocketConnect: Connects a socket. */
+KD_API KDint KD_APIENTRY kdSocketConnect(KDSocket *socket, const KDSockaddr *addr);
+
+/* kdSocketListen: Listen on a socket. */
+KD_API KDint KD_APIENTRY kdSocketListen(KDSocket *socket, KDint backlog);
+
+/* kdSocketAccept: Accept an incoming connection. */
+KD_API KDSocket *KD_APIENTRY kdSocketAccept(KDSocket *socket, KDSockaddr *addr, void *eventuserptr);
+
+/* kdSocketSend, kdSocketSendTo: Send data to a socket. */
+KD_API KDint KD_APIENTRY kdSocketSend(KDSocket *socket, const void *buf, KDint len);
+KD_API KDint KD_APIENTRY kdSocketSendTo(KDSocket *socket, const void *buf, KDint len, const KDSockaddr *addr);
+
+/* kdSocketRecv, kdSocketRecvFrom: Receive data from a socket. */
+KD_API KDint KD_APIENTRY kdSocketRecv(KDSocket *socket, void *buf, KDint len);
+KD_API KDint KD_APIENTRY kdSocketRecvFrom(KDSocket *socket, void *buf, KDint len, KDSockaddr *addr);
+
+/* kdHtonl: Convert a 32-bit integer from host to network byte order. */
+KD_API KDuint32 KD_APIENTRY kdHtonl(KDuint32 hostlong);
+
+/* kdHtons: Convert a 16-bit integer from host to network byte order. */
+KD_API KDuint16 KD_APIENTRY kdHtons(KDuint16 hostshort);
+
+/* kdNtohl: Convert a 32-bit integer from network to host byte order. */
+KD_API KDuint32 KD_APIENTRY kdNtohl(KDuint32 netlong);
+
+/* kdNtohs: Convert a 16-bit integer from network to host byte order. */
+KD_API KDuint16 KD_APIENTRY kdNtohs(KDuint16 netshort);
+
+/* kdInetAton: Convert a &#8220;dotted quad&#8221; format address to an integer. */
+KD_API KDint KD_APIENTRY kdInetAton(const KDchar *cp, KDuint32 *inp);
+
+/* kdInetNtop: Convert a network address to textual form. */
+#define KD_INET_ADDRSTRLEN 16
+typedef struct KDInAddr {
+ KDuint32 _s_addr; /* MSVC VC9 again .. couldn't handle s_addr here */
+} KDInAddr;
+KD_API const KDchar *KD_APIENTRY kdInetNtop(KDuint af, const void *src, KDchar *dst, KDsize cnt);
+
+/* KD_EVENT_SOCKET_READABLE: Event to indicate that a socket is readable. */
+#define KD_EVENT_SOCKET_READABLE 49
+typedef struct KDEventSocketReadable {
+ KDSocket *socket;
+} KDEventSocketReadable;
+
+/* KD_EVENT_SOCKET_WRITABLE: Event to indicate that a socket is writable. */
+#define KD_EVENT_SOCKET_WRITABLE 50
+typedef struct KDEventSocketWritable {
+ KDSocket *socket;
+} KDEventSocketWritable;
+
+/* KD_EVENT_SOCKET_CONNECT_COMPLETE: Event generated when a socket connect is complete */
+#define KD_EVENT_SOCKET_CONNECT_COMPLETE 51
+typedef struct KDEventSocketConnect {
+ KDSocket *socket;
+ KDint32 error;
+} KDEventSocketConnect;
+
+/* KD_EVENT_SOCKET_INCOMING: Event generated when a listening socket detects an incoming connection or an error. */
+#define KD_EVENT_SOCKET_INCOMING 52
+typedef struct KDEventSocketIncoming {
+ KDSocket *socket;
+} KDEventSocketIncoming;
+
+/* KD_EVENT_NAME_LOOKUP_COMPLETE: kdNameLookup complete event. */
+#define KD_EVENT_NAME_LOOKUP_COMPLETE 53
+typedef struct KDEventNameLookup {
+ KDint32 error;
+ KDint32 resultlen;
+ const KDSockaddr *result;
+ KDboolean more;
+} KDEventNameLookup;
+
+/*******************************************************
+ * Input/output
+ *******************************************************/
+
+/* KD_EVENT_STATE: State changed event. */
+#define KD_EVENT_STATE 55
+
+typedef struct KDEventState {
+ KDint32 index;
+ union {
+ KDint32 i;
+ KDint64 l;
+ KDfloat32 f;
+ } value;
+} KDEventState;
+
+/* KD_EVENT_INPUT: Input changed event. */
+#define KD_EVENT_INPUT 56
+
+typedef struct KDEventInput {
+ KDint32 index;
+ union {
+ KDint32 i;
+ KDint64 l;
+ KDfloat32 f;
+ } value;
+} KDEventInput;
+
+/* KD_EVENT_INPUT_JOG: Jogdial jog event. */
+#define KD_EVENT_INPUT_JOG 71
+typedef struct KDEventInputJog {
+ KDint32 index;
+ KDint32 count;
+} KDEventInputJog;
+
+/* KD_EVENT_INPUT_POINTER: Pointer input changed event. */
+#define KD_EVENT_INPUT_POINTER 57
+typedef struct KDEventInputPointer {
+ KDint32 index;
+ KDint32 select;
+ KDint32 x;
+ KDint32 y;
+} KDEventInputPointer;
+
+/* KD_EVENT_INPUT_STICK: Joystick stick changed event. */
+#define KD_EVENT_INPUT_STICK 58
+typedef struct KDEventInputStick {
+ KDint32 index;
+ KDint32 x;
+ KDint32 y;
+ KDint32 z;
+} KDEventInputStick;
+
+/* kdStateGeti, kdStateGetl, kdStateGetf: get state value(s) */
+KD_API KDint KD_APIENTRY kdStateGeti(KDint startidx, KDuint numidxs, KDint32 *buffer);
+KD_API KDint KD_APIENTRY kdStateGetl(KDint startidx, KDuint numidxs, KDint64 *buffer);
+KD_API KDint KD_APIENTRY kdStateGetf(KDint startidx, KDuint numidxs, KDfloat32 *buffer);
+
+/* kdOutputSeti, kdOutputSetf: set outputs */
+KD_API KDint KD_APIENTRY kdOutputSeti(KDint startidx, KDuint numidxs, const KDint32 *buffer);
+KD_API KDint KD_APIENTRY kdOutputSetf(KDint startidx, KDuint numidxs, const KDfloat32 *buffer);
+#define KD_IO_CONTROLLER_STRIDE 64
+
+/* KD_IOGROUP_GAMEKEYS: I/O group for game keys. */
+#define KD_IOGROUP_GAMEKEYS 0x1000
+#define KD_STATE_GAMEKEYS_AVAILABILITY (KD_IOGROUP_GAMEKEYS + 0)
+#define KD_INPUT_GAMEKEYS_UP (KD_IOGROUP_GAMEKEYS + 1)
+#define KD_INPUT_GAMEKEYS_LEFT (KD_IOGROUP_GAMEKEYS + 2)
+#define KD_INPUT_GAMEKEYS_RIGHT (KD_IOGROUP_GAMEKEYS + 3)
+#define KD_INPUT_GAMEKEYS_DOWN (KD_IOGROUP_GAMEKEYS + 4)
+#define KD_INPUT_GAMEKEYS_FIRE (KD_IOGROUP_GAMEKEYS + 5)
+#define KD_INPUT_GAMEKEYS_A (KD_IOGROUP_GAMEKEYS + 6)
+#define KD_INPUT_GAMEKEYS_B (KD_IOGROUP_GAMEKEYS + 7)
+#define KD_INPUT_GAMEKEYS_C (KD_IOGROUP_GAMEKEYS + 8)
+#define KD_INPUT_GAMEKEYS_D (KD_IOGROUP_GAMEKEYS + 9)
+
+/* KD_IOGROUP_GAMEKEYSNC: I/O group for game keys, no chording. */
+#define KD_IOGROUP_GAMEKEYSNC 0x1100
+#define KD_STATE_GAMEKEYSNC_AVAILABILITY (KD_IOGROUP_GAMEKEYSNC + 0)
+#define KD_INPUT_GAMEKEYSNC_UP (KD_IOGROUP_GAMEKEYSNC + 1)
+#define KD_INPUT_GAMEKEYSNC_LEFT (KD_IOGROUP_GAMEKEYSNC + 2)
+#define KD_INPUT_GAMEKEYSNC_RIGHT (KD_IOGROUP_GAMEKEYSNC + 3)
+#define KD_INPUT_GAMEKEYSNC_DOWN (KD_IOGROUP_GAMEKEYSNC + 4)
+#define KD_INPUT_GAMEKEYSNC_FIRE (KD_IOGROUP_GAMEKEYSNC + 5)
+#define KD_INPUT_GAMEKEYSNC_A (KD_IOGROUP_GAMEKEYSNC + 6)
+#define KD_INPUT_GAMEKEYSNC_B (KD_IOGROUP_GAMEKEYSNC + 7)
+#define KD_INPUT_GAMEKEYSNC_C (KD_IOGROUP_GAMEKEYSNC + 8)
+#define KD_INPUT_GAMEKEYSNC_D (KD_IOGROUP_GAMEKEYSNC + 9)
+
+/* KD_IOGROUP_PHONEKEYPAD: I/O group for phone keypad. */
+#define KD_IOGROUP_PHONEKEYPAD 0x2000
+#define KD_STATE_PHONEKEYPAD_AVAILABILITY (KD_IOGROUP_PHONEKEYPAD + 0)
+#define KD_INPUT_PHONEKEYPAD_0 (KD_IOGROUP_PHONEKEYPAD + 1)
+#define KD_INPUT_PHONEKEYPAD_1 (KD_IOGROUP_PHONEKEYPAD + 2)
+#define KD_INPUT_PHONEKEYPAD_2 (KD_IOGROUP_PHONEKEYPAD + 3)
+#define KD_INPUT_PHONEKEYPAD_3 (KD_IOGROUP_PHONEKEYPAD + 4)
+#define KD_INPUT_PHONEKEYPAD_4 (KD_IOGROUP_PHONEKEYPAD + 5)
+#define KD_INPUT_PHONEKEYPAD_5 (KD_IOGROUP_PHONEKEYPAD + 6)
+#define KD_INPUT_PHONEKEYPAD_6 (KD_IOGROUP_PHONEKEYPAD + 7)
+#define KD_INPUT_PHONEKEYPAD_7 (KD_IOGROUP_PHONEKEYPAD + 8)
+#define KD_INPUT_PHONEKEYPAD_8 (KD_IOGROUP_PHONEKEYPAD + 9)
+#define KD_INPUT_PHONEKEYPAD_9 (KD_IOGROUP_PHONEKEYPAD + 10)
+#define KD_INPUT_PHONEKEYPAD_STAR (KD_IOGROUP_PHONEKEYPAD + 11)
+#define KD_INPUT_PHONEKEYPAD_HASH (KD_IOGROUP_PHONEKEYPAD + 12)
+#define KD_INPUT_PHONEKEYPAD_LEFTSOFT (KD_IOGROUP_PHONEKEYPAD + 13)
+#define KD_INPUT_PHONEKEYPAD_RIGHTSOFT (KD_IOGROUP_PHONEKEYPAD + 14)
+#define KD_STATE_PHONEKEYPAD_ORIENTATION (KD_IOGROUP_PHONEKEYPAD + 15)
+
+/* KD_IOGROUP_VIBRATE: I/O group for vibrate. */
+#define KD_IOGROUP_VIBRATE 0x3000
+#define KD_STATE_VIBRATE_AVAILABILITY (KD_IOGROUP_VIBRATE + 0)
+#define KD_STATE_VIBRATE_MINFREQUENCY (KD_IOGROUP_VIBRATE + 1)
+#define KD_STATE_VIBRATE_MAXFREQUENCY (KD_IOGROUP_VIBRATE + 2)
+#define KD_OUTPUT_VIBRATE_VOLUME (KD_IOGROUP_VIBRATE + 3)
+#define KD_OUTPUT_VIBRATE_FREQUENCY (KD_IOGROUP_VIBRATE + 4)
+
+/* KD_IOGROUP_POINTER: I/O group for pointer. */
+#define KD_IOGROUP_POINTER 0x4000
+#define KD_STATE_POINTER_AVAILABILITY (KD_IOGROUP_POINTER + 0)
+#define KD_INPUT_POINTER_X (KD_IOGROUP_POINTER + 1)
+#define KD_INPUT_POINTER_Y (KD_IOGROUP_POINTER + 2)
+#define KD_INPUT_POINTER_SELECT (KD_IOGROUP_POINTER + 3)
+
+/* KD_IOGROUP_BACKLIGHT: I/O group for backlight. */
+#define KD_IOGROUP_BACKLIGHT 0x5000
+#define KD_STATE_BACKLIGHT_AVAILABILITY (KD_IOGROUP_BACKLIGHT + 0)
+#define KD_OUTPUT_BACKLIGHT_FORCE (KD_IOGROUP_BACKLIGHT + 1)
+
+/* KD_IOGROUP_JOGDIAL: I/O group for a jog dial. */
+#define KD_IOGROUP_JOGDIAL 0x6000
+#define KD_STATE_JOGDIAL_AVAILABILITY (KD_IOGROUP_JOGDIAL + 0)
+#define KD_INPUT_JOGDIAL_UP (KD_IOGROUP_JOGDIAL + 1)
+#define KD_INPUT_JOGDIAL_LEFT (KD_IOGROUP_JOGDIAL + 2)
+#define KD_INPUT_JOGDIAL_RIGHT (KD_IOGROUP_JOGDIAL + 3)
+#define KD_INPUT_JOGDIAL_DOWN (KD_IOGROUP_JOGDIAL + 4)
+#define KD_INPUT_JOGDIAL_SELECT (KD_IOGROUP_JOGDIAL + 5)
+
+/* KD_IOGROUP_STICK: I/O group for joystick. */
+#define KD_IOGROUP_STICK 0x7000
+#define KD_STATE_STICK_AVAILABILITY (KD_IOGROUP_STICK + 0)
+#define KD_INPUT_STICK_X (KD_IOGROUP_STICK + 1)
+#define KD_INPUT_STICK_Y (KD_IOGROUP_STICK + 2)
+#define KD_INPUT_STICK_Z (KD_IOGROUP_STICK + 3)
+#define KD_INPUT_STICK_BUTTON (KD_IOGROUP_STICK + 4)
+#define KD_IO_STICK_STRIDE 8
+
+/* KD_IOGROUP_DPAD: I/O group for D-pad. */
+#define KD_IOGROUP_DPAD 0x8000
+#define KD_STATE_DPAD_AVAILABILITY (KD_IOGROUP_DPAD + 0)
+#define KD_STATE_DPAD_COPY (KD_IOGROUP_DPAD + 1)
+#define KD_INPUT_DPAD_UP (KD_IOGROUP_DPAD + 2)
+#define KD_INPUT_DPAD_LEFT (KD_IOGROUP_DPAD + 3)
+#define KD_INPUT_DPAD_RIGHT (KD_IOGROUP_DPAD + 4)
+#define KD_INPUT_DPAD_DOWN (KD_IOGROUP_DPAD + 5)
+#define KD_INPUT_DPAD_SELECT (KD_IOGROUP_DPAD + 6)
+#define KD_IO_DPAD_STRIDE 8
+
+/* KD_IOGROUP_BUTTONS: I/O group for buttons associated with joystick or D-pad. */
+#define KD_IOGROUP_BUTTONS 0x9000
+#define KD_STATE_BUTTONS_AVAILABILITY (KD_IOGROUP_BUTTONS + 0)
+#define KD_INPUT_BUTTONS_0 (KD_IOGROUP_BUTTONS + 1)
+
+/* KD_IO_UNDEFINED: I/O items reserved for implementation-dependent use. */
+#define KD_IO_UNDEFINED 0x40000000
+
+/*******************************************************
+ * Windowing
+ *******************************************************/
+#ifdef KD_WINDOW_SUPPORTED
+#include <EGL/egl.h>
+typedef struct KDWindow KDWindow;
+
+/* kdCreateWindow: Create a window. */
+KD_API KDWindow *KD_APIENTRY kdCreateWindow(EGLDisplay display, EGLConfig config, void *eventuserptr);
+
+/* kdDestroyWindow: Destroy a window. */
+KD_API KDint KD_APIENTRY kdDestroyWindow(KDWindow *window);
+
+/* kdSetWindowPropertybv, kdSetWindowPropertyiv, kdSetWindowPropertycv: Set a window property to request a change in the on-screen representation of the window. */
+KD_API KDint KD_APIENTRY kdSetWindowPropertybv(KDWindow *window, KDint pname, const KDboolean *param);
+KD_API KDint KD_APIENTRY kdSetWindowPropertyiv(KDWindow *window, KDint pname, const KDint32 *param);
+KD_API KDint KD_APIENTRY kdSetWindowPropertycv(KDWindow *window, KDint pname, const KDchar *param);
+
+/* kdGetWindowPropertybv, kdGetWindowPropertyiv, kdGetWindowPropertycv: Get the current value of a window property. */
+KD_API KDint KD_APIENTRY kdGetWindowPropertybv(KDWindow *window, KDint pname, KDboolean *param);
+KD_API KDint KD_APIENTRY kdGetWindowPropertyiv(KDWindow *window, KDint pname, KDint32 *param);
+KD_API KDint KD_APIENTRY kdGetWindowPropertycv(KDWindow *window, KDint pname, KDchar *param, KDsize *size);
+
+/* kdRealizeWindow: Realize the window as a displayable entity and get the native window handle for passing to EGL. */
+KD_API KDint KD_APIENTRY kdRealizeWindow(KDWindow *window, EGLNativeWindowType *nativewindow);
+
+/* KD_WINDOWPROPERTY_SIZE: Window client area width and height. */
+#define KD_WINDOWPROPERTY_SIZE 66
+
+/* KD_WINDOWPROPERTY_VISIBILITY: Window visibility status. */
+#define KD_WINDOWPROPERTY_VISIBILITY 67
+
+/* KD_WINDOWPROPERTY_FOCUS: Window input focus status. */
+#define KD_WINDOWPROPERTY_FOCUS 68
+
+/* KD_WINDOWPROPERTY_CAPTION: Window caption. */
+#define KD_WINDOWPROPERTY_CAPTION 69
+
+/* KD_EVENT_WINDOW_CLOSE: Event to request to close window. */
+#define KD_EVENT_WINDOW_CLOSE 44
+
+/* KD_EVENT_WINDOWPROPERTY_CHANGE: Notification about realized window property change. */
+#define KD_EVENT_WINDOWPROPERTY_CHANGE 47
+typedef struct KDEventWindowProperty {
+ KDint32 pname;
+} KDEventWindowProperty;
+
+/* KD_EVENT_WINDOW_FOCUS: Event for change of window&#8217;s focus state. */
+#define KD_EVENT_WINDOW_FOCUS 60
+typedef struct KDEventWindowFocus {
+ KDint32 focusstate;
+} KDEventWindowFocus;
+
+/* KD_EVENT_WINDOW_REDRAW: Event to notify need to redraw the window. */
+#define KD_EVENT_WINDOW_REDRAW 59
+#endif /* KD_WINDOW_SUPPORTED */
+
+/*******************************************************
+ * Assertions and logging
+ *******************************************************/
+
+/* kdHandleAssertion: Handle assertion failure. */
+KD_API void KD_APIENTRY kdHandleAssertion(const KDchar *condition, const KDchar *filename, KDint linenumber);
+
+/* kdLogMessage: Output a log message. */
+#ifdef KD_NDEBUG
+#define kdLogMessage(s)
+#else
+KD_API void KD_APIENTRY kdLogMessage(const KDchar *string);
+#endif
+
+/* struct KDEvent delayed to the end as it uses event data structs from
+ * other parts of the .h file. */
+struct KDEvent {
+ KDust timestamp;
+ KDint32 type;
+ void *userptr;
+ union KDEventData {
+ KDEventState state;
+ KDEventInput input;
+ KDEventInputJog inputjog;
+ KDEventInputPointer inputpointer;
+ KDEventInputStick inputstick;
+ KDEventSocketReadable socketreadable;
+ KDEventSocketWritable socketwritable;
+ KDEventSocketConnect socketconnect;
+ KDEventSocketIncoming socketincoming;
+ KDEventNameLookup namelookup;
+#ifdef KD_WINDOW_SUPPORTED
+ KDEventWindowProperty windowproperty;
+ KDEventWindowFocus windowfocus;
+#endif /* KD_WINDOW_SUPPORTED */
+ KDEventUser user;
+ } data;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __kd_h_ */
+
diff --git a/make/stub_includes/egl/KD/kdplatform.h b/make/stub_includes/egl/KD/kdplatform.h
new file mode 100755
index 000000000..5e3ebebdf
--- /dev/null
+++ b/make/stub_includes/egl/KD/kdplatform.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+* Copyright (c) 2007 The Khronos Group Inc.
+*
+* Permission is hereby granted, free of charge, to any person obtaining
+* a copy of this software and associated documentation files (the
+* "Software"), to deal in the Software without restriction, including
+* without limitation the rights to use, copy, modify, merge, publish,
+* distribute, sublicense, and/or sell copies of the Software, and to
+* permit persons to whom the Software is furnished to do so, subject
+* to the following conditions:
+* The above copyright notice and this permission notice shall be included
+* in all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*
+*/
+
+
+/* NVIDIA KD/kdplatform.h for OpenKODE Core 1.0 Final candidate (draft 5070) */
+
+#ifndef __kdplatform_h_
+#define __kdplatform_h_
+
+#define KD_API
+#define KD_APIENTRY
+
+typedef int KDint32;
+typedef unsigned int KDuint32;
+#if defined(_MSC_VER)
+typedef signed __int64 KDint64;
+typedef unsigned __int64 KDuint64;
+#else
+typedef long long KDint64;
+typedef unsigned long long KDuint64;
+#endif
+typedef short KDint16;
+typedef unsigned short KDuint16;
+typedef unsigned long KDuintptr;
+typedef unsigned long KDsize;
+typedef long KDssize;
+#define KDINT_MIN (-0x7fffffff-1)
+#define KDINT_MAX 0x7fffffff
+#define KDUINT_MAX 0xffffffffU
+#define KDINT64_MIN (-0x7fffffffffffffffLL-1)
+#define KDINT64_MAX 0x7fffffffffffffffLL
+#define KDUINT64_MAX 0xffffffffffffffffULL
+#define KDSIZE_MAX (~(unsigned long)0)
+#define KDSSIZE_MAX ((long)KDSIZE_MAX/2)
+#define KDSSIZE_MIN (-1 - KDSSIZE_MAX)
+#define KDUINTPTR_MAX KDSIZE_MAX
+#define KD_NORETURN
+#define KD_WINDOW_SUPPORTED
+#ifdef KD_NDEBUG
+#define kdAssert(c)
+#else
+#define kdAssert(c) ((void)( (c) ? 0 : (kdHandleAssertion(#c, __FILE__, __LINE__), 0)))
+#endif
+
+#define KD_INFINITY_BITS 0x7f800000u
+#define KD_NEGATIVE_ZERO_BITS 0x80000000u
+#define KD_INFINITY (kdBitsToFloatNV(KD_INFINITY_BITS))
+#define KD_NEGATIVE_ZERO (kdBitsToFloatNV(KD_NEGATIVE_ZERO_BITS))
+
+KD_API float KD_APIENTRY kdBitsToFloatNV(KDuint32 x);
+
+#endif /* __kdplatform_h_ */
+
diff --git a/make/stub_includes/egl/window-system-ext.c b/make/stub_includes/egl/window-system-ext.c
new file mode 100755
index 000000000..7398847ac
--- /dev/null
+++ b/make/stub_includes/egl/window-system-ext.c
@@ -0,0 +1,7 @@
+#define USE_GLUEGEN
+
+// Define EGL_EGLEXT_PROTOTYPES so that the EGL extension prototypes in
+// "eglext.h" are parsed.
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <EGL/eglext.h>
diff --git a/make/stub_includes/egl/window-system.c b/make/stub_includes/egl/window-system.c
new file mode 100755
index 000000000..fbd0f0cde
--- /dev/null
+++ b/make/stub_includes/egl/window-system.c
@@ -0,0 +1,2 @@
+#define USE_GLUEGEN
+#include <EGL/egl.h>
diff --git a/make/stub_includes/jni/classfile_constants.h b/make/stub_includes/jni/classfile_constants.h
new file mode 100755
index 000000000..6546436a6
--- /dev/null
+++ b/make/stub_includes/jni/classfile_constants.h
@@ -0,0 +1,523 @@
+/*
+ * @(#)classfile_constants.h 1.4 05/11/17
+ *
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ */
+
+#ifndef CLASSFILE_CONSTANTS_H
+#define CLASSFILE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Flags */
+
+enum {
+ JVM_ACC_PUBLIC = 0x0001,
+ JVM_ACC_PRIVATE = 0x0002,
+ JVM_ACC_PROTECTED = 0x0004,
+ JVM_ACC_STATIC = 0x0008,
+ JVM_ACC_FINAL = 0x0010,
+ JVM_ACC_SYNCHRONIZED = 0x0020,
+ JVM_ACC_SUPER = 0x0020,
+ JVM_ACC_VOLATILE = 0x0040,
+ JVM_ACC_BRIDGE = 0x0040,
+ JVM_ACC_TRANSIENT = 0x0080,
+ JVM_ACC_VARARGS = 0x0080,
+ JVM_ACC_NATIVE = 0x0100,
+ JVM_ACC_INTERFACE = 0x0200,
+ JVM_ACC_ABSTRACT = 0x0400,
+ JVM_ACC_STRICT = 0x0800,
+ JVM_ACC_SYNTHETIC = 0x1000,
+ JVM_ACC_ANNOTATION = 0x2000,
+ JVM_ACC_ENUM = 0x4000
+};
+
+/* Used in newarray instruction. */
+
+enum {
+ JVM_T_BOOLEAN = 4,
+ JVM_T_CHAR = 5,
+ JVM_T_FLOAT = 6,
+ JVM_T_DOUBLE = 7,
+ JVM_T_BYTE = 8,
+ JVM_T_SHORT = 9,
+ JVM_T_INT = 10,
+ JVM_T_LONG = 11
+};
+
+/* Constant Pool Entries */
+
+enum {
+ JVM_CONSTANT_Utf8 = 1,
+ JVM_CONSTANT_Unicode = 2, /* unused */
+ JVM_CONSTANT_Integer = 3,
+ JVM_CONSTANT_Float = 4,
+ JVM_CONSTANT_Long = 5,
+ JVM_CONSTANT_Double = 6,
+ JVM_CONSTANT_Class = 7,
+ JVM_CONSTANT_String = 8,
+ JVM_CONSTANT_Fieldref = 9,
+ JVM_CONSTANT_Methodref = 10,
+ JVM_CONSTANT_InterfaceMethodref = 11,
+ JVM_CONSTANT_NameAndType = 12
+};
+
+/* StackMapTable type item numbers */
+
+enum {
+ JVM_ITEM_Top = 0,
+ JVM_ITEM_Integer = 1,
+ JVM_ITEM_Float = 2,
+ JVM_ITEM_Double = 3,
+ JVM_ITEM_Long = 4,
+ JVM_ITEM_Null = 5,
+ JVM_ITEM_UninitializedThis = 6,
+ JVM_ITEM_Object = 7,
+ JVM_ITEM_Uninitialized = 8
+};
+
+/* Type signatures */
+
+enum {
+ JVM_SIGNATURE_ARRAY = '[',
+ JVM_SIGNATURE_BYTE = 'B',
+ JVM_SIGNATURE_CHAR = 'C',
+ JVM_SIGNATURE_CLASS = 'L',
+ JVM_SIGNATURE_ENDCLASS = ';',
+ JVM_SIGNATURE_ENUM = 'E',
+ JVM_SIGNATURE_FLOAT = 'F',
+ JVM_SIGNATURE_DOUBLE = 'D',
+ JVM_SIGNATURE_FUNC = '(',
+ JVM_SIGNATURE_ENDFUNC = ')',
+ JVM_SIGNATURE_INT = 'I',
+ JVM_SIGNATURE_LONG = 'J',
+ JVM_SIGNATURE_SHORT = 'S',
+ JVM_SIGNATURE_VOID = 'V',
+ JVM_SIGNATURE_BOOLEAN = 'Z'
+};
+
+/* Opcodes */
+
+enum {
+ JVM_OPC_nop = 0,
+ JVM_OPC_aconst_null = 1,
+ JVM_OPC_iconst_m1 = 2,
+ JVM_OPC_iconst_0 = 3,
+ JVM_OPC_iconst_1 = 4,
+ JVM_OPC_iconst_2 = 5,
+ JVM_OPC_iconst_3 = 6,
+ JVM_OPC_iconst_4 = 7,
+ JVM_OPC_iconst_5 = 8,
+ JVM_OPC_lconst_0 = 9,
+ JVM_OPC_lconst_1 = 10,
+ JVM_OPC_fconst_0 = 11,
+ JVM_OPC_fconst_1 = 12,
+ JVM_OPC_fconst_2 = 13,
+ JVM_OPC_dconst_0 = 14,
+ JVM_OPC_dconst_1 = 15,
+ JVM_OPC_bipush = 16,
+ JVM_OPC_sipush = 17,
+ JVM_OPC_ldc = 18,
+ JVM_OPC_ldc_w = 19,
+ JVM_OPC_ldc2_w = 20,
+ JVM_OPC_iload = 21,
+ JVM_OPC_lload = 22,
+ JVM_OPC_fload = 23,
+ JVM_OPC_dload = 24,
+ JVM_OPC_aload = 25,
+ JVM_OPC_iload_0 = 26,
+ JVM_OPC_iload_1 = 27,
+ JVM_OPC_iload_2 = 28,
+ JVM_OPC_iload_3 = 29,
+ JVM_OPC_lload_0 = 30,
+ JVM_OPC_lload_1 = 31,
+ JVM_OPC_lload_2 = 32,
+ JVM_OPC_lload_3 = 33,
+ JVM_OPC_fload_0 = 34,
+ JVM_OPC_fload_1 = 35,
+ JVM_OPC_fload_2 = 36,
+ JVM_OPC_fload_3 = 37,
+ JVM_OPC_dload_0 = 38,
+ JVM_OPC_dload_1 = 39,
+ JVM_OPC_dload_2 = 40,
+ JVM_OPC_dload_3 = 41,
+ JVM_OPC_aload_0 = 42,
+ JVM_OPC_aload_1 = 43,
+ JVM_OPC_aload_2 = 44,
+ JVM_OPC_aload_3 = 45,
+ JVM_OPC_iaload = 46,
+ JVM_OPC_laload = 47,
+ JVM_OPC_faload = 48,
+ JVM_OPC_daload = 49,
+ JVM_OPC_aaload = 50,
+ JVM_OPC_baload = 51,
+ JVM_OPC_caload = 52,
+ JVM_OPC_saload = 53,
+ JVM_OPC_istore = 54,
+ JVM_OPC_lstore = 55,
+ JVM_OPC_fstore = 56,
+ JVM_OPC_dstore = 57,
+ JVM_OPC_astore = 58,
+ JVM_OPC_istore_0 = 59,
+ JVM_OPC_istore_1 = 60,
+ JVM_OPC_istore_2 = 61,
+ JVM_OPC_istore_3 = 62,
+ JVM_OPC_lstore_0 = 63,
+ JVM_OPC_lstore_1 = 64,
+ JVM_OPC_lstore_2 = 65,
+ JVM_OPC_lstore_3 = 66,
+ JVM_OPC_fstore_0 = 67,
+ JVM_OPC_fstore_1 = 68,
+ JVM_OPC_fstore_2 = 69,
+ JVM_OPC_fstore_3 = 70,
+ JVM_OPC_dstore_0 = 71,
+ JVM_OPC_dstore_1 = 72,
+ JVM_OPC_dstore_2 = 73,
+ JVM_OPC_dstore_3 = 74,
+ JVM_OPC_astore_0 = 75,
+ JVM_OPC_astore_1 = 76,
+ JVM_OPC_astore_2 = 77,
+ JVM_OPC_astore_3 = 78,
+ JVM_OPC_iastore = 79,
+ JVM_OPC_lastore = 80,
+ JVM_OPC_fastore = 81,
+ JVM_OPC_dastore = 82,
+ JVM_OPC_aastore = 83,
+ JVM_OPC_bastore = 84,
+ JVM_OPC_castore = 85,
+ JVM_OPC_sastore = 86,
+ JVM_OPC_pop = 87,
+ JVM_OPC_pop2 = 88,
+ JVM_OPC_dup = 89,
+ JVM_OPC_dup_x1 = 90,
+ JVM_OPC_dup_x2 = 91,
+ JVM_OPC_dup2 = 92,
+ JVM_OPC_dup2_x1 = 93,
+ JVM_OPC_dup2_x2 = 94,
+ JVM_OPC_swap = 95,
+ JVM_OPC_iadd = 96,
+ JVM_OPC_ladd = 97,
+ JVM_OPC_fadd = 98,
+ JVM_OPC_dadd = 99,
+ JVM_OPC_isub = 100,
+ JVM_OPC_lsub = 101,
+ JVM_OPC_fsub = 102,
+ JVM_OPC_dsub = 103,
+ JVM_OPC_imul = 104,
+ JVM_OPC_lmul = 105,
+ JVM_OPC_fmul = 106,
+ JVM_OPC_dmul = 107,
+ JVM_OPC_idiv = 108,
+ JVM_OPC_ldiv = 109,
+ JVM_OPC_fdiv = 110,
+ JVM_OPC_ddiv = 111,
+ JVM_OPC_irem = 112,
+ JVM_OPC_lrem = 113,
+ JVM_OPC_frem = 114,
+ JVM_OPC_drem = 115,
+ JVM_OPC_ineg = 116,
+ JVM_OPC_lneg = 117,
+ JVM_OPC_fneg = 118,
+ JVM_OPC_dneg = 119,
+ JVM_OPC_ishl = 120,
+ JVM_OPC_lshl = 121,
+ JVM_OPC_ishr = 122,
+ JVM_OPC_lshr = 123,
+ JVM_OPC_iushr = 124,
+ JVM_OPC_lushr = 125,
+ JVM_OPC_iand = 126,
+ JVM_OPC_land = 127,
+ JVM_OPC_ior = 128,
+ JVM_OPC_lor = 129,
+ JVM_OPC_ixor = 130,
+ JVM_OPC_lxor = 131,
+ JVM_OPC_iinc = 132,
+ JVM_OPC_i2l = 133,
+ JVM_OPC_i2f = 134,
+ JVM_OPC_i2d = 135,
+ JVM_OPC_l2i = 136,
+ JVM_OPC_l2f = 137,
+ JVM_OPC_l2d = 138,
+ JVM_OPC_f2i = 139,
+ JVM_OPC_f2l = 140,
+ JVM_OPC_f2d = 141,
+ JVM_OPC_d2i = 142,
+ JVM_OPC_d2l = 143,
+ JVM_OPC_d2f = 144,
+ JVM_OPC_i2b = 145,
+ JVM_OPC_i2c = 146,
+ JVM_OPC_i2s = 147,
+ JVM_OPC_lcmp = 148,
+ JVM_OPC_fcmpl = 149,
+ JVM_OPC_fcmpg = 150,
+ JVM_OPC_dcmpl = 151,
+ JVM_OPC_dcmpg = 152,
+ JVM_OPC_ifeq = 153,
+ JVM_OPC_ifne = 154,
+ JVM_OPC_iflt = 155,
+ JVM_OPC_ifge = 156,
+ JVM_OPC_ifgt = 157,
+ JVM_OPC_ifle = 158,
+ JVM_OPC_if_icmpeq = 159,
+ JVM_OPC_if_icmpne = 160,
+ JVM_OPC_if_icmplt = 161,
+ JVM_OPC_if_icmpge = 162,
+ JVM_OPC_if_icmpgt = 163,
+ JVM_OPC_if_icmple = 164,
+ JVM_OPC_if_acmpeq = 165,
+ JVM_OPC_if_acmpne = 166,
+ JVM_OPC_goto = 167,
+ JVM_OPC_jsr = 168,
+ JVM_OPC_ret = 169,
+ JVM_OPC_tableswitch = 170,
+ JVM_OPC_lookupswitch = 171,
+ JVM_OPC_ireturn = 172,
+ JVM_OPC_lreturn = 173,
+ JVM_OPC_freturn = 174,
+ JVM_OPC_dreturn = 175,
+ JVM_OPC_areturn = 176,
+ JVM_OPC_return = 177,
+ JVM_OPC_getstatic = 178,
+ JVM_OPC_putstatic = 179,
+ JVM_OPC_getfield = 180,
+ JVM_OPC_putfield = 181,
+ JVM_OPC_invokevirtual = 182,
+ JVM_OPC_invokespecial = 183,
+ JVM_OPC_invokestatic = 184,
+ JVM_OPC_invokeinterface = 185,
+ JVM_OPC_xxxunusedxxx = 186,
+ JVM_OPC_new = 187,
+ JVM_OPC_newarray = 188,
+ JVM_OPC_anewarray = 189,
+ JVM_OPC_arraylength = 190,
+ JVM_OPC_athrow = 191,
+ JVM_OPC_checkcast = 192,
+ JVM_OPC_instanceof = 193,
+ JVM_OPC_monitorenter = 194,
+ JVM_OPC_monitorexit = 195,
+ JVM_OPC_wide = 196,
+ JVM_OPC_multianewarray = 197,
+ JVM_OPC_ifnull = 198,
+ JVM_OPC_ifnonnull = 199,
+ JVM_OPC_goto_w = 200,
+ JVM_OPC_jsr_w = 201,
+ JVM_OPC_MAX = 201
+};
+
+/* Opcode length initializer, use with something like:
+ * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
+ */
+#define JVM_OPCODE_LENGTH_INITIALIZER { \
+ 1, /* nop */ \
+ 1, /* aconst_null */ \
+ 1, /* iconst_m1 */ \
+ 1, /* iconst_0 */ \
+ 1, /* iconst_1 */ \
+ 1, /* iconst_2 */ \
+ 1, /* iconst_3 */ \
+ 1, /* iconst_4 */ \
+ 1, /* iconst_5 */ \
+ 1, /* lconst_0 */ \
+ 1, /* lconst_1 */ \
+ 1, /* fconst_0 */ \
+ 1, /* fconst_1 */ \
+ 1, /* fconst_2 */ \
+ 1, /* dconst_0 */ \
+ 1, /* dconst_1 */ \
+ 2, /* bipush */ \
+ 3, /* sipush */ \
+ 2, /* ldc */ \
+ 3, /* ldc_w */ \
+ 3, /* ldc2_w */ \
+ 2, /* iload */ \
+ 2, /* lload */ \
+ 2, /* fload */ \
+ 2, /* dload */ \
+ 2, /* aload */ \
+ 1, /* iload_0 */ \
+ 1, /* iload_1 */ \
+ 1, /* iload_2 */ \
+ 1, /* iload_3 */ \
+ 1, /* lload_0 */ \
+ 1, /* lload_1 */ \
+ 1, /* lload_2 */ \
+ 1, /* lload_3 */ \
+ 1, /* fload_0 */ \
+ 1, /* fload_1 */ \
+ 1, /* fload_2 */ \
+ 1, /* fload_3 */ \
+ 1, /* dload_0 */ \
+ 1, /* dload_1 */ \
+ 1, /* dload_2 */ \
+ 1, /* dload_3 */ \
+ 1, /* aload_0 */ \
+ 1, /* aload_1 */ \
+ 1, /* aload_2 */ \
+ 1, /* aload_3 */ \
+ 1, /* iaload */ \
+ 1, /* laload */ \
+ 1, /* faload */ \
+ 1, /* daload */ \
+ 1, /* aaload */ \
+ 1, /* baload */ \
+ 1, /* caload */ \
+ 1, /* saload */ \
+ 2, /* istore */ \
+ 2, /* lstore */ \
+ 2, /* fstore */ \
+ 2, /* dstore */ \
+ 2, /* astore */ \
+ 1, /* istore_0 */ \
+ 1, /* istore_1 */ \
+ 1, /* istore_2 */ \
+ 1, /* istore_3 */ \
+ 1, /* lstore_0 */ \
+ 1, /* lstore_1 */ \
+ 1, /* lstore_2 */ \
+ 1, /* lstore_3 */ \
+ 1, /* fstore_0 */ \
+ 1, /* fstore_1 */ \
+ 1, /* fstore_2 */ \
+ 1, /* fstore_3 */ \
+ 1, /* dstore_0 */ \
+ 1, /* dstore_1 */ \
+ 1, /* dstore_2 */ \
+ 1, /* dstore_3 */ \
+ 1, /* astore_0 */ \
+ 1, /* astore_1 */ \
+ 1, /* astore_2 */ \
+ 1, /* astore_3 */ \
+ 1, /* iastore */ \
+ 1, /* lastore */ \
+ 1, /* fastore */ \
+ 1, /* dastore */ \
+ 1, /* aastore */ \
+ 1, /* bastore */ \
+ 1, /* castore */ \
+ 1, /* sastore */ \
+ 1, /* pop */ \
+ 1, /* pop2 */ \
+ 1, /* dup */ \
+ 1, /* dup_x1 */ \
+ 1, /* dup_x2 */ \
+ 1, /* dup2 */ \
+ 1, /* dup2_x1 */ \
+ 1, /* dup2_x2 */ \
+ 1, /* swap */ \
+ 1, /* iadd */ \
+ 1, /* ladd */ \
+ 1, /* fadd */ \
+ 1, /* dadd */ \
+ 1, /* isub */ \
+ 1, /* lsub */ \
+ 1, /* fsub */ \
+ 1, /* dsub */ \
+ 1, /* imul */ \
+ 1, /* lmul */ \
+ 1, /* fmul */ \
+ 1, /* dmul */ \
+ 1, /* idiv */ \
+ 1, /* ldiv */ \
+ 1, /* fdiv */ \
+ 1, /* ddiv */ \
+ 1, /* irem */ \
+ 1, /* lrem */ \
+ 1, /* frem */ \
+ 1, /* drem */ \
+ 1, /* ineg */ \
+ 1, /* lneg */ \
+ 1, /* fneg */ \
+ 1, /* dneg */ \
+ 1, /* ishl */ \
+ 1, /* lshl */ \
+ 1, /* ishr */ \
+ 1, /* lshr */ \
+ 1, /* iushr */ \
+ 1, /* lushr */ \
+ 1, /* iand */ \
+ 1, /* land */ \
+ 1, /* ior */ \
+ 1, /* lor */ \
+ 1, /* ixor */ \
+ 1, /* lxor */ \
+ 3, /* iinc */ \
+ 1, /* i2l */ \
+ 1, /* i2f */ \
+ 1, /* i2d */ \
+ 1, /* l2i */ \
+ 1, /* l2f */ \
+ 1, /* l2d */ \
+ 1, /* f2i */ \
+ 1, /* f2l */ \
+ 1, /* f2d */ \
+ 1, /* d2i */ \
+ 1, /* d2l */ \
+ 1, /* d2f */ \
+ 1, /* i2b */ \
+ 1, /* i2c */ \
+ 1, /* i2s */ \
+ 1, /* lcmp */ \
+ 1, /* fcmpl */ \
+ 1, /* fcmpg */ \
+ 1, /* dcmpl */ \
+ 1, /* dcmpg */ \
+ 3, /* ifeq */ \
+ 3, /* ifne */ \
+ 3, /* iflt */ \
+ 3, /* ifge */ \
+ 3, /* ifgt */ \
+ 3, /* ifle */ \
+ 3, /* if_icmpeq */ \
+ 3, /* if_icmpne */ \
+ 3, /* if_icmplt */ \
+ 3, /* if_icmpge */ \
+ 3, /* if_icmpgt */ \
+ 3, /* if_icmple */ \
+ 3, /* if_acmpeq */ \
+ 3, /* if_acmpne */ \
+ 3, /* goto */ \
+ 3, /* jsr */ \
+ 2, /* ret */ \
+ 99, /* tableswitch */ \
+ 99, /* lookupswitch */ \
+ 1, /* ireturn */ \
+ 1, /* lreturn */ \
+ 1, /* freturn */ \
+ 1, /* dreturn */ \
+ 1, /* areturn */ \
+ 1, /* return */ \
+ 3, /* getstatic */ \
+ 3, /* putstatic */ \
+ 3, /* getfield */ \
+ 3, /* putfield */ \
+ 3, /* invokevirtual */ \
+ 3, /* invokespecial */ \
+ 3, /* invokestatic */ \
+ 5, /* invokeinterface */ \
+ 0, /* xxxunusedxxx */ \
+ 3, /* new */ \
+ 2, /* newarray */ \
+ 3, /* anewarray */ \
+ 1, /* arraylength */ \
+ 1, /* athrow */ \
+ 3, /* checkcast */ \
+ 3, /* instanceof */ \
+ 1, /* monitorenter */ \
+ 1, /* monitorexit */ \
+ 0, /* wide */ \
+ 4, /* multianewarray */ \
+ 3, /* ifnull */ \
+ 3, /* ifnonnull */ \
+ 5, /* goto_w */ \
+ 5 /* jsr_w */ \
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* CLASSFILE_CONSTANTS */
diff --git a/make/stub_includes/jni/jawt.h b/make/stub_includes/jni/jawt.h
new file mode 100755
index 000000000..f5eea9b46
--- /dev/null
+++ b/make/stub_includes/jni/jawt.h
@@ -0,0 +1,278 @@
+/*
+ * @(#)jawt.h 1.11 05/11/17
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JAWT_H_
+#define _JAVASOFT_JAWT_H_
+
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * AWT native interface (new in JDK 1.3)
+ *
+ * The AWT native interface allows a native C or C++ application a means
+ * by which to access native structures in AWT. This is to facilitate moving
+ * legacy C and C++ applications to Java and to target the needs of the
+ * community who, at present, wish to do their own native rendering to canvases
+ * for performance reasons. Standard extensions such as Java3D also require a
+ * means to access the underlying native data structures of AWT.
+ *
+ * There may be future extensions to this API depending on demand.
+ *
+ * A VM does not have to implement this API in order to pass the JCK.
+ * It is recommended, however, that this API is implemented on VMs that support
+ * standard extensions, such as Java3D.
+ *
+ * Since this is a native API, any program which uses it cannot be considered
+ * 100% pure java.
+ */
+
+/*
+ * AWT Native Drawing Surface (JAWT_DrawingSurface).
+ *
+ * For each platform, there is a native drawing surface structure. This
+ * platform-specific structure can be found in jawt_md.h. It is recommended
+ * that additional platforms follow the same model. It is also recommended
+ * that VMs on Win32 and Solaris support the existing structures in jawt_md.h.
+ *
+ *******************
+ * EXAMPLE OF USAGE:
+ *******************
+ *
+ * In Win32, a programmer wishes to access the HWND of a canvas to perform
+ * native rendering into it. The programmer has declared the paint() method
+ * for their canvas subclass to be native:
+ *
+ *
+ * MyCanvas.java:
+ *
+ * import java.awt.*;
+ *
+ * public class MyCanvas extends Canvas {
+ *
+ * static {
+ * System.loadLibrary("mylib");
+ * }
+ *
+ * public native void paint(Graphics g);
+ * }
+ *
+ *
+ * myfile.c:
+ *
+ * #include "jawt_md.h"
+ * #include <assert.h>
+ *
+ * JNIEXPORT void JNICALL
+ * Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics)
+ * {
+ * JAWT awt;
+ * JAWT_DrawingSurface* ds;
+ * JAWT_DrawingSurfaceInfo* dsi;
+ * JAWT_Win32DrawingSurfaceInfo* dsi_win;
+ * jboolean result;
+ * jint lock;
+ *
+ * // Get the AWT
+ * awt.version = JAWT_VERSION_1_3;
+ * result = JAWT_GetAWT(env, &awt);
+ * assert(result != JNI_FALSE);
+ *
+ * // Get the drawing surface
+ * ds = awt.GetDrawingSurface(env, canvas);
+ * assert(ds != NULL);
+ *
+ * // Lock the drawing surface
+ * lock = ds->Lock(ds);
+ * assert((lock & JAWT_LOCK_ERROR) == 0);
+ *
+ * // Get the drawing surface info
+ * dsi = ds->GetDrawingSurfaceInfo(ds);
+ *
+ * // Get the platform-specific drawing info
+ * dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
+ *
+ * //////////////////////////////
+ * // !!! DO PAINTING HERE !!! //
+ * //////////////////////////////
+ *
+ * // Free the drawing surface info
+ * ds->FreeDrawingSurfaceInfo(dsi);
+ *
+ * // Unlock the drawing surface
+ * ds->Unlock(ds);
+ *
+ * // Free the drawing surface
+ * awt.FreeDrawingSurface(ds);
+ * }
+ *
+ */
+
+/*
+ * JAWT_Rectangle
+ * Structure for a native rectangle.
+ */
+typedef struct jawt_Rectangle {
+ jint x;
+ jint y;
+ jint width;
+ jint height;
+} JAWT_Rectangle;
+
+struct jawt_DrawingSurface;
+
+/*
+ * JAWT_DrawingSurfaceInfo
+ * Structure for containing the underlying drawing information of a component.
+ */
+typedef struct jawt_DrawingSurfaceInfo {
+ /*
+ * Pointer to the platform-specific information. This can be safely
+ * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
+ * JAWT_X11DrawingSurfaceInfo on Solaris. See jawt_md.h for details.
+ */
+ void* platformInfo;
+ /* Cached pointer to the underlying drawing surface */
+ struct jawt_DrawingSurface* ds;
+ /* Bounding rectangle of the drawing surface */
+ JAWT_Rectangle bounds;
+ /* Number of rectangles in the clip */
+ jint clipSize;
+ /* Clip rectangle array */
+ JAWT_Rectangle* clip;
+} JAWT_DrawingSurfaceInfo;
+
+#define JAWT_LOCK_ERROR 0x00000001
+#define JAWT_LOCK_CLIP_CHANGED 0x00000002
+#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004
+#define JAWT_LOCK_SURFACE_CHANGED 0x00000008
+
+/*
+ * JAWT_DrawingSurface
+ * Structure for containing the underlying drawing information of a component.
+ * All operations on a JAWT_DrawingSurface MUST be performed from the same
+ * thread as the call to GetDrawingSurface.
+ */
+typedef struct jawt_DrawingSurface {
+ /*
+ * Cached reference to the Java environment of the calling thread.
+ * If Lock(), Unlock(), GetDrawingSurfaceInfo() or
+ * FreeDrawingSurfaceInfo() are called from a different thread,
+ * this data member should be set before calling those functions.
+ */
+ JNIEnv* env;
+ /* Cached reference to the target object */
+ jobject target;
+ /*
+ * Lock the surface of the target component for native rendering.
+ * When finished drawing, the surface must be unlocked with
+ * Unlock(). This function returns a bitmask with one or more of the
+ * following values:
+ *
+ * JAWT_LOCK_ERROR - When an error has occurred and the surface could not
+ * be locked.
+ *
+ * JAWT_LOCK_CLIP_CHANGED - When the clip region has changed.
+ *
+ * JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed.
+ *
+ * JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed
+ */
+ jint (JNICALL *Lock)
+ (struct jawt_DrawingSurface* ds);
+ /*
+ * Get the drawing surface info.
+ * The value returned may be cached, but the values may change if
+ * additional calls to Lock() or Unlock() are made.
+ * Lock() must be called before this can return a valid value.
+ * Returns NULL if an error has occurred.
+ * When finished with the returned value, FreeDrawingSurfaceInfo must be
+ * called.
+ */
+ JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo)
+ (struct jawt_DrawingSurface* ds);
+ /*
+ * Free the drawing surface info.
+ */
+ void (JNICALL *FreeDrawingSurfaceInfo)
+ (JAWT_DrawingSurfaceInfo* dsi);
+ /*
+ * Unlock the drawing surface of the target component for native rendering.
+ */
+ void (JNICALL *Unlock)
+ (struct jawt_DrawingSurface* ds);
+} JAWT_DrawingSurface;
+
+/*
+ * JAWT
+ * Structure for containing native AWT functions.
+ */
+typedef struct jawt {
+ /*
+ * Version of this structure. This must always be set before
+ * calling JAWT_GetAWT()
+ */
+ jint version;
+ /*
+ * Return a drawing surface from a target jobject. This value
+ * may be cached.
+ * Returns NULL if an error has occurred.
+ * Target must be a java.awt.Component (should be a Canvas
+ * or Window for native rendering).
+ * FreeDrawingSurface() must be called when finished with the
+ * returned JAWT_DrawingSurface.
+ */
+ JAWT_DrawingSurface* (JNICALL *GetDrawingSurface)
+ (JNIEnv* env, jobject target);
+ /*
+ * Free the drawing surface allocated in GetDrawingSurface.
+ */
+ void (JNICALL *FreeDrawingSurface)
+ (JAWT_DrawingSurface* ds);
+ /*
+ * Since 1.4
+ * Locks the entire AWT for synchronization purposes
+ */
+ void (JNICALL *Lock)(JNIEnv* env);
+ /*
+ * Since 1.4
+ * Unlocks the entire AWT for synchronization purposes
+ */
+ void (JNICALL *Unlock)(JNIEnv* env);
+ /*
+ * Since 1.4
+ * Returns a reference to a java.awt.Component from a native
+ * platform handle. On Windows, this corresponds to an HWND;
+ * on Solaris and Linux, this is a Drawable. For other platforms,
+ * see the appropriate machine-dependent header file for a description.
+ * The reference returned by this function is a local
+ * reference that is only valid in this environment.
+ * This function returns a NULL reference if no component could be
+ * found with matching platform information.
+ */
+ jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo);
+
+} JAWT;
+
+/*
+ * Get the AWT native structure. This function returns JNI_FALSE if
+ * an error occurs.
+ */
+_JNI_IMPORT_OR_EXPORT_
+jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt);
+
+#define JAWT_VERSION_1_3 0x00010003
+#define JAWT_VERSION_1_4 0x00010004
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* !_JAVASOFT_JAWT_H_ */
diff --git a/make/stub_includes/jni/jdwpTransport.h b/make/stub_includes/jni/jdwpTransport.h
new file mode 100755
index 000000000..fc46ca48e
--- /dev/null
+++ b/make/stub_includes/jni/jdwpTransport.h
@@ -0,0 +1,237 @@
+/*
+ * @(#)jdwpTransport.h 1.8 05/11/17
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+/*
+ * Java Debug Wire Protocol Transport Service Provider Interface.
+ */
+
+#ifndef JDWPTRANSPORT_H
+#define JDWPTRANSPORT_H
+
+#include "jni.h"
+
+enum {
+ JDWPTRANSPORT_VERSION_1_0 = 0x00010000
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct jdwpTransportNativeInterface_;
+
+struct _jdwpTransportEnv;
+
+#ifdef __cplusplus
+typedef _jdwpTransportEnv jdwpTransportEnv;
+#else
+typedef const struct jdwpTransportNativeInterface_ *jdwpTransportEnv;
+#endif /* __cplusplus */
+
+/*
+ * Errors. Universal errors with JVMTI/JVMDI equivalents keep the
+ * values the same.
+ */
+typedef enum {
+ JDWPTRANSPORT_ERROR_NONE = 0,
+ JDWPTRANSPORT_ERROR_ILLEGAL_ARGUMENT = 103,
+ JDWPTRANSPORT_ERROR_OUT_OF_MEMORY = 110,
+ JDWPTRANSPORT_ERROR_INTERNAL = 113,
+ JDWPTRANSPORT_ERROR_ILLEGAL_STATE = 201,
+ JDWPTRANSPORT_ERROR_IO_ERROR = 202,
+ JDWPTRANSPORT_ERROR_TIMEOUT = 203,
+ JDWPTRANSPORT_ERROR_MSG_NOT_AVAILABLE = 204
+} jdwpTransportError;
+
+
+/*
+ * Structure to define capabilities
+ */
+typedef struct {
+ unsigned int can_timeout_attach :1;
+ unsigned int can_timeout_accept :1;
+ unsigned int can_timeout_handshake :1;
+ unsigned int reserved3 :1;
+ unsigned int reserved4 :1;
+ unsigned int reserved5 :1;
+ unsigned int reserved6 :1;
+ unsigned int reserved7 :1;
+ unsigned int reserved8 :1;
+ unsigned int reserved9 :1;
+ unsigned int reserved10 :1;
+ unsigned int reserved11 :1;
+ unsigned int reserved12 :1;
+ unsigned int reserved13 :1;
+ unsigned int reserved14 :1;
+ unsigned int reserved15 :1;
+} JDWPTransportCapabilities;
+
+
+/*
+ * Structures to define packet layout.
+ *
+ * See: http://java.sun.com/j2se/1.5/docs/guide/jpda/jdwp-spec.html
+ */
+
+enum {
+ JDWPTRANSPORT_FLAGS_NONE = 0x0,
+ JDWPTRANSPORT_FLAGS_REPLY = 0x80
+};
+
+typedef struct {
+ jint len;
+ jint id;
+ jbyte flags;
+ jbyte cmdSet;
+ jbyte cmd;
+ jbyte *data;
+} jdwpCmdPacket;
+
+typedef struct {
+ jint len;
+ jint id;
+ jbyte flags;
+ jshort errorCode;
+ jbyte *data;
+} jdwpReplyPacket;
+
+typedef struct {
+ union {
+ jdwpCmdPacket cmd;
+ jdwpReplyPacket reply;
+ } type;
+} jdwpPacket;
+
+/*
+ * JDWP functions called by the transport.
+ */
+typedef struct jdwpTransportCallback {
+ void *(*alloc)(jint numBytes); /* Call this for all allocations */
+ void (*free)(void *buffer); /* Call this for all deallocations */
+} jdwpTransportCallback;
+
+typedef jint (JNICALL *jdwpTransport_OnLoad_t)(JavaVM *jvm,
+ jdwpTransportCallback *callback,
+ jint version,
+ jdwpTransportEnv** env);
+
+
+
+/* Function Interface */
+
+struct jdwpTransportNativeInterface_ {
+ /* 1 : RESERVED */
+ void *reserved1;
+
+ /* 2 : Get Capabilities */
+ jdwpTransportError (JNICALL *GetCapabilities)(jdwpTransportEnv* env,
+ JDWPTransportCapabilities *capabilities_ptr);
+
+ /* 3 : Attach */
+ jdwpTransportError (JNICALL *Attach)(jdwpTransportEnv* env,
+ const char* address,
+ jlong attach_timeout,
+ jlong handshake_timeout);
+
+ /* 4: StartListening */
+ jdwpTransportError (JNICALL *StartListening)(jdwpTransportEnv* env,
+ const char* address,
+ char** actual_address);
+
+ /* 5: StopListening */
+ jdwpTransportError (JNICALL *StopListening)(jdwpTransportEnv* env);
+
+ /* 6: Accept */
+ jdwpTransportError (JNICALL *Accept)(jdwpTransportEnv* env,
+ jlong accept_timeout,
+ jlong handshake_timeout);
+
+ /* 7: IsOpen */
+ jboolean (JNICALL *IsOpen)(jdwpTransportEnv* env);
+
+ /* 8: Close */
+ jdwpTransportError (JNICALL *Close)(jdwpTransportEnv* env);
+
+ /* 9: ReadPacket */
+ jdwpTransportError (JNICALL *ReadPacket)(jdwpTransportEnv* env,
+ jdwpPacket *pkt);
+
+ /* 10: Write Packet */
+ jdwpTransportError (JNICALL *WritePacket)(jdwpTransportEnv* env,
+ const jdwpPacket* pkt);
+
+ /* 11: GetLastError */
+ jdwpTransportError (JNICALL *GetLastError)(jdwpTransportEnv* env,
+ char** error);
+
+};
+
+
+/*
+ * Use inlined functions so that C++ code can use syntax such as
+ * env->Attach("mymachine:5000", 10*1000, 0);
+ *
+ * rather than using C's :-
+ *
+ * (*env)->Attach(env, "mymachine:5000", 10*1000, 0);
+ */
+struct _jdwpTransportEnv {
+ const struct jdwpTransportNativeInterface_ *functions;
+#ifdef __cplusplus
+
+ jdwpTransportError GetCapabilities(JDWPTransportCapabilities *capabilities_ptr) {
+ return functions->GetCapabilities(this, capabilities_ptr);
+ }
+
+ jdwpTransportError Attach(const char* address, jlong attach_timeout,
+ jlong handshake_timeout) {
+ return functions->Attach(this, address, attach_timeout, handshake_timeout);
+ }
+
+ jdwpTransportError StartListening(const char* address,
+ char** actual_address) {
+ return functions->StartListening(this, address, actual_address);
+ }
+
+ jdwpTransportError StopListening(void) {
+ return functions->StopListening(this);
+ }
+
+ jdwpTransportError Accept(jlong accept_timeout, jlong handshake_timeout) {
+ return functions->Accept(this, accept_timeout, handshake_timeout);
+ }
+
+ jboolean IsOpen(void) {
+ return functions->IsOpen(this);
+ }
+
+ jdwpTransportError Close(void) {
+ return functions->Close(this);
+ }
+
+ jdwpTransportError ReadPacket(jdwpPacket *pkt) {
+ return functions->ReadPacket(this, pkt);
+ }
+
+ jdwpTransportError WritePacket(const jdwpPacket* pkt) {
+ return functions->WritePacket(this, pkt);
+ }
+
+ jdwpTransportError GetLastError(char** error) {
+ return functions->GetLastError(this, error);
+ }
+
+
+#endif /* __cplusplus */
+};
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* JDWPTRANSPORT_H */
+
diff --git a/make/stub_includes/jni/jni.h b/make/stub_includes/jni/jni.h
new file mode 100755
index 000000000..f53476c09
--- /dev/null
+++ b/make/stub_includes/jni/jni.h
@@ -0,0 +1,1944 @@
+/*
+ * @(#)jni.h 1.62 06/02/02
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+ and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char jboolean;
+typedef unsigned short jchar;
+typedef short jshort;
+typedef float jfloat;
+typedef double jdouble;
+
+typedef jint jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+ jboolean z;
+ jbyte b;
+ jchar c;
+ jshort s;
+ jint i;
+ jlong j;
+ jfloat f;
+ jdouble d;
+ jobject l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+ JNIInvalidRefType = 0,
+ JNILocalRefType = 1,
+ JNIGlobalRefType = 2,
+ JNIWeakGlobalRefType = 3
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK 0 /* success */
+#define JNI_ERR (-1) /* unknown error */
+#define JNI_EDETACHED (-2) /* thread detached from the VM */
+#define JNI_EVERSION (-3) /* JNI version error */
+#define JNI_ENOMEM (-4) /* not enough memory */
+#define JNI_EEXIST (-5) /* VM already created */
+#define JNI_EINVAL (-6) /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+ char *name;
+ char *signature;
+ void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+ void *reserved0;
+ void *reserved1;
+ void *reserved2;
+
+ void *reserved3;
+ jint (JNICALL *GetVersion)(JNIEnv *env);
+
+ jclass (JNICALL *DefineClass)
+ (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+ jsize len);
+ jclass (JNICALL *FindClass)
+ (JNIEnv *env, const char *name);
+
+ jmethodID (JNICALL *FromReflectedMethod)
+ (JNIEnv *env, jobject method);
+ jfieldID (JNICALL *FromReflectedField)
+ (JNIEnv *env, jobject field);
+
+ jobject (JNICALL *ToReflectedMethod)
+ (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+ jclass (JNICALL *GetSuperclass)
+ (JNIEnv *env, jclass sub);
+ jboolean (JNICALL *IsAssignableFrom)
+ (JNIEnv *env, jclass sub, jclass sup);
+
+ jobject (JNICALL *ToReflectedField)
+ (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+ jint (JNICALL *Throw)
+ (JNIEnv *env, jthrowable obj);
+ jint (JNICALL *ThrowNew)
+ (JNIEnv *env, jclass clazz, const char *msg);
+ jthrowable (JNICALL *ExceptionOccurred)
+ (JNIEnv *env);
+ void (JNICALL *ExceptionDescribe)
+ (JNIEnv *env);
+ void (JNICALL *ExceptionClear)
+ (JNIEnv *env);
+ void (JNICALL *FatalError)
+ (JNIEnv *env, const char *msg);
+
+ jint (JNICALL *PushLocalFrame)
+ (JNIEnv *env, jint capacity);
+ jobject (JNICALL *PopLocalFrame)
+ (JNIEnv *env, jobject result);
+
+ jobject (JNICALL *NewGlobalRef)
+ (JNIEnv *env, jobject lobj);
+ void (JNICALL *DeleteGlobalRef)
+ (JNIEnv *env, jobject gref);
+ void (JNICALL *DeleteLocalRef)
+ (JNIEnv *env, jobject obj);
+ jboolean (JNICALL *IsSameObject)
+ (JNIEnv *env, jobject obj1, jobject obj2);
+ jobject (JNICALL *NewLocalRef)
+ (JNIEnv *env, jobject ref);
+ jint (JNICALL *EnsureLocalCapacity)
+ (JNIEnv *env, jint capacity);
+
+ jobject (JNICALL *AllocObject)
+ (JNIEnv *env, jclass clazz);
+ jobject (JNICALL *NewObject)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jobject (JNICALL *NewObjectV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jobject (JNICALL *NewObjectA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jclass (JNICALL *GetObjectClass)
+ (JNIEnv *env, jobject obj);
+ jboolean (JNICALL *IsInstanceOf)
+ (JNIEnv *env, jobject obj, jclass clazz);
+
+ jmethodID (JNICALL *GetMethodID)
+ (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+ jobject (JNICALL *CallObjectMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jobject (JNICALL *CallObjectMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jobject (JNICALL *CallObjectMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+ jboolean (JNICALL *CallBooleanMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jboolean (JNICALL *CallBooleanMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jboolean (JNICALL *CallBooleanMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+ jbyte (JNICALL *CallByteMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jbyte (JNICALL *CallByteMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jbyte (JNICALL *CallByteMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ jchar (JNICALL *CallCharMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jchar (JNICALL *CallCharMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jchar (JNICALL *CallCharMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ jshort (JNICALL *CallShortMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jshort (JNICALL *CallShortMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jshort (JNICALL *CallShortMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ jint (JNICALL *CallIntMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jint (JNICALL *CallIntMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jint (JNICALL *CallIntMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ jlong (JNICALL *CallLongMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jlong (JNICALL *CallLongMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jlong (JNICALL *CallLongMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ jfloat (JNICALL *CallFloatMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jfloat (JNICALL *CallFloatMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jfloat (JNICALL *CallFloatMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ jdouble (JNICALL *CallDoubleMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ jdouble (JNICALL *CallDoubleMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ jdouble (JNICALL *CallDoubleMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+ void (JNICALL *CallVoidMethod)
+ (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+ void (JNICALL *CallVoidMethodV)
+ (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+ void (JNICALL *CallVoidMethodA)
+ (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+ jobject (JNICALL *CallNonvirtualObjectMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jobject (JNICALL *CallNonvirtualObjectMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jobject (JNICALL *CallNonvirtualObjectMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue * args);
+
+ jboolean (JNICALL *CallNonvirtualBooleanMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue * args);
+
+ jbyte (JNICALL *CallNonvirtualByteMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jbyte (JNICALL *CallNonvirtualByteMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jbyte (JNICALL *CallNonvirtualByteMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ jchar (JNICALL *CallNonvirtualCharMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jchar (JNICALL *CallNonvirtualCharMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jchar (JNICALL *CallNonvirtualCharMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ jshort (JNICALL *CallNonvirtualShortMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jshort (JNICALL *CallNonvirtualShortMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jshort (JNICALL *CallNonvirtualShortMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ jint (JNICALL *CallNonvirtualIntMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jint (JNICALL *CallNonvirtualIntMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jint (JNICALL *CallNonvirtualIntMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ jlong (JNICALL *CallNonvirtualLongMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jlong (JNICALL *CallNonvirtualLongMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jlong (JNICALL *CallNonvirtualLongMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ jfloat (JNICALL *CallNonvirtualFloatMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jfloat (JNICALL *CallNonvirtualFloatMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jfloat (JNICALL *CallNonvirtualFloatMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ jdouble (JNICALL *CallNonvirtualDoubleMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue *args);
+
+ void (JNICALL *CallNonvirtualVoidMethod)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+ void (JNICALL *CallNonvirtualVoidMethodV)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ va_list args);
+ void (JNICALL *CallNonvirtualVoidMethodA)
+ (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+ const jvalue * args);
+
+ jfieldID (JNICALL *GetFieldID)
+ (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+ jobject (JNICALL *GetObjectField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jboolean (JNICALL *GetBooleanField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jbyte (JNICALL *GetByteField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jchar (JNICALL *GetCharField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jshort (JNICALL *GetShortField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jint (JNICALL *GetIntField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jlong (JNICALL *GetLongField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jfloat (JNICALL *GetFloatField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+ jdouble (JNICALL *GetDoubleField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+ void (JNICALL *SetObjectField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+ void (JNICALL *SetBooleanField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+ void (JNICALL *SetByteField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+ void (JNICALL *SetCharField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+ void (JNICALL *SetShortField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+ void (JNICALL *SetIntField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+ void (JNICALL *SetLongField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+ void (JNICALL *SetFloatField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+ void (JNICALL *SetDoubleField)
+ (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+ jmethodID (JNICALL *GetStaticMethodID)
+ (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+ jobject (JNICALL *CallStaticObjectMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jobject (JNICALL *CallStaticObjectMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jobject (JNICALL *CallStaticObjectMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jboolean (JNICALL *CallStaticBooleanMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jboolean (JNICALL *CallStaticBooleanMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jboolean (JNICALL *CallStaticBooleanMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jbyte (JNICALL *CallStaticByteMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jbyte (JNICALL *CallStaticByteMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jbyte (JNICALL *CallStaticByteMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jchar (JNICALL *CallStaticCharMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jchar (JNICALL *CallStaticCharMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jchar (JNICALL *CallStaticCharMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jshort (JNICALL *CallStaticShortMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jshort (JNICALL *CallStaticShortMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jshort (JNICALL *CallStaticShortMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jint (JNICALL *CallStaticIntMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jint (JNICALL *CallStaticIntMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jint (JNICALL *CallStaticIntMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jlong (JNICALL *CallStaticLongMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jlong (JNICALL *CallStaticLongMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jlong (JNICALL *CallStaticLongMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jfloat (JNICALL *CallStaticFloatMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jfloat (JNICALL *CallStaticFloatMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jfloat (JNICALL *CallStaticFloatMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ jdouble (JNICALL *CallStaticDoubleMethod)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+ jdouble (JNICALL *CallStaticDoubleMethodV)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+ jdouble (JNICALL *CallStaticDoubleMethodA)
+ (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+ void (JNICALL *CallStaticVoidMethod)
+ (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+ void (JNICALL *CallStaticVoidMethodV)
+ (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+ void (JNICALL *CallStaticVoidMethodA)
+ (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+ jfieldID (JNICALL *GetStaticFieldID)
+ (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+ jobject (JNICALL *GetStaticObjectField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jboolean (JNICALL *GetStaticBooleanField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jbyte (JNICALL *GetStaticByteField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jchar (JNICALL *GetStaticCharField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jshort (JNICALL *GetStaticShortField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jint (JNICALL *GetStaticIntField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jlong (JNICALL *GetStaticLongField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jfloat (JNICALL *GetStaticFloatField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+ jdouble (JNICALL *GetStaticDoubleField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+ void (JNICALL *SetStaticObjectField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+ void (JNICALL *SetStaticBooleanField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+ void (JNICALL *SetStaticByteField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+ void (JNICALL *SetStaticCharField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+ void (JNICALL *SetStaticShortField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+ void (JNICALL *SetStaticIntField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+ void (JNICALL *SetStaticLongField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+ void (JNICALL *SetStaticFloatField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+ void (JNICALL *SetStaticDoubleField)
+ (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+ jstring (JNICALL *NewString)
+ (JNIEnv *env, const jchar *unicode, jsize len);
+ jsize (JNICALL *GetStringLength)
+ (JNIEnv *env, jstring str);
+ const jchar *(JNICALL *GetStringChars)
+ (JNIEnv *env, jstring str, jboolean *isCopy);
+ void (JNICALL *ReleaseStringChars)
+ (JNIEnv *env, jstring str, const jchar *chars);
+
+ jstring (JNICALL *NewStringUTF)
+ (JNIEnv *env, const char *utf);
+ jsize (JNICALL *GetStringUTFLength)
+ (JNIEnv *env, jstring str);
+ const char* (JNICALL *GetStringUTFChars)
+ (JNIEnv *env, jstring str, jboolean *isCopy);
+ void (JNICALL *ReleaseStringUTFChars)
+ (JNIEnv *env, jstring str, const char* chars);
+
+
+ jsize (JNICALL *GetArrayLength)
+ (JNIEnv *env, jarray array);
+
+ jobjectArray (JNICALL *NewObjectArray)
+ (JNIEnv *env, jsize len, jclass clazz, jobject init);
+ jobject (JNICALL *GetObjectArrayElement)
+ (JNIEnv *env, jobjectArray array, jsize index);
+ void (JNICALL *SetObjectArrayElement)
+ (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+ jbooleanArray (JNICALL *NewBooleanArray)
+ (JNIEnv *env, jsize len);
+ jbyteArray (JNICALL *NewByteArray)
+ (JNIEnv *env, jsize len);
+ jcharArray (JNICALL *NewCharArray)
+ (JNIEnv *env, jsize len);
+ jshortArray (JNICALL *NewShortArray)
+ (JNIEnv *env, jsize len);
+ jintArray (JNICALL *NewIntArray)
+ (JNIEnv *env, jsize len);
+ jlongArray (JNICALL *NewLongArray)
+ (JNIEnv *env, jsize len);
+ jfloatArray (JNICALL *NewFloatArray)
+ (JNIEnv *env, jsize len);
+ jdoubleArray (JNICALL *NewDoubleArray)
+ (JNIEnv *env, jsize len);
+
+ jboolean * (JNICALL *GetBooleanArrayElements)
+ (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+ jbyte * (JNICALL *GetByteArrayElements)
+ (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+ jchar * (JNICALL *GetCharArrayElements)
+ (JNIEnv *env, jcharArray array, jboolean *isCopy);
+ jshort * (JNICALL *GetShortArrayElements)
+ (JNIEnv *env, jshortArray array, jboolean *isCopy);
+ jint * (JNICALL *GetIntArrayElements)
+ (JNIEnv *env, jintArray array, jboolean *isCopy);
+ jlong * (JNICALL *GetLongArrayElements)
+ (JNIEnv *env, jlongArray array, jboolean *isCopy);
+ jfloat * (JNICALL *GetFloatArrayElements)
+ (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+ jdouble * (JNICALL *GetDoubleArrayElements)
+ (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+ void (JNICALL *ReleaseBooleanArrayElements)
+ (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+ void (JNICALL *ReleaseByteArrayElements)
+ (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+ void (JNICALL *ReleaseCharArrayElements)
+ (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+ void (JNICALL *ReleaseShortArrayElements)
+ (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+ void (JNICALL *ReleaseIntArrayElements)
+ (JNIEnv *env, jintArray array, jint *elems, jint mode);
+ void (JNICALL *ReleaseLongArrayElements)
+ (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+ void (JNICALL *ReleaseFloatArrayElements)
+ (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+ void (JNICALL *ReleaseDoubleArrayElements)
+ (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+ void (JNICALL *GetBooleanArrayRegion)
+ (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+ void (JNICALL *GetByteArrayRegion)
+ (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+ void (JNICALL *GetCharArrayRegion)
+ (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+ void (JNICALL *GetShortArrayRegion)
+ (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+ void (JNICALL *GetIntArrayRegion)
+ (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+ void (JNICALL *GetLongArrayRegion)
+ (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+ void (JNICALL *GetFloatArrayRegion)
+ (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+ void (JNICALL *GetDoubleArrayRegion)
+ (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+ void (JNICALL *SetBooleanArrayRegion)
+ (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+ void (JNICALL *SetByteArrayRegion)
+ (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+ void (JNICALL *SetCharArrayRegion)
+ (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+ void (JNICALL *SetShortArrayRegion)
+ (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+ void (JNICALL *SetIntArrayRegion)
+ (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+ void (JNICALL *SetLongArrayRegion)
+ (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+ void (JNICALL *SetFloatArrayRegion)
+ (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+ void (JNICALL *SetDoubleArrayRegion)
+ (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+ jint (JNICALL *RegisterNatives)
+ (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+ jint nMethods);
+ jint (JNICALL *UnregisterNatives)
+ (JNIEnv *env, jclass clazz);
+
+ jint (JNICALL *MonitorEnter)
+ (JNIEnv *env, jobject obj);
+ jint (JNICALL *MonitorExit)
+ (JNIEnv *env, jobject obj);
+
+ jint (JNICALL *GetJavaVM)
+ (JNIEnv *env, JavaVM **vm);
+
+ void (JNICALL *GetStringRegion)
+ (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+ void (JNICALL *GetStringUTFRegion)
+ (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+ void * (JNICALL *GetPrimitiveArrayCritical)
+ (JNIEnv *env, jarray array, jboolean *isCopy);
+ void (JNICALL *ReleasePrimitiveArrayCritical)
+ (JNIEnv *env, jarray array, void *carray, jint mode);
+
+ const jchar * (JNICALL *GetStringCritical)
+ (JNIEnv *env, jstring string, jboolean *isCopy);
+ void (JNICALL *ReleaseStringCritical)
+ (JNIEnv *env, jstring string, const jchar *cstring);
+
+ jweak (JNICALL *NewWeakGlobalRef)
+ (JNIEnv *env, jobject obj);
+ void (JNICALL *DeleteWeakGlobalRef)
+ (JNIEnv *env, jweak ref);
+
+ jboolean (JNICALL *ExceptionCheck)
+ (JNIEnv *env);
+
+ jobject (JNICALL *NewDirectByteBuffer)
+ (JNIEnv* env, void* address, jlong capacity);
+ void* (JNICALL *GetDirectBufferAddress)
+ (JNIEnv* env, jobject buf);
+ jlong (JNICALL *GetDirectBufferCapacity)
+ (JNIEnv* env, jobject buf);
+
+ /* New JNI 1.6 Features */
+
+ jobjectRefType (JNICALL *GetObjectRefType)
+ (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ * env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ * (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+ const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+ jint GetVersion() {
+ return functions->GetVersion(this);
+ }
+ jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+ jsize len) {
+ return functions->DefineClass(this, name, loader, buf, len);
+ }
+ jclass FindClass(const char *name) {
+ return functions->FindClass(this, name);
+ }
+ jmethodID FromReflectedMethod(jobject method) {
+ return functions->FromReflectedMethod(this,method);
+ }
+ jfieldID FromReflectedField(jobject field) {
+ return functions->FromReflectedField(this,field);
+ }
+
+ jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+ return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+ }
+
+ jclass GetSuperclass(jclass sub) {
+ return functions->GetSuperclass(this, sub);
+ }
+ jboolean IsAssignableFrom(jclass sub, jclass sup) {
+ return functions->IsAssignableFrom(this, sub, sup);
+ }
+
+ jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+ return functions->ToReflectedField(this,cls,fieldID,isStatic);
+ }
+
+ jint Throw(jthrowable obj) {
+ return functions->Throw(this, obj);
+ }
+ jint ThrowNew(jclass clazz, const char *msg) {
+ return functions->ThrowNew(this, clazz, msg);
+ }
+ jthrowable ExceptionOccurred() {
+ return functions->ExceptionOccurred(this);
+ }
+ void ExceptionDescribe() {
+ functions->ExceptionDescribe(this);
+ }
+ void ExceptionClear() {
+ functions->ExceptionClear(this);
+ }
+ void FatalError(const char *msg) {
+ functions->FatalError(this, msg);
+ }
+
+ jint PushLocalFrame(jint capacity) {
+ return functions->PushLocalFrame(this,capacity);
+ }
+ jobject PopLocalFrame(jobject result) {
+ return functions->PopLocalFrame(this,result);
+ }
+
+ jobject NewGlobalRef(jobject lobj) {
+ return functions->NewGlobalRef(this,lobj);
+ }
+ void DeleteGlobalRef(jobject gref) {
+ functions->DeleteGlobalRef(this,gref);
+ }
+ void DeleteLocalRef(jobject obj) {
+ functions->DeleteLocalRef(this, obj);
+ }
+
+ jboolean IsSameObject(jobject obj1, jobject obj2) {
+ return functions->IsSameObject(this,obj1,obj2);
+ }
+
+ jobject NewLocalRef(jobject ref) {
+ return functions->NewLocalRef(this,ref);
+ }
+ jint EnsureLocalCapacity(jint capacity) {
+ return functions->EnsureLocalCapacity(this,capacity);
+ }
+
+ jobject AllocObject(jclass clazz) {
+ return functions->AllocObject(this,clazz);
+ }
+ jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+ va_list args;
+ jobject result;
+ va_start(args, methodID);
+ result = functions->NewObjectV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jobject NewObjectV(jclass clazz, jmethodID methodID,
+ va_list args) {
+ return functions->NewObjectV(this,clazz,methodID,args);
+ }
+ jobject NewObjectA(jclass clazz, jmethodID methodID,
+ const jvalue *args) {
+ return functions->NewObjectA(this,clazz,methodID,args);
+ }
+
+ jclass GetObjectClass(jobject obj) {
+ return functions->GetObjectClass(this,obj);
+ }
+ jboolean IsInstanceOf(jobject obj, jclass clazz) {
+ return functions->IsInstanceOf(this,obj,clazz);
+ }
+
+ jmethodID GetMethodID(jclass clazz, const char *name,
+ const char *sig) {
+ return functions->GetMethodID(this,clazz,name,sig);
+ }
+
+ jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jobject result;
+ va_start(args,methodID);
+ result = functions->CallObjectMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallObjectMethodV(this,obj,methodID,args);
+ }
+ jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallObjectMethodA(this,obj,methodID,args);
+ }
+
+ jboolean CallBooleanMethod(jobject obj,
+ jmethodID methodID, ...) {
+ va_list args;
+ jboolean result;
+ va_start(args,methodID);
+ result = functions->CallBooleanMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallBooleanMethodV(this,obj,methodID,args);
+ }
+ jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallBooleanMethodA(this,obj,methodID, args);
+ }
+
+ jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jbyte result;
+ va_start(args,methodID);
+ result = functions->CallByteMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallByteMethodV(this,obj,methodID,args);
+ }
+ jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallByteMethodA(this,obj,methodID,args);
+ }
+
+ jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jchar result;
+ va_start(args,methodID);
+ result = functions->CallCharMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jchar CallCharMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallCharMethodV(this,obj,methodID,args);
+ }
+ jchar CallCharMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallCharMethodA(this,obj,methodID,args);
+ }
+
+ jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jshort result;
+ va_start(args,methodID);
+ result = functions->CallShortMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jshort CallShortMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallShortMethodV(this,obj,methodID,args);
+ }
+ jshort CallShortMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallShortMethodA(this,obj,methodID,args);
+ }
+
+ jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jint result;
+ va_start(args,methodID);
+ result = functions->CallIntMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jint CallIntMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallIntMethodV(this,obj,methodID,args);
+ }
+ jint CallIntMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallIntMethodA(this,obj,methodID,args);
+ }
+
+ jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jlong result;
+ va_start(args,methodID);
+ result = functions->CallLongMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jlong CallLongMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallLongMethodV(this,obj,methodID,args);
+ }
+ jlong CallLongMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallLongMethodA(this,obj,methodID,args);
+ }
+
+ jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jfloat result;
+ va_start(args,methodID);
+ result = functions->CallFloatMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallFloatMethodV(this,obj,methodID,args);
+ }
+ jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallFloatMethodA(this,obj,methodID,args);
+ }
+
+ jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ jdouble result;
+ va_start(args,methodID);
+ result = functions->CallDoubleMethodV(this,obj,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ return functions->CallDoubleMethodV(this,obj,methodID,args);
+ }
+ jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallDoubleMethodA(this,obj,methodID,args);
+ }
+
+ void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+ va_list args;
+ va_start(args,methodID);
+ functions->CallVoidMethodV(this,obj,methodID,args);
+ va_end(args);
+ }
+ void CallVoidMethodV(jobject obj, jmethodID methodID,
+ va_list args) {
+ functions->CallVoidMethodV(this,obj,methodID,args);
+ }
+ void CallVoidMethodA(jobject obj, jmethodID methodID,
+ const jvalue * args) {
+ functions->CallVoidMethodA(this,obj,methodID,args);
+ }
+
+ jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jobject result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jboolean result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+ methodID, args);
+ }
+
+ jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jbyte result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jchar result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jshort result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jint result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jlong result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+ jmethodID methodID, const jvalue * args) {
+ return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jfloat result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+ jmethodID methodID,
+ va_list args) {
+ return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+ jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jdouble result;
+ va_start(args,methodID);
+ result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+ methodID,args);
+ va_end(args);
+ return result;
+ }
+ jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+ jmethodID methodID,
+ va_list args) {
+ return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+ methodID,args);
+ }
+ jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+ jmethodID methodID,
+ const jvalue * args) {
+ return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+ methodID,args);
+ }
+
+ void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ va_start(args,methodID);
+ functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+ va_end(args);
+ }
+ void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+ jmethodID methodID,
+ va_list args) {
+ functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+ }
+ void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+ jmethodID methodID,
+ const jvalue * args) {
+ functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+ }
+
+ jfieldID GetFieldID(jclass clazz, const char *name,
+ const char *sig) {
+ return functions->GetFieldID(this,clazz,name,sig);
+ }
+
+ jobject GetObjectField(jobject obj, jfieldID fieldID) {
+ return functions->GetObjectField(this,obj,fieldID);
+ }
+ jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+ return functions->GetBooleanField(this,obj,fieldID);
+ }
+ jbyte GetByteField(jobject obj, jfieldID fieldID) {
+ return functions->GetByteField(this,obj,fieldID);
+ }
+ jchar GetCharField(jobject obj, jfieldID fieldID) {
+ return functions->GetCharField(this,obj,fieldID);
+ }
+ jshort GetShortField(jobject obj, jfieldID fieldID) {
+ return functions->GetShortField(this,obj,fieldID);
+ }
+ jint GetIntField(jobject obj, jfieldID fieldID) {
+ return functions->GetIntField(this,obj,fieldID);
+ }
+ jlong GetLongField(jobject obj, jfieldID fieldID) {
+ return functions->GetLongField(this,obj,fieldID);
+ }
+ jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+ return functions->GetFloatField(this,obj,fieldID);
+ }
+ jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+ return functions->GetDoubleField(this,obj,fieldID);
+ }
+
+ void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+ functions->SetObjectField(this,obj,fieldID,val);
+ }
+ void SetBooleanField(jobject obj, jfieldID fieldID,
+ jboolean val) {
+ functions->SetBooleanField(this,obj,fieldID,val);
+ }
+ void SetByteField(jobject obj, jfieldID fieldID,
+ jbyte val) {
+ functions->SetByteField(this,obj,fieldID,val);
+ }
+ void SetCharField(jobject obj, jfieldID fieldID,
+ jchar val) {
+ functions->SetCharField(this,obj,fieldID,val);
+ }
+ void SetShortField(jobject obj, jfieldID fieldID,
+ jshort val) {
+ functions->SetShortField(this,obj,fieldID,val);
+ }
+ void SetIntField(jobject obj, jfieldID fieldID,
+ jint val) {
+ functions->SetIntField(this,obj,fieldID,val);
+ }
+ void SetLongField(jobject obj, jfieldID fieldID,
+ jlong val) {
+ functions->SetLongField(this,obj,fieldID,val);
+ }
+ void SetFloatField(jobject obj, jfieldID fieldID,
+ jfloat val) {
+ functions->SetFloatField(this,obj,fieldID,val);
+ }
+ void SetDoubleField(jobject obj, jfieldID fieldID,
+ jdouble val) {
+ functions->SetDoubleField(this,obj,fieldID,val);
+ }
+
+ jmethodID GetStaticMethodID(jclass clazz, const char *name,
+ const char *sig) {
+ return functions->GetStaticMethodID(this,clazz,name,sig);
+ }
+
+ jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+ ...) {
+ va_list args;
+ jobject result;
+ va_start(args,methodID);
+ result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+ va_list args) {
+ return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+ }
+ jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+ const jvalue *args) {
+ return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+ }
+
+ jboolean CallStaticBooleanMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jboolean result;
+ va_start(args,methodID);
+ result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jboolean CallStaticBooleanMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+ }
+ jboolean CallStaticBooleanMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+ }
+
+ jbyte CallStaticByteMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jbyte result;
+ va_start(args,methodID);
+ result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jbyte CallStaticByteMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+ }
+ jbyte CallStaticByteMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+ }
+
+ jchar CallStaticCharMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jchar result;
+ va_start(args,methodID);
+ result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jchar CallStaticCharMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+ }
+ jchar CallStaticCharMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+ }
+
+ jshort CallStaticShortMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jshort result;
+ va_start(args,methodID);
+ result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jshort CallStaticShortMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+ }
+ jshort CallStaticShortMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+ }
+
+ jint CallStaticIntMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jint result;
+ va_start(args,methodID);
+ result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jint CallStaticIntMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+ }
+ jint CallStaticIntMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+ }
+
+ jlong CallStaticLongMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jlong result;
+ va_start(args,methodID);
+ result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jlong CallStaticLongMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+ }
+ jlong CallStaticLongMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+ }
+
+ jfloat CallStaticFloatMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jfloat result;
+ va_start(args,methodID);
+ result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jfloat CallStaticFloatMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+ }
+ jfloat CallStaticFloatMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+ }
+
+ jdouble CallStaticDoubleMethod(jclass clazz,
+ jmethodID methodID, ...) {
+ va_list args;
+ jdouble result;
+ va_start(args,methodID);
+ result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+ va_end(args);
+ return result;
+ }
+ jdouble CallStaticDoubleMethodV(jclass clazz,
+ jmethodID methodID, va_list args) {
+ return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+ }
+ jdouble CallStaticDoubleMethodA(jclass clazz,
+ jmethodID methodID, const jvalue *args) {
+ return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+ }
+
+ void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+ va_list args;
+ va_start(args,methodID);
+ functions->CallStaticVoidMethodV(this,cls,methodID,args);
+ va_end(args);
+ }
+ void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+ va_list args) {
+ functions->CallStaticVoidMethodV(this,cls,methodID,args);
+ }
+ void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+ const jvalue * args) {
+ functions->CallStaticVoidMethodA(this,cls,methodID,args);
+ }
+
+ jfieldID GetStaticFieldID(jclass clazz, const char *name,
+ const char *sig) {
+ return functions->GetStaticFieldID(this,clazz,name,sig);
+ }
+ jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticObjectField(this,clazz,fieldID);
+ }
+ jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticBooleanField(this,clazz,fieldID);
+ }
+ jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticByteField(this,clazz,fieldID);
+ }
+ jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticCharField(this,clazz,fieldID);
+ }
+ jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticShortField(this,clazz,fieldID);
+ }
+ jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticIntField(this,clazz,fieldID);
+ }
+ jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticLongField(this,clazz,fieldID);
+ }
+ jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticFloatField(this,clazz,fieldID);
+ }
+ jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+ return functions->GetStaticDoubleField(this,clazz,fieldID);
+ }
+
+ void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+ jobject value) {
+ functions->SetStaticObjectField(this,clazz,fieldID,value);
+ }
+ void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+ jboolean value) {
+ functions->SetStaticBooleanField(this,clazz,fieldID,value);
+ }
+ void SetStaticByteField(jclass clazz, jfieldID fieldID,
+ jbyte value) {
+ functions->SetStaticByteField(this,clazz,fieldID,value);
+ }
+ void SetStaticCharField(jclass clazz, jfieldID fieldID,
+ jchar value) {
+ functions->SetStaticCharField(this,clazz,fieldID,value);
+ }
+ void SetStaticShortField(jclass clazz, jfieldID fieldID,
+ jshort value) {
+ functions->SetStaticShortField(this,clazz,fieldID,value);
+ }
+ void SetStaticIntField(jclass clazz, jfieldID fieldID,
+ jint value) {
+ functions->SetStaticIntField(this,clazz,fieldID,value);
+ }
+ void SetStaticLongField(jclass clazz, jfieldID fieldID,
+ jlong value) {
+ functions->SetStaticLongField(this,clazz,fieldID,value);
+ }
+ void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+ jfloat value) {
+ functions->SetStaticFloatField(this,clazz,fieldID,value);
+ }
+ void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+ jdouble value) {
+ functions->SetStaticDoubleField(this,clazz,fieldID,value);
+ }
+
+ jstring NewString(const jchar *unicode, jsize len) {
+ return functions->NewString(this,unicode,len);
+ }
+ jsize GetStringLength(jstring str) {
+ return functions->GetStringLength(this,str);
+ }
+ const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+ return functions->GetStringChars(this,str,isCopy);
+ }
+ void ReleaseStringChars(jstring str, const jchar *chars) {
+ functions->ReleaseStringChars(this,str,chars);
+ }
+
+ jstring NewStringUTF(const char *utf) {
+ return functions->NewStringUTF(this,utf);
+ }
+ jsize GetStringUTFLength(jstring str) {
+ return functions->GetStringUTFLength(this,str);
+ }
+ const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+ return functions->GetStringUTFChars(this,str,isCopy);
+ }
+ void ReleaseStringUTFChars(jstring str, const char* chars) {
+ functions->ReleaseStringUTFChars(this,str,chars);
+ }
+
+ jsize GetArrayLength(jarray array) {
+ return functions->GetArrayLength(this,array);
+ }
+
+ jobjectArray NewObjectArray(jsize len, jclass clazz,
+ jobject init) {
+ return functions->NewObjectArray(this,len,clazz,init);
+ }
+ jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+ return functions->GetObjectArrayElement(this,array,index);
+ }
+ void SetObjectArrayElement(jobjectArray array, jsize index,
+ jobject val) {
+ functions->SetObjectArrayElement(this,array,index,val);
+ }
+
+ jbooleanArray NewBooleanArray(jsize len) {
+ return functions->NewBooleanArray(this,len);
+ }
+ jbyteArray NewByteArray(jsize len) {
+ return functions->NewByteArray(this,len);
+ }
+ jcharArray NewCharArray(jsize len) {
+ return functions->NewCharArray(this,len);
+ }
+ jshortArray NewShortArray(jsize len) {
+ return functions->NewShortArray(this,len);
+ }
+ jintArray NewIntArray(jsize len) {
+ return functions->NewIntArray(this,len);
+ }
+ jlongArray NewLongArray(jsize len) {
+ return functions->NewLongArray(this,len);
+ }
+ jfloatArray NewFloatArray(jsize len) {
+ return functions->NewFloatArray(this,len);
+ }
+ jdoubleArray NewDoubleArray(jsize len) {
+ return functions->NewDoubleArray(this,len);
+ }
+
+ jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+ return functions->GetBooleanArrayElements(this,array,isCopy);
+ }
+ jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+ return functions->GetByteArrayElements(this,array,isCopy);
+ }
+ jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+ return functions->GetCharArrayElements(this,array,isCopy);
+ }
+ jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+ return functions->GetShortArrayElements(this,array,isCopy);
+ }
+ jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+ return functions->GetIntArrayElements(this,array,isCopy);
+ }
+ jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+ return functions->GetLongArrayElements(this,array,isCopy);
+ }
+ jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+ return functions->GetFloatArrayElements(this,array,isCopy);
+ }
+ jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+ return functions->GetDoubleArrayElements(this,array,isCopy);
+ }
+
+ void ReleaseBooleanArrayElements(jbooleanArray array,
+ jboolean *elems,
+ jint mode) {
+ functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+ }
+ void ReleaseByteArrayElements(jbyteArray array,
+ jbyte *elems,
+ jint mode) {
+ functions->ReleaseByteArrayElements(this,array,elems,mode);
+ }
+ void ReleaseCharArrayElements(jcharArray array,
+ jchar *elems,
+ jint mode) {
+ functions->ReleaseCharArrayElements(this,array,elems,mode);
+ }
+ void ReleaseShortArrayElements(jshortArray array,
+ jshort *elems,
+ jint mode) {
+ functions->ReleaseShortArrayElements(this,array,elems,mode);
+ }
+ void ReleaseIntArrayElements(jintArray array,
+ jint *elems,
+ jint mode) {
+ functions->ReleaseIntArrayElements(this,array,elems,mode);
+ }
+ void ReleaseLongArrayElements(jlongArray array,
+ jlong *elems,
+ jint mode) {
+ functions->ReleaseLongArrayElements(this,array,elems,mode);
+ }
+ void ReleaseFloatArrayElements(jfloatArray array,
+ jfloat *elems,
+ jint mode) {
+ functions->ReleaseFloatArrayElements(this,array,elems,mode);
+ }
+ void ReleaseDoubleArrayElements(jdoubleArray array,
+ jdouble *elems,
+ jint mode) {
+ functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+ }
+
+ void GetBooleanArrayRegion(jbooleanArray array,
+ jsize start, jsize len, jboolean *buf) {
+ functions->GetBooleanArrayRegion(this,array,start,len,buf);
+ }
+ void GetByteArrayRegion(jbyteArray array,
+ jsize start, jsize len, jbyte *buf) {
+ functions->GetByteArrayRegion(this,array,start,len,buf);
+ }
+ void GetCharArrayRegion(jcharArray array,
+ jsize start, jsize len, jchar *buf) {
+ functions->GetCharArrayRegion(this,array,start,len,buf);
+ }
+ void GetShortArrayRegion(jshortArray array,
+ jsize start, jsize len, jshort *buf) {
+ functions->GetShortArrayRegion(this,array,start,len,buf);
+ }
+ void GetIntArrayRegion(jintArray array,
+ jsize start, jsize len, jint *buf) {
+ functions->GetIntArrayRegion(this,array,start,len,buf);
+ }
+ void GetLongArrayRegion(jlongArray array,
+ jsize start, jsize len, jlong *buf) {
+ functions->GetLongArrayRegion(this,array,start,len,buf);
+ }
+ void GetFloatArrayRegion(jfloatArray array,
+ jsize start, jsize len, jfloat *buf) {
+ functions->GetFloatArrayRegion(this,array,start,len,buf);
+ }
+ void GetDoubleArrayRegion(jdoubleArray array,
+ jsize start, jsize len, jdouble *buf) {
+ functions->GetDoubleArrayRegion(this,array,start,len,buf);
+ }
+
+ void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+ const jboolean *buf) {
+ functions->SetBooleanArrayRegion(this,array,start,len,buf);
+ }
+ void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+ const jbyte *buf) {
+ functions->SetByteArrayRegion(this,array,start,len,buf);
+ }
+ void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+ const jchar *buf) {
+ functions->SetCharArrayRegion(this,array,start,len,buf);
+ }
+ void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+ const jshort *buf) {
+ functions->SetShortArrayRegion(this,array,start,len,buf);
+ }
+ void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+ const jint *buf) {
+ functions->SetIntArrayRegion(this,array,start,len,buf);
+ }
+ void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+ const jlong *buf) {
+ functions->SetLongArrayRegion(this,array,start,len,buf);
+ }
+ void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+ const jfloat *buf) {
+ functions->SetFloatArrayRegion(this,array,start,len,buf);
+ }
+ void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+ const jdouble *buf) {
+ functions->SetDoubleArrayRegion(this,array,start,len,buf);
+ }
+
+ jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+ jint nMethods) {
+ return functions->RegisterNatives(this,clazz,methods,nMethods);
+ }
+ jint UnregisterNatives(jclass clazz) {
+ return functions->UnregisterNatives(this,clazz);
+ }
+
+ jint MonitorEnter(jobject obj) {
+ return functions->MonitorEnter(this,obj);
+ }
+ jint MonitorExit(jobject obj) {
+ return functions->MonitorExit(this,obj);
+ }
+
+ jint GetJavaVM(JavaVM **vm) {
+ return functions->GetJavaVM(this,vm);
+ }
+
+ void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+ functions->GetStringRegion(this,str,start,len,buf);
+ }
+ void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+ functions->GetStringUTFRegion(this,str,start,len,buf);
+ }
+
+ void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+ return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+ }
+ void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+ functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+ }
+
+ const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+ return functions->GetStringCritical(this,string,isCopy);
+ }
+ void ReleaseStringCritical(jstring string, const jchar *cstring) {
+ functions->ReleaseStringCritical(this,string,cstring);
+ }
+
+ jweak NewWeakGlobalRef(jobject obj) {
+ return functions->NewWeakGlobalRef(this,obj);
+ }
+ void DeleteWeakGlobalRef(jweak ref) {
+ functions->DeleteWeakGlobalRef(this,ref);
+ }
+
+ jboolean ExceptionCheck() {
+ return functions->ExceptionCheck(this);
+ }
+
+ jobject NewDirectByteBuffer(void* address, jlong capacity) {
+ return functions->NewDirectByteBuffer(this, address, capacity);
+ }
+ void* GetDirectBufferAddress(jobject buf) {
+ return functions->GetDirectBufferAddress(this, buf);
+ }
+ jlong GetDirectBufferCapacity(jobject buf) {
+ return functions->GetDirectBufferCapacity(this, buf);
+ }
+ jobjectRefType GetObjectRefType(jobject obj) {
+ return functions->GetObjectRefType(this, obj);
+ }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+ char *optionString;
+ void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+ jint version;
+
+ jint nOptions;
+ JavaVMOption *options;
+ jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+ jint version;
+
+ char *name;
+ jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+ void *reserved0;
+ void *reserved1;
+ void *reserved2;
+
+ jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+ jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+ jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+ jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+ jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+ const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+ jint DestroyJavaVM() {
+ return functions->DestroyJavaVM(this);
+ }
+ jint AttachCurrentThread(void **penv, void *args) {
+ return functions->AttachCurrentThread(this, penv, args);
+ }
+ jint DetachCurrentThread() {
+ return functions->DetachCurrentThread(this);
+ }
+
+ jint GetEnv(void **penv, jint version) {
+ return functions->GetEnv(this, penv, version);
+ }
+ jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+ return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+ }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
+
+
+
diff --git a/make/stub_includes/jni/jvmti.h b/make/stub_includes/jni/jvmti.h
new file mode 100755
index 000000000..4cb89df17
--- /dev/null
+++ b/make/stub_includes/jni/jvmti.h
@@ -0,0 +1,2504 @@
+#ifdef USE_PRAGMA_IDENT_HDR
+#pragma ident "@(#)jvmtiLib.xsl 1.38 06/08/02 23:22:31 JVM"
+#endif
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+ /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */
+
+
+ /* Include file for the Java(tm) Virtual Machine Tool Interface */
+
+#ifndef _JAVA_JVMTI_H_
+#define _JAVA_JVMTI_H_
+
+#include "jni.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+ JVMTI_VERSION_1 = 0x30010000,
+ JVMTI_VERSION_1_0 = 0x30010000,
+ JVMTI_VERSION_1_1 = 0x30010100,
+
+ JVMTI_VERSION = 0x30000000 + (1 * 0x10000) + (1 * 0x100) + 102 /* version: 1.1.102 */
+};
+
+JNIEXPORT jint JNICALL
+Agent_OnLoad(JavaVM *vm, char *options, void *reserved);
+
+JNIEXPORT jint JNICALL
+Agent_OnAttach(JavaVM* vm, char* options, void* reserved);
+
+JNIEXPORT void JNICALL
+Agent_OnUnload(JavaVM *vm);
+
+ /* Forward declaration of the environment */
+
+struct _jvmtiEnv;
+
+struct jvmtiInterface_1_;
+
+#ifdef __cplusplus
+typedef _jvmtiEnv jvmtiEnv;
+#else
+typedef const struct jvmtiInterface_1_ *jvmtiEnv;
+#endif /* __cplusplus */
+
+/* Derived Base Types */
+
+typedef jobject jthread;
+typedef jobject jthreadGroup;
+typedef jlong jlocation;
+struct _jrawMonitorID;
+typedef struct _jrawMonitorID *jrawMonitorID;
+typedef struct JNINativeInterface_ jniNativeInterface;
+
+ /* Constants */
+
+
+ /* Thread State Flags */
+
+enum {
+ JVMTI_THREAD_STATE_ALIVE = 0x0001,
+ JVMTI_THREAD_STATE_TERMINATED = 0x0002,
+ JVMTI_THREAD_STATE_RUNNABLE = 0x0004,
+ JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 0x0400,
+ JVMTI_THREAD_STATE_WAITING = 0x0080,
+ JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 0x0010,
+ JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 0x0020,
+ JVMTI_THREAD_STATE_SLEEPING = 0x0040,
+ JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 0x0100,
+ JVMTI_THREAD_STATE_PARKED = 0x0200,
+ JVMTI_THREAD_STATE_SUSPENDED = 0x100000,
+ JVMTI_THREAD_STATE_INTERRUPTED = 0x200000,
+ JVMTI_THREAD_STATE_IN_NATIVE = 0x400000,
+ JVMTI_THREAD_STATE_VENDOR_1 = 0x10000000,
+ JVMTI_THREAD_STATE_VENDOR_2 = 0x20000000,
+ JVMTI_THREAD_STATE_VENDOR_3 = 0x40000000
+};
+
+ /* java.lang.Thread.State Conversion Masks */
+
+enum {
+ JVMTI_JAVA_LANG_THREAD_STATE_MASK = JVMTI_THREAD_STATE_TERMINATED | JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT,
+ JVMTI_JAVA_LANG_THREAD_STATE_NEW = 0,
+ JVMTI_JAVA_LANG_THREAD_STATE_TERMINATED = JVMTI_THREAD_STATE_TERMINATED,
+ JVMTI_JAVA_LANG_THREAD_STATE_RUNNABLE = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE,
+ JVMTI_JAVA_LANG_THREAD_STATE_BLOCKED = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER,
+ JVMTI_JAVA_LANG_THREAD_STATE_WAITING = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY,
+ JVMTI_JAVA_LANG_THREAD_STATE_TIMED_WAITING = JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT
+};
+
+ /* Thread Priority Constants */
+
+enum {
+ JVMTI_THREAD_MIN_PRIORITY = 1,
+ JVMTI_THREAD_NORM_PRIORITY = 5,
+ JVMTI_THREAD_MAX_PRIORITY = 10
+};
+
+ /* Heap Filter Flags */
+
+enum {
+ JVMTI_HEAP_FILTER_TAGGED = 0x4,
+ JVMTI_HEAP_FILTER_UNTAGGED = 0x8,
+ JVMTI_HEAP_FILTER_CLASS_TAGGED = 0x10,
+ JVMTI_HEAP_FILTER_CLASS_UNTAGGED = 0x20
+};
+
+ /* Heap Visit Control Flags */
+
+enum {
+ JVMTI_VISIT_OBJECTS = 0x100,
+ JVMTI_VISIT_ABORT = 0x8000
+};
+
+ /* Heap Reference Enumeration */
+
+typedef enum {
+ JVMTI_HEAP_REFERENCE_CLASS = 1,
+ JVMTI_HEAP_REFERENCE_FIELD = 2,
+ JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT = 3,
+ JVMTI_HEAP_REFERENCE_CLASS_LOADER = 4,
+ JVMTI_HEAP_REFERENCE_SIGNERS = 5,
+ JVMTI_HEAP_REFERENCE_PROTECTION_DOMAIN = 6,
+ JVMTI_HEAP_REFERENCE_INTERFACE = 7,
+ JVMTI_HEAP_REFERENCE_STATIC_FIELD = 8,
+ JVMTI_HEAP_REFERENCE_CONSTANT_POOL = 9,
+ JVMTI_HEAP_REFERENCE_SUPERCLASS = 10,
+ JVMTI_HEAP_REFERENCE_JNI_GLOBAL = 21,
+ JVMTI_HEAP_REFERENCE_SYSTEM_CLASS = 22,
+ JVMTI_HEAP_REFERENCE_MONITOR = 23,
+ JVMTI_HEAP_REFERENCE_STACK_LOCAL = 24,
+ JVMTI_HEAP_REFERENCE_JNI_LOCAL = 25,
+ JVMTI_HEAP_REFERENCE_THREAD = 26,
+ JVMTI_HEAP_REFERENCE_OTHER = 27
+} jvmtiHeapReferenceKind;
+
+ /* Primitive Type Enumeration */
+
+typedef enum {
+ JVMTI_PRIMITIVE_TYPE_BOOLEAN = 90,
+ JVMTI_PRIMITIVE_TYPE_BYTE = 66,
+ JVMTI_PRIMITIVE_TYPE_CHAR = 67,
+ JVMTI_PRIMITIVE_TYPE_SHORT = 83,
+ JVMTI_PRIMITIVE_TYPE_INT = 73,
+ JVMTI_PRIMITIVE_TYPE_LONG = 74,
+ JVMTI_PRIMITIVE_TYPE_FLOAT = 70,
+ JVMTI_PRIMITIVE_TYPE_DOUBLE = 68
+} jvmtiPrimitiveType;
+
+ /* Heap Object Filter Enumeration */
+
+typedef enum {
+ JVMTI_HEAP_OBJECT_TAGGED = 1,
+ JVMTI_HEAP_OBJECT_UNTAGGED = 2,
+ JVMTI_HEAP_OBJECT_EITHER = 3
+} jvmtiHeapObjectFilter;
+
+ /* Heap Root Kind Enumeration */
+
+typedef enum {
+ JVMTI_HEAP_ROOT_JNI_GLOBAL = 1,
+ JVMTI_HEAP_ROOT_SYSTEM_CLASS = 2,
+ JVMTI_HEAP_ROOT_MONITOR = 3,
+ JVMTI_HEAP_ROOT_STACK_LOCAL = 4,
+ JVMTI_HEAP_ROOT_JNI_LOCAL = 5,
+ JVMTI_HEAP_ROOT_THREAD = 6,
+ JVMTI_HEAP_ROOT_OTHER = 7
+} jvmtiHeapRootKind;
+
+ /* Object Reference Enumeration */
+
+typedef enum {
+ JVMTI_REFERENCE_CLASS = 1,
+ JVMTI_REFERENCE_FIELD = 2,
+ JVMTI_REFERENCE_ARRAY_ELEMENT = 3,
+ JVMTI_REFERENCE_CLASS_LOADER = 4,
+ JVMTI_REFERENCE_SIGNERS = 5,
+ JVMTI_REFERENCE_PROTECTION_DOMAIN = 6,
+ JVMTI_REFERENCE_INTERFACE = 7,
+ JVMTI_REFERENCE_STATIC_FIELD = 8,
+ JVMTI_REFERENCE_CONSTANT_POOL = 9
+} jvmtiObjectReferenceKind;
+
+ /* Iteration Control Enumeration */
+
+typedef enum {
+ JVMTI_ITERATION_CONTINUE = 1,
+ JVMTI_ITERATION_IGNORE = 2,
+ JVMTI_ITERATION_ABORT = 0
+} jvmtiIterationControl;
+
+ /* Class Status Flags */
+
+enum {
+ JVMTI_CLASS_STATUS_VERIFIED = 1,
+ JVMTI_CLASS_STATUS_PREPARED = 2,
+ JVMTI_CLASS_STATUS_INITIALIZED = 4,
+ JVMTI_CLASS_STATUS_ERROR = 8,
+ JVMTI_CLASS_STATUS_ARRAY = 16,
+ JVMTI_CLASS_STATUS_PRIMITIVE = 32
+};
+
+ /* Event Enable/Disable */
+
+typedef enum {
+ JVMTI_ENABLE = 1,
+ JVMTI_DISABLE = 0
+} jvmtiEventMode;
+
+ /* Extension Function/Event Parameter Types */
+
+typedef enum {
+ JVMTI_TYPE_JBYTE = 101,
+ JVMTI_TYPE_JCHAR = 102,
+ JVMTI_TYPE_JSHORT = 103,
+ JVMTI_TYPE_JINT = 104,
+ JVMTI_TYPE_JLONG = 105,
+ JVMTI_TYPE_JFLOAT = 106,
+ JVMTI_TYPE_JDOUBLE = 107,
+ JVMTI_TYPE_JBOOLEAN = 108,
+ JVMTI_TYPE_JOBJECT = 109,
+ JVMTI_TYPE_JTHREAD = 110,
+ JVMTI_TYPE_JCLASS = 111,
+ JVMTI_TYPE_JVALUE = 112,
+ JVMTI_TYPE_JFIELDID = 113,
+ JVMTI_TYPE_JMETHODID = 114,
+ JVMTI_TYPE_CCHAR = 115,
+ JVMTI_TYPE_CVOID = 116,
+ JVMTI_TYPE_JNIENV = 117
+} jvmtiParamTypes;
+
+ /* Extension Function/Event Parameter Kinds */
+
+typedef enum {
+ JVMTI_KIND_IN = 91,
+ JVMTI_KIND_IN_PTR = 92,
+ JVMTI_KIND_IN_BUF = 93,
+ JVMTI_KIND_ALLOC_BUF = 94,
+ JVMTI_KIND_ALLOC_ALLOC_BUF = 95,
+ JVMTI_KIND_OUT = 96,
+ JVMTI_KIND_OUT_BUF = 97
+} jvmtiParamKind;
+
+ /* Timer Kinds */
+
+typedef enum {
+ JVMTI_TIMER_USER_CPU = 30,
+ JVMTI_TIMER_TOTAL_CPU = 31,
+ JVMTI_TIMER_ELAPSED = 32
+} jvmtiTimerKind;
+
+ /* Phases of execution */
+
+typedef enum {
+ JVMTI_PHASE_ONLOAD = 1,
+ JVMTI_PHASE_PRIMORDIAL = 2,
+ JVMTI_PHASE_START = 6,
+ JVMTI_PHASE_LIVE = 4,
+ JVMTI_PHASE_DEAD = 8
+} jvmtiPhase;
+
+ /* Version Interface Types */
+
+enum {
+ JVMTI_VERSION_INTERFACE_JNI = 0x00000000,
+ JVMTI_VERSION_INTERFACE_JVMTI = 0x30000000
+};
+
+ /* Version Masks */
+
+enum {
+ JVMTI_VERSION_MASK_INTERFACE_TYPE = 0x70000000,
+ JVMTI_VERSION_MASK_MAJOR = 0x0FFF0000,
+ JVMTI_VERSION_MASK_MINOR = 0x0000FF00,
+ JVMTI_VERSION_MASK_MICRO = 0x000000FF
+};
+
+ /* Version Shifts */
+
+enum {
+ JVMTI_VERSION_SHIFT_MAJOR = 16,
+ JVMTI_VERSION_SHIFT_MINOR = 8,
+ JVMTI_VERSION_SHIFT_MICRO = 0
+};
+
+ /* Verbose Flag Enumeration */
+
+typedef enum {
+ JVMTI_VERBOSE_OTHER = 0,
+ JVMTI_VERBOSE_GC = 1,
+ JVMTI_VERBOSE_CLASS = 2,
+ JVMTI_VERBOSE_JNI = 4
+} jvmtiVerboseFlag;
+
+ /* JLocation Format Enumeration */
+
+typedef enum {
+ JVMTI_JLOCATION_JVMBCI = 1,
+ JVMTI_JLOCATION_MACHINEPC = 2,
+ JVMTI_JLOCATION_OTHER = 0
+} jvmtiJlocationFormat;
+
+ /* Resource Exhaustion Flags */
+
+enum {
+ JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR = 0x0001,
+ JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP = 0x0002,
+ JVMTI_RESOURCE_EXHAUSTED_THREADS = 0x0004
+};
+
+ /* Errors */
+
+typedef enum {
+ JVMTI_ERROR_NONE = 0,
+ JVMTI_ERROR_INVALID_THREAD = 10,
+ JVMTI_ERROR_INVALID_THREAD_GROUP = 11,
+ JVMTI_ERROR_INVALID_PRIORITY = 12,
+ JVMTI_ERROR_THREAD_NOT_SUSPENDED = 13,
+ JVMTI_ERROR_THREAD_SUSPENDED = 14,
+ JVMTI_ERROR_THREAD_NOT_ALIVE = 15,
+ JVMTI_ERROR_INVALID_OBJECT = 20,
+ JVMTI_ERROR_INVALID_CLASS = 21,
+ JVMTI_ERROR_CLASS_NOT_PREPARED = 22,
+ JVMTI_ERROR_INVALID_METHODID = 23,
+ JVMTI_ERROR_INVALID_LOCATION = 24,
+ JVMTI_ERROR_INVALID_FIELDID = 25,
+ JVMTI_ERROR_NO_MORE_FRAMES = 31,
+ JVMTI_ERROR_OPAQUE_FRAME = 32,
+ JVMTI_ERROR_TYPE_MISMATCH = 34,
+ JVMTI_ERROR_INVALID_SLOT = 35,
+ JVMTI_ERROR_DUPLICATE = 40,
+ JVMTI_ERROR_NOT_FOUND = 41,
+ JVMTI_ERROR_INVALID_MONITOR = 50,
+ JVMTI_ERROR_NOT_MONITOR_OWNER = 51,
+ JVMTI_ERROR_INTERRUPT = 52,
+ JVMTI_ERROR_INVALID_CLASS_FORMAT = 60,
+ JVMTI_ERROR_CIRCULAR_CLASS_DEFINITION = 61,
+ JVMTI_ERROR_FAILS_VERIFICATION = 62,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_ADDED = 63,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_SCHEMA_CHANGED = 64,
+ JVMTI_ERROR_INVALID_TYPESTATE = 65,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_HIERARCHY_CHANGED = 66,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED = 67,
+ JVMTI_ERROR_UNSUPPORTED_VERSION = 68,
+ JVMTI_ERROR_NAMES_DONT_MATCH = 69,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED = 70,
+ JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED = 71,
+ JVMTI_ERROR_UNMODIFIABLE_CLASS = 79,
+ JVMTI_ERROR_NOT_AVAILABLE = 98,
+ JVMTI_ERROR_MUST_POSSESS_CAPABILITY = 99,
+ JVMTI_ERROR_NULL_POINTER = 100,
+ JVMTI_ERROR_ABSENT_INFORMATION = 101,
+ JVMTI_ERROR_INVALID_EVENT_TYPE = 102,
+ JVMTI_ERROR_ILLEGAL_ARGUMENT = 103,
+ JVMTI_ERROR_NATIVE_METHOD = 104,
+ JVMTI_ERROR_CLASS_LOADER_UNSUPPORTED = 106,
+ JVMTI_ERROR_OUT_OF_MEMORY = 110,
+ JVMTI_ERROR_ACCESS_DENIED = 111,
+ JVMTI_ERROR_WRONG_PHASE = 112,
+ JVMTI_ERROR_INTERNAL = 113,
+ JVMTI_ERROR_UNATTACHED_THREAD = 115,
+ JVMTI_ERROR_INVALID_ENVIRONMENT = 116,
+ JVMTI_ERROR_MAX = 116
+} jvmtiError;
+
+ /* Event IDs */
+
+typedef enum {
+ JVMTI_MIN_EVENT_TYPE_VAL = 50,
+ JVMTI_EVENT_VM_INIT = 50,
+ JVMTI_EVENT_VM_DEATH = 51,
+ JVMTI_EVENT_THREAD_START = 52,
+ JVMTI_EVENT_THREAD_END = 53,
+ JVMTI_EVENT_CLASS_FILE_LOAD_HOOK = 54,
+ JVMTI_EVENT_CLASS_LOAD = 55,
+ JVMTI_EVENT_CLASS_PREPARE = 56,
+ JVMTI_EVENT_VM_START = 57,
+ JVMTI_EVENT_EXCEPTION = 58,
+ JVMTI_EVENT_EXCEPTION_CATCH = 59,
+ JVMTI_EVENT_SINGLE_STEP = 60,
+ JVMTI_EVENT_FRAME_POP = 61,
+ JVMTI_EVENT_BREAKPOINT = 62,
+ JVMTI_EVENT_FIELD_ACCESS = 63,
+ JVMTI_EVENT_FIELD_MODIFICATION = 64,
+ JVMTI_EVENT_METHOD_ENTRY = 65,
+ JVMTI_EVENT_METHOD_EXIT = 66,
+ JVMTI_EVENT_NATIVE_METHOD_BIND = 67,
+ JVMTI_EVENT_COMPILED_METHOD_LOAD = 68,
+ JVMTI_EVENT_COMPILED_METHOD_UNLOAD = 69,
+ JVMTI_EVENT_DYNAMIC_CODE_GENERATED = 70,
+ JVMTI_EVENT_DATA_DUMP_REQUEST = 71,
+ JVMTI_EVENT_MONITOR_WAIT = 73,
+ JVMTI_EVENT_MONITOR_WAITED = 74,
+ JVMTI_EVENT_MONITOR_CONTENDED_ENTER = 75,
+ JVMTI_EVENT_MONITOR_CONTENDED_ENTERED = 76,
+ JVMTI_EVENT_RESOURCE_EXHAUSTED = 80,
+ JVMTI_EVENT_GARBAGE_COLLECTION_START = 81,
+ JVMTI_EVENT_GARBAGE_COLLECTION_FINISH = 82,
+ JVMTI_EVENT_OBJECT_FREE = 83,
+ JVMTI_EVENT_VM_OBJECT_ALLOC = 84,
+ JVMTI_MAX_EVENT_TYPE_VAL = 84
+} jvmtiEvent;
+
+
+ /* Pre-Declarations */
+struct _jvmtiThreadInfo;
+typedef struct _jvmtiThreadInfo jvmtiThreadInfo;
+struct _jvmtiMonitorStackDepthInfo;
+typedef struct _jvmtiMonitorStackDepthInfo jvmtiMonitorStackDepthInfo;
+struct _jvmtiThreadGroupInfo;
+typedef struct _jvmtiThreadGroupInfo jvmtiThreadGroupInfo;
+struct _jvmtiFrameInfo;
+typedef struct _jvmtiFrameInfo jvmtiFrameInfo;
+struct _jvmtiStackInfo;
+typedef struct _jvmtiStackInfo jvmtiStackInfo;
+struct _jvmtiHeapReferenceInfoField;
+typedef struct _jvmtiHeapReferenceInfoField jvmtiHeapReferenceInfoField;
+struct _jvmtiHeapReferenceInfoArray;
+typedef struct _jvmtiHeapReferenceInfoArray jvmtiHeapReferenceInfoArray;
+struct _jvmtiHeapReferenceInfoConstantPool;
+typedef struct _jvmtiHeapReferenceInfoConstantPool jvmtiHeapReferenceInfoConstantPool;
+struct _jvmtiHeapReferenceInfoStackLocal;
+typedef struct _jvmtiHeapReferenceInfoStackLocal jvmtiHeapReferenceInfoStackLocal;
+struct _jvmtiHeapReferenceInfoJniLocal;
+typedef struct _jvmtiHeapReferenceInfoJniLocal jvmtiHeapReferenceInfoJniLocal;
+struct _jvmtiHeapReferenceInfoReserved;
+typedef struct _jvmtiHeapReferenceInfoReserved jvmtiHeapReferenceInfoReserved;
+union _jvmtiHeapReferenceInfo;
+typedef union _jvmtiHeapReferenceInfo jvmtiHeapReferenceInfo;
+struct _jvmtiHeapCallbacks;
+typedef struct _jvmtiHeapCallbacks jvmtiHeapCallbacks;
+struct _jvmtiClassDefinition;
+typedef struct _jvmtiClassDefinition jvmtiClassDefinition;
+struct _jvmtiMonitorUsage;
+typedef struct _jvmtiMonitorUsage jvmtiMonitorUsage;
+struct _jvmtiLineNumberEntry;
+typedef struct _jvmtiLineNumberEntry jvmtiLineNumberEntry;
+struct _jvmtiLocalVariableEntry;
+typedef struct _jvmtiLocalVariableEntry jvmtiLocalVariableEntry;
+struct _jvmtiParamInfo;
+typedef struct _jvmtiParamInfo jvmtiParamInfo;
+struct _jvmtiExtensionFunctionInfo;
+typedef struct _jvmtiExtensionFunctionInfo jvmtiExtensionFunctionInfo;
+struct _jvmtiExtensionEventInfo;
+typedef struct _jvmtiExtensionEventInfo jvmtiExtensionEventInfo;
+struct _jvmtiTimerInfo;
+typedef struct _jvmtiTimerInfo jvmtiTimerInfo;
+struct _jvmtiAddrLocationMap;
+typedef struct _jvmtiAddrLocationMap jvmtiAddrLocationMap;
+
+ /* Function Types */
+
+typedef void (JNICALL *jvmtiStartFunction)
+ (jvmtiEnv* jvmti_env, JNIEnv* jni_env, void* arg);
+
+typedef jint (JNICALL *jvmtiHeapIterationCallback)
+ (jlong class_tag, jlong size, jlong* tag_ptr, jint length, void* user_data);
+
+typedef jint (JNICALL *jvmtiHeapReferenceCallback)
+ (jvmtiHeapReferenceKind reference_kind, const jvmtiHeapReferenceInfo* reference_info, jlong class_tag, jlong referrer_class_tag, jlong size, jlong* tag_ptr, jlong* referrer_tag_ptr, jint length, void* user_data);
+
+typedef jint (JNICALL *jvmtiPrimitiveFieldCallback)
+ (jvmtiHeapReferenceKind kind, const jvmtiHeapReferenceInfo* info, jlong object_class_tag, jlong* object_tag_ptr, jvalue value, jvmtiPrimitiveType value_type, void* user_data);
+
+typedef jint (JNICALL *jvmtiArrayPrimitiveValueCallback)
+ (jlong class_tag, jlong size, jlong* tag_ptr, jint element_count, jvmtiPrimitiveType element_type, const void* elements, void* user_data);
+
+typedef jint (JNICALL *jvmtiStringPrimitiveValueCallback)
+ (jlong class_tag, jlong size, jlong* tag_ptr, const jchar* value, jint value_length, void* user_data);
+
+typedef jint (JNICALL *jvmtiReservedCallback)
+ ();
+
+typedef jvmtiIterationControl (JNICALL *jvmtiHeapObjectCallback)
+ (jlong class_tag, jlong size, jlong* tag_ptr, void* user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiHeapRootCallback)
+ (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong* tag_ptr, void* user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiStackReferenceCallback)
+ (jvmtiHeapRootKind root_kind, jlong class_tag, jlong size, jlong* tag_ptr, jlong thread_tag, jint depth, jmethodID method, jint slot, void* user_data);
+
+typedef jvmtiIterationControl (JNICALL *jvmtiObjectReferenceCallback)
+ (jvmtiObjectReferenceKind reference_kind, jlong class_tag, jlong size, jlong* tag_ptr, jlong referrer_tag, jint referrer_index, void* user_data);
+
+typedef jvmtiError (JNICALL *jvmtiExtensionFunction)
+ (jvmtiEnv* jvmti_env, ...);
+
+typedef void (JNICALL *jvmtiExtensionEvent)
+ (jvmtiEnv* jvmti_env, ...);
+
+
+ /* Structure Types */
+struct _jvmtiThreadInfo {
+ char* name;
+ jint priority;
+ jboolean is_daemon;
+ jthreadGroup thread_group;
+ jobject context_class_loader;
+};
+struct _jvmtiMonitorStackDepthInfo {
+ jobject monitor;
+ jint stack_depth;
+};
+struct _jvmtiThreadGroupInfo {
+ jthreadGroup parent;
+ char* name;
+ jint max_priority;
+ jboolean is_daemon;
+};
+struct _jvmtiFrameInfo {
+ jmethodID method;
+ jlocation location;
+};
+struct _jvmtiStackInfo {
+ jthread thread;
+ jint state;
+ jvmtiFrameInfo* frame_buffer;
+ jint frame_count;
+};
+struct _jvmtiHeapReferenceInfoField {
+ jint index;
+};
+struct _jvmtiHeapReferenceInfoArray {
+ jint index;
+};
+struct _jvmtiHeapReferenceInfoConstantPool {
+ jint index;
+};
+struct _jvmtiHeapReferenceInfoStackLocal {
+ jlong thread_tag;
+ jlong thread_id;
+ jint depth;
+ jmethodID method;
+ jlocation location;
+ jint slot;
+};
+struct _jvmtiHeapReferenceInfoJniLocal {
+ jlong thread_tag;
+ jlong thread_id;
+ jint depth;
+ jmethodID method;
+};
+struct _jvmtiHeapReferenceInfoReserved {
+ jlong reserved1;
+ jlong reserved2;
+ jlong reserved3;
+ jlong reserved4;
+ jlong reserved5;
+ jlong reserved6;
+ jlong reserved7;
+ jlong reserved8;
+};
+union _jvmtiHeapReferenceInfo {
+ jvmtiHeapReferenceInfoField field;
+ jvmtiHeapReferenceInfoArray array;
+ jvmtiHeapReferenceInfoConstantPool constant_pool;
+ jvmtiHeapReferenceInfoStackLocal stack_local;
+ jvmtiHeapReferenceInfoJniLocal jni_local;
+ jvmtiHeapReferenceInfoReserved other;
+};
+struct _jvmtiHeapCallbacks {
+ jvmtiHeapIterationCallback heap_iteration_callback;
+ jvmtiHeapReferenceCallback heap_reference_callback;
+ jvmtiPrimitiveFieldCallback primitive_field_callback;
+ jvmtiArrayPrimitiveValueCallback array_primitive_value_callback;
+ jvmtiStringPrimitiveValueCallback string_primitive_value_callback;
+ jvmtiReservedCallback reserved5;
+ jvmtiReservedCallback reserved6;
+ jvmtiReservedCallback reserved7;
+ jvmtiReservedCallback reserved8;
+ jvmtiReservedCallback reserved9;
+ jvmtiReservedCallback reserved10;
+ jvmtiReservedCallback reserved11;
+ jvmtiReservedCallback reserved12;
+ jvmtiReservedCallback reserved13;
+ jvmtiReservedCallback reserved14;
+ jvmtiReservedCallback reserved15;
+};
+struct _jvmtiClassDefinition {
+ jclass klass;
+ jint class_byte_count;
+ const unsigned char* class_bytes;
+};
+struct _jvmtiMonitorUsage {
+ jthread owner;
+ jint entry_count;
+ jint waiter_count;
+ jthread* waiters;
+ jint notify_waiter_count;
+ jthread* notify_waiters;
+};
+struct _jvmtiLineNumberEntry {
+ jlocation start_location;
+ jint line_number;
+};
+struct _jvmtiLocalVariableEntry {
+ jlocation start_location;
+ jint length;
+ char* name;
+ char* signature;
+ char* generic_signature;
+ jint slot;
+};
+struct _jvmtiParamInfo {
+ char* name;
+ jvmtiParamKind kind;
+ jvmtiParamTypes base_type;
+ jboolean null_ok;
+};
+struct _jvmtiExtensionFunctionInfo {
+ jvmtiExtensionFunction func;
+ char* id;
+ char* short_description;
+ jint param_count;
+ jvmtiParamInfo* params;
+ jint error_count;
+ jvmtiError* errors;
+};
+struct _jvmtiExtensionEventInfo {
+ jint extension_event_index;
+ char* id;
+ char* short_description;
+ jint param_count;
+ jvmtiParamInfo* params;
+};
+struct _jvmtiTimerInfo {
+ jlong max_value;
+ jboolean may_skip_forward;
+ jboolean may_skip_backward;
+ jvmtiTimerKind kind;
+ jlong reserved1;
+ jlong reserved2;
+};
+struct _jvmtiAddrLocationMap {
+ const void* start_address;
+ jlocation location;
+};
+
+typedef struct {
+ unsigned int can_tag_objects : 1;
+ unsigned int can_generate_field_modification_events : 1;
+ unsigned int can_generate_field_access_events : 1;
+ unsigned int can_get_bytecodes : 1;
+ unsigned int can_get_synthetic_attribute : 1;
+ unsigned int can_get_owned_monitor_info : 1;
+ unsigned int can_get_current_contended_monitor : 1;
+ unsigned int can_get_monitor_info : 1;
+ unsigned int can_pop_frame : 1;
+ unsigned int can_redefine_classes : 1;
+ unsigned int can_signal_thread : 1;
+ unsigned int can_get_source_file_name : 1;
+ unsigned int can_get_line_numbers : 1;
+ unsigned int can_get_source_debug_extension : 1;
+ unsigned int can_access_local_variables : 1;
+ unsigned int can_maintain_original_method_order : 1;
+ unsigned int can_generate_single_step_events : 1;
+ unsigned int can_generate_exception_events : 1;
+ unsigned int can_generate_frame_pop_events : 1;
+ unsigned int can_generate_breakpoint_events : 1;
+ unsigned int can_suspend : 1;
+ unsigned int can_redefine_any_class : 1;
+ unsigned int can_get_current_thread_cpu_time : 1;
+ unsigned int can_get_thread_cpu_time : 1;
+ unsigned int can_generate_method_entry_events : 1;
+ unsigned int can_generate_method_exit_events : 1;
+ unsigned int can_generate_all_class_hook_events : 1;
+ unsigned int can_generate_compiled_method_load_events : 1;
+ unsigned int can_generate_monitor_events : 1;
+ unsigned int can_generate_vm_object_alloc_events : 1;
+ unsigned int can_generate_native_method_bind_events : 1;
+ unsigned int can_generate_garbage_collection_events : 1;
+ unsigned int can_generate_object_free_events : 1;
+ unsigned int can_force_early_return : 1;
+ unsigned int can_get_owned_monitor_stack_depth_info : 1;
+ unsigned int can_get_constant_pool : 1;
+ unsigned int can_set_native_method_prefix : 1;
+ unsigned int can_retransform_classes : 1;
+ unsigned int can_retransform_any_class : 1;
+ unsigned int can_generate_resource_exhaustion_heap_events : 1;
+ unsigned int can_generate_resource_exhaustion_threads_events : 1;
+ unsigned int : 7;
+ unsigned int : 16;
+ unsigned int : 16;
+ unsigned int : 16;
+ unsigned int : 16;
+ unsigned int : 16;
+} jvmtiCapabilities;
+
+
+ /* Event Definitions */
+
+typedef void (JNICALL *jvmtiEventReserved)(void);
+
+
+typedef void (JNICALL *jvmtiEventBreakpoint)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jlocation location);
+
+typedef void (JNICALL *jvmtiEventClassFileLoadHook)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jclass class_being_redefined,
+ jobject loader,
+ const char* name,
+ jobject protection_domain,
+ jint class_data_len,
+ const unsigned char* class_data,
+ jint* new_class_data_len,
+ unsigned char** new_class_data);
+
+typedef void (JNICALL *jvmtiEventClassLoad)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jclass klass);
+
+typedef void (JNICALL *jvmtiEventClassPrepare)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jclass klass);
+
+typedef void (JNICALL *jvmtiEventCompiledMethodLoad)
+ (jvmtiEnv *jvmti_env,
+ jmethodID method,
+ jint code_size,
+ const void* code_addr,
+ jint map_length,
+ const jvmtiAddrLocationMap* map,
+ const void* compile_info);
+
+typedef void (JNICALL *jvmtiEventCompiledMethodUnload)
+ (jvmtiEnv *jvmti_env,
+ jmethodID method,
+ const void* code_addr);
+
+typedef void (JNICALL *jvmtiEventDataDumpRequest)
+ (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventDynamicCodeGenerated)
+ (jvmtiEnv *jvmti_env,
+ const char* name,
+ const void* address,
+ jint length);
+
+typedef void (JNICALL *jvmtiEventException)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jlocation location,
+ jobject exception,
+ jmethodID catch_method,
+ jlocation catch_location);
+
+typedef void (JNICALL *jvmtiEventExceptionCatch)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jlocation location,
+ jobject exception);
+
+typedef void (JNICALL *jvmtiEventFieldAccess)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jlocation location,
+ jclass field_klass,
+ jobject object,
+ jfieldID field);
+
+typedef void (JNICALL *jvmtiEventFieldModification)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jlocation location,
+ jclass field_klass,
+ jobject object,
+ jfieldID field,
+ char signature_type,
+ jvalue new_value);
+
+typedef void (JNICALL *jvmtiEventFramePop)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jboolean was_popped_by_exception);
+
+typedef void (JNICALL *jvmtiEventGarbageCollectionFinish)
+ (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventGarbageCollectionStart)
+ (jvmtiEnv *jvmti_env);
+
+typedef void (JNICALL *jvmtiEventMethodEntry)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method);
+
+typedef void (JNICALL *jvmtiEventMethodExit)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jboolean was_popped_by_exception,
+ jvalue return_value);
+
+typedef void (JNICALL *jvmtiEventMonitorContendedEnter)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jobject object);
+
+typedef void (JNICALL *jvmtiEventMonitorContendedEntered)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jobject object);
+
+typedef void (JNICALL *jvmtiEventMonitorWait)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jobject object,
+ jlong timeout);
+
+typedef void (JNICALL *jvmtiEventMonitorWaited)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jobject object,
+ jboolean timed_out);
+
+typedef void (JNICALL *jvmtiEventNativeMethodBind)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ void* address,
+ void** new_address_ptr);
+
+typedef void (JNICALL *jvmtiEventObjectFree)
+ (jvmtiEnv *jvmti_env,
+ jlong tag);
+
+typedef void (JNICALL *jvmtiEventResourceExhausted)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jint flags,
+ const void* reserved,
+ const char* description);
+
+typedef void (JNICALL *jvmtiEventSingleStep)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jmethodID method,
+ jlocation location);
+
+typedef void (JNICALL *jvmtiEventThreadEnd)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread);
+
+typedef void (JNICALL *jvmtiEventThreadStart)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread);
+
+typedef void (JNICALL *jvmtiEventVMDeath)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env);
+
+typedef void (JNICALL *jvmtiEventVMInit)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread);
+
+typedef void (JNICALL *jvmtiEventVMObjectAlloc)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env,
+ jthread thread,
+ jobject object,
+ jclass object_klass,
+ jlong size);
+
+typedef void (JNICALL *jvmtiEventVMStart)
+ (jvmtiEnv *jvmti_env,
+ JNIEnv* jni_env);
+
+ /* Event Callback Structure */
+
+typedef struct {
+ /* 50 : VM Initialization Event */
+ jvmtiEventVMInit VMInit;
+ /* 51 : VM Death Event */
+ jvmtiEventVMDeath VMDeath;
+ /* 52 : Thread Start */
+ jvmtiEventThreadStart ThreadStart;
+ /* 53 : Thread End */
+ jvmtiEventThreadEnd ThreadEnd;
+ /* 54 : Class File Load Hook */
+ jvmtiEventClassFileLoadHook ClassFileLoadHook;
+ /* 55 : Class Load */
+ jvmtiEventClassLoad ClassLoad;
+ /* 56 : Class Prepare */
+ jvmtiEventClassPrepare ClassPrepare;
+ /* 57 : VM Start Event */
+ jvmtiEventVMStart VMStart;
+ /* 58 : Exception */
+ jvmtiEventException Exception;
+ /* 59 : Exception Catch */
+ jvmtiEventExceptionCatch ExceptionCatch;
+ /* 60 : Single Step */
+ jvmtiEventSingleStep SingleStep;
+ /* 61 : Frame Pop */
+ jvmtiEventFramePop FramePop;
+ /* 62 : Breakpoint */
+ jvmtiEventBreakpoint Breakpoint;
+ /* 63 : Field Access */
+ jvmtiEventFieldAccess FieldAccess;
+ /* 64 : Field Modification */
+ jvmtiEventFieldModification FieldModification;
+ /* 65 : Method Entry */
+ jvmtiEventMethodEntry MethodEntry;
+ /* 66 : Method Exit */
+ jvmtiEventMethodExit MethodExit;
+ /* 67 : Native Method Bind */
+ jvmtiEventNativeMethodBind NativeMethodBind;
+ /* 68 : Compiled Method Load */
+ jvmtiEventCompiledMethodLoad CompiledMethodLoad;
+ /* 69 : Compiled Method Unload */
+ jvmtiEventCompiledMethodUnload CompiledMethodUnload;
+ /* 70 : Dynamic Code Generated */
+ jvmtiEventDynamicCodeGenerated DynamicCodeGenerated;
+ /* 71 : Data Dump Request */
+ jvmtiEventDataDumpRequest DataDumpRequest;
+ /* 72 */
+ jvmtiEventReserved reserved72;
+ /* 73 : Monitor Wait */
+ jvmtiEventMonitorWait MonitorWait;
+ /* 74 : Monitor Waited */
+ jvmtiEventMonitorWaited MonitorWaited;
+ /* 75 : Monitor Contended Enter */
+ jvmtiEventMonitorContendedEnter MonitorContendedEnter;
+ /* 76 : Monitor Contended Entered */
+ jvmtiEventMonitorContendedEntered MonitorContendedEntered;
+ /* 77 */
+ jvmtiEventReserved reserved77;
+ /* 78 */
+ jvmtiEventReserved reserved78;
+ /* 79 */
+ jvmtiEventReserved reserved79;
+ /* 80 : Resource Exhausted */
+ jvmtiEventResourceExhausted ResourceExhausted;
+ /* 81 : Garbage Collection Start */
+ jvmtiEventGarbageCollectionStart GarbageCollectionStart;
+ /* 82 : Garbage Collection Finish */
+ jvmtiEventGarbageCollectionFinish GarbageCollectionFinish;
+ /* 83 : Object Free */
+ jvmtiEventObjectFree ObjectFree;
+ /* 84 : VM Object Allocation */
+ jvmtiEventVMObjectAlloc VMObjectAlloc;
+} jvmtiEventCallbacks;
+
+
+ /* Function Interface */
+
+typedef struct jvmtiInterface_1_ {
+
+ /* 1 : RESERVED */
+ void *reserved1;
+
+ /* 2 : Set Event Notification Mode */
+ jvmtiError (JNICALL *SetEventNotificationMode) (jvmtiEnv* env,
+ jvmtiEventMode mode,
+ jvmtiEvent event_type,
+ jthread event_thread,
+ ...);
+
+ /* 3 : RESERVED */
+ void *reserved3;
+
+ /* 4 : Get All Threads */
+ jvmtiError (JNICALL *GetAllThreads) (jvmtiEnv* env,
+ jint* threads_count_ptr,
+ jthread** threads_ptr);
+
+ /* 5 : Suspend Thread */
+ jvmtiError (JNICALL *SuspendThread) (jvmtiEnv* env,
+ jthread thread);
+
+ /* 6 : Resume Thread */
+ jvmtiError (JNICALL *ResumeThread) (jvmtiEnv* env,
+ jthread thread);
+
+ /* 7 : Stop Thread */
+ jvmtiError (JNICALL *StopThread) (jvmtiEnv* env,
+ jthread thread,
+ jobject exception);
+
+ /* 8 : Interrupt Thread */
+ jvmtiError (JNICALL *InterruptThread) (jvmtiEnv* env,
+ jthread thread);
+
+ /* 9 : Get Thread Info */
+ jvmtiError (JNICALL *GetThreadInfo) (jvmtiEnv* env,
+ jthread thread,
+ jvmtiThreadInfo* info_ptr);
+
+ /* 10 : Get Owned Monitor Info */
+ jvmtiError (JNICALL *GetOwnedMonitorInfo) (jvmtiEnv* env,
+ jthread thread,
+ jint* owned_monitor_count_ptr,
+ jobject** owned_monitors_ptr);
+
+ /* 11 : Get Current Contended Monitor */
+ jvmtiError (JNICALL *GetCurrentContendedMonitor) (jvmtiEnv* env,
+ jthread thread,
+ jobject* monitor_ptr);
+
+ /* 12 : Run Agent Thread */
+ jvmtiError (JNICALL *RunAgentThread) (jvmtiEnv* env,
+ jthread thread,
+ jvmtiStartFunction proc,
+ const void* arg,
+ jint priority);
+
+ /* 13 : Get Top Thread Groups */
+ jvmtiError (JNICALL *GetTopThreadGroups) (jvmtiEnv* env,
+ jint* group_count_ptr,
+ jthreadGroup** groups_ptr);
+
+ /* 14 : Get Thread Group Info */
+ jvmtiError (JNICALL *GetThreadGroupInfo) (jvmtiEnv* env,
+ jthreadGroup group,
+ jvmtiThreadGroupInfo* info_ptr);
+
+ /* 15 : Get Thread Group Children */
+ jvmtiError (JNICALL *GetThreadGroupChildren) (jvmtiEnv* env,
+ jthreadGroup group,
+ jint* thread_count_ptr,
+ jthread** threads_ptr,
+ jint* group_count_ptr,
+ jthreadGroup** groups_ptr);
+
+ /* 16 : Get Frame Count */
+ jvmtiError (JNICALL *GetFrameCount) (jvmtiEnv* env,
+ jthread thread,
+ jint* count_ptr);
+
+ /* 17 : Get Thread State */
+ jvmtiError (JNICALL *GetThreadState) (jvmtiEnv* env,
+ jthread thread,
+ jint* thread_state_ptr);
+
+ /* 18 : Get Current Thread */
+ jvmtiError (JNICALL *GetCurrentThread) (jvmtiEnv* env,
+ jthread* thread_ptr);
+
+ /* 19 : Get Frame Location */
+ jvmtiError (JNICALL *GetFrameLocation) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jmethodID* method_ptr,
+ jlocation* location_ptr);
+
+ /* 20 : Notify Frame Pop */
+ jvmtiError (JNICALL *NotifyFramePop) (jvmtiEnv* env,
+ jthread thread,
+ jint depth);
+
+ /* 21 : Get Local Variable - Object */
+ jvmtiError (JNICALL *GetLocalObject) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jobject* value_ptr);
+
+ /* 22 : Get Local Variable - Int */
+ jvmtiError (JNICALL *GetLocalInt) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jint* value_ptr);
+
+ /* 23 : Get Local Variable - Long */
+ jvmtiError (JNICALL *GetLocalLong) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jlong* value_ptr);
+
+ /* 24 : Get Local Variable - Float */
+ jvmtiError (JNICALL *GetLocalFloat) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jfloat* value_ptr);
+
+ /* 25 : Get Local Variable - Double */
+ jvmtiError (JNICALL *GetLocalDouble) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jdouble* value_ptr);
+
+ /* 26 : Set Local Variable - Object */
+ jvmtiError (JNICALL *SetLocalObject) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jobject value);
+
+ /* 27 : Set Local Variable - Int */
+ jvmtiError (JNICALL *SetLocalInt) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jint value);
+
+ /* 28 : Set Local Variable - Long */
+ jvmtiError (JNICALL *SetLocalLong) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jlong value);
+
+ /* 29 : Set Local Variable - Float */
+ jvmtiError (JNICALL *SetLocalFloat) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jfloat value);
+
+ /* 30 : Set Local Variable - Double */
+ jvmtiError (JNICALL *SetLocalDouble) (jvmtiEnv* env,
+ jthread thread,
+ jint depth,
+ jint slot,
+ jdouble value);
+
+ /* 31 : Create Raw Monitor */
+ jvmtiError (JNICALL *CreateRawMonitor) (jvmtiEnv* env,
+ const char* name,
+ jrawMonitorID* monitor_ptr);
+
+ /* 32 : Destroy Raw Monitor */
+ jvmtiError (JNICALL *DestroyRawMonitor) (jvmtiEnv* env,
+ jrawMonitorID monitor);
+
+ /* 33 : Raw Monitor Enter */
+ jvmtiError (JNICALL *RawMonitorEnter) (jvmtiEnv* env,
+ jrawMonitorID monitor);
+
+ /* 34 : Raw Monitor Exit */
+ jvmtiError (JNICALL *RawMonitorExit) (jvmtiEnv* env,
+ jrawMonitorID monitor);
+
+ /* 35 : Raw Monitor Wait */
+ jvmtiError (JNICALL *RawMonitorWait) (jvmtiEnv* env,
+ jrawMonitorID monitor,
+ jlong millis);
+
+ /* 36 : Raw Monitor Notify */
+ jvmtiError (JNICALL *RawMonitorNotify) (jvmtiEnv* env,
+ jrawMonitorID monitor);
+
+ /* 37 : Raw Monitor Notify All */
+ jvmtiError (JNICALL *RawMonitorNotifyAll) (jvmtiEnv* env,
+ jrawMonitorID monitor);
+
+ /* 38 : Set Breakpoint */
+ jvmtiError (JNICALL *SetBreakpoint) (jvmtiEnv* env,
+ jmethodID method,
+ jlocation location);
+
+ /* 39 : Clear Breakpoint */
+ jvmtiError (JNICALL *ClearBreakpoint) (jvmtiEnv* env,
+ jmethodID method,
+ jlocation location);
+
+ /* 40 : RESERVED */
+ void *reserved40;
+
+ /* 41 : Set Field Access Watch */
+ jvmtiError (JNICALL *SetFieldAccessWatch) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field);
+
+ /* 42 : Clear Field Access Watch */
+ jvmtiError (JNICALL *ClearFieldAccessWatch) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field);
+
+ /* 43 : Set Field Modification Watch */
+ jvmtiError (JNICALL *SetFieldModificationWatch) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field);
+
+ /* 44 : Clear Field Modification Watch */
+ jvmtiError (JNICALL *ClearFieldModificationWatch) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field);
+
+ /* 45 : Is Modifiable Class */
+ jvmtiError (JNICALL *IsModifiableClass) (jvmtiEnv* env,
+ jclass klass,
+ jboolean* is_modifiable_class_ptr);
+
+ /* 46 : Allocate */
+ jvmtiError (JNICALL *Allocate) (jvmtiEnv* env,
+ jlong size,
+ unsigned char** mem_ptr);
+
+ /* 47 : Deallocate */
+ jvmtiError (JNICALL *Deallocate) (jvmtiEnv* env,
+ unsigned char* mem);
+
+ /* 48 : Get Class Signature */
+ jvmtiError (JNICALL *GetClassSignature) (jvmtiEnv* env,
+ jclass klass,
+ char** signature_ptr,
+ char** generic_ptr);
+
+ /* 49 : Get Class Status */
+ jvmtiError (JNICALL *GetClassStatus) (jvmtiEnv* env,
+ jclass klass,
+ jint* status_ptr);
+
+ /* 50 : Get Source File Name */
+ jvmtiError (JNICALL *GetSourceFileName) (jvmtiEnv* env,
+ jclass klass,
+ char** source_name_ptr);
+
+ /* 51 : Get Class Modifiers */
+ jvmtiError (JNICALL *GetClassModifiers) (jvmtiEnv* env,
+ jclass klass,
+ jint* modifiers_ptr);
+
+ /* 52 : Get Class Methods */
+ jvmtiError (JNICALL *GetClassMethods) (jvmtiEnv* env,
+ jclass klass,
+ jint* method_count_ptr,
+ jmethodID** methods_ptr);
+
+ /* 53 : Get Class Fields */
+ jvmtiError (JNICALL *GetClassFields) (jvmtiEnv* env,
+ jclass klass,
+ jint* field_count_ptr,
+ jfieldID** fields_ptr);
+
+ /* 54 : Get Implemented Interfaces */
+ jvmtiError (JNICALL *GetImplementedInterfaces) (jvmtiEnv* env,
+ jclass klass,
+ jint* interface_count_ptr,
+ jclass** interfaces_ptr);
+
+ /* 55 : Is Interface */
+ jvmtiError (JNICALL *IsInterface) (jvmtiEnv* env,
+ jclass klass,
+ jboolean* is_interface_ptr);
+
+ /* 56 : Is Array Class */
+ jvmtiError (JNICALL *IsArrayClass) (jvmtiEnv* env,
+ jclass klass,
+ jboolean* is_array_class_ptr);
+
+ /* 57 : Get Class Loader */
+ jvmtiError (JNICALL *GetClassLoader) (jvmtiEnv* env,
+ jclass klass,
+ jobject* classloader_ptr);
+
+ /* 58 : Get Object Hash Code */
+ jvmtiError (JNICALL *GetObjectHashCode) (jvmtiEnv* env,
+ jobject object,
+ jint* hash_code_ptr);
+
+ /* 59 : Get Object Monitor Usage */
+ jvmtiError (JNICALL *GetObjectMonitorUsage) (jvmtiEnv* env,
+ jobject object,
+ jvmtiMonitorUsage* info_ptr);
+
+ /* 60 : Get Field Name (and Signature) */
+ jvmtiError (JNICALL *GetFieldName) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field,
+ char** name_ptr,
+ char** signature_ptr,
+ char** generic_ptr);
+
+ /* 61 : Get Field Declaring Class */
+ jvmtiError (JNICALL *GetFieldDeclaringClass) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field,
+ jclass* declaring_class_ptr);
+
+ /* 62 : Get Field Modifiers */
+ jvmtiError (JNICALL *GetFieldModifiers) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field,
+ jint* modifiers_ptr);
+
+ /* 63 : Is Field Synthetic */
+ jvmtiError (JNICALL *IsFieldSynthetic) (jvmtiEnv* env,
+ jclass klass,
+ jfieldID field,
+ jboolean* is_synthetic_ptr);
+
+ /* 64 : Get Method Name (and Signature) */
+ jvmtiError (JNICALL *GetMethodName) (jvmtiEnv* env,
+ jmethodID method,
+ char** name_ptr,
+ char** signature_ptr,
+ char** generic_ptr);
+
+ /* 65 : Get Method Declaring Class */
+ jvmtiError (JNICALL *GetMethodDeclaringClass) (jvmtiEnv* env,
+ jmethodID method,
+ jclass* declaring_class_ptr);
+
+ /* 66 : Get Method Modifiers */
+ jvmtiError (JNICALL *GetMethodModifiers) (jvmtiEnv* env,
+ jmethodID method,
+ jint* modifiers_ptr);
+
+ /* 67 : RESERVED */
+ void *reserved67;
+
+ /* 68 : Get Max Locals */
+ jvmtiError (JNICALL *GetMaxLocals) (jvmtiEnv* env,
+ jmethodID method,
+ jint* max_ptr);
+
+ /* 69 : Get Arguments Size */
+ jvmtiError (JNICALL *GetArgumentsSize) (jvmtiEnv* env,
+ jmethodID method,
+ jint* size_ptr);
+
+ /* 70 : Get Line Number Table */
+ jvmtiError (JNICALL *GetLineNumberTable) (jvmtiEnv* env,
+ jmethodID method,
+ jint* entry_count_ptr,
+ jvmtiLineNumberEntry** table_ptr);
+
+ /* 71 : Get Method Location */
+ jvmtiError (JNICALL *GetMethodLocation) (jvmtiEnv* env,
+ jmethodID method,
+ jlocation* start_location_ptr,
+ jlocation* end_location_ptr);
+
+ /* 72 : Get Local Variable Table */
+ jvmtiError (JNICALL *GetLocalVariableTable) (jvmtiEnv* env,
+ jmethodID method,
+ jint* entry_count_ptr,
+ jvmtiLocalVariableEntry** table_ptr);
+
+ /* 73 : Set Native Method Prefix */
+ jvmtiError (JNICALL *SetNativeMethodPrefix) (jvmtiEnv* env,
+ const char* prefix);
+
+ /* 74 : Set Native Method Prefixes */
+ jvmtiError (JNICALL *SetNativeMethodPrefixes) (jvmtiEnv* env,
+ jint prefix_count,
+ char** prefixes);
+
+ /* 75 : Get Bytecodes */
+ jvmtiError (JNICALL *GetBytecodes) (jvmtiEnv* env,
+ jmethodID method,
+ jint* bytecode_count_ptr,
+ unsigned char** bytecodes_ptr);
+
+ /* 76 : Is Method Native */
+ jvmtiError (JNICALL *IsMethodNative) (jvmtiEnv* env,
+ jmethodID method,
+ jboolean* is_native_ptr);
+
+ /* 77 : Is Method Synthetic */
+ jvmtiError (JNICALL *IsMethodSynthetic) (jvmtiEnv* env,
+ jmethodID method,
+ jboolean* is_synthetic_ptr);
+
+ /* 78 : Get Loaded Classes */
+ jvmtiError (JNICALL *GetLoadedClasses) (jvmtiEnv* env,
+ jint* class_count_ptr,
+ jclass** classes_ptr);
+
+ /* 79 : Get Classloader Classes */
+ jvmtiError (JNICALL *GetClassLoaderClasses) (jvmtiEnv* env,
+ jobject initiating_loader,
+ jint* class_count_ptr,
+ jclass** classes_ptr);
+
+ /* 80 : Pop Frame */
+ jvmtiError (JNICALL *PopFrame) (jvmtiEnv* env,
+ jthread thread);
+
+ /* 81 : Force Early Return - Object */
+ jvmtiError (JNICALL *ForceEarlyReturnObject) (jvmtiEnv* env,
+ jthread thread,
+ jobject value);
+
+ /* 82 : Force Early Return - Int */
+ jvmtiError (JNICALL *ForceEarlyReturnInt) (jvmtiEnv* env,
+ jthread thread,
+ jint value);
+
+ /* 83 : Force Early Return - Long */
+ jvmtiError (JNICALL *ForceEarlyReturnLong) (jvmtiEnv* env,
+ jthread thread,
+ jlong value);
+
+ /* 84 : Force Early Return - Float */
+ jvmtiError (JNICALL *ForceEarlyReturnFloat) (jvmtiEnv* env,
+ jthread thread,
+ jfloat value);
+
+ /* 85 : Force Early Return - Double */
+ jvmtiError (JNICALL *ForceEarlyReturnDouble) (jvmtiEnv* env,
+ jthread thread,
+ jdouble value);
+
+ /* 86 : Force Early Return - Void */
+ jvmtiError (JNICALL *ForceEarlyReturnVoid) (jvmtiEnv* env,
+ jthread thread);
+
+ /* 87 : Redefine Classes */
+ jvmtiError (JNICALL *RedefineClasses) (jvmtiEnv* env,
+ jint class_count,
+ const jvmtiClassDefinition* class_definitions);
+
+ /* 88 : Get Version Number */
+ jvmtiError (JNICALL *GetVersionNumber) (jvmtiEnv* env,
+ jint* version_ptr);
+
+ /* 89 : Get Capabilities */
+ jvmtiError (JNICALL *GetCapabilities) (jvmtiEnv* env,
+ jvmtiCapabilities* capabilities_ptr);
+
+ /* 90 : Get Source Debug Extension */
+ jvmtiError (JNICALL *GetSourceDebugExtension) (jvmtiEnv* env,
+ jclass klass,
+ char** source_debug_extension_ptr);
+
+ /* 91 : Is Method Obsolete */
+ jvmtiError (JNICALL *IsMethodObsolete) (jvmtiEnv* env,
+ jmethodID method,
+ jboolean* is_obsolete_ptr);
+
+ /* 92 : Suspend Thread List */
+ jvmtiError (JNICALL *SuspendThreadList) (jvmtiEnv* env,
+ jint request_count,
+ const jthread* request_list,
+ jvmtiError* results);
+
+ /* 93 : Resume Thread List */
+ jvmtiError (JNICALL *ResumeThreadList) (jvmtiEnv* env,
+ jint request_count,
+ const jthread* request_list,
+ jvmtiError* results);
+
+ /* 94 : RESERVED */
+ void *reserved94;
+
+ /* 95 : RESERVED */
+ void *reserved95;
+
+ /* 96 : RESERVED */
+ void *reserved96;
+
+ /* 97 : RESERVED */
+ void *reserved97;
+
+ /* 98 : RESERVED */
+ void *reserved98;
+
+ /* 99 : RESERVED */
+ void *reserved99;
+
+ /* 100 : Get All Stack Traces */
+ jvmtiError (JNICALL *GetAllStackTraces) (jvmtiEnv* env,
+ jint max_frame_count,
+ jvmtiStackInfo** stack_info_ptr,
+ jint* thread_count_ptr);
+
+ /* 101 : Get Thread List Stack Traces */
+ jvmtiError (JNICALL *GetThreadListStackTraces) (jvmtiEnv* env,
+ jint thread_count,
+ const jthread* thread_list,
+ jint max_frame_count,
+ jvmtiStackInfo** stack_info_ptr);
+
+ /* 102 : Get Thread Local Storage */
+ jvmtiError (JNICALL *GetThreadLocalStorage) (jvmtiEnv* env,
+ jthread thread,
+ void** data_ptr);
+
+ /* 103 : Set Thread Local Storage */
+ jvmtiError (JNICALL *SetThreadLocalStorage) (jvmtiEnv* env,
+ jthread thread,
+ const void* data);
+
+ /* 104 : Get Stack Trace */
+ jvmtiError (JNICALL *GetStackTrace) (jvmtiEnv* env,
+ jthread thread,
+ jint start_depth,
+ jint max_frame_count,
+ jvmtiFrameInfo* frame_buffer,
+ jint* count_ptr);
+
+ /* 105 : RESERVED */
+ void *reserved105;
+
+ /* 106 : Get Tag */
+ jvmtiError (JNICALL *GetTag) (jvmtiEnv* env,
+ jobject object,
+ jlong* tag_ptr);
+
+ /* 107 : Set Tag */
+ jvmtiError (JNICALL *SetTag) (jvmtiEnv* env,
+ jobject object,
+ jlong tag);
+
+ /* 108 : Force Garbage Collection */
+ jvmtiError (JNICALL *ForceGarbageCollection) (jvmtiEnv* env);
+
+ /* 109 : Iterate Over Objects Reachable From Object */
+ jvmtiError (JNICALL *IterateOverObjectsReachableFromObject) (jvmtiEnv* env,
+ jobject object,
+ jvmtiObjectReferenceCallback object_reference_callback,
+ const void* user_data);
+
+ /* 110 : Iterate Over Reachable Objects */
+ jvmtiError (JNICALL *IterateOverReachableObjects) (jvmtiEnv* env,
+ jvmtiHeapRootCallback heap_root_callback,
+ jvmtiStackReferenceCallback stack_ref_callback,
+ jvmtiObjectReferenceCallback object_ref_callback,
+ const void* user_data);
+
+ /* 111 : Iterate Over Heap */
+ jvmtiError (JNICALL *IterateOverHeap) (jvmtiEnv* env,
+ jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ const void* user_data);
+
+ /* 112 : Iterate Over Instances Of Class */
+ jvmtiError (JNICALL *IterateOverInstancesOfClass) (jvmtiEnv* env,
+ jclass klass,
+ jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ const void* user_data);
+
+ /* 113 : RESERVED */
+ void *reserved113;
+
+ /* 114 : Get Objects With Tags */
+ jvmtiError (JNICALL *GetObjectsWithTags) (jvmtiEnv* env,
+ jint tag_count,
+ const jlong* tags,
+ jint* count_ptr,
+ jobject** object_result_ptr,
+ jlong** tag_result_ptr);
+
+ /* 115 : Follow References */
+ jvmtiError (JNICALL *FollowReferences) (jvmtiEnv* env,
+ jint heap_filter,
+ jclass klass,
+ jobject initial_object,
+ const jvmtiHeapCallbacks* callbacks,
+ const void* user_data);
+
+ /* 116 : Iterate Through Heap */
+ jvmtiError (JNICALL *IterateThroughHeap) (jvmtiEnv* env,
+ jint heap_filter,
+ jclass klass,
+ const jvmtiHeapCallbacks* callbacks,
+ const void* user_data);
+
+ /* 117 : RESERVED */
+ void *reserved117;
+
+ /* 118 : RESERVED */
+ void *reserved118;
+
+ /* 119 : RESERVED */
+ void *reserved119;
+
+ /* 120 : Set JNI Function Table */
+ jvmtiError (JNICALL *SetJNIFunctionTable) (jvmtiEnv* env,
+ const jniNativeInterface* function_table);
+
+ /* 121 : Get JNI Function Table */
+ jvmtiError (JNICALL *GetJNIFunctionTable) (jvmtiEnv* env,
+ jniNativeInterface** function_table);
+
+ /* 122 : Set Event Callbacks */
+ jvmtiError (JNICALL *SetEventCallbacks) (jvmtiEnv* env,
+ const jvmtiEventCallbacks* callbacks,
+ jint size_of_callbacks);
+
+ /* 123 : Generate Events */
+ jvmtiError (JNICALL *GenerateEvents) (jvmtiEnv* env,
+ jvmtiEvent event_type);
+
+ /* 124 : Get Extension Functions */
+ jvmtiError (JNICALL *GetExtensionFunctions) (jvmtiEnv* env,
+ jint* extension_count_ptr,
+ jvmtiExtensionFunctionInfo** extensions);
+
+ /* 125 : Get Extension Events */
+ jvmtiError (JNICALL *GetExtensionEvents) (jvmtiEnv* env,
+ jint* extension_count_ptr,
+ jvmtiExtensionEventInfo** extensions);
+
+ /* 126 : Set Extension Event Callback */
+ jvmtiError (JNICALL *SetExtensionEventCallback) (jvmtiEnv* env,
+ jint extension_event_index,
+ jvmtiExtensionEvent callback);
+
+ /* 127 : Dispose Environment */
+ jvmtiError (JNICALL *DisposeEnvironment) (jvmtiEnv* env);
+
+ /* 128 : Get Error Name */
+ jvmtiError (JNICALL *GetErrorName) (jvmtiEnv* env,
+ jvmtiError error,
+ char** name_ptr);
+
+ /* 129 : Get JLocation Format */
+ jvmtiError (JNICALL *GetJLocationFormat) (jvmtiEnv* env,
+ jvmtiJlocationFormat* format_ptr);
+
+ /* 130 : Get System Properties */
+ jvmtiError (JNICALL *GetSystemProperties) (jvmtiEnv* env,
+ jint* count_ptr,
+ char*** property_ptr);
+
+ /* 131 : Get System Property */
+ jvmtiError (JNICALL *GetSystemProperty) (jvmtiEnv* env,
+ const char* property,
+ char** value_ptr);
+
+ /* 132 : Set System Property */
+ jvmtiError (JNICALL *SetSystemProperty) (jvmtiEnv* env,
+ const char* property,
+ const char* value);
+
+ /* 133 : Get Phase */
+ jvmtiError (JNICALL *GetPhase) (jvmtiEnv* env,
+ jvmtiPhase* phase_ptr);
+
+ /* 134 : Get Current Thread CPU Timer Information */
+ jvmtiError (JNICALL *GetCurrentThreadCpuTimerInfo) (jvmtiEnv* env,
+ jvmtiTimerInfo* info_ptr);
+
+ /* 135 : Get Current Thread CPU Time */
+ jvmtiError (JNICALL *GetCurrentThreadCpuTime) (jvmtiEnv* env,
+ jlong* nanos_ptr);
+
+ /* 136 : Get Thread CPU Timer Information */
+ jvmtiError (JNICALL *GetThreadCpuTimerInfo) (jvmtiEnv* env,
+ jvmtiTimerInfo* info_ptr);
+
+ /* 137 : Get Thread CPU Time */
+ jvmtiError (JNICALL *GetThreadCpuTime) (jvmtiEnv* env,
+ jthread thread,
+ jlong* nanos_ptr);
+
+ /* 138 : Get Timer Information */
+ jvmtiError (JNICALL *GetTimerInfo) (jvmtiEnv* env,
+ jvmtiTimerInfo* info_ptr);
+
+ /* 139 : Get Time */
+ jvmtiError (JNICALL *GetTime) (jvmtiEnv* env,
+ jlong* nanos_ptr);
+
+ /* 140 : Get Potential Capabilities */
+ jvmtiError (JNICALL *GetPotentialCapabilities) (jvmtiEnv* env,
+ jvmtiCapabilities* capabilities_ptr);
+
+ /* 141 : RESERVED */
+ void *reserved141;
+
+ /* 142 : Add Capabilities */
+ jvmtiError (JNICALL *AddCapabilities) (jvmtiEnv* env,
+ const jvmtiCapabilities* capabilities_ptr);
+
+ /* 143 : Relinquish Capabilities */
+ jvmtiError (JNICALL *RelinquishCapabilities) (jvmtiEnv* env,
+ const jvmtiCapabilities* capabilities_ptr);
+
+ /* 144 : Get Available Processors */
+ jvmtiError (JNICALL *GetAvailableProcessors) (jvmtiEnv* env,
+ jint* processor_count_ptr);
+
+ /* 145 : Get Class Version Numbers */
+ jvmtiError (JNICALL *GetClassVersionNumbers) (jvmtiEnv* env,
+ jclass klass,
+ jint* minor_version_ptr,
+ jint* major_version_ptr);
+
+ /* 146 : Get Constant Pool */
+ jvmtiError (JNICALL *GetConstantPool) (jvmtiEnv* env,
+ jclass klass,
+ jint* constant_pool_count_ptr,
+ jint* constant_pool_byte_count_ptr,
+ unsigned char** constant_pool_bytes_ptr);
+
+ /* 147 : Get Environment Local Storage */
+ jvmtiError (JNICALL *GetEnvironmentLocalStorage) (jvmtiEnv* env,
+ void** data_ptr);
+
+ /* 148 : Set Environment Local Storage */
+ jvmtiError (JNICALL *SetEnvironmentLocalStorage) (jvmtiEnv* env,
+ const void* data);
+
+ /* 149 : Add To Bootstrap Class Loader Search */
+ jvmtiError (JNICALL *AddToBootstrapClassLoaderSearch) (jvmtiEnv* env,
+ const char* segment);
+
+ /* 150 : Set Verbose Flag */
+ jvmtiError (JNICALL *SetVerboseFlag) (jvmtiEnv* env,
+ jvmtiVerboseFlag flag,
+ jboolean value);
+
+ /* 151 : Add To System Class Loader Search */
+ jvmtiError (JNICALL *AddToSystemClassLoaderSearch) (jvmtiEnv* env,
+ const char* segment);
+
+ /* 152 : Retransform Classes */
+ jvmtiError (JNICALL *RetransformClasses) (jvmtiEnv* env,
+ jint class_count,
+ const jclass* classes);
+
+ /* 153 : Get Owned Monitor Stack Depth Info */
+ jvmtiError (JNICALL *GetOwnedMonitorStackDepthInfo) (jvmtiEnv* env,
+ jthread thread,
+ jint* monitor_info_count_ptr,
+ jvmtiMonitorStackDepthInfo** monitor_info_ptr);
+
+ /* 154 : Get Object Size */
+ jvmtiError (JNICALL *GetObjectSize) (jvmtiEnv* env,
+ jobject object,
+ jlong* size_ptr);
+
+} jvmtiInterface_1;
+
+struct _jvmtiEnv {
+ const struct jvmtiInterface_1_ *functions;
+#ifdef __cplusplus
+
+
+ jvmtiError Allocate(jlong size,
+ unsigned char** mem_ptr) {
+ return functions->Allocate(this, size, mem_ptr);
+ }
+
+ jvmtiError Deallocate(unsigned char* mem) {
+ return functions->Deallocate(this, mem);
+ }
+
+ jvmtiError GetThreadState(jthread thread,
+ jint* thread_state_ptr) {
+ return functions->GetThreadState(this, thread, thread_state_ptr);
+ }
+
+ jvmtiError GetCurrentThread(jthread* thread_ptr) {
+ return functions->GetCurrentThread(this, thread_ptr);
+ }
+
+ jvmtiError GetAllThreads(jint* threads_count_ptr,
+ jthread** threads_ptr) {
+ return functions->GetAllThreads(this, threads_count_ptr, threads_ptr);
+ }
+
+ jvmtiError SuspendThread(jthread thread) {
+ return functions->SuspendThread(this, thread);
+ }
+
+ jvmtiError SuspendThreadList(jint request_count,
+ const jthread* request_list,
+ jvmtiError* results) {
+ return functions->SuspendThreadList(this, request_count, request_list, results);
+ }
+
+ jvmtiError ResumeThread(jthread thread) {
+ return functions->ResumeThread(this, thread);
+ }
+
+ jvmtiError ResumeThreadList(jint request_count,
+ const jthread* request_list,
+ jvmtiError* results) {
+ return functions->ResumeThreadList(this, request_count, request_list, results);
+ }
+
+ jvmtiError StopThread(jthread thread,
+ jobject exception) {
+ return functions->StopThread(this, thread, exception);
+ }
+
+ jvmtiError InterruptThread(jthread thread) {
+ return functions->InterruptThread(this, thread);
+ }
+
+ jvmtiError GetThreadInfo(jthread thread,
+ jvmtiThreadInfo* info_ptr) {
+ return functions->GetThreadInfo(this, thread, info_ptr);
+ }
+
+ jvmtiError GetOwnedMonitorInfo(jthread thread,
+ jint* owned_monitor_count_ptr,
+ jobject** owned_monitors_ptr) {
+ return functions->GetOwnedMonitorInfo(this, thread, owned_monitor_count_ptr, owned_monitors_ptr);
+ }
+
+ jvmtiError GetOwnedMonitorStackDepthInfo(jthread thread,
+ jint* monitor_info_count_ptr,
+ jvmtiMonitorStackDepthInfo** monitor_info_ptr) {
+ return functions->GetOwnedMonitorStackDepthInfo(this, thread, monitor_info_count_ptr, monitor_info_ptr);
+ }
+
+ jvmtiError GetCurrentContendedMonitor(jthread thread,
+ jobject* monitor_ptr) {
+ return functions->GetCurrentContendedMonitor(this, thread, monitor_ptr);
+ }
+
+ jvmtiError RunAgentThread(jthread thread,
+ jvmtiStartFunction proc,
+ const void* arg,
+ jint priority) {
+ return functions->RunAgentThread(this, thread, proc, arg, priority);
+ }
+
+ jvmtiError SetThreadLocalStorage(jthread thread,
+ const void* data) {
+ return functions->SetThreadLocalStorage(this, thread, data);
+ }
+
+ jvmtiError GetThreadLocalStorage(jthread thread,
+ void** data_ptr) {
+ return functions->GetThreadLocalStorage(this, thread, data_ptr);
+ }
+
+ jvmtiError GetTopThreadGroups(jint* group_count_ptr,
+ jthreadGroup** groups_ptr) {
+ return functions->GetTopThreadGroups(this, group_count_ptr, groups_ptr);
+ }
+
+ jvmtiError GetThreadGroupInfo(jthreadGroup group,
+ jvmtiThreadGroupInfo* info_ptr) {
+ return functions->GetThreadGroupInfo(this, group, info_ptr);
+ }
+
+ jvmtiError GetThreadGroupChildren(jthreadGroup group,
+ jint* thread_count_ptr,
+ jthread** threads_ptr,
+ jint* group_count_ptr,
+ jthreadGroup** groups_ptr) {
+ return functions->GetThreadGroupChildren(this, group, thread_count_ptr, threads_ptr, group_count_ptr, groups_ptr);
+ }
+
+ jvmtiError GetStackTrace(jthread thread,
+ jint start_depth,
+ jint max_frame_count,
+ jvmtiFrameInfo* frame_buffer,
+ jint* count_ptr) {
+ return functions->GetStackTrace(this, thread, start_depth, max_frame_count, frame_buffer, count_ptr);
+ }
+
+ jvmtiError GetAllStackTraces(jint max_frame_count,
+ jvmtiStackInfo** stack_info_ptr,
+ jint* thread_count_ptr) {
+ return functions->GetAllStackTraces(this, max_frame_count, stack_info_ptr, thread_count_ptr);
+ }
+
+ jvmtiError GetThreadListStackTraces(jint thread_count,
+ const jthread* thread_list,
+ jint max_frame_count,
+ jvmtiStackInfo** stack_info_ptr) {
+ return functions->GetThreadListStackTraces(this, thread_count, thread_list, max_frame_count, stack_info_ptr);
+ }
+
+ jvmtiError GetFrameCount(jthread thread,
+ jint* count_ptr) {
+ return functions->GetFrameCount(this, thread, count_ptr);
+ }
+
+ jvmtiError PopFrame(jthread thread) {
+ return functions->PopFrame(this, thread);
+ }
+
+ jvmtiError GetFrameLocation(jthread thread,
+ jint depth,
+ jmethodID* method_ptr,
+ jlocation* location_ptr) {
+ return functions->GetFrameLocation(this, thread, depth, method_ptr, location_ptr);
+ }
+
+ jvmtiError NotifyFramePop(jthread thread,
+ jint depth) {
+ return functions->NotifyFramePop(this, thread, depth);
+ }
+
+ jvmtiError ForceEarlyReturnObject(jthread thread,
+ jobject value) {
+ return functions->ForceEarlyReturnObject(this, thread, value);
+ }
+
+ jvmtiError ForceEarlyReturnInt(jthread thread,
+ jint value) {
+ return functions->ForceEarlyReturnInt(this, thread, value);
+ }
+
+ jvmtiError ForceEarlyReturnLong(jthread thread,
+ jlong value) {
+ return functions->ForceEarlyReturnLong(this, thread, value);
+ }
+
+ jvmtiError ForceEarlyReturnFloat(jthread thread,
+ jfloat value) {
+ return functions->ForceEarlyReturnFloat(this, thread, value);
+ }
+
+ jvmtiError ForceEarlyReturnDouble(jthread thread,
+ jdouble value) {
+ return functions->ForceEarlyReturnDouble(this, thread, value);
+ }
+
+ jvmtiError ForceEarlyReturnVoid(jthread thread) {
+ return functions->ForceEarlyReturnVoid(this, thread);
+ }
+
+ jvmtiError FollowReferences(jint heap_filter,
+ jclass klass,
+ jobject initial_object,
+ const jvmtiHeapCallbacks* callbacks,
+ const void* user_data) {
+ return functions->FollowReferences(this, heap_filter, klass, initial_object, callbacks, user_data);
+ }
+
+ jvmtiError IterateThroughHeap(jint heap_filter,
+ jclass klass,
+ const jvmtiHeapCallbacks* callbacks,
+ const void* user_data) {
+ return functions->IterateThroughHeap(this, heap_filter, klass, callbacks, user_data);
+ }
+
+ jvmtiError GetTag(jobject object,
+ jlong* tag_ptr) {
+ return functions->GetTag(this, object, tag_ptr);
+ }
+
+ jvmtiError SetTag(jobject object,
+ jlong tag) {
+ return functions->SetTag(this, object, tag);
+ }
+
+ jvmtiError GetObjectsWithTags(jint tag_count,
+ const jlong* tags,
+ jint* count_ptr,
+ jobject** object_result_ptr,
+ jlong** tag_result_ptr) {
+ return functions->GetObjectsWithTags(this, tag_count, tags, count_ptr, object_result_ptr, tag_result_ptr);
+ }
+
+ jvmtiError ForceGarbageCollection() {
+ return functions->ForceGarbageCollection(this);
+ }
+
+ jvmtiError IterateOverObjectsReachableFromObject(jobject object,
+ jvmtiObjectReferenceCallback object_reference_callback,
+ const void* user_data) {
+ return functions->IterateOverObjectsReachableFromObject(this, object, object_reference_callback, user_data);
+ }
+
+ jvmtiError IterateOverReachableObjects(jvmtiHeapRootCallback heap_root_callback,
+ jvmtiStackReferenceCallback stack_ref_callback,
+ jvmtiObjectReferenceCallback object_ref_callback,
+ const void* user_data) {
+ return functions->IterateOverReachableObjects(this, heap_root_callback, stack_ref_callback, object_ref_callback, user_data);
+ }
+
+ jvmtiError IterateOverHeap(jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ const void* user_data) {
+ return functions->IterateOverHeap(this, object_filter, heap_object_callback, user_data);
+ }
+
+ jvmtiError IterateOverInstancesOfClass(jclass klass,
+ jvmtiHeapObjectFilter object_filter,
+ jvmtiHeapObjectCallback heap_object_callback,
+ const void* user_data) {
+ return functions->IterateOverInstancesOfClass(this, klass, object_filter, heap_object_callback, user_data);
+ }
+
+ jvmtiError GetLocalObject(jthread thread,
+ jint depth,
+ jint slot,
+ jobject* value_ptr) {
+ return functions->GetLocalObject(this, thread, depth, slot, value_ptr);
+ }
+
+ jvmtiError GetLocalInt(jthread thread,
+ jint depth,
+ jint slot,
+ jint* value_ptr) {
+ return functions->GetLocalInt(this, thread, depth, slot, value_ptr);
+ }
+
+ jvmtiError GetLocalLong(jthread thread,
+ jint depth,
+ jint slot,
+ jlong* value_ptr) {
+ return functions->GetLocalLong(this, thread, depth, slot, value_ptr);
+ }
+
+ jvmtiError GetLocalFloat(jthread thread,
+ jint depth,
+ jint slot,
+ jfloat* value_ptr) {
+ return functions->GetLocalFloat(this, thread, depth, slot, value_ptr);
+ }
+
+ jvmtiError GetLocalDouble(jthread thread,
+ jint depth,
+ jint slot,
+ jdouble* value_ptr) {
+ return functions->GetLocalDouble(this, thread, depth, slot, value_ptr);
+ }
+
+ jvmtiError SetLocalObject(jthread thread,
+ jint depth,
+ jint slot,
+ jobject value) {
+ return functions->SetLocalObject(this, thread, depth, slot, value);
+ }
+
+ jvmtiError SetLocalInt(jthread thread,
+ jint depth,
+ jint slot,
+ jint value) {
+ return functions->SetLocalInt(this, thread, depth, slot, value);
+ }
+
+ jvmtiError SetLocalLong(jthread thread,
+ jint depth,
+ jint slot,
+ jlong value) {
+ return functions->SetLocalLong(this, thread, depth, slot, value);
+ }
+
+ jvmtiError SetLocalFloat(jthread thread,
+ jint depth,
+ jint slot,
+ jfloat value) {
+ return functions->SetLocalFloat(this, thread, depth, slot, value);
+ }
+
+ jvmtiError SetLocalDouble(jthread thread,
+ jint depth,
+ jint slot,
+ jdouble value) {
+ return functions->SetLocalDouble(this, thread, depth, slot, value);
+ }
+
+ jvmtiError SetBreakpoint(jmethodID method,
+ jlocation location) {
+ return functions->SetBreakpoint(this, method, location);
+ }
+
+ jvmtiError ClearBreakpoint(jmethodID method,
+ jlocation location) {
+ return functions->ClearBreakpoint(this, method, location);
+ }
+
+ jvmtiError SetFieldAccessWatch(jclass klass,
+ jfieldID field) {
+ return functions->SetFieldAccessWatch(this, klass, field);
+ }
+
+ jvmtiError ClearFieldAccessWatch(jclass klass,
+ jfieldID field) {
+ return functions->ClearFieldAccessWatch(this, klass, field);
+ }
+
+ jvmtiError SetFieldModificationWatch(jclass klass,
+ jfieldID field) {
+ return functions->SetFieldModificationWatch(this, klass, field);
+ }
+
+ jvmtiError ClearFieldModificationWatch(jclass klass,
+ jfieldID field) {
+ return functions->ClearFieldModificationWatch(this, klass, field);
+ }
+
+ jvmtiError GetLoadedClasses(jint* class_count_ptr,
+ jclass** classes_ptr) {
+ return functions->GetLoadedClasses(this, class_count_ptr, classes_ptr);
+ }
+
+ jvmtiError GetClassLoaderClasses(jobject initiating_loader,
+ jint* class_count_ptr,
+ jclass** classes_ptr) {
+ return functions->GetClassLoaderClasses(this, initiating_loader, class_count_ptr, classes_ptr);
+ }
+
+ jvmtiError GetClassSignature(jclass klass,
+ char** signature_ptr,
+ char** generic_ptr) {
+ return functions->GetClassSignature(this, klass, signature_ptr, generic_ptr);
+ }
+
+ jvmtiError GetClassStatus(jclass klass,
+ jint* status_ptr) {
+ return functions->GetClassStatus(this, klass, status_ptr);
+ }
+
+ jvmtiError GetSourceFileName(jclass klass,
+ char** source_name_ptr) {
+ return functions->GetSourceFileName(this, klass, source_name_ptr);
+ }
+
+ jvmtiError GetClassModifiers(jclass klass,
+ jint* modifiers_ptr) {
+ return functions->GetClassModifiers(this, klass, modifiers_ptr);
+ }
+
+ jvmtiError GetClassMethods(jclass klass,
+ jint* method_count_ptr,
+ jmethodID** methods_ptr) {
+ return functions->GetClassMethods(this, klass, method_count_ptr, methods_ptr);
+ }
+
+ jvmtiError GetClassFields(jclass klass,
+ jint* field_count_ptr,
+ jfieldID** fields_ptr) {
+ return functions->GetClassFields(this, klass, field_count_ptr, fields_ptr);
+ }
+
+ jvmtiError GetImplementedInterfaces(jclass klass,
+ jint* interface_count_ptr,
+ jclass** interfaces_ptr) {
+ return functions->GetImplementedInterfaces(this, klass, interface_count_ptr, interfaces_ptr);
+ }
+
+ jvmtiError GetClassVersionNumbers(jclass klass,
+ jint* minor_version_ptr,
+ jint* major_version_ptr) {
+ return functions->GetClassVersionNumbers(this, klass, minor_version_ptr, major_version_ptr);
+ }
+
+ jvmtiError GetConstantPool(jclass klass,
+ jint* constant_pool_count_ptr,
+ jint* constant_pool_byte_count_ptr,
+ unsigned char** constant_pool_bytes_ptr) {
+ return functions->GetConstantPool(this, klass, constant_pool_count_ptr, constant_pool_byte_count_ptr, constant_pool_bytes_ptr);
+ }
+
+ jvmtiError IsInterface(jclass klass,
+ jboolean* is_interface_ptr) {
+ return functions->IsInterface(this, klass, is_interface_ptr);
+ }
+
+ jvmtiError IsArrayClass(jclass klass,
+ jboolean* is_array_class_ptr) {
+ return functions->IsArrayClass(this, klass, is_array_class_ptr);
+ }
+
+ jvmtiError IsModifiableClass(jclass klass,
+ jboolean* is_modifiable_class_ptr) {
+ return functions->IsModifiableClass(this, klass, is_modifiable_class_ptr);
+ }
+
+ jvmtiError GetClassLoader(jclass klass,
+ jobject* classloader_ptr) {
+ return functions->GetClassLoader(this, klass, classloader_ptr);
+ }
+
+ jvmtiError GetSourceDebugExtension(jclass klass,
+ char** source_debug_extension_ptr) {
+ return functions->GetSourceDebugExtension(this, klass, source_debug_extension_ptr);
+ }
+
+ jvmtiError RetransformClasses(jint class_count,
+ const jclass* classes) {
+ return functions->RetransformClasses(this, class_count, classes);
+ }
+
+ jvmtiError RedefineClasses(jint class_count,
+ const jvmtiClassDefinition* class_definitions) {
+ return functions->RedefineClasses(this, class_count, class_definitions);
+ }
+
+ jvmtiError GetObjectSize(jobject object,
+ jlong* size_ptr) {
+ return functions->GetObjectSize(this, object, size_ptr);
+ }
+
+ jvmtiError GetObjectHashCode(jobject object,
+ jint* hash_code_ptr) {
+ return functions->GetObjectHashCode(this, object, hash_code_ptr);
+ }
+
+ jvmtiError GetObjectMonitorUsage(jobject object,
+ jvmtiMonitorUsage* info_ptr) {
+ return functions->GetObjectMonitorUsage(this, object, info_ptr);
+ }
+
+ jvmtiError GetFieldName(jclass klass,
+ jfieldID field,
+ char** name_ptr,
+ char** signature_ptr,
+ char** generic_ptr) {
+ return functions->GetFieldName(this, klass, field, name_ptr, signature_ptr, generic_ptr);
+ }
+
+ jvmtiError GetFieldDeclaringClass(jclass klass,
+ jfieldID field,
+ jclass* declaring_class_ptr) {
+ return functions->GetFieldDeclaringClass(this, klass, field, declaring_class_ptr);
+ }
+
+ jvmtiError GetFieldModifiers(jclass klass,
+ jfieldID field,
+ jint* modifiers_ptr) {
+ return functions->GetFieldModifiers(this, klass, field, modifiers_ptr);
+ }
+
+ jvmtiError IsFieldSynthetic(jclass klass,
+ jfieldID field,
+ jboolean* is_synthetic_ptr) {
+ return functions->IsFieldSynthetic(this, klass, field, is_synthetic_ptr);
+ }
+
+ jvmtiError GetMethodName(jmethodID method,
+ char** name_ptr,
+ char** signature_ptr,
+ char** generic_ptr) {
+ return functions->GetMethodName(this, method, name_ptr, signature_ptr, generic_ptr);
+ }
+
+ jvmtiError GetMethodDeclaringClass(jmethodID method,
+ jclass* declaring_class_ptr) {
+ return functions->GetMethodDeclaringClass(this, method, declaring_class_ptr);
+ }
+
+ jvmtiError GetMethodModifiers(jmethodID method,
+ jint* modifiers_ptr) {
+ return functions->GetMethodModifiers(this, method, modifiers_ptr);
+ }
+
+ jvmtiError GetMaxLocals(jmethodID method,
+ jint* max_ptr) {
+ return functions->GetMaxLocals(this, method, max_ptr);
+ }
+
+ jvmtiError GetArgumentsSize(jmethodID method,
+ jint* size_ptr) {
+ return functions->GetArgumentsSize(this, method, size_ptr);
+ }
+
+ jvmtiError GetLineNumberTable(jmethodID method,
+ jint* entry_count_ptr,
+ jvmtiLineNumberEntry** table_ptr) {
+ return functions->GetLineNumberTable(this, method, entry_count_ptr, table_ptr);
+ }
+
+ jvmtiError GetMethodLocation(jmethodID method,
+ jlocation* start_location_ptr,
+ jlocation* end_location_ptr) {
+ return functions->GetMethodLocation(this, method, start_location_ptr, end_location_ptr);
+ }
+
+ jvmtiError GetLocalVariableTable(jmethodID method,
+ jint* entry_count_ptr,
+ jvmtiLocalVariableEntry** table_ptr) {
+ return functions->GetLocalVariableTable(this, method, entry_count_ptr, table_ptr);
+ }
+
+ jvmtiError GetBytecodes(jmethodID method,
+ jint* bytecode_count_ptr,
+ unsigned char** bytecodes_ptr) {
+ return functions->GetBytecodes(this, method, bytecode_count_ptr, bytecodes_ptr);
+ }
+
+ jvmtiError IsMethodNative(jmethodID method,
+ jboolean* is_native_ptr) {
+ return functions->IsMethodNative(this, method, is_native_ptr);
+ }
+
+ jvmtiError IsMethodSynthetic(jmethodID method,
+ jboolean* is_synthetic_ptr) {
+ return functions->IsMethodSynthetic(this, method, is_synthetic_ptr);
+ }
+
+ jvmtiError IsMethodObsolete(jmethodID method,
+ jboolean* is_obsolete_ptr) {
+ return functions->IsMethodObsolete(this, method, is_obsolete_ptr);
+ }
+
+ jvmtiError SetNativeMethodPrefix(const char* prefix) {
+ return functions->SetNativeMethodPrefix(this, prefix);
+ }
+
+ jvmtiError SetNativeMethodPrefixes(jint prefix_count,
+ char** prefixes) {
+ return functions->SetNativeMethodPrefixes(this, prefix_count, prefixes);
+ }
+
+ jvmtiError CreateRawMonitor(const char* name,
+ jrawMonitorID* monitor_ptr) {
+ return functions->CreateRawMonitor(this, name, monitor_ptr);
+ }
+
+ jvmtiError DestroyRawMonitor(jrawMonitorID monitor) {
+ return functions->DestroyRawMonitor(this, monitor);
+ }
+
+ jvmtiError RawMonitorEnter(jrawMonitorID monitor) {
+ return functions->RawMonitorEnter(this, monitor);
+ }
+
+ jvmtiError RawMonitorExit(jrawMonitorID monitor) {
+ return functions->RawMonitorExit(this, monitor);
+ }
+
+ jvmtiError RawMonitorWait(jrawMonitorID monitor,
+ jlong millis) {
+ return functions->RawMonitorWait(this, monitor, millis);
+ }
+
+ jvmtiError RawMonitorNotify(jrawMonitorID monitor) {
+ return functions->RawMonitorNotify(this, monitor);
+ }
+
+ jvmtiError RawMonitorNotifyAll(jrawMonitorID monitor) {
+ return functions->RawMonitorNotifyAll(this, monitor);
+ }
+
+ jvmtiError SetJNIFunctionTable(const jniNativeInterface* function_table) {
+ return functions->SetJNIFunctionTable(this, function_table);
+ }
+
+ jvmtiError GetJNIFunctionTable(jniNativeInterface** function_table) {
+ return functions->GetJNIFunctionTable(this, function_table);
+ }
+
+ jvmtiError SetEventCallbacks(const jvmtiEventCallbacks* callbacks,
+ jint size_of_callbacks) {
+ return functions->SetEventCallbacks(this, callbacks, size_of_callbacks);
+ }
+
+ jvmtiError SetEventNotificationMode(jvmtiEventMode mode,
+ jvmtiEvent event_type,
+ jthread event_thread,
+ ...) {
+ return functions->SetEventNotificationMode(this, mode, event_type, event_thread);
+ }
+
+ jvmtiError GenerateEvents(jvmtiEvent event_type) {
+ return functions->GenerateEvents(this, event_type);
+ }
+
+ jvmtiError GetExtensionFunctions(jint* extension_count_ptr,
+ jvmtiExtensionFunctionInfo** extensions) {
+ return functions->GetExtensionFunctions(this, extension_count_ptr, extensions);
+ }
+
+ jvmtiError GetExtensionEvents(jint* extension_count_ptr,
+ jvmtiExtensionEventInfo** extensions) {
+ return functions->GetExtensionEvents(this, extension_count_ptr, extensions);
+ }
+
+ jvmtiError SetExtensionEventCallback(jint extension_event_index,
+ jvmtiExtensionEvent callback) {
+ return functions->SetExtensionEventCallback(this, extension_event_index, callback);
+ }
+
+ jvmtiError GetPotentialCapabilities(jvmtiCapabilities* capabilities_ptr) {
+ return functions->GetPotentialCapabilities(this, capabilities_ptr);
+ }
+
+ jvmtiError AddCapabilities(const jvmtiCapabilities* capabilities_ptr) {
+ return functions->AddCapabilities(this, capabilities_ptr);
+ }
+
+ jvmtiError RelinquishCapabilities(const jvmtiCapabilities* capabilities_ptr) {
+ return functions->RelinquishCapabilities(this, capabilities_ptr);
+ }
+
+ jvmtiError GetCapabilities(jvmtiCapabilities* capabilities_ptr) {
+ return functions->GetCapabilities(this, capabilities_ptr);
+ }
+
+ jvmtiError GetCurrentThreadCpuTimerInfo(jvmtiTimerInfo* info_ptr) {
+ return functions->GetCurrentThreadCpuTimerInfo(this, info_ptr);
+ }
+
+ jvmtiError GetCurrentThreadCpuTime(jlong* nanos_ptr) {
+ return functions->GetCurrentThreadCpuTime(this, nanos_ptr);
+ }
+
+ jvmtiError GetThreadCpuTimerInfo(jvmtiTimerInfo* info_ptr) {
+ return functions->GetThreadCpuTimerInfo(this, info_ptr);
+ }
+
+ jvmtiError GetThreadCpuTime(jthread thread,
+ jlong* nanos_ptr) {
+ return functions->GetThreadCpuTime(this, thread, nanos_ptr);
+ }
+
+ jvmtiError GetTimerInfo(jvmtiTimerInfo* info_ptr) {
+ return functions->GetTimerInfo(this, info_ptr);
+ }
+
+ jvmtiError GetTime(jlong* nanos_ptr) {
+ return functions->GetTime(this, nanos_ptr);
+ }
+
+ jvmtiError GetAvailableProcessors(jint* processor_count_ptr) {
+ return functions->GetAvailableProcessors(this, processor_count_ptr);
+ }
+
+ jvmtiError AddToBootstrapClassLoaderSearch(const char* segment) {
+ return functions->AddToBootstrapClassLoaderSearch(this, segment);
+ }
+
+ jvmtiError AddToSystemClassLoaderSearch(const char* segment) {
+ return functions->AddToSystemClassLoaderSearch(this, segment);
+ }
+
+ jvmtiError GetSystemProperties(jint* count_ptr,
+ char*** property_ptr) {
+ return functions->GetSystemProperties(this, count_ptr, property_ptr);
+ }
+
+ jvmtiError GetSystemProperty(const char* property,
+ char** value_ptr) {
+ return functions->GetSystemProperty(this, property, value_ptr);
+ }
+
+ jvmtiError SetSystemProperty(const char* property,
+ const char* value) {
+ return functions->SetSystemProperty(this, property, value);
+ }
+
+ jvmtiError GetPhase(jvmtiPhase* phase_ptr) {
+ return functions->GetPhase(this, phase_ptr);
+ }
+
+ jvmtiError DisposeEnvironment() {
+ return functions->DisposeEnvironment(this);
+ }
+
+ jvmtiError SetEnvironmentLocalStorage(const void* data) {
+ return functions->SetEnvironmentLocalStorage(this, data);
+ }
+
+ jvmtiError GetEnvironmentLocalStorage(void** data_ptr) {
+ return functions->GetEnvironmentLocalStorage(this, data_ptr);
+ }
+
+ jvmtiError GetVersionNumber(jint* version_ptr) {
+ return functions->GetVersionNumber(this, version_ptr);
+ }
+
+ jvmtiError GetErrorName(jvmtiError error,
+ char** name_ptr) {
+ return functions->GetErrorName(this, error, name_ptr);
+ }
+
+ jvmtiError SetVerboseFlag(jvmtiVerboseFlag flag,
+ jboolean value) {
+ return functions->SetVerboseFlag(this, flag, value);
+ }
+
+ jvmtiError GetJLocationFormat(jvmtiJlocationFormat* format_ptr) {
+ return functions->GetJLocationFormat(this, format_ptr);
+ }
+
+#endif /* __cplusplus */
+};
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVA_JVMTI_H_ */
+
diff --git a/make/stub_includes/jni/macosx/AWTCocoaComponent.h b/make/stub_includes/jni/macosx/AWTCocoaComponent.h
new file mode 100644
index 000000000..8f004c5c0
--- /dev/null
+++ b/make/stub_includes/jni/macosx/AWTCocoaComponent.h
@@ -0,0 +1,15 @@
+//
+// AWTCocoaComponent.h
+//
+// Copyright (c) 2003 Apple Computer Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <JavaVM/jni.h>
+
+// This is implemented by a com.apple.eawt.CocoaComponent. It receives messages
+// from java safely on the AppKit thread. See the com.apple.eawt.CocoaComponent
+// java documentation for more information.
+@protocol AWTCocoaComponent
+-(void)awtMessage:(jint)messageID message:(jobject)message env:(JNIEnv*)env;
+@end
diff --git a/make/stub_includes/jni/macosx/JDWP.h b/make/stub_includes/jni/macosx/JDWP.h
new file mode 100644
index 000000000..9f359e06c
--- /dev/null
+++ b/make/stub_includes/jni/macosx/JDWP.h
@@ -0,0 +1,53 @@
+/*
+ * @(#)JDWP.h 1.31 03/12/19
+ *
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef JDWP_JDWP_H
+#define JDWP_JDWP_H
+
+#include "JDWPCommands.h"
+
+/*
+ * JDWPCommands.h is the javah'ed version of all the constants defined
+ * com.sun.tools.jdi.JDWP and all its nested classes. Since the names are
+ * very long, the macros below are provided for convenience.
+ */
+
+#define JDWP_COMMAND_SET(name) JDWP_ ## name
+#define JDWP_COMMAND(set, name) JDWP_ ## set ## _ ## name
+#define JDWP_REQUEST_MODIFIER(name) \
+ JDWP_EventRequest_Set_Out_modifiers_Modifier_ ## name
+#define JDWP_EVENT(name) \
+ JDWP_EventKind_ ## name
+#define JDWP_THREAD_STATUS(name) \
+ JDWP_ThreadStatus_ ## name
+#define JDWP_SUSPEND_STATUS(name) \
+ JDWP_SuspendStatus_SUSPEND_STATUS_ ## name
+#define JDWP_CLASS_STATUS(name) \
+ JDWP_ClassStatus_ ## name
+#define JDWP_TYPE_TAG(name) \
+ JDWP_TypeTag_ ## name
+#define JDWP_TAG(name) \
+ JDWP_Tag_ ## name
+#define JDWP_STEP_DEPTH(name) \
+ JDWP_StepDepth_ ## name
+#define JDWP_STEP_SIZE(name) \
+ JDWP_StepSize_ ## name
+#define JDWP_SUSPEND_POLICY(name) \
+ JDWP_SuspendPolicy_ ## name
+#define JDWP_INVOKE_OPTIONS(name) \
+ JDWP_InvokeOptions_INVOKE_ ## name
+#define JDWP_ERROR(name) \
+ JDWP_Error_ ## name
+#define JDWP_HIGHEST_COMMAND_SET 17
+#define JDWP_REQUEST_NONE -1
+
+/* This typedef helps keep the event and error types straight. */
+typedef unsigned short jdwpError;
+typedef unsigned char jdwpEvent;
+typedef jint jdwpThreadStatus;
+
+#endif
diff --git a/make/stub_includes/jni/macosx/JDWPCommands.h b/make/stub_includes/jni/macosx/JDWPCommands.h
new file mode 100644
index 000000000..f5011b25f
--- /dev/null
+++ b/make/stub_includes/jni/macosx/JDWPCommands.h
@@ -0,0 +1,238 @@
+#define JDWP_VirtualMachine 1
+#define JDWP_VirtualMachine_Version 1
+#define JDWP_VirtualMachine_ClassesBySignature 2
+#define JDWP_VirtualMachine_AllClasses 3
+#define JDWP_VirtualMachine_AllThreads 4
+#define JDWP_VirtualMachine_TopLevelThreadGroups 5
+#define JDWP_VirtualMachine_Dispose 6
+#define JDWP_VirtualMachine_IDSizes 7
+#define JDWP_VirtualMachine_Suspend 8
+#define JDWP_VirtualMachine_Resume 9
+#define JDWP_VirtualMachine_Exit 10
+#define JDWP_VirtualMachine_CreateString 11
+#define JDWP_VirtualMachine_Capabilities 12
+#define JDWP_VirtualMachine_ClassPaths 13
+#define JDWP_VirtualMachine_DisposeObjects 14
+#define JDWP_VirtualMachine_HoldEvents 15
+#define JDWP_VirtualMachine_ReleaseEvents 16
+#define JDWP_VirtualMachine_CapabilitiesNew 17
+#define JDWP_VirtualMachine_RedefineClasses 18
+#define JDWP_VirtualMachine_SetDefaultStratum 19
+#define JDWP_VirtualMachine_AllClassesWithGeneric 20
+#define JDWP_ReferenceType 2
+#define JDWP_ReferenceType_Signature 1
+#define JDWP_ReferenceType_ClassLoader 2
+#define JDWP_ReferenceType_Modifiers 3
+#define JDWP_ReferenceType_Fields 4
+#define JDWP_ReferenceType_Methods 5
+#define JDWP_ReferenceType_GetValues 6
+#define JDWP_ReferenceType_SourceFile 7
+#define JDWP_ReferenceType_NestedTypes 8
+#define JDWP_ReferenceType_Status 9
+#define JDWP_ReferenceType_Interfaces 10
+#define JDWP_ReferenceType_ClassObject 11
+#define JDWP_ReferenceType_SourceDebugExtension 12
+#define JDWP_ReferenceType_SignatureWithGeneric 13
+#define JDWP_ReferenceType_FieldsWithGeneric 14
+#define JDWP_ReferenceType_MethodsWithGeneric 15
+#define JDWP_ClassType 3
+#define JDWP_ClassType_Superclass 1
+#define JDWP_ClassType_SetValues 2
+#define JDWP_ClassType_InvokeMethod 3
+#define JDWP_ClassType_NewInstance 4
+#define JDWP_ArrayType 4
+#define JDWP_ArrayType_NewInstance 1
+#define JDWP_InterfaceType 5
+#define JDWP_Method 6
+#define JDWP_Method_LineTable 1
+#define JDWP_Method_VariableTable 2
+#define JDWP_Method_Bytecodes 3
+#define JDWP_Method_IsObsolete 4
+#define JDWP_Method_VariableTableWithGeneric 5
+#define JDWP_Field 8
+#define JDWP_ObjectReference 9
+#define JDWP_ObjectReference_ReferenceType 1
+#define JDWP_ObjectReference_GetValues 2
+#define JDWP_ObjectReference_SetValues 3
+#define JDWP_ObjectReference_MonitorInfo 5
+#define JDWP_ObjectReference_InvokeMethod 6
+#define JDWP_ObjectReference_DisableCollection 7
+#define JDWP_ObjectReference_EnableCollection 8
+#define JDWP_ObjectReference_IsCollected 9
+#define JDWP_StringReference 10
+#define JDWP_StringReference_Value 1
+#define JDWP_ThreadReference 11
+#define JDWP_ThreadReference_Name 1
+#define JDWP_ThreadReference_Suspend 2
+#define JDWP_ThreadReference_Resume 3
+#define JDWP_ThreadReference_Status 4
+#define JDWP_ThreadReference_ThreadGroup 5
+#define JDWP_ThreadReference_Frames 6
+#define JDWP_ThreadReference_FrameCount 7
+#define JDWP_ThreadReference_OwnedMonitors 8
+#define JDWP_ThreadReference_CurrentContendedMonitor 9
+#define JDWP_ThreadReference_Stop 10
+#define JDWP_ThreadReference_Interrupt 11
+#define JDWP_ThreadReference_SuspendCount 12
+#define JDWP_ThreadGroupReference 12
+#define JDWP_ThreadGroupReference_Name 1
+#define JDWP_ThreadGroupReference_Parent 2
+#define JDWP_ThreadGroupReference_Children 3
+#define JDWP_ArrayReference 13
+#define JDWP_ArrayReference_Length 1
+#define JDWP_ArrayReference_GetValues 2
+#define JDWP_ArrayReference_SetValues 3
+#define JDWP_ClassLoaderReference 14
+#define JDWP_ClassLoaderReference_VisibleClasses 1
+#define JDWP_EventRequest 15
+#define JDWP_EventRequest_Set 1
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_Count 1
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_Conditional 2
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ThreadOnly 3
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ClassOnly 4
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ClassMatch 5
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ClassExclude 6
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_LocationOnly 7
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_ExceptionOnly 8
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_FieldOnly 9
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_Step 10
+#define JDWP_EventRequest_Set_Out_modifiers_Modifier_InstanceOnly 11
+#define JDWP_EventRequest_Clear 2
+#define JDWP_EventRequest_ClearAllBreakpoints 3
+#define JDWP_StackFrame 16
+#define JDWP_StackFrame_GetValues 1
+#define JDWP_StackFrame_SetValues 2
+#define JDWP_StackFrame_ThisObject 3
+#define JDWP_StackFrame_PopFrames 4
+#define JDWP_ClassObjectReference 17
+#define JDWP_ClassObjectReference_ReflectedType 1
+#define JDWP_Event 64
+#define JDWP_Event_Composite 100
+#define JDWP_Event_Composite_Event_events_Events_VMStart JDWP.EventKind.VM_START
+#define JDWP_Event_Composite_Event_events_Events_SingleStep JDWP.EventKind.SINGLE_STEP
+#define JDWP_Event_Composite_Event_events_Events_Breakpoint JDWP.EventKind.BREAKPOINT
+#define JDWP_Event_Composite_Event_events_Events_MethodEntry JDWP.EventKind.METHOD_ENTRY
+#define JDWP_Event_Composite_Event_events_Events_MethodExit JDWP.EventKind.METHOD_EXIT
+#define JDWP_Event_Composite_Event_events_Events_Exception JDWP.EventKind.EXCEPTION
+#define JDWP_Event_Composite_Event_events_Events_ThreadStart JDWP.EventKind.THREAD_START
+#define JDWP_Event_Composite_Event_events_Events_ThreadDeath JDWP.EventKind.THREAD_DEATH
+#define JDWP_Event_Composite_Event_events_Events_ClassPrepare JDWP.EventKind.CLASS_PREPARE
+#define JDWP_Event_Composite_Event_events_Events_ClassUnload JDWP.EventKind.CLASS_UNLOAD
+#define JDWP_Event_Composite_Event_events_Events_FieldAccess JDWP.EventKind.FIELD_ACCESS
+#define JDWP_Event_Composite_Event_events_Events_FieldModification JDWP.EventKind.FIELD_MODIFICATION
+#define JDWP_Event_Composite_Event_events_Events_VMDeath JDWP.EventKind.VM_DEATH
+#define JDWP_Error_NONE 0
+#define JDWP_Error_INVALID_THREAD 10
+#define JDWP_Error_INVALID_THREAD_GROUP 11
+#define JDWP_Error_INVALID_PRIORITY 12
+#define JDWP_Error_THREAD_NOT_SUSPENDED 13
+#define JDWP_Error_THREAD_SUSPENDED 14
+#define JDWP_Error_INVALID_OBJECT 20
+#define JDWP_Error_INVALID_CLASS 21
+#define JDWP_Error_CLASS_NOT_PREPARED 22
+#define JDWP_Error_INVALID_METHODID 23
+#define JDWP_Error_INVALID_LOCATION 24
+#define JDWP_Error_INVALID_FIELDID 25
+#define JDWP_Error_INVALID_FRAMEID 30
+#define JDWP_Error_NO_MORE_FRAMES 31
+#define JDWP_Error_OPAQUE_FRAME 32
+#define JDWP_Error_NOT_CURRENT_FRAME 33
+#define JDWP_Error_TYPE_MISMATCH 34
+#define JDWP_Error_INVALID_SLOT 35
+#define JDWP_Error_DUPLICATE 40
+#define JDWP_Error_NOT_FOUND 41
+#define JDWP_Error_INVALID_MONITOR 50
+#define JDWP_Error_NOT_MONITOR_OWNER 51
+#define JDWP_Error_INTERRUPT 52
+#define JDWP_Error_INVALID_CLASS_FORMAT 60
+#define JDWP_Error_CIRCULAR_CLASS_DEFINITION 61
+#define JDWP_Error_FAILS_VERIFICATION 62
+#define JDWP_Error_ADD_METHOD_NOT_IMPLEMENTED 63
+#define JDWP_Error_SCHEMA_CHANGE_NOT_IMPLEMENTED 64
+#define JDWP_Error_INVALID_TYPESTATE 65
+#define JDWP_Error_HIERARCHY_CHANGE_NOT_IMPLEMENTED 66
+#define JDWP_Error_DELETE_METHOD_NOT_IMPLEMENTED 67
+#define JDWP_Error_UNSUPPORTED_VERSION 68
+#define JDWP_Error_NAMES_DONT_MATCH 69
+#define JDWP_Error_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED 70
+#define JDWP_Error_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED 71
+#define JDWP_Error_NOT_IMPLEMENTED 99
+#define JDWP_Error_NULL_POINTER 100
+#define JDWP_Error_ABSENT_INFORMATION 101
+#define JDWP_Error_INVALID_EVENT_TYPE 102
+#define JDWP_Error_ILLEGAL_ARGUMENT 103
+#define JDWP_Error_OUT_OF_MEMORY 110
+#define JDWP_Error_ACCESS_DENIED 111
+#define JDWP_Error_VM_DEAD 112
+#define JDWP_Error_INTERNAL 113
+#define JDWP_Error_UNATTACHED_THREAD 115
+#define JDWP_Error_INVALID_TAG 500
+#define JDWP_Error_ALREADY_INVOKING 502
+#define JDWP_Error_INVALID_INDEX 503
+#define JDWP_Error_INVALID_LENGTH 504
+#define JDWP_Error_INVALID_STRING 506
+#define JDWP_Error_INVALID_CLASS_LOADER 507
+#define JDWP_Error_INVALID_ARRAY 508
+#define JDWP_Error_TRANSPORT_LOAD 509
+#define JDWP_Error_TRANSPORT_INIT 510
+#define JDWP_Error_NATIVE_METHOD 511
+#define JDWP_Error_INVALID_COUNT 512
+#define JDWP_EventKind_VM_DISCONNECTED 100
+#define JDWP_EventKind_VM_START JDWP.EventKind.VM_INIT
+#define JDWP_EventKind_THREAD_DEATH JDWP.EventKind.THREAD_END
+#define JDWP_EventKind_SINGLE_STEP 1
+#define JDWP_EventKind_BREAKPOINT 2
+#define JDWP_EventKind_FRAME_POP 3
+#define JDWP_EventKind_EXCEPTION 4
+#define JDWP_EventKind_USER_DEFINED 5
+#define JDWP_EventKind_THREAD_START 6
+#define JDWP_EventKind_THREAD_END 7
+#define JDWP_EventKind_CLASS_PREPARE 8
+#define JDWP_EventKind_CLASS_UNLOAD 9
+#define JDWP_EventKind_CLASS_LOAD 10
+#define JDWP_EventKind_FIELD_ACCESS 20
+#define JDWP_EventKind_FIELD_MODIFICATION 21
+#define JDWP_EventKind_EXCEPTION_CATCH 30
+#define JDWP_EventKind_METHOD_ENTRY 40
+#define JDWP_EventKind_METHOD_EXIT 41
+#define JDWP_EventKind_VM_INIT 90
+#define JDWP_EventKind_VM_DEATH 99
+#define JDWP_ThreadStatus_ZOMBIE 0
+#define JDWP_ThreadStatus_RUNNING 1
+#define JDWP_ThreadStatus_SLEEPING 2
+#define JDWP_ThreadStatus_MONITOR 3
+#define JDWP_ThreadStatus_WAIT 4
+#define JDWP_SuspendStatus_SUSPEND_STATUS_SUSPENDED 0x1
+#define JDWP_ClassStatus_VERIFIED 1
+#define JDWP_ClassStatus_PREPARED 2
+#define JDWP_ClassStatus_INITIALIZED 4
+#define JDWP_ClassStatus_ERROR 8
+#define JDWP_TypeTag_CLASS 1
+#define JDWP_TypeTag_INTERFACE 2
+#define JDWP_TypeTag_ARRAY 3
+#define JDWP_Tag_ARRAY 91
+#define JDWP_Tag_BYTE 66
+#define JDWP_Tag_CHAR 67
+#define JDWP_Tag_OBJECT 76
+#define JDWP_Tag_FLOAT 70
+#define JDWP_Tag_DOUBLE 68
+#define JDWP_Tag_INT 73
+#define JDWP_Tag_LONG 74
+#define JDWP_Tag_SHORT 83
+#define JDWP_Tag_VOID 86
+#define JDWP_Tag_BOOLEAN 90
+#define JDWP_Tag_STRING 115
+#define JDWP_Tag_THREAD 116
+#define JDWP_Tag_THREAD_GROUP 103
+#define JDWP_Tag_CLASS_LOADER 108
+#define JDWP_Tag_CLASS_OBJECT 99
+#define JDWP_StepDepth_INTO 0
+#define JDWP_StepDepth_OVER 1
+#define JDWP_StepDepth_OUT 2
+#define JDWP_StepSize_MIN 0
+#define JDWP_StepSize_LINE 1
+#define JDWP_SuspendPolicy_NONE 0
+#define JDWP_SuspendPolicy_EVENT_THREAD 1
+#define JDWP_SuspendPolicy_ALL 2
+#define JDWP_InvokeOptions_INVOKE_SINGLE_THREADED 0x01
+#define JDWP_InvokeOptions_INVOKE_NONVIRTUAL 0x02
diff --git a/make/stub_includes/jni/macosx/jawt_md.h b/make/stub_includes/jni/macosx/jawt_md.h
new file mode 100644
index 000000000..aca47f66e
--- /dev/null
+++ b/make/stub_includes/jni/macosx/jawt_md.h
@@ -0,0 +1,27 @@
+//
+// jawt_md.h
+//
+// Copyright (c) 2002 Apple computer Inc. All rights reserved.
+//
+
+#ifndef _JAVASOFT_JAWT_MD_H_
+#define _JAVASOFT_JAWT_MD_H_
+
+#include <jawt.h>
+#include <AppKit/NSView.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct JAWT_MacOSXDrawingSurfaceInfo
+{
+ NSView *cocoaViewRef; // the view is guaranteed to be valid only for the duration of Component.paint method
+}
+JAWT_MacOSXDrawingSurfaceInfo;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_JAVASOFT_JAWT_MD_H_ */
diff --git a/make/stub_includes/jni/macosx/jni_md.h b/make/stub_includes/jni/macosx/jni_md.h
new file mode 100644
index 000000000..86b5ad230
--- /dev/null
+++ b/make/stub_includes/jni/macosx/jni_md.h
@@ -0,0 +1,23 @@
+/*
+ * @(#)jni_md.h 1.18 03/12/19
+ *
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT __attribute__((visibility("default")))
+#define JNIIMPORT
+#define JNICALL
+
+#if __LP64__
+typedef int jint;
+#else
+typedef long jint;
+#endif
+typedef long long jlong;
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/make/stub_includes/jni/macosx/jvmdi.h b/make/stub_includes/jni/macosx/jvmdi.h
new file mode 100644
index 000000000..81e559db7
--- /dev/null
+++ b/make/stub_includes/jni/macosx/jvmdi.h
@@ -0,0 +1,1012 @@
+/*
+ * @(#)jvmdi.h 1.48 03/12/19
+ *
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+/*
+ * Java Virtual Machine Debug Interface
+ *
+ * Defines debugging functionality that a VM should provide.
+ *
+ * Should not overlap functionality in jni.h
+ */
+
+#ifndef _JAVASOFT_JVMDI_H_
+#define _JAVASOFT_JVMDI_H_
+
+#include "jni.h"
+
+#define JVMDI_VERSION_1 0x20010000
+#define JVMDI_VERSION_1_1 0x20010001
+#define JVMDI_VERSION_1_2 0x20010002
+#define JVMDI_VERSION_1_3 0x20010003
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef jobject jthread;
+
+typedef jobject jthreadGroup;
+
+struct _jframeID;
+typedef struct _jframeID *jframeID;
+
+ /* specifies program location "pc" - often byte code index */
+typedef jlong jlocation;
+
+ /* The jmethodID for methods that have been replaced */
+ /* via RedefineClasses - used when the implementation */
+ /* does not wish to retain replaced jmethodIDs */
+#define OBSOLETE_METHOD_ID ((jmethodID)(NULL))
+
+ /*
+ * Errors
+ */
+
+typedef jint jvmdiError;
+
+ /* no error */
+#define JVMDI_ERROR_NONE ((jvmdiError)0)
+
+ /*
+ * Errors on thread operations
+ */
+
+ /* invalid thread */
+#define JVMDI_ERROR_INVALID_THREAD ((jvmdiError)10)
+ /* invalid thread group */
+#define JVMDI_ERROR_INVALID_THREAD_GROUP ((jvmdiError)11)
+ /* invalid thread priority */
+#define JVMDI_ERROR_INVALID_PRIORITY ((jvmdiError)12)
+ /* thread not suspended */
+#define JVMDI_ERROR_THREAD_NOT_SUSPENDED ((jvmdiError)13)
+ /* thread already suspended */
+#define JVMDI_ERROR_THREAD_SUSPENDED ((jvmdiError)14)
+
+ /*
+ * Errors on object and class operations
+ */
+
+ /* invalid object (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_INVALID_OBJECT ((jvmdiError)20)
+ /* invalid class (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_INVALID_CLASS ((jvmdiError)21)
+ /* class not prepared */
+#define JVMDI_ERROR_CLASS_NOT_PREPARED ((jvmdiError)22)
+ /* invalid methodID (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_INVALID_METHODID ((jvmdiError)23)
+ /* invalid location */
+#define JVMDI_ERROR_INVALID_LOCATION ((jvmdiError)24)
+ /* invalid fieldID (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_INVALID_FIELDID ((jvmdiError)25)
+
+ /*
+ * Errors on frame operations
+ */
+
+ /* invalid frameID (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_INVALID_FRAMEID ((jvmdiError)30)
+ /* there are no more frames on the stack */
+#define JVMDI_ERROR_NO_MORE_FRAMES ((jvmdiError)31)
+ /* operation cannot be performed on this frame */
+#define JVMDI_ERROR_OPAQUE_FRAME ((jvmdiError)32)
+ /* operation can only be performed on current frame */
+#define JVMDI_ERROR_NOT_CURRENT_FRAME ((jvmdiError)33)
+ /* type mismatch (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_TYPE_MISMATCH ((jvmdiError)34)
+ /* invalid slot */
+#define JVMDI_ERROR_INVALID_SLOT ((jvmdiError)35)
+
+ /*
+ * Errors on set/clear/find operations
+ */
+
+ /* item already present */
+#define JVMDI_ERROR_DUPLICATE ((jvmdiError)40)
+ /* item not found */
+#define JVMDI_ERROR_NOT_FOUND ((jvmdiError)41)
+
+ /*
+ * Errors on monitor operations
+ */
+
+ /* invalid monitor */
+#define JVMDI_ERROR_INVALID_MONITOR ((jvmdiError)50)
+ /* wait, notify, notify all tried without entering monitor */
+#define JVMDI_ERROR_NOT_MONITOR_OWNER ((jvmdiError)51)
+ /* waiting thread interrupted */
+#define JVMDI_ERROR_INTERRUPT ((jvmdiError)52)
+
+ /*
+ * Class redefinition / operand stack errors
+ */
+
+ /* The equivalent of ClassFormatError */
+#define JVMDI_ERROR_INVALID_CLASS_FORMAT ((jvmdiError)60)
+ /* The equivalent of ClassCircularityError */
+#define JVMDI_ERROR_CIRCULAR_CLASS_DEFINITION ((jvmdiError)61)
+ /* The class bytes fail verification */
+#define JVMDI_ERROR_FAILS_VERIFICATION ((jvmdiError)62)
+ /* The new class version adds new methods */
+ /* and can_add_method is false */
+#define JVMDI_ERROR_ADD_METHOD_NOT_IMPLEMENTED ((jvmdiError)63)
+ /* The new class version changes fields */
+ /* and can_unrestrictedly_redefine_classes is false */
+#define JVMDI_ERROR_SCHEMA_CHANGE_NOT_IMPLEMENTED ((jvmdiError)64)
+ /* bci/operand stack/local var combination is not verifiably */
+ /* type safe */
+#define JVMDI_ERROR_INVALID_TYPESTATE ((jvmdiError)65)
+ /* A direct superclass is different for the new class */
+ /* version, or the set of directly implemented */
+ /* interfaces is different */
+ /* and can_unrestrictedly_redefine_classes is false */
+#define JVMDI_ERROR_HIERARCHY_CHANGE_NOT_IMPLEMENTED ((jvmdiError)66)
+ /* The new class version does not declare a method */
+ /* declared in the old class version */
+ /* and can_unrestrictedly_redefine_classes is false */
+#define JVMDI_ERROR_DELETE_METHOD_NOT_IMPLEMENTED ((jvmdiError)67)
+ /* A class file has a version number not supported */
+ /* by this VM. */
+#define JVMDI_ERROR_UNSUPPORTED_VERSION ((jvmdiError)68)
+ /* The class name defined in the new class file is */
+ /* different from the name in the old class object */
+#define JVMDI_ERROR_NAMES_DONT_MATCH ((jvmdiError)69)
+ /* The new class version has different modifiers and */
+ /* can_unrestrictedly_redefine_classes is false */
+#define JVMDI_ERROR_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED ((jvmdiError)70)
+ /* A method in the new class version has different modifiers */
+ /* than its counterpart in the old class version */
+ /* and can_unrestrictedly_redefine_classes is false */
+#define JVMDI_ERROR_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED ((jvmdiError)71)
+
+ /*
+ * Miscellaneous errors
+ */
+
+ /* Not yet implemented */
+#define JVMDI_ERROR_NOT_IMPLEMENTED ((jvmdiError)99)
+ /* null pointer */
+#define JVMDI_ERROR_NULL_POINTER ((jvmdiError)100)
+ /* information is absent */
+#define JVMDI_ERROR_ABSENT_INFORMATION ((jvmdiError)101)
+ /* invalid event type */
+#define JVMDI_ERROR_INVALID_EVENT_TYPE ((jvmdiError)102)
+ /* invalid argument */
+#define JVMDI_ERROR_ILLEGAL_ARGUMENT ((jvmdiError)103)
+
+ /*
+ * Universal errors. These errors may be returned by
+ * any JVMDI function, not just the ones for which they are listed
+ * below.
+ */
+
+ /* no more memory available for allocation */
+#define JVMDI_ERROR_OUT_OF_MEMORY ((jvmdiError)110)
+ /* debugging has not been enabled in this VM */
+#define JVMDI_ERROR_ACCESS_DENIED ((jvmdiError)111)
+ /* VM is dead (implementation not required to gracefully catch) */
+#define JVMDI_ERROR_VM_DEAD ((jvmdiError)112)
+ /* internal error */
+#define JVMDI_ERROR_INTERNAL ((jvmdiError)113)
+ /* Thread calling JVMDI function not attached to VM */
+#define JVMDI_ERROR_UNATTACHED_THREAD ((jvmdiError)115)
+
+
+ /*
+ * Threads
+ */
+
+ /* Thread status is unknown */
+#define JVMDI_THREAD_STATUS_UNKNOWN ((jint)-1)
+ /* Thread is waiting to die */
+#define JVMDI_THREAD_STATUS_ZOMBIE ((jint)0)
+ /* Thread is runnable */
+#define JVMDI_THREAD_STATUS_RUNNING ((jint)1)
+ /* Thread is sleeping - Thread.sleep() or JVM_Sleep() was called */
+#define JVMDI_THREAD_STATUS_SLEEPING ((jint)2)
+ /* Thread is waiting on a java monitor */
+#define JVMDI_THREAD_STATUS_MONITOR ((jint)3)
+ /* Thread is waiting - Thread.wait() or JVM_MonitorWait() was called */
+#define JVMDI_THREAD_STATUS_WAIT ((jint)4)
+
+ /* Thread is suspended - Thread.suspend(), JVM_Suspend() or
+ * JVMDI_Suspend was called */
+#define JVMDI_SUSPEND_STATUS_SUSPENDED ((jint)0x1)
+ /* Thread is at a breakpoint */
+#define JVMDI_SUSPEND_STATUS_BREAK ((jint)0x2)
+
+
+ /* Thread priority constants */
+#define JVMDI_THREAD_MIN_PRIORITY ((jint)1)
+#define JVMDI_THREAD_NORM_PRIORITY ((jint)5)
+#define JVMDI_THREAD_MAX_PRIORITY ((jint)10)
+
+typedef struct {
+ char *name;
+ jint priority;
+ jboolean is_daemon;
+ jthreadGroup thread_group;
+ jobject context_class_loader;
+} JVMDI_thread_info;
+
+typedef struct {
+ jthreadGroup parent;
+ char *name;
+ jint max_priority;
+ jboolean is_daemon;
+} JVMDI_thread_group_info;
+
+#define JVMDI_DISABLE ((jint) 0)
+#define JVMDI_ENABLE ((jint) 1)
+
+/*
+ * Initial function for debug threads created through JVMDI
+ */
+typedef void (*JVMDI_StartFunction)(void *);
+
+/*
+ * Type for debug monitors created through JVMDI
+ */
+typedef void *JVMDI_RawMonitor;
+
+#define JVMDI_MONITOR_WAIT_FOREVER ((jlong)(0))
+
+/*
+ * Monitor information
+ */
+typedef struct {
+ jthread owner;
+ jint entry_count;
+ jint waiter_count;
+ jthread *waiters;
+} JVMDI_monitor_info;
+
+typedef struct {
+ jint owned_monitor_count;
+ jobject *owned_monitors;
+} JVMDI_owned_monitor_info;
+
+ /*
+ * Events
+ */
+
+ /* kind = JVMDI_EVENT_SINGLE_STEP */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jlocation location;
+ } JVMDI_single_step_event_data;
+
+ /* kind = JVMDI_EVENT_BREAKPOINT */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jlocation location;
+ } JVMDI_breakpoint_event_data;
+
+ /* kind = JVMDI_EVENT_FIELD_ACCESS */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jlocation location;
+ jclass field_clazz;
+ jobject object;
+ jfieldID field;
+ } JVMDI_field_access_event_data;
+
+ /* kind = JVMDI_EVENT_FIELD_MODIFICATION */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jlocation location;
+ jclass field_clazz;
+ jobject object;
+ jfieldID field;
+ char signature_type;
+ jvalue new_value;
+ } JVMDI_field_modification_event_data;
+
+ /* kind = JVMDI_EVENT_FRAME_POP */
+ /* kind = JVMDI_EVENT_METHOD_ENTRY */
+ /* kind = JVMDI_EVENT_METHOD_EXIT */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jframeID frame;
+ } JVMDI_frame_event_data;
+
+ /* kind = JVMDI_EVENT_EXCEPTION */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jlocation location;
+ jobject exception;
+ jclass catch_clazz;
+ jmethodID catch_method;
+ jlocation catch_location;
+ } JVMDI_exception_event_data;
+
+ /* kind = JVMDI_EVENT_EXCEPTION_CATCH */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ jmethodID method;
+ jlocation location;
+ jobject exception;
+ } JVMDI_exception_catch_event_data;
+
+ /* kind = JVMDI_EVENT_USER_DEFINED */
+ typedef struct {
+ jobject object;
+ jint key;
+ } JVMDI_user_event_data;
+
+ /* kind = JVMDI_EVENT_THREAD_END or */
+ /* JVMDI_EVENT_THREAD_START */
+ typedef struct {
+ jthread thread;
+ } JVMDI_thread_change_event_data;
+
+ /* kind = JVMDI_EVENT_CLASS_LOAD, */
+ /* JVMDI_EVENT_CLASS_UNLOAD, or */
+ /* JVMDI_EVENT_CLASS_PREPARE */
+ typedef struct {
+ jthread thread;
+ jclass clazz;
+ } JVMDI_class_event_data;
+
+/* This stucture passes information about the event.
+ * location is the index of the last instruction executed.
+ */
+typedef struct {
+ jint kind; /* the discriminant */
+
+ union {
+ /* kind = JVMDI_EVENT_SINGLE_STEP */
+ JVMDI_single_step_event_data single_step;
+
+ /* kind = JVMDI_EVENT_BREAKPOINT */
+ JVMDI_breakpoint_event_data breakpoint;
+
+ /* kind = JVMDI_EVENT_FRAME_POP */
+ /* kind = JVMDI_EVENT_METHOD_ENTRY */
+ /* kind = JVMDI_EVENT_METHOD_EXIT */
+ JVMDI_frame_event_data frame;
+
+ /* kind = JVMDI_EVENT_FIELD_ACCESS */
+ JVMDI_field_access_event_data field_access;
+
+ /* kind = JVMDI_EVENT_FIELD_MODIFICATION */
+ JVMDI_field_modification_event_data field_modification;
+
+ /* kind = JVMDI_EVENT_EXCEPTION */
+ JVMDI_exception_event_data exception;
+
+ /* kind = JVMDI_EVENT_EXCEPTION_CATCH */
+ JVMDI_exception_catch_event_data exception_catch;
+
+ /* kind = JVMDI_EVENT_USER_DEFINED */
+ JVMDI_user_event_data user;
+
+ /* kind = JVMDI_EVENT_THREAD_END or */
+ /* JVMDI_EVENT_THREAD_START */
+ JVMDI_thread_change_event_data thread_change;
+
+ /* kind = JVMDI_EVENT_CLASS_LOAD, */
+ /* JVMDI_EVENT_CLASS_UNLOAD, or */
+ /* JVMDI_EVENT_CLASS_PREPARE */
+ JVMDI_class_event_data class_event;
+
+ /* kind = JVMDI_EVENT_VM_DEATH, JVMDI_EVENT_VM_INIT */
+ /* no additional fields */
+ } u;
+} JVMDI_Event;
+
+ /*** event kinds ***/
+#define JVMDI_EVENT_SINGLE_STEP ((jint)1)
+#define JVMDI_EVENT_BREAKPOINT ((jint)2)
+#define JVMDI_EVENT_FRAME_POP ((jint)3)
+#define JVMDI_EVENT_EXCEPTION ((jint)4)
+#define JVMDI_EVENT_USER_DEFINED ((jint)5)
+#define JVMDI_EVENT_THREAD_START ((jint)6)
+#define JVMDI_EVENT_THREAD_END ((jint)7)
+#define JVMDI_EVENT_CLASS_PREPARE ((jint)8)
+#define JVMDI_EVENT_CLASS_UNLOAD ((jint)9)
+#define JVMDI_EVENT_CLASS_LOAD ((jint)10)
+#define JVMDI_EVENT_FIELD_ACCESS ((jint)20)
+#define JVMDI_EVENT_FIELD_MODIFICATION ((jint)21)
+#define JVMDI_EVENT_EXCEPTION_CATCH ((jint)30)
+#define JVMDI_EVENT_METHOD_ENTRY ((jint)40)
+#define JVMDI_EVENT_METHOD_EXIT ((jint)41)
+#define JVMDI_EVENT_VM_INIT ((jint)90)
+#define JVMDI_EVENT_VM_DEATH ((jint)99)
+
+#define JVMDI_MAX_EVENT_TYPE_VAL ((jint)99)
+
+
+
+/* event handler hook */
+typedef void (*JVMDI_EventHook)(JNIEnv *env, JVMDI_Event *event);
+
+typedef jvmdiError (*JVMDI_AllocHook) (jlong size, jbyte** memPtr);
+typedef jvmdiError (*JVMDI_DeallocHook) (jbyte* buffer);
+
+/*
+ * Class states used in JVMDI_GetClassStatus
+ */
+#define JVMDI_CLASS_STATUS_VERIFIED ((jint)0x01)
+#define JVMDI_CLASS_STATUS_PREPARED ((jint)0x02)
+#define JVMDI_CLASS_STATUS_INITIALIZED ((jint)0x04)
+ /* Error prevents initialization */
+#define JVMDI_CLASS_STATUS_ERROR ((jint)0x08)
+
+/* structure for returning line number information
+ */
+typedef struct {
+ jlocation start_location;
+ jint line_number;
+} JVMDI_line_number_entry;
+
+
+/* structure for returning local variable information
+ */
+typedef struct {
+ jlocation start_location; /* variable valid start_location */
+ jint length; /* upto start_location+length */
+ char *name; /* name in UTF8 */
+ char *signature; /* type signature in UTF8 */
+ jint slot; /* variable slot, see JVMDI_GetLocal*() */
+} JVMDI_local_variable_entry;
+
+/* structure for returning exception handler information
+ */
+typedef struct {
+ jlocation start_location;
+ jlocation end_location;
+ jlocation handler_location;
+ jclass exception; /* if null, all exceptions */
+} JVMDI_exception_handler_entry;
+
+#define JVMDI_OPERAND_TYPE_REFERENCE ((jint)1)
+#define JVMDI_OPERAND_TYPE_INT ((jint)2)
+#define JVMDI_OPERAND_TYPE_FLOAT ((jint)3)
+#define JVMDI_OPERAND_TYPE_LONG0 ((jint)4) /* least sig. 32 bits */
+#define JVMDI_OPERAND_TYPE_LONG1 ((jint)5) /* most sig. 32 bits */
+#define JVMDI_OPERAND_TYPE_DOUBLE0 ((jint)6) /* least sig. 32 bits */
+#define JVMDI_OPERAND_TYPE_DOUBLE1 ((jint)7) /* most sig. 32 bits */
+#define JVMDI_OPERAND_TYPE_RETURN_ADDRESS ((jint)8)
+
+typedef struct {
+ jint word; /* 32 bit operand stack quantities */
+ jint type; /* type encoding of the operand word */
+ /* one of JVMDI_OPERAND_TYPE_* */
+} JVMDI_operand_stack_element;
+
+typedef struct {
+ jint instance_field_count; /* number of instance fields referencing obj */
+ struct JVMDI_instance_field {
+ jobject instance; /* instance referencing obj */
+ jfieldID field; /* field holding reference */
+ } *instance_fields; /* instanceField_count of them */
+
+ jint static_field_count; /* number of static fields referencing obj */
+ struct JVMDI_static_field {
+ jclass clazz; /* class referencing obj */
+ jfieldID static_field; /* field holding reference */
+ } *static_fields; /* static_field_count of them */
+
+ jint array_element_count; /* number of array elements referencing obj */
+ struct JVMDI_array_element {
+ jobjectArray array; /* array referencing obj */
+ jint index; /* index holding reference */
+ } *array_elements; /* array_element_count of them */
+
+ jint frame_slot_count; /* number of frame slots referencing obj */
+ struct JVMDI_frame_slot {
+ jthread thread; /* thread of the frame */
+ jframeID frame; /* frame referencing obj */
+ jint slot; /* slot holding reference */
+ } *frame_slots; /* frame_slot_count of them */
+} JVMDI_object_reference_info;
+
+/* structure for defining a class
+*/
+typedef struct {
+ jclass clazz; /* Class object for this class */
+ jint class_byte_count; /* number of bytes defining class (below) */
+ jbyte *class_bytes; /* bytes defining class (in JVM spec */
+ /* Class File Format) */
+} JVMDI_class_definition;
+
+ /* For backwards compatibility */
+#define can_change_schema can_unrestrictedly_redefine_classes
+
+typedef struct {
+ unsigned int can_watch_field_modification : 1;
+ unsigned int can_watch_field_access : 1;
+ unsigned int can_get_bytecodes : 1;
+ unsigned int can_get_synthetic_attribute : 1;
+ unsigned int can_get_owned_monitor_info : 1;
+ unsigned int can_get_current_contended_monitor : 1;
+ unsigned int can_get_monitor_info : 1;
+ unsigned int can_get_heap_info : 1;
+ unsigned int can_get_operand_stack : 1;
+ unsigned int can_set_operand_stack : 1;
+ unsigned int can_pop_frame : 1;
+ unsigned int can_get_class_definition : 1;
+ unsigned int can_redefine_classes : 1;
+ unsigned int can_add_method : 1;
+ unsigned int can_unrestrictedly_redefine_classes : 1;
+ unsigned int can_suspend_resume_thread_lists : 1;
+} JVMDI_capabilities;
+
+typedef struct JVMDI_Interface_1_ {
+ jvmdiError (JNICALL *SetEventHook)
+ (JVMDI_EventHook hook);
+ jvmdiError (JNICALL *SetEventNotificationMode)
+ (jint mode, jint eventType, jthread thread, ...);
+
+ jvmdiError (JNICALL *GetThreadStatus)
+ (jthread thread,
+ jint *threadStatusPtr, jint *suspendStatusPtr);
+ jvmdiError (JNICALL *GetAllThreads)
+ (jint *threadsCountPtr, jthread **threadsPtr);
+ jvmdiError (JNICALL *SuspendThread)
+ (jthread thread);
+ jvmdiError (JNICALL *ResumeThread)
+ (jthread thread);
+ jvmdiError (JNICALL *StopThread)
+ (jthread thread, jobject exception);
+ jvmdiError (JNICALL *InterruptThread)
+ (jthread thread);
+ jvmdiError (JNICALL *GetThreadInfo)
+ (jthread thread, JVMDI_thread_info *infoPtr);
+ jvmdiError (JNICALL *GetOwnedMonitorInfo)
+ (jthread thread, JVMDI_owned_monitor_info *infoPtr);
+ jvmdiError (JNICALL *GetCurrentContendedMonitor)
+ (jthread thread, jobject *monitor);
+ jvmdiError (JNICALL *RunDebugThread)
+ (jthread thread, JVMDI_StartFunction proc, void *arg,
+ int priority);
+
+ jvmdiError (JNICALL *GetTopThreadGroups)
+ (jint *groupCountPtr, jthreadGroup **groupsPtr);
+ jvmdiError (JNICALL *GetThreadGroupInfo)
+ (jthreadGroup group, JVMDI_thread_group_info *infoPtr);
+ jvmdiError (JNICALL *GetThreadGroupChildren)
+ (jthreadGroup group,
+ jint *threadCountPtr, jthread **threadsPtr,
+ jint *groupCountPtr, jthreadGroup **groupsPtr);
+
+ jvmdiError (JNICALL *GetFrameCount)
+ (jthread thread, jint *countPtr);
+ jvmdiError (JNICALL *GetCurrentFrame)
+ (jthread thread, jframeID *framePtr);
+ jvmdiError (JNICALL *GetCallerFrame)
+ (jframeID called, jframeID *framePtr);
+ jvmdiError (JNICALL *GetFrameLocation)
+ (jframeID frame, jclass *classPtr, jmethodID *methodPtr,
+ jlocation *locationPtr);
+ jvmdiError (JNICALL *NotifyFramePop)
+ (jframeID frame);
+ jvmdiError (JNICALL *GetLocalObject)
+ (jframeID frame, jint slot, jobject *valuePtr);
+ jvmdiError (JNICALL *GetLocalInt)
+ (jframeID frame, jint slot, jint *valuePtr);
+ jvmdiError (JNICALL *GetLocalLong)
+ (jframeID frame, jint slot, jlong *valuePtr);
+ jvmdiError (JNICALL *GetLocalFloat)
+ (jframeID frame, jint slot, jfloat *valuePtr);
+ jvmdiError (JNICALL *GetLocalDouble)
+ (jframeID frame, jint slot, jdouble *valuePtr);
+ jvmdiError (JNICALL *SetLocalObject)
+ (jframeID frame, jint slot, jobject value);
+ jvmdiError (JNICALL *SetLocalInt)
+ (jframeID frame, jint slot, jint value);
+ jvmdiError (JNICALL *SetLocalLong)
+ (jframeID frame, jint slot, jlong value);
+ jvmdiError (JNICALL *SetLocalFloat)
+ (jframeID frame, jint slot, jfloat value);
+ jvmdiError (JNICALL *SetLocalDouble)
+ (jframeID frame, jint slot, jdouble value);
+
+ jvmdiError (JNICALL *CreateRawMonitor)
+ (char *name, JVMDI_RawMonitor *monitorPtr);
+ jvmdiError (JNICALL *DestroyRawMonitor)
+ (JVMDI_RawMonitor monitor);
+ jvmdiError (JNICALL *RawMonitorEnter)
+ (JVMDI_RawMonitor monitor);
+ jvmdiError (JNICALL *RawMonitorExit)
+ (JVMDI_RawMonitor monitor);
+ jvmdiError (JNICALL *RawMonitorWait)
+ (JVMDI_RawMonitor monitor, jlong millis);
+ jvmdiError (JNICALL *RawMonitorNotify)
+ (JVMDI_RawMonitor monitor);
+ jvmdiError (JNICALL *RawMonitorNotifyAll)
+ (JVMDI_RawMonitor monitor);
+
+ jvmdiError (JNICALL *SetBreakpoint)
+ (jclass clazz, jmethodID method, jlocation location);
+ jvmdiError (JNICALL *ClearBreakpoint)
+ (jclass clazz, jmethodID method, jlocation location);
+ jvmdiError (JNICALL *ClearAllBreakpoints)
+ ();
+
+ jvmdiError (JNICALL *SetFieldAccessWatch)
+ (jclass clazz, jfieldID field);
+ jvmdiError (JNICALL *ClearFieldAccessWatch)
+ (jclass clazz, jfieldID field);
+ jvmdiError (JNICALL *SetFieldModificationWatch)
+ (jclass clazz, jfieldID field);
+ jvmdiError (JNICALL *ClearFieldModificationWatch)
+ (jclass clazz, jfieldID field);
+
+ jvmdiError (JNICALL *SetAllocationHooks)
+ (JVMDI_AllocHook ahook, JVMDI_DeallocHook dhook);
+ jvmdiError (JNICALL *Allocate)
+ (jlong size, jbyte** memPtr);
+ jvmdiError (JNICALL *Deallocate)
+ (jbyte* mem);
+
+ jvmdiError (JNICALL *GetClassSignature)
+ (jclass clazz, char **sigPtr);
+ jvmdiError (JNICALL *GetClassStatus)
+ (jclass clazz, jint *statusPtr);
+ jvmdiError (JNICALL *GetSourceFileName)
+ (jclass clazz, char **sourceNamePtr);
+ jvmdiError (JNICALL *GetClassModifiers)
+ (jclass clazz, jint *modifiersPtr);
+ jvmdiError (JNICALL *GetClassMethods)
+ (jclass clazz, jint *methodCountPtr, jmethodID **methodsPtr);
+ jvmdiError (JNICALL *GetClassFields)
+ (jclass clazz, jint *fieldCountPtr, jfieldID **fieldsPtr);
+ jvmdiError (JNICALL *GetImplementedInterfaces)
+ (jclass clazz, jint *interfaceCountPtr, jclass **interfacesPtr);
+ jvmdiError (JNICALL *IsInterface)
+ (jclass clazz, jboolean *isInterfacePtr);
+ jvmdiError (JNICALL *IsArrayClass)
+ (jclass clazz, jboolean *isArrayClassPtr);
+ jvmdiError (JNICALL *GetClassLoader)
+ (jclass clazz, jobject *classloaderPtr);
+
+ jvmdiError (JNICALL *GetObjectHashCode)
+ (jobject object, jint *hashCodePtr);
+ jvmdiError (JNICALL *GetMonitorInfo)
+ (jobject object, JVMDI_monitor_info *infoPtr);
+
+ jvmdiError (JNICALL *GetFieldName)
+ (jclass clazz, jfieldID field, char **namePtr, char **signaturePtr);
+ jvmdiError (JNICALL *GetFieldDeclaringClass)
+ (jclass clazz, jfieldID field, jclass *declaringClassPtr);
+ jvmdiError (JNICALL *GetFieldModifiers)
+ (jclass clazz, jfieldID field, jint *modifiersPtr);
+ jvmdiError (JNICALL *IsFieldSynthetic)
+ (jclass clazz, jfieldID field, jboolean *isSyntheticPtr);
+
+ jvmdiError (JNICALL *GetMethodName)
+ (jclass clazz, jmethodID method,
+ char **namePtr, char **signaturePtr);
+ jvmdiError (JNICALL *GetMethodDeclaringClass)
+ (jclass clazz, jmethodID method, jclass *declaringClassPtr);
+ jvmdiError (JNICALL *GetMethodModifiers)
+ (jclass clazz, jmethodID method, jint *modifiersPtr);
+ jvmdiError (JNICALL *GetMaxStack)
+ (jclass clazz, jmethodID method, jint *maxPtr);
+ jvmdiError (JNICALL *GetMaxLocals)
+ (jclass clazz, jmethodID method, jint *maxPtr);
+ jvmdiError (JNICALL *GetArgumentsSize)
+ (jclass clazz, jmethodID method, jint *sizePtr);
+ jvmdiError (JNICALL *GetLineNumberTable)
+ (jclass clazz, jmethodID method,
+ jint *entryCountPtr, JVMDI_line_number_entry **tablePtr);
+ jvmdiError (JNICALL *GetMethodLocation)
+ (jclass clazz, jmethodID method,
+ jlocation *startLocationPtr, jlocation *endLocationPtr);
+ jvmdiError (JNICALL *GetLocalVariableTable)
+ (jclass clazz, jmethodID method,
+ jint *entryCountPtr, JVMDI_local_variable_entry **tablePtr);
+ jvmdiError (JNICALL *GetExceptionHandlerTable)
+ (jclass clazz, jmethodID method,
+ jint *entryCountPtr, JVMDI_exception_handler_entry **tablePtr);
+ jvmdiError (JNICALL *GetThrownExceptions)
+ (jclass clazz, jmethodID method,
+ jint *exceptionCountPtr, jclass **exceptionsPtr);
+ jvmdiError (JNICALL *GetBytecodes)
+ (jclass clazz, jmethodID method,
+ jint *bytecodeCountPtr, jbyte **bytecodesPtr);
+ jvmdiError (JNICALL *IsMethodNative)
+ (jclass clazz, jmethodID method, jboolean *isNativePtr);
+ jvmdiError (JNICALL *IsMethodSynthetic)
+ (jclass clazz, jmethodID method, jboolean *isSyntheticPtr);
+
+ jvmdiError (JNICALL *GetLoadedClasses)
+ (jint *classCountPtr, jclass **classesPtr);
+ jvmdiError (JNICALL *GetClassLoaderClasses)
+ (jobject initiatingLoader, jint *classesCountPtr,
+ jclass **classesPtr);
+
+ jvmdiError (JNICALL *PopFrame)
+ (jthread thread);
+ jvmdiError (JNICALL *SetFrameLocation)
+ (jframeID frame, jlocation location);
+ jvmdiError (JNICALL *GetOperandStack)
+ (jframeID frame, jint *operandStackSizePtr,
+ JVMDI_operand_stack_element **operandStackPtr);
+ jvmdiError (JNICALL *SetOperandStack)
+ (jframeID frame, jint operandStackSize,
+ JVMDI_operand_stack_element *operandStack);
+ jvmdiError (JNICALL *AllInstances)
+ (jclass clazz, jint *instanceCountPtr, jobject **instancesPtr);
+ jvmdiError (JNICALL *References)
+ (jobject obj, JVMDI_object_reference_info *refs);
+ jvmdiError (JNICALL *GetClassDefinition)
+ (jclass clazz, JVMDI_class_definition *classDefPtr);
+ jvmdiError (JNICALL *RedefineClasses)
+ (jint classCount, JVMDI_class_definition *classDefs);
+
+ jvmdiError (JNICALL *GetVersionNumber)
+ (jint *versionPtr);
+ jvmdiError (JNICALL *GetCapabilities)
+ (JVMDI_capabilities *capabilitiesPtr);
+
+ jvmdiError (JNICALL *GetSourceDebugExtension)
+ (jclass clazz, char **sourceDebugExtension);
+ jvmdiError (JNICALL *IsMethodObsolete)
+ (jclass clazz, jmethodID method, jboolean *isObsoletePtr);
+
+ jvmdiError (JNICALL *SuspendThreadList)
+ (jint reqCount, jthread *reqList, jvmdiError *results);
+ jvmdiError (JNICALL *ResumeThreadList)
+ (jint reqCount, jthread *reqList, jvmdiError *results);
+} JVMDI_Interface_1;
+
+#ifndef NO_JVMDI_MACROS
+
+#define JVMDI_ERROR_DUPLICATE_BREAKPOINT JVMDI_ERROR_DUPLICATE
+#define JVMDI_ERROR_NO_SUCH_BREAKPOINT JVMDI_ERROR_NOT_FOUND
+#define JVMDI_ERROR_DUPLICATE_FRAME_POP JVMDI_ERROR_DUPLICATE
+
+
+static JVMDI_Interface_1 *jvmdi_interface = NULL;
+static JavaVM *j_vm;
+
+#ifdef __cplusplus
+#define SetJVMDIfromJNIEnv(a_env) ( (jvmdi_interface == NULL)? \
+ ((a_env)->GetJavaVM(&j_vm), \
+ (j_vm)->GetEnv((void **)&jvmdi_interface, \
+ JVMDI_VERSION_1)):0)
+#else
+#define SetJVMDIfromJNIEnv(a_env) ( (jvmdi_interface == NULL)? \
+ ((*a_env)->GetJavaVM(a_env, &j_vm), \
+ (*j_vm)->GetEnv(j_vm, (void **)&jvmdi_interface, \
+ JVMDI_VERSION_1)):0)
+#endif
+
+#define JVMDI_SetEventHook(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetEventHook(a1) )
+#define JVMDI_GetThreadStatus(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetThreadStatus(a1, a2, a3) )
+#define JVMDI_GetAllThreads(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetAllThreads(a1, a2) )
+#define JVMDI_SuspendThread(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SuspendThread(a1) )
+#define JVMDI_ResumeThread(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->ResumeThread(a1) )
+#define JVMDI_StopThread(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->StopThread(a1, a2) )
+#define JVMDI_InterruptThread(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->InterruptThread(a1) )
+#define JVMDI_SetSingleStep(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetEventNotificationMode( \
+ (a2) ? JVMDI_ENABLE : JVMDI_DISABLE, \
+ JVMDI_EVENT_SINGLE_STEP, a1) )
+#define JVMDI_GetThreadInfo(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetThreadInfo(a1, a2) )
+#define JVMDI_RunDebugThread(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->RunDebugThread(a1, a2, a3, a4) )
+#define JVMDI_GetTopThreadGroups(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetTopThreadGroups(a1, a2) )
+#define JVMDI_GetThreadGroupInfo(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetThreadGroupInfo(a1, a2) )
+#define JVMDI_GetThreadGroupChildren(a_env, a1, a2, a3, a4, a5) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetThreadGroupChildren(a1, a2, a3, a4, a5) )
+#define JVMDI_GetCurrentFrame(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetCurrentFrame(a1, a2) )
+#define JVMDI_GetCallerFrame(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetCallerFrame(a1, a2) )
+#define JVMDI_GetFrameLocation(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetFrameLocation(a1, a2, a3, a4) )
+#define JVMDI_NotifyFramePop(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->NotifyFramePop(a1) )
+#define JVMDI_GetLocalObject(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLocalObject(a1, a2, a3) )
+#define JVMDI_GetLocalInt(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLocalInt(a1, a2, a3) )
+#define JVMDI_GetLocalLong(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLocalLong(a1, a2, a3) )
+#define JVMDI_GetLocalFloat(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLocalFloat(a1, a2, a3) )
+#define JVMDI_GetLocalDouble(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLocalDouble(a1, a2, a3) )
+#define JVMDI_SetLocalObject(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetLocalObject(a1, a2, a3) )
+#define JVMDI_SetLocalInt(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetLocalInt(a1, a2, a3) )
+#define JVMDI_SetLocalLong(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetLocalLong(a1, a2, a3) )
+#define JVMDI_SetLocalFloat(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetLocalFloat(a1, a2, a3) )
+#define JVMDI_SetLocalDouble(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetLocalDouble(a1, a2, a3) )
+#define JVMDI_CreateRawMonitor(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->CreateRawMonitor(a1, a2) )
+#define JVMDI_DestroyRawMonitor(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->DestroyRawMonitor(a1) )
+#define JVMDI_RawMonitorEnter(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->RawMonitorEnter(a1) )
+#define JVMDI_RawMonitorExit(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->RawMonitorExit(a1) )
+#define JVMDI_RawMonitorWait(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->RawMonitorWait(a1, a2) )
+#define JVMDI_RawMonitorNotify(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->RawMonitorNotify(a1) )
+#define JVMDI_RawMonitorNotifyAll(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->RawMonitorNotifyAll(a1) )
+#define JVMDI_SetBreakpoint(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetBreakpoint(a1, a2, a3) )
+#define JVMDI_ClearBreakpoint(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->ClearBreakpoint(a1, a2, a3) )
+#define JVMDI_ClearAllBreakpoints(a_env) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->ClearAllBreakpoints() )
+#define JVMDI_SetAllocationHooks(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->SetAllocationHooks(a1, a2) )
+#define JVMDI_Allocate(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->Allocate(a1, a2) )
+#define JVMDI_Deallocate(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->Deallocate(a1) )
+#define JVMDI_GetClassSignature(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassSignature(a1, a2) )
+#define JVMDI_GetClassStatus(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassStatus(a1, a2) )
+#define JVMDI_GetSourceFileName(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetSourceFileName(a1, a2) )
+#define JVMDI_GetClassModifiers(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassModifiers(a1, a2) )
+#define JVMDI_GetClassMethods(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassMethods(a1, a2, a3) )
+#define JVMDI_GetClassFields(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassFields(a1, a2, a3) )
+#define JVMDI_GetImplementedInterfaces(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetImplementedInterfaces(a1, a2, a3) )
+#define JVMDI_IsInterface(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->IsInterface(a1, a2) )
+#define JVMDI_IsArrayClass(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->IsArrayClass(a1, a2) )
+#define JVMDI_ClassLoader(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassLoader(a1, a2) )
+#define JVMDI_GetFieldName(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetFieldName(a1, a2, a3, a4) )
+#define JVMDI_GetFieldDeclaringClass(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetFieldDeclaringClass(a1, a2, a3) )
+#define JVMDI_GetFieldModifiers(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetFieldModifiers(a1, a2, a3) )
+#define JVMDI_GetMethodName(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetMethodName(a1, a2, a3, a4) )
+#define JVMDI_GetMethodDeclaringClass(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetMethodDeclaringClass(a1, a2, a3) )
+#define JVMDI_GetMethodModifiers(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetMethodModifiers(a1, a2, a3) )
+#define JVMDI_GetMaxStack(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetMaxStack(a1, a2, a3) )
+#define JVMDI_GetMaxLocals(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetMaxLocals(a1, a2, a3) )
+#define JVMDI_GetArgumentsSize(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetArgumentsSize(a1, a2, a3) )
+#define JVMDI_GetLineNumberTable(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLineNumberTable(a1, a2, a3, a4) )
+#define JVMDI_GetMethodLocation(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetMethodLocation(a1, a2, a3, a4) )
+#define JVMDI_GetLocalVariableTable(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLocalVariableTable(a1, a2, a3, a4) )
+#define JVMDI_GetExceptionHandlerTable(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetExceptionHandlerTable(a1, a2, a3, a4) )
+#define JVMDI_GetThrownExceptions(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetThrownExceptions(a1, a2, a3, a4) )
+#define JVMDI_GetBytecodes(a_env, a1, a2, a3, a4) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetBytecodes(a1, a2, a3, a4) )
+#define JVMDI_IsMethodNative(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->IsMethodNative(a1, a2, a3) )
+#define JVMDI_GetLoadedClasses(a_env, a1, a2) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetLoadedClasses(a1, a2) )
+#define JVMDI_GetClassLoaderClasses(a_env, a1, a2, a3) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetClassLoaderClasses(a1, a2, a3) )
+#define JVMDI_GetVersionNumber(a_env, a1) ( \
+ SetJVMDIfromJNIEnv(a_env), \
+ jvmdi_interface->GetVersionNumber(a1) )
+
+#endif /* !NO_JVMDI_MACROS */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JVMDI_H_ */
+
+
diff --git a/make/stub_includes/jni/macosx/jvmpi.h b/make/stub_includes/jni/macosx/jvmpi.h
new file mode 100644
index 000000000..2dbaae5e7
--- /dev/null
+++ b/make/stub_includes/jni/macosx/jvmpi.h
@@ -0,0 +1,642 @@
+/*
+ * @(#)jvmpi.h 1.28 03/12/19
+ *
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JVMPI_H_
+#define _JAVASOFT_JVMPI_H_
+
+#include "jni.h"
+
+#define JVMPI_VERSION_1 ((jint)0x10000001) /* implied 0 for minor version */
+#define JVMPI_VERSION_1_1 ((jint)0x10000002)
+#define JVMPI_VERSION_1_2 ((jint)0x10000003)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ typedef void (*jvmpi_void_function_of_void)(void *);
+#ifdef __cplusplus
+}
+#endif
+
+/****************************************************************
+ * Profiler interface data structures.
+ ****************************************************************/
+/* identifier types. */
+struct _jobjectID;
+typedef struct _jobjectID * jobjectID; /* type of object ids */
+
+/* raw monitors */
+struct _JVMPI_RawMonitor;
+typedef struct _JVMPI_RawMonitor * JVMPI_RawMonitor;
+
+/* call frame */
+typedef struct {
+ jint lineno; /* line number in the source file */
+ jmethodID method_id; /* method executed in this frame */
+} JVMPI_CallFrame;
+
+/* call trace */
+typedef struct {
+ JNIEnv *env_id; /* Env where trace was recorded */
+ jint num_frames; /* number of frames in this trace */
+ JVMPI_CallFrame *frames; /* frames */
+} JVMPI_CallTrace;
+
+/* method */
+typedef struct {
+ char *method_name; /* name of method */
+ char *method_signature; /* signature of method */
+ jint start_lineno; /* -1 if native, abstract .. */
+ jint end_lineno; /* -1 if native, abstract .. */
+ jmethodID method_id; /* id assigned to this method */
+} JVMPI_Method;
+
+/* Field */
+typedef struct {
+ char *field_name; /* name of field */
+ char *field_signature; /* signature of field */
+} JVMPI_Field;
+
+/* line number info for a compiled method */
+typedef struct {
+ jint offset; /* offset from beginning of method */
+ jint lineno; /* lineno from beginning of src file */
+} JVMPI_Lineno;
+
+/* event */
+typedef struct {
+ jint event_type; /* event_type */
+ JNIEnv *env_id; /* env where this event occured */
+
+ union {
+ struct {
+ const char *class_name; /* class name */
+ char *source_name; /* name of source file */
+ jint num_interfaces; /* number of interfaces implemented */
+ jint num_methods; /* number of methods in the class */
+ JVMPI_Method *methods; /* methods */
+ jint num_static_fields; /* number of static fields */
+ JVMPI_Field *statics; /* static fields */
+ jint num_instance_fields; /* number of instance fields */
+ JVMPI_Field *instances; /* instance fields */
+ jobjectID class_id; /* id of the class object */
+ } class_load;
+
+ struct {
+ jobjectID class_id; /* id of the class object */
+ } class_unload;
+
+ struct {
+ unsigned char *class_data; /* content of class file */
+ jint class_data_len; /* class file length */
+ unsigned char *new_class_data; /* instrumented class file */
+ jint new_class_data_len; /* new class file length */
+ void * (*malloc_f)(unsigned int); /* memory allocation function */
+ } class_load_hook;
+
+ struct {
+ jint arena_id;
+ jobjectID class_id; /* id of object class */
+ jint is_array; /* JVMPI_NORMAL_OBJECT, ... */
+ jint size; /* size in number of bytes */
+ jobjectID obj_id; /* id assigned to this object */
+ } obj_alloc;
+
+ struct {
+ jobjectID obj_id; /* id of the object */
+ } obj_free;
+
+ struct {
+ jint arena_id; /* cur arena id */
+ jobjectID obj_id; /* cur object id */
+ jint new_arena_id; /* new arena id */
+ jobjectID new_obj_id; /* new object id */
+ } obj_move;
+
+ struct {
+ jint arena_id; /* id of arena */
+ const char *arena_name; /* name of arena */
+ } new_arena;
+
+ struct {
+ jint arena_id; /* id of arena */
+ } delete_arena;
+
+ struct {
+ char *thread_name; /* name of thread */
+ char *group_name; /* name of group */
+ char *parent_name; /* name of parent */
+ jobjectID thread_id; /* id of the thread object */
+ JNIEnv *thread_env_id;
+ } thread_start;
+
+ struct {
+ int dump_level; /* level of the heap dump info */
+ char *begin; /* where all the root records begin,
+ please see the heap dump buffer
+ format described below */
+ char *end; /* where the object records end. */
+ jint num_traces; /* number of thread traces,
+ 0 if dump level = JVMPI_DUMP_LEVEL_0 */
+ JVMPI_CallTrace *traces; /* thread traces collected during
+ heap dump */
+ } heap_dump;
+
+ struct {
+ jobjectID obj_id; /* object id */
+ jobject ref_id; /* id assigned to the globalref */
+ } jni_globalref_alloc;
+
+ struct {
+ jobject ref_id; /* id of the global ref */
+ } jni_globalref_free;
+
+ struct {
+ jmethodID method_id; /* method */
+ } method;
+
+ struct {
+ jmethodID method_id; /* id of method */
+ jobjectID obj_id; /* id of target object */
+ } method_entry2;
+
+ struct {
+ jmethodID method_id; /* id of compiled method */
+ void *code_addr; /* code start addr. in memory */
+ jint code_size; /* code size */
+ jint lineno_table_size; /* size of lineno table */
+ JVMPI_Lineno *lineno_table; /* lineno info */
+ } compiled_method_load;
+
+ struct {
+ jmethodID method_id; /* id of unloaded compiled method */
+ } compiled_method_unload;
+
+ struct {
+ jmethodID method_id; /* id of the method the instruction belongs to */
+ jint offset; /* instruction offset in the method's bytecode */
+ union {
+ struct {
+ jboolean is_true; /* whether true or false branch is taken */
+ } if_info;
+ struct {
+ jint key; /* top stack value used as an index */
+ jint low; /* min value of the index */
+ jint hi; /* max value of the index */
+ } tableswitch_info;
+ struct {
+ jint chosen_pair_index; /* actually chosen pair index (0-based)
+ * if chosen_pair_index == pairs_total then
+ * the 'default' branch is taken
+ */
+ jint pairs_total; /* total number of lookupswitch pairs */
+ } lookupswitch_info;
+ } u;
+ } instruction;
+
+ struct {
+ char *begin; /* beginning of dump buffer,
+ see below for format */
+ char *end; /* end of dump buffer */
+ jint num_traces; /* number of traces */
+ JVMPI_CallTrace *traces; /* traces of all threads */
+ jint *threads_status; /* status of all threads */
+ } monitor_dump;
+
+ struct {
+ const char *name; /* name of raw monitor */
+ JVMPI_RawMonitor id; /* id */
+ } raw_monitor;
+
+ struct {
+ jobjectID object; /* Java object */
+ } monitor;
+
+ struct {
+ jobjectID object; /* Java object */
+ jlong timeout; /* timeout period */
+ } monitor_wait;
+
+ struct {
+ jlong used_objects;
+ jlong used_object_space;
+ jlong total_object_space;
+ } gc_info;
+
+ struct {
+ jint data_len;
+ char *data;
+ } object_dump;
+ } u;
+} JVMPI_Event;
+
+/* interface functions */
+typedef struct {
+ jint version; /* JVMPI version */
+
+ /* ------interface implemented by the profiler------ */
+
+ /**
+ * Function called by the JVM to notify an event.
+ */
+ void (*NotifyEvent)(JVMPI_Event *event);
+
+ /* ------interface implemented by the JVM------ */
+
+ /**
+ * Function called by the profiler to enable/disable/send notification
+ * for a particular event type.
+ *
+ * event_type - event_type
+ * arg - event specific arg
+ *
+ * return JVMPI_NOT_AVAILABLE, JVMPI_SUCCESS or JVMPI_FAIL
+ */
+ jint (*EnableEvent)(jint event_type, void *arg);
+ jint (*DisableEvent)(jint event_type, void *arg);
+ jint (*RequestEvent)(jint event_type, void *arg);
+
+ /**
+ * Function called by the profiler to get a stack
+ * trace from the JVM.
+ *
+ * trace - trace data structure to be filled
+ * depth - maximum depth of the trace.
+ */
+ void (*GetCallTrace)(JVMPI_CallTrace *trace, jint depth);
+
+ /**
+ * Function called by profiler when it wants to exit/stop.
+ */
+ void (*ProfilerExit)(jint);
+
+ /**
+ * Utility functions provided by the JVM.
+ */
+ JVMPI_RawMonitor (*RawMonitorCreate)(char *lock_name);
+ void (*RawMonitorEnter)(JVMPI_RawMonitor lock_id);
+ void (*RawMonitorExit)(JVMPI_RawMonitor lock_id);
+ void (*RawMonitorWait)(JVMPI_RawMonitor lock_id, jlong ms);
+ void (*RawMonitorNotifyAll)(JVMPI_RawMonitor lock_id);
+ void (*RawMonitorDestroy)(JVMPI_RawMonitor lock_id);
+
+ /**
+ * Function called by the profiler to get the current thread's CPU time.
+ *
+ * return time in nanoseconds;
+ */
+ jlong (*GetCurrentThreadCpuTime)(void);
+
+ void (*SuspendThread)(JNIEnv *env);
+ void (*ResumeThread)(JNIEnv *env);
+ jint (*GetThreadStatus)(JNIEnv *env);
+ jboolean (*ThreadHasRun)(JNIEnv *env);
+
+ /* This function can be called safely only after JVMPI_EVENT_VM_INIT_DONE
+ notification by the JVM. */
+ jint (*CreateSystemThread)(char *name, jint priority, void (*f)(void *));
+
+ /* thread local storage access functions to avoid locking in time
+ critical functions */
+ void (*SetThreadLocalStorage)(JNIEnv *env_id, void *ptr);
+ void * (*GetThreadLocalStorage)(JNIEnv *env_id);
+
+ /* control GC */
+ void (*DisableGC)(void);
+ void (*EnableGC)(void);
+ void (*RunGC)(void);
+
+ jobjectID (*GetThreadObject)(JNIEnv *env);
+ jobjectID (*GetMethodClass)(jmethodID mid);
+
+ /* JNI <-> jobject conversions */
+ jobject (*jobjectID2jobject)(jobjectID jid);
+ jobjectID (*jobject2jobjectID)(jobject jobj);
+
+ void (*SuspendThreadList)
+ (jint reqCount, JNIEnv **reqList, jint *results);
+ void (*ResumeThreadList)
+ (jint reqCount, JNIEnv **reqList, jint *results);
+} JVMPI_Interface;
+
+/* type of argument passed to RequestEvent for heap dumps */
+typedef struct {
+ jint heap_dump_level;
+} JVMPI_HeapDumpArg;
+
+/**********************************************************************
+ * Constants and formats used in JVM Profiler Interface.
+ **********************************************************************/
+/*
+ * Event type constants.
+ */
+#define JVMPI_EVENT_METHOD_ENTRY ((jint)1)
+#define JVMPI_EVENT_METHOD_ENTRY2 ((jint)2)
+#define JVMPI_EVENT_METHOD_EXIT ((jint)3)
+
+#define JVMPI_EVENT_OBJECT_ALLOC ((jint)4)
+#define JVMPI_EVENT_OBJECT_FREE ((jint)5)
+#define JVMPI_EVENT_OBJECT_MOVE ((jint)6)
+
+#define JVMPI_EVENT_COMPILED_METHOD_LOAD ((jint)7)
+#define JVMPI_EVENT_COMPILED_METHOD_UNLOAD ((jint)8)
+
+#define JVMPI_EVENT_INSTRUCTION_START ((jint)9)
+
+#define JVMPI_EVENT_THREAD_START ((jint)33)
+#define JVMPI_EVENT_THREAD_END ((jint)34)
+
+#define JVMPI_EVENT_CLASS_LOAD_HOOK ((jint)35)
+
+#define JVMPI_EVENT_HEAP_DUMP ((jint)37)
+#define JVMPI_EVENT_JNI_GLOBALREF_ALLOC ((jint)38)
+#define JVMPI_EVENT_JNI_GLOBALREF_FREE ((jint)39)
+#define JVMPI_EVENT_JNI_WEAK_GLOBALREF_ALLOC ((jint)40)
+#define JVMPI_EVENT_JNI_WEAK_GLOBALREF_FREE ((jint)41)
+#define JVMPI_EVENT_CLASS_LOAD ((jint)42)
+#define JVMPI_EVENT_CLASS_UNLOAD ((jint)43)
+#define JVMPI_EVENT_DATA_DUMP_REQUEST ((jint)44)
+#define JVMPI_EVENT_DATA_RESET_REQUEST ((jint)45)
+
+#define JVMPI_EVENT_JVM_INIT_DONE ((jint)46)
+#define JVMPI_EVENT_JVM_SHUT_DOWN ((jint)47)
+
+#define JVMPI_EVENT_ARENA_NEW ((jint)48)
+#define JVMPI_EVENT_ARENA_DELETE ((jint)49)
+
+#define JVMPI_EVENT_OBJECT_DUMP ((jint)50)
+
+#define JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTER ((jint)51)
+#define JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTERED ((jint)52)
+#define JVMPI_EVENT_RAW_MONITOR_CONTENDED_EXIT ((jint)53)
+#define JVMPI_EVENT_MONITOR_CONTENDED_ENTER ((jint)54)
+#define JVMPI_EVENT_MONITOR_CONTENDED_ENTERED ((jint)55)
+#define JVMPI_EVENT_MONITOR_CONTENDED_EXIT ((jint)56)
+#define JVMPI_EVENT_MONITOR_WAIT ((jint)57)
+#define JVMPI_EVENT_MONITOR_WAITED ((jint)58)
+#define JVMPI_EVENT_MONITOR_DUMP ((jint)59)
+
+#define JVMPI_EVENT_GC_START ((jint)60)
+#define JVMPI_EVENT_GC_FINISH ((jint)61)
+
+#define JVMPI_MAX_EVENT_TYPE_VAL ((jint)61)
+
+/* old definitions, to be removed */
+#define JVMPI_EVENT_LOAD_COMPILED_METHOD ((jint)7)
+#define JVMPI_EVENT_UNLOAD_COMPILED_METHOD ((jint)8)
+#define JVMPI_EVENT_NEW_ARENA ((jint)48)
+#define JVMPI_EVENT_DELETE_ARENA ((jint)49)
+#define JVMPI_EVENT_DUMP_DATA_REQUEST ((jint)44)
+#define JVMPI_EVENT_RESET_DATA_REQUEST ((jint)45)
+#define JVMPI_EVENT_OBJ_ALLOC ((jint)4)
+#define JVMPI_EVENT_OBJ_FREE ((jint)5)
+#define JVMPI_EVENT_OBJ_MOVE ((jint)6)
+
+#define JVMPI_REQUESTED_EVENT ((jint)0x10000000)
+
+
+
+/*
+ * enabling/disabling event notification.
+ */
+/* results */
+#define JVMPI_SUCCESS ((jint)0)
+#define JVMPI_NOT_AVAILABLE ((jint)1)
+#define JVMPI_FAIL ((jint)-1)
+
+/*
+ * Thread status
+ */
+enum {
+ JVMPI_THREAD_RUNNABLE = 1,
+ JVMPI_THREAD_MONITOR_WAIT,
+ JVMPI_THREAD_CONDVAR_WAIT
+};
+
+#define JVMPI_THREAD_SUSPENDED 0x8000
+#define JVMPI_THREAD_INTERRUPTED 0x4000
+
+/*
+ * Thread priority
+ */
+#define JVMPI_MINIMUM_PRIORITY 1
+#define JVMPI_MAXIMUM_PRIORITY 10
+#define JVMPI_NORMAL_PRIORITY 5
+
+/*
+ * Object type constants.
+ */
+#define JVMPI_NORMAL_OBJECT ((jint)0)
+#define JVMPI_CLASS ((jint)2)
+#define JVMPI_BOOLEAN ((jint)4)
+#define JVMPI_CHAR ((jint)5)
+#define JVMPI_FLOAT ((jint)6)
+#define JVMPI_DOUBLE ((jint)7)
+#define JVMPI_BYTE ((jint)8)
+#define JVMPI_SHORT ((jint)9)
+#define JVMPI_INT ((jint)10)
+#define JVMPI_LONG ((jint)11)
+
+/*
+ * Monitor dump constants.
+ */
+
+#define JVMPI_MONITOR_JAVA 0x01
+#define JVMPI_MONITOR_RAW 0x02
+
+/*
+ * Heap dump constants.
+ */
+#define JVMPI_GC_ROOT_UNKNOWN 0xff
+#define JVMPI_GC_ROOT_JNI_GLOBAL 0x01
+#define JVMPI_GC_ROOT_JNI_LOCAL 0x02
+#define JVMPI_GC_ROOT_JAVA_FRAME 0x03
+#define JVMPI_GC_ROOT_NATIVE_STACK 0x04
+#define JVMPI_GC_ROOT_STICKY_CLASS 0x05
+#define JVMPI_GC_ROOT_THREAD_BLOCK 0x06
+#define JVMPI_GC_ROOT_MONITOR_USED 0x07
+#define JVMPI_GC_ROOT_THREAD_OBJ 0x08
+
+#define JVMPI_GC_CLASS_DUMP 0x20
+#define JVMPI_GC_INSTANCE_DUMP 0x21
+#define JVMPI_GC_OBJ_ARRAY_DUMP 0x22
+#define JVMPI_GC_PRIM_ARRAY_DUMP 0x23
+
+/*
+ * Dump levels
+ */
+#define JVMPI_DUMP_LEVEL_0 ((jint)0)
+#define JVMPI_DUMP_LEVEL_1 ((jint)1)
+#define JVMPI_DUMP_LEVEL_2 ((jint)2)
+
+/* Types used in dumps -
+ *
+ * u1: 1 byte
+ * u2: 2 bytes
+ * u4: 4 bytes
+ * u8: 8 bytes
+ *
+ * ty: u1 where:
+ * JVMPI_CLASS: object
+ * JVMPI_BOOLEAN: boolean
+ * JVMPI_CHAR: char
+ * JVMPI_FLOAT: float
+ * JVMPI_DOUBLE: double
+ * JVMPI_BYTE: byte
+ * JVMPI_SHORT: short
+ * JVMPI_INT: int
+ * JVMPI_LONG: long
+ *
+ * vl: values, exact type depends on the type of the value:
+ * JVMPI_BOOLEAN & JVMPI_BYTE: u1
+ * JVMPI_SHORT & JVMPI_CHAR: u2
+ * JVMPI_INT & JVMPI_FLOAT: u4
+ * JVMPI_LONG & JVMPI_DOUBLE: u8
+ * JVMPI_CLASS: jobjectID
+ */
+
+/* Format of the monitor dump buffer:
+ *
+ * u1 monitor type
+ *
+ * JVMPI_MONITOR_JAVA Java monitor
+ *
+ * jobjectID object
+ * JNIEnv * owner thread
+ * u4 entry count
+ * u4 # of threads waiting to enter
+ * [JNIEnv *]* threads waiting to enter
+ * u4 # of threads waiting to be notified
+ * [JNIEnv *]* threads waiting to be notified
+ *
+ * JVMPI_MONITOR_RAW raw monitor
+ *
+ * char * name
+ * JVMPI_RawMonitor raw monitor
+ * JNIEnv * owner thread
+ * u4 entry count
+ * u4 # of threads waiting to enter
+ * [JNIEnv *]* threads waiting to enter
+ * u4 # of threads waiting to be notified
+ * [JNIEnv *]* threads waiting to be notified
+ */
+
+/* Format of the heap dump buffer depends on the dump level
+ * specified in the JVMPI_HeapDumpArg passed to RequestEvent as arg.
+ * The default is JVMPI_DUMP_LEVEL_2.
+ *
+ * JVMPI_DUMP_LEVEL_0:
+ *
+ * u1 object type (JVMPI_CLASS ...)
+ * jobjectID object
+ *
+ * JVMPI_DUMP_LEVEL_1 and JVMPI_DUMP_LEVEL_2 use the following format:
+ * In the case of JVMPI_DUMP_LEVEL_1 the values of primitive fields in object
+ * instance dumps , the values of primitive statics in class dumps and the
+ * values of primitive arrays are excluded. JVMPI_DUMP_LEVEL_2 includes the
+ * primitive values.
+ *
+ * u1 record type
+ *
+ * JVMPI_GC_ROOT_UNKNOWN unknown root
+ *
+ * jobjectID object
+ *
+ * JVMPI_GC_ROOT_JNI_GLOBAL JNI global ref root
+ *
+ * jobjectID object
+ * jobject JNI global reference
+ *
+ * JVMPI_GC_ROOT_JNI_LOCAL JNI local ref
+ *
+ * jobjectID object
+ * JNIEnv * thread
+ * u4 frame # in stack trace (-1 for empty)
+ *
+ * JVMPI_GC_ROOT_JAVA_FRAME Java stack frame
+ *
+ * jobjectID object
+ * JNIEnv * thread
+ * u4 frame # in stack trace (-1 for empty)
+ *
+ * JVMPI_GC_ROOT_NATIVE_STACK Native stack
+ *
+ * jobjectID object
+ * JNIEnv * thread
+ *
+ * JVMPI_GC_ROOT_STICKY_CLASS System class
+ *
+ * jobjectID class object
+ *
+ * JVMPI_GC_ROOT_THREAD_BLOCK Reference from thread block
+ *
+ * jobjectID thread object
+ * JNIEnv * thread
+ *
+ * JVMPI_GC_ROOT_MONITOR_USED Busy monitor
+ *
+ * jobjectID object
+ *
+ * JVMPI_GC_CLASS_DUMP dump of a class object
+ *
+ * jobjectID class
+ * jobjectID super
+ * jobjectID class loader
+ * jobjectID signers
+ * jobjectID protection domain
+ * jobjectID class name
+ * void * reserved
+ *
+ * u4 instance size (in bytes)
+ *
+ * [jobjectID]* interfaces
+ *
+ * u2 size of constant pool
+ * [u2, constant pool index,
+ * ty, type,
+ * vl]* value
+ *
+ * [vl]* static field values
+ *
+ * JVMPI_GC_INSTANCE_DUMP dump of a normal object
+ *
+ * jobjectID object
+ * jobjectID class
+ * u4 number of bytes that follow
+ * [vl]* instance field values (class, followed
+ * by super, super's super ...)
+ *
+ * JVMPI_GC_OBJ_ARRAY_DUMP dump of an object array
+ *
+ * jobjectID array object
+ * u4 number of elements
+ * jobjectID element class
+ * [jobjectID]* elements
+ *
+ * JVMPI_GC_PRIM_ARRAY_DUMP dump of a primitive array
+ *
+ * jobjectID array object
+ * u4 number of elements
+ * ty element type
+ * [vl]* elements
+ *
+ */
+
+/* Format of the dump received in JVMPI_EVENT_OBJECT_DUMP:
+ * All the records have JVMPI_DUMP_LEVEL_2 information.
+ *
+ * u1 record type
+ *
+ * followed by a:
+ *
+ * JVMPI_GC_CLASS_DUMP,
+ * JVMPI_GC_INSTANCE_DUMP,
+ * JVMPI_GC_OBJ_ARRAY_DUMP, or
+ * JVMPI_GC_PRIM_ARRAY_DUMP record.
+ */
+
+#endif /* !_JAVASOFT_JVMPI_H_ */
diff --git a/make/stub_includes/jni/win32/jawt_md.h b/make/stub_includes/jni/win32/jawt_md.h
new file mode 100755
index 000000000..ebfc66afe
--- /dev/null
+++ b/make/stub_includes/jni/win32/jawt_md.h
@@ -0,0 +1,41 @@
+/*
+ * @(#)jawt_md.h 1.8 05/11/17
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JAWT_MD_H_
+#define _JAVASOFT_JAWT_MD_H_
+
+#include <windows.h>
+#include "jawt.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Win32-specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ */
+typedef struct jawt_Win32DrawingSurfaceInfo {
+ /* Native window, DDB, or DIB handle */
+ union {
+ HWND hwnd;
+ HBITMAP hbitmap;
+ void* pbits;
+ };
+ /*
+ * This HDC should always be used instead of the HDC returned from
+ * BeginPaint() or any calls to GetDC().
+ */
+ HDC hdc;
+ HPALETTE hpalette;
+} JAWT_Win32DrawingSurfaceInfo;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_JAVASOFT_JAWT_MD_H_ */
diff --git a/make/stub_includes/jni/win32/jni_md.h b/make/stub_includes/jni/win32/jni_md.h
new file mode 100755
index 000000000..9f0cfa463
--- /dev/null
+++ b/make/stub_includes/jni/win32/jni_md.h
@@ -0,0 +1,19 @@
+/*
+ * @(#)jni_md.h 1.15 05/11/17
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT __declspec(dllexport)
+#define JNIIMPORT __declspec(dllimport)
+#define JNICALL __stdcall
+
+typedef long jint;
+typedef __int64 jlong;
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/make/stub_includes/jni/x11/jawt_md.h b/make/stub_includes/jni/x11/jawt_md.h
new file mode 100644
index 000000000..2a8fe5cf9
--- /dev/null
+++ b/make/stub_includes/jni/x11/jawt_md.h
@@ -0,0 +1,43 @@
+/*
+ * @(#)jawt_md.h 1.12 05/11/17
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JAWT_MD_H_
+#define _JAVASOFT_JAWT_MD_H_
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Intrinsic.h>
+#include "jawt.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * X11-specific declarations for AWT native interface.
+ * See notes in jawt.h for an example of use.
+ */
+typedef struct jawt_X11DrawingSurfaceInfo {
+ Drawable drawable;
+ Display* display;
+ VisualID visualID;
+ Colormap colormapID;
+ int depth;
+ /*
+ * Since 1.4
+ * Returns a pixel value from a set of RGB values.
+ * This is useful for paletted color (256 color) modes.
+ */
+ int (JNICALL *GetAWTColor)(JAWT_DrawingSurface* ds,
+ int r, int g, int b);
+} JAWT_X11DrawingSurfaceInfo;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_JAVASOFT_JAWT_MD_H_ */
diff --git a/make/stub_includes/jni/x11/jni_md.h b/make/stub_includes/jni/x11/jni_md.h
new file mode 100644
index 000000000..3320cc7c7
--- /dev/null
+++ b/make/stub_includes/jni/x11/jni_md.h
@@ -0,0 +1,24 @@
+/*
+ * @(#)jni_md.h 1.19 05/11/17
+ *
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit Solaris */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/make/stub_includes/macosx/AppKit/NSView.h b/make/stub_includes/macosx/AppKit/NSView.h
new file mode 100644
index 000000000..5d3acf658
--- /dev/null
+++ b/make/stub_includes/macosx/AppKit/NSView.h
@@ -0,0 +1 @@
+typedef struct _NSView NSView;
diff --git a/make/stub_includes/macosx/OpenGL/OpenGL.h b/make/stub_includes/macosx/OpenGL/OpenGL.h
new file mode 100644
index 000000000..16225b46b
--- /dev/null
+++ b/make/stub_includes/macosx/OpenGL/OpenGL.h
@@ -0,0 +1,101 @@
+/* Typedefs, enums and function prototypes extracted from Apple's
+ OpenGL.h to expose portions of the low-level CGL API to Java */
+
+/* Typedefs to get things working */
+typedef struct _cglObj* CGLContextObj;
+typedef struct _cglObj* CGLPBufferObj;
+typedef struct _cglObj* CGLPixelFormatObj;
+
+/*
+** Attribute names for CGLChoosePixelFormat and CGLDescribePixelFormat.
+*/
+typedef enum _CGLPixelFormatAttribute {
+ kCGLPFAAllRenderers = 1, /* choose from all available renderers */
+ kCGLPFADoubleBuffer = 5, /* choose a double buffered pixel format */
+ kCGLPFAStereo = 6, /* stereo buffering supported */
+ kCGLPFAAuxBuffers = 7, /* number of aux buffers */
+ kCGLPFAColorSize = 8, /* number of color buffer bits */
+ kCGLPFAAlphaSize = 11, /* number of alpha component bits */
+ kCGLPFADepthSize = 12, /* number of depth buffer bits */
+ kCGLPFAStencilSize = 13, /* number of stencil buffer bits */
+ kCGLPFAAccumSize = 14, /* number of accum buffer bits */
+ kCGLPFAMinimumPolicy = 51, /* never choose smaller buffers than requested */
+ kCGLPFAMaximumPolicy = 52, /* choose largest buffers of type requested */
+ kCGLPFAOffScreen = 53, /* choose an off-screen capable renderer */
+ kCGLPFAFullScreen = 54, /* choose a full-screen capable renderer */
+ kCGLPFASampleBuffers = 55, /* number of multi sample buffers */
+ kCGLPFASamples = 56, /* number of samples per multi sample buffer */
+ kCGLPFAAuxDepthStencil = 57, /* each aux buffer has its own depth stencil */
+ kCGLPFAColorFloat = 58, /* color buffers store floating point pixels */
+ kCGLPFAMultisample = 59, /* choose multisampling */
+ kCGLPFASupersample = 60, /* choose supersampling */
+ kCGLPFASampleAlpha = 61, /* request alpha filtering */
+
+ kCGLPFARendererID = 70, /* request renderer by ID */
+ kCGLPFASingleRenderer = 71, /* choose a single renderer for all screens */
+ kCGLPFANoRecovery = 72, /* disable all failure recovery systems */
+ kCGLPFAAccelerated = 73, /* choose a hardware accelerated renderer */
+ kCGLPFAClosestPolicy = 74, /* choose the closest color buffer to request */
+ kCGLPFARobust = 75, /* renderer does not need failure recovery */
+ kCGLPFABackingStore = 76, /* back buffer contents are valid after swap */
+ kCGLPFAMPSafe = 78, /* renderer is multi-processor safe */
+ kCGLPFAWindow = 80, /* can be used to render to an onscreen window */
+ kCGLPFAMultiScreen = 81, /* single window can span multiple screens */
+ kCGLPFACompliant = 83, /* renderer is opengl compliant */
+ kCGLPFADisplayMask = 84, /* mask limiting supported displays */
+ kCGLPFAPBuffer = 90, /* can be used to render to a pbuffer */
+ kCGLPFARemotePBuffer = 91, /* can be used to render offline to a pbuffer */
+ kCGLPFAVirtualScreenCount = 128 /* number of virtual screens in this format */
+} CGLPixelFormatAttribute;
+
+/*
+** Error return values from CGLGetError.
+*/
+typedef enum _CGLError {
+ kCGLNoError = 0, /* no error */
+ kCGLBadAttribute = 10000, /* invalid pixel format attribute */
+ kCGLBadProperty = 10001, /* invalid renderer property */
+ kCGLBadPixelFormat = 10002, /* invalid pixel format */
+ kCGLBadRendererInfo = 10003, /* invalid renderer info */
+ kCGLBadContext = 10004, /* invalid context */
+ kCGLBadDrawable = 10005, /* invalid drawable */
+ kCGLBadDisplay = 10006, /* invalid graphics device */
+ kCGLBadState = 10007, /* invalid context state */
+ kCGLBadValue = 10008, /* invalid numerical value */
+ kCGLBadMatch = 10009, /* invalid share context */
+ kCGLBadEnumeration = 10010, /* invalid enumerant */
+ kCGLBadOffScreen = 10011, /* invalid offscreen drawable */
+ kCGLBadFullScreen = 10012, /* invalid offscreen drawable */
+ kCGLBadWindow = 10013, /* invalid window */
+ kCGLBadAddress = 10014, /* invalid pointer */
+ kCGLBadCodeModule = 10015, /* invalid code module */
+ kCGLBadAlloc = 10016, /* invalid memory allocation */
+ kCGLBadConnection = 10017 /* invalid CoreGraphics connection */
+} CGLError;
+
+/* Pixel format manipulation */
+CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs,
+ CGLPixelFormatObj *pix,
+ long *npix);
+CGLError CGLDestroyPixelFormat(CGLPixelFormatObj pix);
+
+/* Context manipulation */
+CGLError CGLCreateContext(CGLPixelFormatObj pix,
+ CGLContextObj share,
+ CGLContextObj* ctx);
+CGLError CGLDestroyContext(CGLContextObj ctx);
+CGLError CGLSetCurrentContext(CGLContextObj ctx);
+
+/* PBuffer manipulation */
+CGLError CGLCreatePBuffer(long width,
+ long height,
+ unsigned long target,
+ unsigned long internalFormat,
+ long max_level,
+ CGLPBufferObj* pbuffer);
+CGLError CGLDestroyPBuffer(CGLPBufferObj pbuffer);
+CGLError CGLSetPBuffer(CGLContextObj ctx,
+ CGLPBufferObj pbuffer,
+ unsigned long face,
+ long level,
+ long screen);
diff --git a/make/stub_includes/macosx/cglext.c b/make/stub_includes/macosx/cglext.c
new file mode 100755
index 000000000..14010fcc4
--- /dev/null
+++ b/make/stub_includes/macosx/cglext.c
@@ -0,0 +1 @@
+#include <cglext.h>
diff --git a/make/stub_includes/macosx/jni.h b/make/stub_includes/macosx/jni.h
new file mode 100644
index 000000000..be01d0187
--- /dev/null
+++ b/make/stub_includes/macosx/jni.h
@@ -0,0 +1,78 @@
+/* Stub header for JNI which provides needed declarations without more
+ complicated and unnecessary constructs */
+
+/*
+ * JNI Types
+ */
+
+#include "jni_md.h"
+
+typedef unsigned char jboolean;
+typedef unsigned short jchar;
+typedef short jshort;
+typedef float jfloat;
+typedef double jdouble;
+
+typedef jint jsize;
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+typedef jobject jweak;
+
+typedef union jvalue {
+ jboolean z;
+ jbyte b;
+ jchar c;
+ jshort s;
+ jint i;
+ jlong j;
+ jfloat f;
+ jdouble d;
+ jobject l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK 0 /* success */
+#define JNI_ERR (-1) /* unknown error */
+#define JNI_EDETACHED (-2) /* thread detached from the VM */
+#define JNI_EVERSION (-3) /* JNI version error */
+#define JNI_ENOMEM (-4) /* not enough memory */
+#define JNI_EEXIST (-5) /* VM already created */
+#define JNI_EINVAL (-6) /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
diff --git a/make/stub_includes/macosx/jni_md.h b/make/stub_includes/macosx/jni_md.h
new file mode 100644
index 000000000..449786272
--- /dev/null
+++ b/make/stub_includes/macosx/jni_md.h
@@ -0,0 +1,15 @@
+#define _JNI_IMPORT_OR_EXPORT_
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit Solaris */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+
+typedef signed char jbyte;
+
+typedef long JNIEnv;
diff --git a/make/stub_includes/macosx/window-system.c b/make/stub_includes/macosx/window-system.c
new file mode 100644
index 000000000..787d265ed
--- /dev/null
+++ b/make/stub_includes/macosx/window-system.c
@@ -0,0 +1,47 @@
+#include "macosx-window-system.h"
+
+/* These can not show up in the header file above because they must not be visible during the real build */
+
+/*
+** Attribute names for [NSOpenGLPixelFormat initWithAttributes]
+** and [NSOpenGLPixelFormat getValues:forAttribute:forVirtualScreen].
+*/
+typedef enum {
+ NSOpenGLPFAAllRenderers = 1, /* choose from all available renderers */
+ NSOpenGLPFADoubleBuffer = 5, /* choose a double buffered pixel format */
+ NSOpenGLPFAStereo = 6, /* stereo buffering supported */
+ NSOpenGLPFAAuxBuffers = 7, /* number of aux buffers */
+ NSOpenGLPFAColorSize = 8, /* number of color buffer bits */
+ NSOpenGLPFAAlphaSize = 11, /* number of alpha component bits */
+ NSOpenGLPFADepthSize = 12, /* number of depth buffer bits */
+ NSOpenGLPFAStencilSize = 13, /* number of stencil buffer bits */
+ NSOpenGLPFAAccumSize = 14, /* number of accum buffer bits */
+ NSOpenGLPFAMinimumPolicy = 51, /* never choose smaller buffers than requested */
+ NSOpenGLPFAMaximumPolicy = 52, /* choose largest buffers of type requested */
+ NSOpenGLPFAOffScreen = 53, /* choose an off-screen capable renderer */
+ NSOpenGLPFAFullScreen = 54, /* choose a full-screen capable renderer */
+ NSOpenGLPFASampleBuffers = 55, /* number of multi sample buffers */
+ NSOpenGLPFASamples = 56, /* number of samples per multi sample buffer */
+ NSOpenGLPFAAuxDepthStencil = 57, /* each aux buffer has its own depth stencil */
+ NSOpenGLPFAColorFloat = 58, /* color buffers store floating point pixels */
+
+ NSOpenGLPFAMultisample = 59, /* choose multisampling */
+ NSOpenGLPFASupersample = 60, /* choose supersampling */
+ NSOpenGLPFASampleAlpha = 61, /* request alpha filtering */
+
+ NSOpenGLPFARendererID = 70, /* request renderer by ID */
+ NSOpenGLPFASingleRenderer = 71, /* choose a single renderer for all screens */
+ NSOpenGLPFANoRecovery = 72, /* disable all failure recovery systems */
+ NSOpenGLPFAAccelerated = 73, /* choose a hardware accelerated renderer */
+ NSOpenGLPFAClosestPolicy = 74, /* choose the closest color buffer to request */
+ NSOpenGLPFARobust = 75, /* renderer does not need failure recovery */
+ NSOpenGLPFABackingStore = 76, /* back buffer contents are valid after swap */
+ NSOpenGLPFAMPSafe = 78, /* renderer is multi-processor safe */
+ NSOpenGLPFAWindow = 80, /* can be used to render to an onscreen window */
+ NSOpenGLPFAMultiScreen = 81, /* single window can span multiple screens */
+ NSOpenGLPFACompliant = 83, /* renderer is opengl compliant */
+ NSOpenGLPFAScreenMask = 84, /* bit mask of supported physical screens */
+ NSOpenGLPFAPixelBuffer = 90, /* can be used to render to a pbuffer */
+ NSOpenGLPFAVirtualScreenCount = 128 /* number of virtual screens in this format */
+} NSOpenGLPixelFormatAttribute;
+
diff --git a/make/stub_includes/opengl/GL/cglext.h b/make/stub_includes/opengl/GL/cglext.h
new file mode 100644
index 000000000..7f49b980e
--- /dev/null
+++ b/make/stub_includes/opengl/GL/cglext.h
@@ -0,0 +1,13 @@
+#ifndef __cglext_h_
+#define __cglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/make/stub_includes/opengl/GL/gl.h b/make/stub_includes/opengl/GL/gl.h
new file mode 100644
index 000000000..244696a9f
--- /dev/null
+++ b/make/stub_includes/opengl/GL/gl.h
@@ -0,0 +1,1407 @@
+/*
+ * This file is was based upon the Mesa 3D Graphics library version 4.1 file
+ * "gl.h"; The Mesa copyright notice is preserved below.
+ *
+ * It has been modified to include only OpenGL 1.1 and earlier headers
+ * as well as some system-specific information. It should not need to be
+ * modified in the event that the OpenGL specification changes; these changes
+ * should be reflected in the glext.h header file. This file should only need
+ * to modified to add or changed system-specific information.
+ */
+
+/*
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __gl_h_
+#define __gl_h_
+
+/**********************************************************************
+ * Begin system-specific stuff.
+ */
+#if defined(__BEOS__)
+#include <stdlib.h> /* to get some BeOS-isms */
+#endif
+
+#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO))
+#define OPENSTEP
+#endif
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# endif /* _STATIC_MESA support */
+# define GLAPIENTRY __stdcall
+#else
+/* non-Windows compilation */
+# define GLAPI extern
+# define GLAPIENTRY
+#endif /* WIN32 / CYGWIN bracket */
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
+#include <gl/mesa_wgl.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * ---------------------------------------------
+ * OpenGL 1.0 Spec
+ * ---------------------------------------------
+ */
+#ifndef GL_VERSION_1_0
+#define GL_VERSION_1_0 1
+
+/*
+ * Datatypes
+ */
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+/*
+ * Constants
+ */
+
+/* Boolean values */
+#define GL_FALSE 0x0
+#define GL_TRUE 0x1
+
+/* Data types */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_DOUBLE 0x140A
+#define GL_2_BYTES 0x1407
+#define GL_3_BYTES 0x1408
+#define GL_4_BYTES 0x1409
+
+/* Primitives */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_QUADS 0x0007
+#define GL_QUAD_STRIP 0x0008
+#define GL_POLYGON 0x0009
+
+/* Matrix Mode */
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* Points */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_RANGE 0x0B12
+
+/* Lines */
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+
+/* Polygons */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_EDGE_FLAG 0x0B43
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+
+/* Display Lists */
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+
+/* Depth buffer */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_COMPONENT 0x1902
+
+/* Lighting */
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_SHININESS 0x1601
+#define GL_EMISSION 0x1600
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_COLOR_INDEXES 0x1603
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_SHADE_MODEL 0x0B54
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_NORMALIZE 0x0BA1
+
+/* User clipping planes */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* Accumulation buffer */
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM 0x0100
+#define GL_ADD 0x0104
+#define GL_LOAD 0x0101
+#define GL_MULT 0x0103
+#define GL_RETURN 0x0102
+
+/* Alpha testing */
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+
+/* Blending */
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_DST 0x0BE0
+#define GL_ZERO 0x0
+#define GL_ONE 0x1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+
+/* Render Mode */
+#define GL_FEEDBACK 0x1C01
+#define GL_RENDER 0x1C00
+#define GL_SELECT 0x1C02
+
+/* Feedback */
+#define GL_2D 0x0600
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_POINT_TOKEN 0x0701
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+
+/* Selection */
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+
+/* Fog */
+#define GL_FOG 0x0B60
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_LINEAR 0x2601
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* Logic Ops */
+#define GL_LOGIC_OP 0x0BF1
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_CLEAR 0x1500
+#define GL_SET 0x150F
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_NOOP 0x1505
+#define GL_INVERT 0x150A
+#define GL_AND 0x1501
+#define GL_NAND 0x150E
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_XOR 0x1506
+#define GL_EQUIV 0x1509
+#define GL_AND_REVERSE 0x1502
+#define GL_AND_INVERTED 0x1504
+#define GL_OR_REVERSE 0x150B
+#define GL_OR_INVERTED 0x150D
+
+/* Stencil */
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_INDEX 0x1901
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+
+/* Buffers, Pixel Drawing/Reading */
+#define GL_NONE 0x0
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+/*GL_FRONT 0x0404 */
+/*GL_BACK 0x0405 */
+/*GL_FRONT_AND_BACK 0x0408 */
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_COLOR_INDEX 0x1900
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_ALPHA_BITS 0x0D55
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_INDEX_BITS 0x0D51
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_READ_BUFFER 0x0C02
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_BITMAP 0x1A00
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+#define GL_DITHER 0x0BD0
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+
+/* Implementation limits */
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+
+/* Gets */
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_RENDER_MODE 0x0C40
+#define GL_RGBA_MODE 0x0C31
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_VIEWPORT 0x0BA2
+
+/* Evaluators */
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_COEFF 0x0A00
+#define GL_DOMAIN 0x0A02
+#define GL_ORDER 0x0A01
+
+/* Hints */
+#define GL_FOG_HINT 0x0C54
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* Scissor box */
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_SCISSOR_BOX 0x0C10
+
+/* Pixel Mode / Transfer */
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_STENCIL 0x0D11
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_RED_SCALE 0x0D14
+#define GL_RED_BIAS 0x0D15
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GREEN_BIAS 0x0D19
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+/* Texture mapping */
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_SPHERE_MAP 0x2402
+#define GL_DECAL 0x2101
+#define GL_MODULATE 0x2100
+#define GL_NEAREST 0x2600
+#define GL_REPEAT 0x2901
+#define GL_CLAMP 0x2900
+#define GL_S 0x2000
+#define GL_T 0x2001
+#define GL_R 0x2002
+#define GL_Q 0x2003
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_Q 0x0C63
+
+/* Utility */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* Errors */
+#define GL_NO_ERROR 0x0
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* glPush/PopAttrib bits */
+#define GL_CURRENT_BIT 0x00000001
+#define GL_POINT_BIT 0x00000002
+#define GL_LINE_BIT 0x00000004
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_FOG_BIT 0x00000080
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_ENABLE_BIT 0x00002000
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_HINT_BIT 0x00008000
+#define GL_EVAL_BIT 0x00010000
+#define GL_LIST_BIT 0x00020000
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_ALL_ATTRIB_BITS 0x000FFFFF
+
+/*
+ * Miscellaneous
+ */
+
+GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
+
+GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
+
+GLAPI void GLAPIENTRY glClear( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
+
+GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
+
+GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
+
+GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
+
+GLAPI void GLAPIENTRY glCullFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
+
+GLAPI void GLAPIENTRY glPointSize( GLfloat size );
+
+GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
+
+GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
+
+GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
+
+GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
+
+GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
+
+GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
+
+GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
+
+GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
+
+GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
+
+GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
+
+GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnable( GLenum cap );
+
+GLAPI void GLAPIENTRY glDisable( GLenum cap );
+
+GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
+
+GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
+
+GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
+
+GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
+
+GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
+
+GLAPI void GLAPIENTRY glPopAttrib( void );
+
+
+
+GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
+
+GLAPI GLenum GLAPIENTRY glGetError( void );
+
+GLAPI const GLubyte* GLAPIENTRY glGetString( GLenum name );
+
+GLAPI void GLAPIENTRY glFinish( void );
+
+GLAPI void GLAPIENTRY glFlush( void );
+
+GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
+
+
+/*
+ * Depth Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
+
+GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
+
+GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
+
+GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
+
+
+/*
+ * Accumulation Buffer
+ */
+
+GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
+
+GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
+
+
+/*
+ * Transformation
+ */
+
+GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
+
+GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble near_val, GLdouble far_val );
+
+GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
+ GLsizei width, GLsizei height );
+
+GLAPI void GLAPIENTRY glPushMatrix( void );
+
+GLAPI void GLAPIENTRY glPopMatrix( void );
+
+GLAPI void GLAPIENTRY glLoadIdentity( void );
+
+GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
+GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
+
+GLAPI void GLAPIENTRY glRotated( GLdouble angle,
+ GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
+ GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
+
+GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
+
+
+/*
+ * Display Lists
+ */
+
+GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
+
+GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
+
+GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
+
+GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
+
+GLAPI void GLAPIENTRY glEndList( void );
+
+GLAPI void GLAPIENTRY glCallList( GLuint list );
+
+GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
+ const GLvoid *lists );
+
+GLAPI void GLAPIENTRY glListBase( GLuint base );
+
+
+/*
+ * Drawing Functions
+ */
+
+GLAPI void GLAPIENTRY glBegin( GLenum mode );
+
+GLAPI void GLAPIENTRY glEnd( void );
+
+
+GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
+GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
+GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
+GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
+GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
+GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
+
+GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
+GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glIndexd( GLdouble c );
+GLAPI void GLAPIENTRY glIndexf( GLfloat c );
+GLAPI void GLAPIENTRY glIndexi( GLint c );
+GLAPI void GLAPIENTRY glIndexs( GLshort c );
+
+GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
+GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
+GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
+GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
+
+GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
+GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
+GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
+GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
+GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
+GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
+GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
+GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
+
+GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
+ GLbyte blue, GLbyte alpha );
+GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
+ GLdouble blue, GLdouble alpha );
+GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
+ GLfloat blue, GLfloat alpha );
+GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
+ GLint blue, GLint alpha );
+GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
+ GLshort blue, GLshort alpha );
+GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
+ GLubyte blue, GLubyte alpha );
+GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
+ GLuint blue, GLuint alpha );
+GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
+ GLushort blue, GLushort alpha );
+
+
+GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
+
+GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
+GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
+GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
+GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
+GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
+GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
+
+
+GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
+GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
+GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
+GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
+
+GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
+GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
+GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
+GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
+
+GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
+GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
+GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
+GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
+
+GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
+GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
+GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
+GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
+
+GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
+GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
+GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
+GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
+GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
+
+GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
+GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
+GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
+GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
+
+GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
+GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
+GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
+GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
+
+GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
+
+GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
+GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
+GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
+GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
+
+
+GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
+GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
+GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
+GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
+
+
+GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
+GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
+GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
+GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
+
+
+/*
+ * Lighting
+ */
+
+GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
+
+GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
+ GLfloat *params );
+GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
+ GLint *params );
+
+GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
+GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
+
+
+/*
+ * Raster functions
+ */
+
+GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
+
+GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLint mapsize,
+ const GLfloat *values );
+GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLint mapsize,
+ const GLuint *values );
+GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLint mapsize,
+ const GLushort *values );
+
+GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
+GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
+GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
+
+GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
+ GLfloat xorig, GLfloat yorig,
+ GLfloat xmove, GLfloat ymove,
+ const GLubyte *bitmap );
+
+GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum type );
+
+/*
+ * Stenciling
+ */
+
+GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
+
+GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
+
+GLAPI void GLAPIENTRY glClearStencil( GLint s );
+
+
+
+/*
+ * Texture mapping
+ */
+
+GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
+GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
+GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
+GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
+GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
+GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
+ const GLfloat *params );
+GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
+ const GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
+ GLenum pname, GLfloat *params);
+GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
+ GLenum pname, GLint *params );
+
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
+ GLenum pname, GLfloat *params );
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
+ GLenum pname, GLint *params );
+
+
+GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
+ GLint internalFormat,
+ GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
+ GLenum format, GLenum type,
+ GLvoid *pixels );
+
+
+/*
+ * Evaluators
+ */
+
+GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
+ GLint stride,
+ GLint order, const GLdouble *points );
+GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
+ GLint stride,
+ GLint order, const GLfloat *points );
+
+GLAPI void GLAPIENTRY glMap2d( GLenum target,
+ GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
+ GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
+ const GLdouble *points );
+GLAPI void GLAPIENTRY glMap2f( GLenum target,
+ GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
+ GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
+ const GLfloat *points );
+
+GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
+GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
+GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
+
+GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
+GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
+
+GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
+GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
+
+GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
+GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
+
+GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
+GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
+
+GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
+ GLint vn, GLdouble v1, GLdouble v2 );
+GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
+ GLint vn, GLfloat v1, GLfloat v2 );
+
+GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
+
+GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
+
+GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
+
+GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
+
+
+/*
+ * Fog
+ */
+
+GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
+
+GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
+
+GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
+
+GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
+
+
+/*
+ * Selection and Feedback
+ */
+
+GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
+
+GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
+
+GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
+
+GLAPI void GLAPIENTRY glInitNames( void );
+
+GLAPI void GLAPIENTRY glLoadName( GLuint name );
+
+GLAPI void GLAPIENTRY glPushName( GLuint name );
+
+GLAPI void GLAPIENTRY glPopName( void );
+
+#endif /* GL_VERSION_1_0 */
+
+/*
+ * ---------------------------------------------
+ * OpenGL 1.1 Spec
+ * ---------------------------------------------
+ */
+
+/* OpenGL 1.1 */
+#ifndef GL_VERSION_1_1
+#define GL_VERSION_1_1 1
+
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_INDEX_ARRAY 0x8077
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_C3F_V3F 0x2A24
+#define GL_N3F_V3F 0x2A25
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_V4F 0x2A28
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+
+GLAPI void GLAPIENTRY glIndexub( GLubyte c );
+GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c );
+
+GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask );
+GLAPI void GLAPIENTRY glPopClientAttrib( void );
+GLAPI void GLAPIENTRY glEnableClientState( GLenum cap );
+GLAPI void GLAPIENTRY glDisableClientState( GLenum cap );
+GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
+GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, const GLvoid *ptr );
+GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
+GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, const GLvoid *ptr );
+GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *ptr );
+GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
+GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
+GLAPI void GLAPIENTRY glArrayElement( GLint i );
+GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
+GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices );
+GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer );
+
+GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
+GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
+GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
+GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, const GLuint *textures, const GLclampf *priorities );
+GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, const GLuint *textures, GLboolean *residences );
+GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
+GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels );
+GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels );
+GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border );
+GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
+GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
+GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
+
+#endif /* GL_VERSION_1_1 */
+
+/* Include Post-GL 1.1 changes and extensions */
+#include <GL/glext.h>
+
+
+/**********************************************************************
+ * Begin system-specific stuff
+ */
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export off
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import off
+#endif
+/*
+ * End system-specific stuff
+ **********************************************************************/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
diff --git a/make/stub_includes/opengl/GL/glext.h b/make/stub_includes/opengl/GL/glext.h
new file mode 100644
index 000000000..e6c6fab40
--- /dev/null
+++ b/make/stub_includes/opengl/GL/glext.h
@@ -0,0 +1,8116 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY*
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glext.h last updated 2009/01/08 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GL_GLEXT_VERSION 44
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_CONVOLUTION_1D 0x8010
+#define GL_CONVOLUTION_2D 0x8011
+#define GL_SEPARABLE_2D 0x8012
+#define GL_CONVOLUTION_BORDER_MODE 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS 0x8015
+#define GL_REDUCE 0x8016
+#define GL_CONVOLUTION_FORMAT 0x8017
+#define GL_CONVOLUTION_WIDTH 0x8018
+#define GL_CONVOLUTION_HEIGHT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
+#define GL_HISTOGRAM 0x8024
+#define GL_PROXY_HISTOGRAM 0x8025
+#define GL_HISTOGRAM_WIDTH 0x8026
+#define GL_HISTOGRAM_FORMAT 0x8027
+#define GL_HISTOGRAM_RED_SIZE 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
+#define GL_HISTOGRAM_SINK 0x802D
+#define GL_MINMAX 0x802E
+#define GL_MINMAX_FORMAT 0x802F
+#define GL_MINMAX_SINK 0x8030
+#define GL_TABLE_TOO_LARGE 0x8031
+#define GL_COLOR_MATRIX 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
+#define GL_COLOR_TABLE 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
+#define GL_PROXY_COLOR_TABLE 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
+#define GL_COLOR_TABLE_SCALE 0x80D6
+#define GL_COLOR_TABLE_BIAS 0x80D7
+#define GL_COLOR_TABLE_FORMAT 0x80D8
+#define GL_COLOR_TABLE_WIDTH 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
+#define GL_CONSTANT_BORDER 0x8151
+#define GL_REPLICATE_BORDER 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR 0x8154
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_NORMAL_MAP 0x8511
+#define GL_REFLECTION_MAP 0x8512
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_SUBTRACT 0x84E7
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_COLOR_SUM 0x8458
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
+#define GL_FOG_COORD GL_FOG_COORDINATE
+#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
+#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
+#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
+#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
+#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
+#define GL_SRC0_RGB GL_SOURCE0_RGB
+#define GL_SRC1_RGB GL_SOURCE1_RGB
+#define GL_SRC2_RGB GL_SOURCE2_RGB
+#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
+#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
+#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#define GL_DRAW_BUFFER0 0x8825
+#define GL_DRAW_BUFFER1 0x8826
+#define GL_DRAW_BUFFER2 0x8827
+#define GL_DRAW_BUFFER3 0x8828
+#define GL_DRAW_BUFFER4 0x8829
+#define GL_DRAW_BUFFER5 0x882A
+#define GL_DRAW_BUFFER6 0x882B
+#define GL_DRAW_BUFFER7 0x882C
+#define GL_DRAW_BUFFER8 0x882D
+#define GL_DRAW_BUFFER9 0x882E
+#define GL_DRAW_BUFFER10 0x882F
+#define GL_DRAW_BUFFER11 0x8830
+#define GL_DRAW_BUFFER12 0x8831
+#define GL_DRAW_BUFFER13 0x8832
+#define GL_DRAW_BUFFER14 0x8833
+#define GL_DRAW_BUFFER15 0x8834
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_POINT_SPRITE 0x8861
+#define GL_COORD_REPLACE 0x8862
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_COORDS 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_DELETE_STATUS 0x8B80
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
+#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
+#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
+#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
+#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
+#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
+#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
+#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
+#define GL_MAJOR_VERSION 0x821B
+#define GL_MINOR_VERSION 0x821C
+#define GL_NUM_EXTENSIONS 0x821D
+#define GL_CONTEXT_FLAGS 0x821E
+#define GL_DEPTH_BUFFER 0x8223
+#define GL_STENCIL_BUFFER 0x8224
+#define GL_COMPRESSED_RED 0x8225
+#define GL_COMPRESSED_RG 0x8226
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
+#define GL_RGBA32F 0x8814
+#define GL_RGB32F 0x8815
+#define GL_RGBA16F 0x881A
+#define GL_RGB16F 0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
+#define GL_CLAMP_VERTEX_COLOR 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR 0x891B
+#define GL_CLAMP_READ_COLOR 0x891C
+#define GL_FIXED_ONLY 0x891D
+#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
+#define GL_TEXTURE_RED_TYPE 0x8C10
+#define GL_TEXTURE_GREEN_TYPE 0x8C11
+#define GL_TEXTURE_BLUE_TYPE 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE 0x8C16
+#define GL_UNSIGNED_NORMALIZED 0x8C17
+#define GL_TEXTURE_1D_ARRAY 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
+#define GL_TEXTURE_2D_ARRAY 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
+#define GL_R11F_G11F_B10F 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
+#define GL_RGB9_E5 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE 0x8C3F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_PRIMITIVES_GENERATED 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS 0x8C8C
+#define GL_SEPARATE_ATTRIBS 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI 0x8D70
+#define GL_RGB32UI 0x8D71
+#define GL_RGBA16UI 0x8D76
+#define GL_RGB16UI 0x8D77
+#define GL_RGBA8UI 0x8D7C
+#define GL_RGB8UI 0x8D7D
+#define GL_RGBA32I 0x8D82
+#define GL_RGB32I 0x8D83
+#define GL_RGBA16I 0x8D88
+#define GL_RGB16I 0x8D89
+#define GL_RGBA8I 0x8D8E
+#define GL_RGB8I 0x8D8F
+#define GL_RED_INTEGER 0x8D94
+#define GL_GREEN_INTEGER 0x8D95
+#define GL_BLUE_INTEGER 0x8D96
+#define GL_ALPHA_INTEGER 0x8D97
+#define GL_RGB_INTEGER 0x8D98
+#define GL_RGBA_INTEGER 0x8D99
+#define GL_BGR_INTEGER 0x8D9A
+#define GL_BGRA_INTEGER 0x8D9B
+#define GL_SAMPLER_1D_ARRAY 0x8DC0
+#define GL_SAMPLER_2D_ARRAY 0x8DC1
+#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
+#define GL_UNSIGNED_INT_VEC2 0x8DC6
+#define GL_UNSIGNED_INT_VEC3 0x8DC7
+#define GL_UNSIGNED_INT_VEC4 0x8DC8
+#define GL_INT_SAMPLER_1D 0x8DC9
+#define GL_INT_SAMPLER_2D 0x8DCA
+#define GL_INT_SAMPLER_3D 0x8DCB
+#define GL_INT_SAMPLER_CUBE 0x8DCC
+#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
+#define GL_QUERY_WAIT 0x8E13
+#define GL_QUERY_NO_WAIT 0x8E14
+#define GL_QUERY_BY_REGION_WAIT 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
+/* Reuse tokens from ARB_depth_buffer_float */
+/* reuse GL_DEPTH_COMPONENT32F */
+/* reuse GL_DEPTH32F_STENCIL8 */
+/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
+/* Reuse tokens from ARB_framebuffer_object */
+/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_DEFAULT */
+/* reuse GL_FRAMEBUFFER_UNDEFINED */
+/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
+/* reuse GL_INDEX */
+/* reuse GL_MAX_RENDERBUFFER_SIZE */
+/* reuse GL_DEPTH_STENCIL */
+/* reuse GL_UNSIGNED_INT_24_8 */
+/* reuse GL_DEPTH24_STENCIL8 */
+/* reuse GL_TEXTURE_STENCIL_SIZE */
+/* reuse GL_TEXTURE_RED_TYPE */
+/* reuse GL_TEXTURE_GREEN_TYPE */
+/* reuse GL_TEXTURE_BLUE_TYPE */
+/* reuse GL_TEXTURE_ALPHA_TYPE */
+/* reuse GL_TEXTURE_LUMINANCE_TYPE */
+/* reuse GL_TEXTURE_INTENSITY_TYPE */
+/* reuse GL_TEXTURE_DEPTH_TYPE */
+/* reuse GL_UNSIGNED_NORMALIZED */
+/* reuse GL_FRAMEBUFFER_BINDING */
+/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_BINDING */
+/* reuse GL_READ_FRAMEBUFFER */
+/* reuse GL_DRAW_FRAMEBUFFER */
+/* reuse GL_READ_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_SAMPLES */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+/* reuse GL_FRAMEBUFFER_COMPLETE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
+/* reuse GL_MAX_COLOR_ATTACHMENTS */
+/* reuse GL_COLOR_ATTACHMENT0 */
+/* reuse GL_COLOR_ATTACHMENT1 */
+/* reuse GL_COLOR_ATTACHMENT2 */
+/* reuse GL_COLOR_ATTACHMENT3 */
+/* reuse GL_COLOR_ATTACHMENT4 */
+/* reuse GL_COLOR_ATTACHMENT5 */
+/* reuse GL_COLOR_ATTACHMENT6 */
+/* reuse GL_COLOR_ATTACHMENT7 */
+/* reuse GL_COLOR_ATTACHMENT8 */
+/* reuse GL_COLOR_ATTACHMENT9 */
+/* reuse GL_COLOR_ATTACHMENT10 */
+/* reuse GL_COLOR_ATTACHMENT11 */
+/* reuse GL_COLOR_ATTACHMENT12 */
+/* reuse GL_COLOR_ATTACHMENT13 */
+/* reuse GL_COLOR_ATTACHMENT14 */
+/* reuse GL_COLOR_ATTACHMENT15 */
+/* reuse GL_DEPTH_ATTACHMENT */
+/* reuse GL_STENCIL_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER */
+/* reuse GL_RENDERBUFFER */
+/* reuse GL_RENDERBUFFER_WIDTH */
+/* reuse GL_RENDERBUFFER_HEIGHT */
+/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
+/* reuse GL_STENCIL_INDEX1 */
+/* reuse GL_STENCIL_INDEX4 */
+/* reuse GL_STENCIL_INDEX8 */
+/* reuse GL_STENCIL_INDEX16 */
+/* reuse GL_RENDERBUFFER_RED_SIZE */
+/* reuse GL_RENDERBUFFER_GREEN_SIZE */
+/* reuse GL_RENDERBUFFER_BLUE_SIZE */
+/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
+/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
+/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+/* reuse GL_MAX_SAMPLES */
+/* Reuse tokens from ARB_framebuffer_sRGB */
+/* reuse GL_FRAMEBUFFER_SRGB */
+/* Reuse tokens from ARB_half_float_vertex */
+/* reuse GL_HALF_FLOAT */
+/* Reuse tokens from ARB_map_buffer_range */
+/* reuse GL_MAP_READ_BIT */
+/* reuse GL_MAP_WRITE_BIT */
+/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
+/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
+/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
+/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
+/* Reuse tokens from ARB_texture_compression_rgtc */
+/* reuse GL_COMPRESSED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_RG_RGTC2 */
+/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
+/* Reuse tokens from ARB_texture_rg */
+/* reuse GL_RG */
+/* reuse GL_RG_INTEGER */
+/* reuse GL_R8 */
+/* reuse GL_R16 */
+/* reuse GL_RG8 */
+/* reuse GL_RG16 */
+/* reuse GL_R16F */
+/* reuse GL_R32F */
+/* reuse GL_RG16F */
+/* reuse GL_RG32F */
+/* reuse GL_R8I */
+/* reuse GL_R8UI */
+/* reuse GL_R16I */
+/* reuse GL_R16UI */
+/* reuse GL_R32I */
+/* reuse GL_R32UI */
+/* reuse GL_RG8I */
+/* reuse GL_RG8UI */
+/* reuse GL_RG16I */
+/* reuse GL_RG16UI */
+/* reuse GL_RG32I */
+/* reuse GL_RG32UI */
+/* Reuse tokens from ARB_vertex_array_object */
+/* reuse GL_VERTEX_ARRAY_BINDING */
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_TEXTURE0_ARB 0x84C0
+#define GL_TEXTURE1_ARB 0x84C1
+#define GL_TEXTURE2_ARB 0x84C2
+#define GL_TEXTURE3_ARB 0x84C3
+#define GL_TEXTURE4_ARB 0x84C4
+#define GL_TEXTURE5_ARB 0x84C5
+#define GL_TEXTURE6_ARB 0x84C6
+#define GL_TEXTURE7_ARB 0x84C7
+#define GL_TEXTURE8_ARB 0x84C8
+#define GL_TEXTURE9_ARB 0x84C9
+#define GL_TEXTURE10_ARB 0x84CA
+#define GL_TEXTURE11_ARB 0x84CB
+#define GL_TEXTURE12_ARB 0x84CC
+#define GL_TEXTURE13_ARB 0x84CD
+#define GL_TEXTURE14_ARB 0x84CE
+#define GL_TEXTURE15_ARB 0x84CF
+#define GL_TEXTURE16_ARB 0x84D0
+#define GL_TEXTURE17_ARB 0x84D1
+#define GL_TEXTURE18_ARB 0x84D2
+#define GL_TEXTURE19_ARB 0x84D3
+#define GL_TEXTURE20_ARB 0x84D4
+#define GL_TEXTURE21_ARB 0x84D5
+#define GL_TEXTURE22_ARB 0x84D6
+#define GL_TEXTURE23_ARB 0x84D7
+#define GL_TEXTURE24_ARB 0x84D8
+#define GL_TEXTURE25_ARB 0x84D9
+#define GL_TEXTURE26_ARB 0x84DA
+#define GL_TEXTURE27_ARB 0x84DB
+#define GL_TEXTURE28_ARB 0x84DC
+#define GL_TEXTURE29_ARB 0x84DD
+#define GL_TEXTURE30_ARB 0x84DE
+#define GL_TEXTURE31_ARB 0x84DF
+#define GL_ACTIVE_TEXTURE_ARB 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
+#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
+#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_NORMAL_MAP_ARB 0x8511
+#define GL_REFLECTION_MAP_ARB 0x8512
+#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_COMPRESSED_ALPHA_ARB 0x84E9
+#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
+#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
+#define GL_COMPRESSED_RGB_ARB 0x84ED
+#define GL_COMPRESSED_RGBA_ARB 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
+#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_ARB 0x812D
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_POINT_SIZE_MIN_ARB 0x8126
+#define GL_POINT_SIZE_MAX_ARB 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
+#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
+#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
+#define GL_VERTEX_BLEND_ARB 0x86A7
+#define GL_CURRENT_WEIGHT_ARB 0x86A8
+#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
+#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
+#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
+#define GL_WEIGHT_ARRAY_ARB 0x86AD
+#define GL_MODELVIEW0_ARB 0x1700
+#define GL_MODELVIEW1_ARB 0x850A
+#define GL_MODELVIEW2_ARB 0x8722
+#define GL_MODELVIEW3_ARB 0x8723
+#define GL_MODELVIEW4_ARB 0x8724
+#define GL_MODELVIEW5_ARB 0x8725
+#define GL_MODELVIEW6_ARB 0x8726
+#define GL_MODELVIEW7_ARB 0x8727
+#define GL_MODELVIEW8_ARB 0x8728
+#define GL_MODELVIEW9_ARB 0x8729
+#define GL_MODELVIEW10_ARB 0x872A
+#define GL_MODELVIEW11_ARB 0x872B
+#define GL_MODELVIEW12_ARB 0x872C
+#define GL_MODELVIEW13_ARB 0x872D
+#define GL_MODELVIEW14_ARB 0x872E
+#define GL_MODELVIEW15_ARB 0x872F
+#define GL_MODELVIEW16_ARB 0x8730
+#define GL_MODELVIEW17_ARB 0x8731
+#define GL_MODELVIEW18_ARB 0x8732
+#define GL_MODELVIEW19_ARB 0x8733
+#define GL_MODELVIEW20_ARB 0x8734
+#define GL_MODELVIEW21_ARB 0x8735
+#define GL_MODELVIEW22_ARB 0x8736
+#define GL_MODELVIEW23_ARB 0x8737
+#define GL_MODELVIEW24_ARB 0x8738
+#define GL_MODELVIEW25_ARB 0x8739
+#define GL_MODELVIEW26_ARB 0x873A
+#define GL_MODELVIEW27_ARB 0x873B
+#define GL_MODELVIEW28_ARB 0x873C
+#define GL_MODELVIEW29_ARB 0x873D
+#define GL_MODELVIEW30_ARB 0x873E
+#define GL_MODELVIEW31_ARB 0x873F
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_MATRIX_PALETTE_ARB 0x8840
+#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
+#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
+#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
+#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
+#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
+#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_COMBINE_ARB 0x8570
+#define GL_COMBINE_RGB_ARB 0x8571
+#define GL_COMBINE_ALPHA_ARB 0x8572
+#define GL_SOURCE0_RGB_ARB 0x8580
+#define GL_SOURCE1_RGB_ARB 0x8581
+#define GL_SOURCE2_RGB_ARB 0x8582
+#define GL_SOURCE0_ALPHA_ARB 0x8588
+#define GL_SOURCE1_ALPHA_ARB 0x8589
+#define GL_SOURCE2_ALPHA_ARB 0x858A
+#define GL_OPERAND0_RGB_ARB 0x8590
+#define GL_OPERAND1_RGB_ARB 0x8591
+#define GL_OPERAND2_RGB_ARB 0x8592
+#define GL_OPERAND0_ALPHA_ARB 0x8598
+#define GL_OPERAND1_ALPHA_ARB 0x8599
+#define GL_OPERAND2_ALPHA_ARB 0x859A
+#define GL_RGB_SCALE_ARB 0x8573
+#define GL_ADD_SIGNED_ARB 0x8574
+#define GL_INTERPOLATE_ARB 0x8575
+#define GL_SUBTRACT_ARB 0x84E7
+#define GL_CONSTANT_ARB 0x8576
+#define GL_PRIMARY_COLOR_ARB 0x8577
+#define GL_PREVIOUS_ARB 0x8578
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_DOT3_RGB_ARB 0x86AE
+#define GL_DOT3_RGBA_ARB 0x86AF
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_ARB 0x8370
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_DEPTH_COMPONENT16_ARB 0x81A5
+#define GL_DEPTH_COMPONENT24_ARB 0x81A6
+#define GL_DEPTH_COMPONENT32_ARB 0x81A7
+#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
+#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
+#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
+#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
+#endif
+
+#ifndef GL_ARB_window_pos
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_COLOR_SUM_ARB 0x8458
+#define GL_VERTEX_PROGRAM_ARB 0x8620
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
+#define GL_PROGRAM_LENGTH_ARB 0x8627
+#define GL_PROGRAM_STRING_ARB 0x8628
+#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
+#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
+#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
+#define GL_CURRENT_MATRIX_ARB 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
+#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
+#define GL_PROGRAM_BINDING_ARB 0x8677
+#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
+#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
+#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
+#define GL_PROGRAM_FORMAT_ARB 0x8876
+#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
+#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
+#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
+#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
+#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
+#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
+#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
+#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
+#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
+#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
+#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
+#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
+#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
+#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
+#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
+#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
+#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
+#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
+#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
+#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
+#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
+#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
+#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
+#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
+#define GL_MATRIX0_ARB 0x88C0
+#define GL_MATRIX1_ARB 0x88C1
+#define GL_MATRIX2_ARB 0x88C2
+#define GL_MATRIX3_ARB 0x88C3
+#define GL_MATRIX4_ARB 0x88C4
+#define GL_MATRIX5_ARB 0x88C5
+#define GL_MATRIX6_ARB 0x88C6
+#define GL_MATRIX7_ARB 0x88C7
+#define GL_MATRIX8_ARB 0x88C8
+#define GL_MATRIX9_ARB 0x88C9
+#define GL_MATRIX10_ARB 0x88CA
+#define GL_MATRIX11_ARB 0x88CB
+#define GL_MATRIX12_ARB 0x88CC
+#define GL_MATRIX13_ARB 0x88CD
+#define GL_MATRIX14_ARB 0x88CE
+#define GL_MATRIX15_ARB 0x88CF
+#define GL_MATRIX16_ARB 0x88D0
+#define GL_MATRIX17_ARB 0x88D1
+#define GL_MATRIX18_ARB 0x88D2
+#define GL_MATRIX19_ARB 0x88D3
+#define GL_MATRIX20_ARB 0x88D4
+#define GL_MATRIX21_ARB 0x88D5
+#define GL_MATRIX22_ARB 0x88D6
+#define GL_MATRIX23_ARB 0x88D7
+#define GL_MATRIX24_ARB 0x88D8
+#define GL_MATRIX25_ARB 0x88D9
+#define GL_MATRIX26_ARB 0x88DA
+#define GL_MATRIX27_ARB 0x88DB
+#define GL_MATRIX28_ARB 0x88DC
+#define GL_MATRIX29_ARB 0x88DD
+#define GL_MATRIX30_ARB 0x88DE
+#define GL_MATRIX31_ARB 0x88DF
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_FRAGMENT_PROGRAM_ARB 0x8804
+#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
+#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
+#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
+#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
+#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
+#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
+#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
+#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
+#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
+#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
+#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
+#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
+#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_BUFFER_SIZE_ARB 0x8764
+#define GL_BUFFER_USAGE_ARB 0x8765
+#define GL_ARRAY_BUFFER_ARB 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
+#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
+#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
+#define GL_READ_ONLY_ARB 0x88B8
+#define GL_WRITE_ONLY_ARB 0x88B9
+#define GL_READ_WRITE_ARB 0x88BA
+#define GL_BUFFER_ACCESS_ARB 0x88BB
+#define GL_BUFFER_MAPPED_ARB 0x88BC
+#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
+#define GL_STREAM_DRAW_ARB 0x88E0
+#define GL_STREAM_READ_ARB 0x88E1
+#define GL_STREAM_COPY_ARB 0x88E2
+#define GL_STATIC_DRAW_ARB 0x88E4
+#define GL_STATIC_READ_ARB 0x88E5
+#define GL_STATIC_COPY_ARB 0x88E6
+#define GL_DYNAMIC_DRAW_ARB 0x88E8
+#define GL_DYNAMIC_READ_ARB 0x88E9
+#define GL_DYNAMIC_COPY_ARB 0x88EA
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_QUERY_COUNTER_BITS_ARB 0x8864
+#define GL_CURRENT_QUERY_ARB 0x8865
+#define GL_QUERY_RESULT_ARB 0x8866
+#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
+#define GL_SAMPLES_PASSED_ARB 0x8914
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_PROGRAM_OBJECT_ARB 0x8B40
+#define GL_SHADER_OBJECT_ARB 0x8B48
+#define GL_OBJECT_TYPE_ARB 0x8B4E
+#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
+#define GL_FLOAT_VEC2_ARB 0x8B50
+#define GL_FLOAT_VEC3_ARB 0x8B51
+#define GL_FLOAT_VEC4_ARB 0x8B52
+#define GL_INT_VEC2_ARB 0x8B53
+#define GL_INT_VEC3_ARB 0x8B54
+#define GL_INT_VEC4_ARB 0x8B55
+#define GL_BOOL_ARB 0x8B56
+#define GL_BOOL_VEC2_ARB 0x8B57
+#define GL_BOOL_VEC3_ARB 0x8B58
+#define GL_BOOL_VEC4_ARB 0x8B59
+#define GL_FLOAT_MAT2_ARB 0x8B5A
+#define GL_FLOAT_MAT3_ARB 0x8B5B
+#define GL_FLOAT_MAT4_ARB 0x8B5C
+#define GL_SAMPLER_1D_ARB 0x8B5D
+#define GL_SAMPLER_2D_ARB 0x8B5E
+#define GL_SAMPLER_3D_ARB 0x8B5F
+#define GL_SAMPLER_CUBE_ARB 0x8B60
+#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
+#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
+#define GL_SAMPLER_2D_RECT_ARB 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
+#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
+#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
+#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
+#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
+#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
+#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
+#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
+#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
+#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_VERTEX_SHADER_ARB 0x8B31
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
+#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
+#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
+#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_FRAGMENT_SHADER_ARB 0x8B30
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_POINT_SPRITE_ARB 0x8861
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
+#define GL_DRAW_BUFFER0_ARB 0x8825
+#define GL_DRAW_BUFFER1_ARB 0x8826
+#define GL_DRAW_BUFFER2_ARB 0x8827
+#define GL_DRAW_BUFFER3_ARB 0x8828
+#define GL_DRAW_BUFFER4_ARB 0x8829
+#define GL_DRAW_BUFFER5_ARB 0x882A
+#define GL_DRAW_BUFFER6_ARB 0x882B
+#define GL_DRAW_BUFFER7_ARB 0x882C
+#define GL_DRAW_BUFFER8_ARB 0x882D
+#define GL_DRAW_BUFFER9_ARB 0x882E
+#define GL_DRAW_BUFFER10_ARB 0x882F
+#define GL_DRAW_BUFFER11_ARB 0x8830
+#define GL_DRAW_BUFFER12_ARB 0x8831
+#define GL_DRAW_BUFFER13_ARB 0x8832
+#define GL_DRAW_BUFFER14_ARB 0x8833
+#define GL_DRAW_BUFFER15_ARB 0x8834
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_RGBA_FLOAT_MODE_ARB 0x8820
+#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
+#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
+#define GL_CLAMP_READ_COLOR_ARB 0x891C
+#define GL_FIXED_ONLY_ARB 0x891D
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_HALF_FLOAT_ARB 0x140B
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
+#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
+#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
+#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
+#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
+#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
+#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
+#define GL_RGBA32F_ARB 0x8814
+#define GL_RGB32F_ARB 0x8815
+#define GL_ALPHA32F_ARB 0x8816
+#define GL_INTENSITY32F_ARB 0x8817
+#define GL_LUMINANCE32F_ARB 0x8818
+#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
+#define GL_RGBA16F_ARB 0x881A
+#define GL_RGB16F_ARB 0x881B
+#define GL_ALPHA16F_ARB 0x881C
+#define GL_INTENSITY16F_ARB 0x881D
+#define GL_LUMINANCE16F_ARB 0x881E
+#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
+#endif
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#define GL_DEPTH32F_STENCIL8 0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#endif
+
+#ifndef GL_ARB_draw_instanced
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT 0x8218
+#define GL_FRAMEBUFFER_UNDEFINED 0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#define GL_INDEX 0x8222
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_DEPTH_STENCIL 0x84F9
+#define GL_UNSIGNED_INT_24_8 0x84FA
+#define GL_DEPTH24_STENCIL8 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE 0x88F1
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
+#define GL_RENDERBUFFER_SAMPLES 0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_COLOR_ATTACHMENT1 0x8CE1
+#define GL_COLOR_ATTACHMENT2 0x8CE2
+#define GL_COLOR_ATTACHMENT3 0x8CE3
+#define GL_COLOR_ATTACHMENT4 0x8CE4
+#define GL_COLOR_ATTACHMENT5 0x8CE5
+#define GL_COLOR_ATTACHMENT6 0x8CE6
+#define GL_COLOR_ATTACHMENT7 0x8CE7
+#define GL_COLOR_ATTACHMENT8 0x8CE8
+#define GL_COLOR_ATTACHMENT9 0x8CE9
+#define GL_COLOR_ATTACHMENT10 0x8CEA
+#define GL_COLOR_ATTACHMENT11 0x8CEB
+#define GL_COLOR_ATTACHMENT12 0x8CEC
+#define GL_COLOR_ATTACHMENT13 0x8CED
+#define GL_COLOR_ATTACHMENT14 0x8CEE
+#define GL_COLOR_ATTACHMENT15 0x8CEF
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_STENCIL_INDEX1 0x8D46
+#define GL_STENCIL_INDEX4 0x8D47
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_INDEX16 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES 0x8D57
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_LINES_ADJACENCY_ARB 0x000A
+#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B
+#define GL_TRIANGLES_ADJACENCY_ARB 0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D
+#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
+#define GL_GEOMETRY_SHADER_ARB 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
+/* reuse GL_MAX_VARYING_COMPONENTS */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+#endif
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_HALF_FLOAT 0x140B
+#endif
+
+#ifndef GL_ARB_instanced_arrays
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_WRITE_BIT 0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
+#endif
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_TEXTURE_BUFFER_ARB 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
+#define GL_COMPRESSED_RG_RGTC2 0x8DBD
+#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_RG 0x8227
+#define GL_RG_INTEGER 0x8228
+#define GL_R8 0x8229
+#define GL_R16 0x822A
+#define GL_RG8 0x822B
+#define GL_RG16 0x822C
+#define GL_R16F 0x822D
+#define GL_R32F 0x822E
+#define GL_RG16F 0x822F
+#define GL_RG32F 0x8230
+#define GL_R8I 0x8231
+#define GL_R8UI 0x8232
+#define GL_R16I 0x8233
+#define GL_R16UI 0x8234
+#define GL_R32I 0x8235
+#define GL_R32UI 0x8236
+#define GL_RG8I 0x8237
+#define GL_RG8UI 0x8238
+#define GL_RG16I 0x8239
+#define GL_RG16UI 0x823A
+#define GL_RG32I 0x823B
+#define GL_RG32UI 0x823C
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_ABGR_EXT 0x8000
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_CONSTANT_COLOR_EXT 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
+#define GL_CONSTANT_ALPHA_EXT 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
+#define GL_BLEND_COLOR_EXT 0x8005
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_POLYGON_OFFSET_EXT 0x8037
+#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
+#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_ALPHA4_EXT 0x803B
+#define GL_ALPHA8_EXT 0x803C
+#define GL_ALPHA12_EXT 0x803D
+#define GL_ALPHA16_EXT 0x803E
+#define GL_LUMINANCE4_EXT 0x803F
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE12_EXT 0x8041
+#define GL_LUMINANCE16_EXT 0x8042
+#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
+#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
+#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
+#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
+#define GL_INTENSITY_EXT 0x8049
+#define GL_INTENSITY4_EXT 0x804A
+#define GL_INTENSITY8_EXT 0x804B
+#define GL_INTENSITY12_EXT 0x804C
+#define GL_INTENSITY16_EXT 0x804D
+#define GL_RGB2_EXT 0x804E
+#define GL_RGB4_EXT 0x804F
+#define GL_RGB5_EXT 0x8050
+#define GL_RGB8_EXT 0x8051
+#define GL_RGB10_EXT 0x8052
+#define GL_RGB12_EXT 0x8053
+#define GL_RGB16_EXT 0x8054
+#define GL_RGBA2_EXT 0x8055
+#define GL_RGBA4_EXT 0x8056
+#define GL_RGB5_A1_EXT 0x8057
+#define GL_RGBA8_EXT 0x8058
+#define GL_RGB10_A2_EXT 0x8059
+#define GL_RGBA12_EXT 0x805A
+#define GL_RGBA16_EXT 0x805B
+#define GL_TEXTURE_RED_SIZE_EXT 0x805C
+#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
+#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
+#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
+#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
+#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
+#define GL_REPLACE_EXT 0x8062
+#define GL_PROXY_TEXTURE_1D_EXT 0x8063
+#define GL_PROXY_TEXTURE_2D_EXT 0x8064
+#define GL_TEXTURE_TOO_LARGE_EXT 0x8065
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_PACK_SKIP_IMAGES_EXT 0x806B
+#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
+#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
+#define GL_TEXTURE_3D_EXT 0x806F
+#define GL_PROXY_TEXTURE_3D_EXT 0x8070
+#define GL_TEXTURE_DEPTH_EXT 0x8071
+#define GL_TEXTURE_WRAP_R_EXT 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_FILTER4_SGIS 0x8146
+#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147
+#endif
+
+#ifndef GL_EXT_subtexture
+#endif
+
+#ifndef GL_EXT_copy_texture
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_HISTOGRAM_EXT 0x8024
+#define GL_PROXY_HISTOGRAM_EXT 0x8025
+#define GL_HISTOGRAM_WIDTH_EXT 0x8026
+#define GL_HISTOGRAM_FORMAT_EXT 0x8027
+#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
+#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
+#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
+#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
+#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
+#define GL_HISTOGRAM_SINK_EXT 0x802D
+#define GL_MINMAX_EXT 0x802E
+#define GL_MINMAX_FORMAT_EXT 0x802F
+#define GL_MINMAX_SINK_EXT 0x8030
+#define GL_TABLE_TOO_LARGE_EXT 0x8031
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_CONVOLUTION_1D_EXT 0x8010
+#define GL_CONVOLUTION_2D_EXT 0x8011
+#define GL_SEPARABLE_2D_EXT 0x8012
+#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
+#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
+#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
+#define GL_REDUCE_EXT 0x8016
+#define GL_CONVOLUTION_FORMAT_EXT 0x8017
+#define GL_CONVOLUTION_WIDTH_EXT 0x8018
+#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
+#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
+#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
+#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
+#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
+#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
+#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
+#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
+#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
+#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
+#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_COLOR_MATRIX_SGI 0x80B1
+#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
+#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
+#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
+#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
+#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
+#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
+#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
+#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
+#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
+#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_COLOR_TABLE_SGI 0x80D0
+#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
+#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
+#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
+#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
+#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
+#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
+#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
+#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
+#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
+#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
+#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
+#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
+#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
+#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
+#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_PIXEL_TEXTURE_SGIS 0x8353
+#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354
+#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355
+#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_PIXEL_TEX_GEN_SGIX 0x8139
+#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130
+#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131
+#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132
+#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133
+#define GL_TEXTURE_4D_SGIS 0x8134
+#define GL_PROXY_TEXTURE_4D_SGIS 0x8135
+#define GL_TEXTURE_4DSIZE_SGIS 0x8136
+#define GL_TEXTURE_WRAP_Q_SGIS 0x8137
+#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138
+#define GL_TEXTURE_4D_BINDING_SGIS 0x814F
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
+#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_CMYK_EXT 0x800C
+#define GL_CMYKA_EXT 0x800D
+#define GL_PACK_CMYK_HINT_EXT 0x800E
+#define GL_UNPACK_CMYK_HINT_EXT 0x800F
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_TEXTURE_PRIORITY_EXT 0x8066
+#define GL_TEXTURE_RESIDENT_EXT 0x8067
+#define GL_TEXTURE_1D_BINDING_EXT 0x8068
+#define GL_TEXTURE_2D_BINDING_EXT 0x8069
+#define GL_TEXTURE_3D_BINDING_EXT 0x806A
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095
+#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096
+#define GL_LINEAR_DETAIL_SGIS 0x8097
+#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098
+#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099
+#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A
+#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B
+#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_LINEAR_SHARPEN_SGIS 0x80AD
+#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE
+#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF
+#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
+#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
+#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
+#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_MULTISAMPLE_SGIS 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
+#define GL_SAMPLE_MASK_SGIS 0x80A0
+#define GL_1PASS_SGIS 0x80A1
+#define GL_2PASS_0_SGIS 0x80A2
+#define GL_2PASS_1_SGIS 0x80A3
+#define GL_4PASS_0_SGIS 0x80A4
+#define GL_4PASS_1_SGIS 0x80A5
+#define GL_4PASS_2_SGIS 0x80A6
+#define GL_4PASS_3_SGIS 0x80A7
+#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
+#define GL_SAMPLES_SGIS 0x80A9
+#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
+#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
+#define GL_SAMPLE_PATTERN_SGIS 0x80AC
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_VERTEX_ARRAY_EXT 0x8074
+#define GL_NORMAL_ARRAY_EXT 0x8075
+#define GL_COLOR_ARRAY_EXT 0x8076
+#define GL_INDEX_ARRAY_EXT 0x8077
+#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
+#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
+#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
+#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
+#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
+#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
+#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
+#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
+#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
+#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
+#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
+#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
+#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
+#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
+#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
+#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
+#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
+#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
+#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
+#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
+#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
+#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
+#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
+#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
+#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
+#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170
+#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171
+#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172
+#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173
+#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174
+#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175
+#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176
+#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177
+#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178
+#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D
+#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E
+#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_TEXTURE_COMPARE_SGIX 0x819A
+#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
+#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
+#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_CLAMP_TO_EDGE_SGIS 0x812F
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_CLAMP_TO_BORDER_SGIS 0x812D
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_FUNC_ADD_EXT 0x8006
+#define GL_MIN_EXT 0x8007
+#define GL_MAX_EXT 0x8008
+#define GL_BLEND_EQUATION_EXT 0x8009
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_FUNC_SUBTRACT_EXT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_INTERLACE_SGIX 0x8094
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E
+#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F
+#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140
+#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141
+#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142
+#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143
+#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144
+#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145
+#endif
+
+#ifndef GL_SGIS_texture_select
+#define GL_DUAL_ALPHA4_SGIS 0x8110
+#define GL_DUAL_ALPHA8_SGIS 0x8111
+#define GL_DUAL_ALPHA12_SGIS 0x8112
+#define GL_DUAL_ALPHA16_SGIS 0x8113
+#define GL_DUAL_LUMINANCE4_SGIS 0x8114
+#define GL_DUAL_LUMINANCE8_SGIS 0x8115
+#define GL_DUAL_LUMINANCE12_SGIS 0x8116
+#define GL_DUAL_LUMINANCE16_SGIS 0x8117
+#define GL_DUAL_INTENSITY4_SGIS 0x8118
+#define GL_DUAL_INTENSITY8_SGIS 0x8119
+#define GL_DUAL_INTENSITY12_SGIS 0x811A
+#define GL_DUAL_INTENSITY16_SGIS 0x811B
+#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C
+#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D
+#define GL_QUAD_ALPHA4_SGIS 0x811E
+#define GL_QUAD_ALPHA8_SGIS 0x811F
+#define GL_QUAD_LUMINANCE4_SGIS 0x8120
+#define GL_QUAD_LUMINANCE8_SGIS 0x8121
+#define GL_QUAD_INTENSITY4_SGIS 0x8122
+#define GL_QUAD_INTENSITY8_SGIS 0x8123
+#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124
+#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SPRITE_SGIX 0x8148
+#define GL_SPRITE_MODE_SGIX 0x8149
+#define GL_SPRITE_AXIS_SGIX 0x814A
+#define GL_SPRITE_TRANSLATION_SGIX 0x814B
+#define GL_SPRITE_AXIAL_SGIX 0x814C
+#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D
+#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_POINT_SIZE_MIN_EXT 0x8126
+#define GL_POINT_SIZE_MAX_EXT 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
+#define GL_DISTANCE_ATTENUATION_EXT 0x8129
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_POINT_SIZE_MIN_SGIS 0x8126
+#define GL_POINT_SIZE_MAX_SGIS 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128
+#define GL_DISTANCE_ATTENUATION_SGIS 0x8129
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180
+#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
+#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
+#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
+#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_FRAMEZOOM_SGIX 0x818B
+#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C
+#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#endif
+
+#ifndef GL_FfdMaskSGIX
+#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
+#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
+#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
+#define GL_DEFORMATIONS_MASK_SGIX 0x8196
+#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_REFERENCE_PLANE_SGIX 0x817D
+#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
+#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
+#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_FOG_FUNC_SGIS 0x812A
+#define GL_FOG_FUNC_POINTS_SGIS 0x812B
+#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_FOG_OFFSET_SGIX 0x8198
+#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_IMAGE_SCALE_X_HP 0x8155
+#define GL_IMAGE_SCALE_Y_HP 0x8156
+#define GL_IMAGE_TRANSLATE_X_HP 0x8157
+#define GL_IMAGE_TRANSLATE_Y_HP 0x8158
+#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159
+#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A
+#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B
+#define GL_IMAGE_MAG_FILTER_HP 0x815C
+#define GL_IMAGE_MIN_FILTER_HP 0x815D
+#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E
+#define GL_CUBIC_HP 0x815F
+#define GL_AVERAGE_HP 0x8160
+#define GL_IMAGE_TRANSFORM_2D_HP 0x8161
+#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162
+#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_IGNORE_BORDER_HP 0x8150
+#define GL_CONSTANT_BORDER_HP 0x8151
+#define GL_REPLICATE_BORDER_HP 0x8153
+#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154
+#endif
+
+#ifndef GL_INGR_palette_buffer
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE
+#endif
+
+#ifndef GL_EXT_color_subtable
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_VERTEX_DATA_HINT_PGI 0x1A22A
+#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B
+#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C
+#define GL_MAX_VERTEX_HINT_PGI 0x1A22D
+#define GL_COLOR3_BIT_PGI 0x00010000
+#define GL_COLOR4_BIT_PGI 0x00020000
+#define GL_EDGEFLAG_BIT_PGI 0x00040000
+#define GL_INDEX_BIT_PGI 0x00080000
+#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
+#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
+#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
+#define GL_MAT_EMISSION_BIT_PGI 0x00800000
+#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
+#define GL_MAT_SHININESS_BIT_PGI 0x02000000
+#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
+#define GL_NORMAL_BIT_PGI 0x08000000
+#define GL_TEXCOORD1_BIT_PGI 0x10000000
+#define GL_TEXCOORD2_BIT_PGI 0x20000000
+#define GL_TEXCOORD3_BIT_PGI 0x40000000
+#define GL_TEXCOORD4_BIT_PGI 0x80000000
+#define GL_VERTEX23_BIT_PGI 0x00000004
+#define GL_VERTEX4_BIT_PGI 0x00000008
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8
+#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD
+#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE
+#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202
+#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203
+#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204
+#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C
+#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D
+#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E
+#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F
+#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210
+#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211
+#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216
+#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217
+#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218
+#define GL_FULL_STIPPLE_HINT_PGI 0x1A219
+#define GL_CLIP_NEAR_HINT_PGI 0x1A220
+#define GL_CLIP_FAR_HINT_PGI 0x1A221
+#define GL_WIDE_LINE_HINT_PGI 0x1A222
+#define GL_BACK_NORMALS_HINT_PGI 0x1A223
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_COLOR_INDEX1_EXT 0x80E2
+#define GL_COLOR_INDEX2_EXT 0x80E3
+#define GL_COLOR_INDEX4_EXT 0x80E4
+#define GL_COLOR_INDEX8_EXT 0x80E5
+#define GL_COLOR_INDEX12_EXT 0x80E6
+#define GL_COLOR_INDEX16_EXT 0x80E7
+#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_LIST_PRIORITY_SGIX 0x8182
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_IR_INSTRUMENT1_SGIX 0x817F
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E
+#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F
+#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SHADOW_AMBIENT_SGIX 0x80BF
+#endif
+
+#ifndef GL_EXT_index_texture
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_INDEX_MATERIAL_EXT 0x81B8
+#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9
+#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_INDEX_TEST_EXT 0x81B5
+#define GL_INDEX_TEST_FUNC_EXT 0x81B6
+#define GL_INDEX_TEST_REF_EXT 0x81B7
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_IUI_V2F_EXT 0x81AD
+#define GL_IUI_V3F_EXT 0x81AE
+#define GL_IUI_N3F_V2F_EXT 0x81AF
+#define GL_IUI_N3F_V3F_EXT 0x81B0
+#define GL_T2F_IUI_V2F_EXT 0x81B1
+#define GL_T2F_IUI_V3F_EXT 0x81B2
+#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3
+#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
+#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_CULL_VERTEX_EXT 0x81AA
+#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
+#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_YCRCB_422_SGIX 0x81BB
+#define GL_YCRCB_444_SGIX 0x81BC
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_FRAGMENT_LIGHTING_SGIX 0x8400
+#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401
+#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402
+#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403
+#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404
+#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405
+#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406
+#define GL_LIGHT_ENV_MODE_SGIX 0x8407
+#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408
+#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409
+#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A
+#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B
+#define GL_FRAGMENT_LIGHT0_SGIX 0x840C
+#define GL_FRAGMENT_LIGHT1_SGIX 0x840D
+#define GL_FRAGMENT_LIGHT2_SGIX 0x840E
+#define GL_FRAGMENT_LIGHT3_SGIX 0x840F
+#define GL_FRAGMENT_LIGHT4_SGIX 0x8410
+#define GL_FRAGMENT_LIGHT5_SGIX 0x8411
+#define GL_FRAGMENT_LIGHT6_SGIX 0x8412
+#define GL_FRAGMENT_LIGHT7_SGIX 0x8413
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167
+#define GL_TEXTURE_POST_SPECULAR_HP 0x8168
+#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
+#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_PHONG_WIN 0x80EA
+#define GL_PHONG_HINT_WIN 0x80EB
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_FRAGMENT_MATERIAL_EXT 0x8349
+#define GL_FRAGMENT_NORMAL_EXT 0x834A
+#define GL_FRAGMENT_COLOR_EXT 0x834C
+#define GL_ATTENUATION_EXT 0x834D
+#define GL_SHADOW_ATTENUATION_EXT 0x834E
+#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
+#define GL_TEXTURE_LIGHT_EXT 0x8350
+#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
+#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
+/* reuse GL_FRAGMENT_DEPTH_EXT */
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_ALPHA_MIN_SGIX 0x8320
+#define GL_ALPHA_MAX_SGIX 0x8321
+#endif
+
+#ifndef GL_SGIX_impact_pixel_texture
+#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184
+#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185
+#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186
+#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187
+#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188
+#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189
+#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_BGR_EXT 0x80E0
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_ASYNC_MARKER_SGIX 0x8329
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
+#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
+#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
+#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
+#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
+#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
+#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
+#endif
+
+#ifndef GL_INTEL_texture_scissor
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
+#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
+#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
+#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
+#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_OCCLUSION_TEST_HP 0x8165
+#define GL_OCCLUSION_TEST_RESULT_HP 0x8166
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
+#define GL_PIXEL_MAG_FILTER_EXT 0x8331
+#define GL_PIXEL_MIN_FILTER_EXT 0x8332
+#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
+#define GL_CUBIC_EXT 0x8334
+#define GL_AVERAGE_EXT 0x8335
+#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
+#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
+#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
+#define GL_SINGLE_COLOR_EXT 0x81F9
+#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_COLOR_SUM_EXT 0x8458
+#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
+#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_PERTURB_EXT 0x85AE
+#define GL_TEXTURE_NORMAL_EXT 0x85AF
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
+#define GL_FOG_COORDINATE_EXT 0x8451
+#define GL_FRAGMENT_DEPTH_EXT 0x8452
+#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
+#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
+#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
+#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
+#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_SCREEN_COORDINATES_REND 0x8490
+#define GL_INVERTED_SCREEN_W_REND 0x8491
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_TANGENT_ARRAY_EXT 0x8439
+#define GL_BINORMAL_ARRAY_EXT 0x843A
+#define GL_CURRENT_TANGENT_EXT 0x843B
+#define GL_CURRENT_BINORMAL_EXT 0x843C
+#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
+#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
+#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
+#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
+#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
+#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
+#define GL_MAP1_TANGENT_EXT 0x8444
+#define GL_MAP2_TANGENT_EXT 0x8445
+#define GL_MAP1_BINORMAL_EXT 0x8446
+#define GL_MAP2_BINORMAL_EXT 0x8447
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_COMBINE_EXT 0x8570
+#define GL_COMBINE_RGB_EXT 0x8571
+#define GL_COMBINE_ALPHA_EXT 0x8572
+#define GL_RGB_SCALE_EXT 0x8573
+#define GL_ADD_SIGNED_EXT 0x8574
+#define GL_INTERPOLATE_EXT 0x8575
+#define GL_CONSTANT_EXT 0x8576
+#define GL_PRIMARY_COLOR_EXT 0x8577
+#define GL_PREVIOUS_EXT 0x8578
+#define GL_SOURCE0_RGB_EXT 0x8580
+#define GL_SOURCE1_RGB_EXT 0x8581
+#define GL_SOURCE2_RGB_EXT 0x8582
+#define GL_SOURCE3_RGB_EXT 0x8583
+#define GL_SOURCE4_RGB_EXT 0x8584
+#define GL_SOURCE5_RGB_EXT 0x8585
+#define GL_SOURCE6_RGB_EXT 0x8586
+#define GL_SOURCE7_RGB_EXT 0x8587
+#define GL_SOURCE0_ALPHA_EXT 0x8588
+#define GL_SOURCE1_ALPHA_EXT 0x8589
+#define GL_SOURCE2_ALPHA_EXT 0x858A
+#define GL_SOURCE3_ALPHA_EXT 0x858B
+#define GL_SOURCE4_ALPHA_EXT 0x858C
+#define GL_SOURCE5_ALPHA_EXT 0x858D
+#define GL_SOURCE6_ALPHA_EXT 0x858E
+#define GL_SOURCE7_ALPHA_EXT 0x858F
+#define GL_OPERAND0_RGB_EXT 0x8590
+#define GL_OPERAND1_RGB_EXT 0x8591
+#define GL_OPERAND2_RGB_EXT 0x8592
+#define GL_OPERAND3_RGB_EXT 0x8593
+#define GL_OPERAND4_RGB_EXT 0x8594
+#define GL_OPERAND5_RGB_EXT 0x8595
+#define GL_OPERAND6_RGB_EXT 0x8596
+#define GL_OPERAND7_RGB_EXT 0x8597
+#define GL_OPERAND0_ALPHA_EXT 0x8598
+#define GL_OPERAND1_ALPHA_EXT 0x8599
+#define GL_OPERAND2_ALPHA_EXT 0x859A
+#define GL_OPERAND3_ALPHA_EXT 0x859B
+#define GL_OPERAND4_ALPHA_EXT 0x859C
+#define GL_OPERAND5_ALPHA_EXT 0x859D
+#define GL_OPERAND6_ALPHA_EXT 0x859E
+#define GL_OPERAND7_ALPHA_EXT 0x859F
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_TRANSFORM_HINT_APPLE 0x85B1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_FOG_SCALE_SGIX 0x81FC
+#define GL_FOG_SCALE_VALUE_SGIX 0x81FD
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
+#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_GLOBAL_ALPHA_SUN 0x81D9
+#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_RESTART_SUN 0x0001
+#define GL_REPLACE_MIDDLE_SUN 0x0002
+#define GL_REPLACE_OLDEST_SUN 0x0003
+#define GL_TRIANGLE_LIST_SUN 0x81D7
+#define GL_REPLACEMENT_CODE_SUN 0x81D8
+#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
+#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
+#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
+#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
+#define GL_R1UI_V3F_SUN 0x85C4
+#define GL_R1UI_C4UB_V3F_SUN 0x85C5
+#define GL_R1UI_C3F_V3F_SUN 0x85C6
+#define GL_R1UI_N3F_V3F_SUN 0x85C7
+#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
+#define GL_R1UI_T2F_V3F_SUN 0x85C9
+#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
+#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
+#endif
+
+#ifndef GL_SUN_vertex
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_BLEND_DST_RGB_EXT 0x80C8
+#define GL_BLEND_SRC_RGB_EXT 0x80C9
+#define GL_BLEND_DST_ALPHA_EXT 0x80CA
+#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_RED_MIN_CLAMP_INGR 0x8560
+#define GL_GREEN_MIN_CLAMP_INGR 0x8561
+#define GL_BLUE_MIN_CLAMP_INGR 0x8562
+#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
+#define GL_RED_MAX_CLAMP_INGR 0x8564
+#define GL_GREEN_MAX_CLAMP_INGR 0x8565
+#define GL_BLUE_MAX_CLAMP_INGR 0x8566
+#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INTERLACE_READ_INGR 0x8568
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_INCR_WRAP_EXT 0x8507
+#define GL_DECR_WRAP_EXT 0x8508
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_422_EXT 0x80CC
+#define GL_422_REV_EXT 0x80CD
+#define GL_422_AVERAGE_EXT 0x80CE
+#define GL_422_REV_AVERAGE_EXT 0x80CF
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NORMAL_MAP_NV 0x8511
+#define GL_REFLECTION_MAP_NV 0x8512
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_NORMAL_MAP_EXT 0x8511
+#define GL_REFLECTION_MAP_EXT 0x8512
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_WRAP_BORDER_SUN 0x81D4
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH
+#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
+#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX
+#define GL_MODELVIEW1_MATRIX_EXT 0x8506
+#define GL_VERTEX_WEIGHTING_EXT 0x8509
+#define GL_MODELVIEW0_EXT GL_MODELVIEW
+#define GL_MODELVIEW1_EXT 0x850A
+#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
+#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
+#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
+#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
+#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
+#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_MAX_SHININESS_NV 0x8504
+#define GL_MAX_SPOT_EXPONENT_NV 0x8505
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
+#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_REGISTER_COMBINERS_NV 0x8522
+#define GL_VARIABLE_A_NV 0x8523
+#define GL_VARIABLE_B_NV 0x8524
+#define GL_VARIABLE_C_NV 0x8525
+#define GL_VARIABLE_D_NV 0x8526
+#define GL_VARIABLE_E_NV 0x8527
+#define GL_VARIABLE_F_NV 0x8528
+#define GL_VARIABLE_G_NV 0x8529
+#define GL_CONSTANT_COLOR0_NV 0x852A
+#define GL_CONSTANT_COLOR1_NV 0x852B
+#define GL_PRIMARY_COLOR_NV 0x852C
+#define GL_SECONDARY_COLOR_NV 0x852D
+#define GL_SPARE0_NV 0x852E
+#define GL_SPARE1_NV 0x852F
+#define GL_DISCARD_NV 0x8530
+#define GL_E_TIMES_F_NV 0x8531
+#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
+#define GL_UNSIGNED_IDENTITY_NV 0x8536
+#define GL_UNSIGNED_INVERT_NV 0x8537
+#define GL_EXPAND_NORMAL_NV 0x8538
+#define GL_EXPAND_NEGATE_NV 0x8539
+#define GL_HALF_BIAS_NORMAL_NV 0x853A
+#define GL_HALF_BIAS_NEGATE_NV 0x853B
+#define GL_SIGNED_IDENTITY_NV 0x853C
+#define GL_SIGNED_NEGATE_NV 0x853D
+#define GL_SCALE_BY_TWO_NV 0x853E
+#define GL_SCALE_BY_FOUR_NV 0x853F
+#define GL_SCALE_BY_ONE_HALF_NV 0x8540
+#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
+#define GL_COMBINER_INPUT_NV 0x8542
+#define GL_COMBINER_MAPPING_NV 0x8543
+#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
+#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
+#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
+#define GL_COMBINER_MUX_SUM_NV 0x8547
+#define GL_COMBINER_SCALE_NV 0x8548
+#define GL_COMBINER_BIAS_NV 0x8549
+#define GL_COMBINER_AB_OUTPUT_NV 0x854A
+#define GL_COMBINER_CD_OUTPUT_NV 0x854B
+#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
+#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
+#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
+#define GL_COLOR_SUM_CLAMP_NV 0x854F
+#define GL_COMBINER0_NV 0x8550
+#define GL_COMBINER1_NV 0x8551
+#define GL_COMBINER2_NV 0x8552
+#define GL_COMBINER3_NV 0x8553
+#define GL_COMBINER4_NV 0x8554
+#define GL_COMBINER5_NV 0x8555
+#define GL_COMBINER6_NV 0x8556
+#define GL_COMBINER7_NV 0x8557
+/* reuse GL_TEXTURE0_ARB */
+/* reuse GL_TEXTURE1_ARB */
+/* reuse GL_ZERO */
+/* reuse GL_NONE */
+/* reuse GL_FOG */
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_FOG_DISTANCE_MODE_NV 0x855A
+#define GL_EYE_RADIAL_NV 0x855B
+#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
+/* reuse GL_EYE_PLANE */
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_EMBOSS_LIGHT_NV 0x855D
+#define GL_EMBOSS_CONSTANT_NV 0x855E
+#define GL_EMBOSS_MAP_NV 0x855F
+#endif
+
+#ifndef GL_NV_blend_square
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_COMBINE4_NV 0x8503
+#define GL_SOURCE3_RGB_NV 0x8583
+#define GL_SOURCE3_ALPHA_NV 0x858B
+#define GL_OPERAND3_RGB_NV 0x8593
+#define GL_OPERAND3_ALPHA_NV 0x859B
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#endif
+
+#ifndef GL_MESA_window_pos
+#endif
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_CULL_VERTEX_IBM 103050
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_VERTEX_ARRAY_LIST_IBM 103070
+#define GL_NORMAL_ARRAY_LIST_IBM 103071
+#define GL_COLOR_ARRAY_LIST_IBM 103072
+#define GL_INDEX_ARRAY_LIST_IBM 103073
+#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
+#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
+#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
+#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
+#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
+#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
+#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
+#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
+#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
+#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
+#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
+#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0
+#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1
+#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2
+#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3
+#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_YCRCB_SGIX 0x8318
+#define GL_YCRCBA_SGIX 0x8319
+#endif
+
+#ifndef GL_SGI_depth_pass_instrument
+#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310
+#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311
+#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
+#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_MULTISAMPLE_3DFX 0x86B2
+#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
+#define GL_SAMPLES_3DFX 0x86B4
+#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_MULTISAMPLE_EXT 0x809D
+#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
+#define GL_SAMPLE_MASK_EXT 0x80A0
+#define GL_1PASS_EXT 0x80A1
+#define GL_2PASS_0_EXT 0x80A2
+#define GL_2PASS_1_EXT 0x80A3
+#define GL_4PASS_0_EXT 0x80A4
+#define GL_4PASS_1_EXT 0x80A5
+#define GL_4PASS_2_EXT 0x80A6
+#define GL_4PASS_3_EXT 0x80A7
+#define GL_SAMPLE_BUFFERS_EXT 0x80A8
+#define GL_SAMPLES_EXT 0x80A9
+#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
+#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
+#define GL_SAMPLE_PATTERN_EXT 0x80AC
+#define GL_MULTISAMPLE_BIT_EXT 0x20000000
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_VERTEX_PRECLIP_SGIX 0x83EE
+#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_CONVOLUTION_HINT_SGIX 0x8316
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_PACK_RESAMPLE_SGIX 0x842C
+#define GL_UNPACK_RESAMPLE_SGIX 0x842D
+#define GL_RESAMPLE_REPLICATE_SGIX 0x842E
+#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F
+#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
+#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
+#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
+#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
+#define GL_EYE_POINT_SGIS 0x81F4
+#define GL_OBJECT_POINT_SGIS 0x81F5
+#define GL_EYE_LINE_SGIS 0x81F6
+#define GL_OBJECT_LINE_SGIS 0x81F7
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_DOT3_RGB_EXT 0x8740
+#define GL_DOT3_RGBA_EXT 0x8741
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_MIRROR_CLAMP_ATI 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
+#endif
+
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+#ifndef GL_IBM_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_IBM 0x8370
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_EVAL_2D_NV 0x86C0
+#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
+#define GL_MAP_TESSELLATION_NV 0x86C2
+#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
+#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
+#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
+#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
+#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
+#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
+#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
+#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
+#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
+#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
+#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
+#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
+#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
+#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
+#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
+#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
+#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
+#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
+#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
+#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
+#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_DEPTH_STENCIL_NV 0x84F9
+#define GL_UNSIGNED_INT_24_8_NV 0x84FA
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_PER_STAGE_CONSTANTS_NV 0x8535
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_TEXTURE_RECTANGLE_NV 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
+#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
+#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
+#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
+#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
+#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
+#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
+#define GL_SHADER_CONSISTENT_NV 0x86DD
+#define GL_TEXTURE_SHADER_NV 0x86DE
+#define GL_SHADER_OPERATION_NV 0x86DF
+#define GL_CULL_MODES_NV 0x86E0
+#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
+#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
+#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
+#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
+#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
+#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
+#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
+#define GL_CONST_EYE_NV 0x86E5
+#define GL_PASS_THROUGH_NV 0x86E6
+#define GL_CULL_FRAGMENT_NV 0x86E7
+#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
+#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
+#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
+#define GL_DOT_PRODUCT_NV 0x86EC
+#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
+#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
+#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
+#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
+#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
+#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
+#define GL_HILO_NV 0x86F4
+#define GL_DSDT_NV 0x86F5
+#define GL_DSDT_MAG_NV 0x86F6
+#define GL_DSDT_MAG_VIB_NV 0x86F7
+#define GL_HILO16_NV 0x86F8
+#define GL_SIGNED_HILO_NV 0x86F9
+#define GL_SIGNED_HILO16_NV 0x86FA
+#define GL_SIGNED_RGBA_NV 0x86FB
+#define GL_SIGNED_RGBA8_NV 0x86FC
+#define GL_SIGNED_RGB_NV 0x86FE
+#define GL_SIGNED_RGB8_NV 0x86FF
+#define GL_SIGNED_LUMINANCE_NV 0x8701
+#define GL_SIGNED_LUMINANCE8_NV 0x8702
+#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
+#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
+#define GL_SIGNED_ALPHA_NV 0x8705
+#define GL_SIGNED_ALPHA8_NV 0x8706
+#define GL_SIGNED_INTENSITY_NV 0x8707
+#define GL_SIGNED_INTENSITY8_NV 0x8708
+#define GL_DSDT8_NV 0x8709
+#define GL_DSDT8_MAG8_NV 0x870A
+#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
+#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
+#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
+#define GL_HI_SCALE_NV 0x870E
+#define GL_LO_SCALE_NV 0x870F
+#define GL_DS_SCALE_NV 0x8710
+#define GL_DT_SCALE_NV 0x8711
+#define GL_MAGNITUDE_SCALE_NV 0x8712
+#define GL_VIBRANCE_SCALE_NV 0x8713
+#define GL_HI_BIAS_NV 0x8714
+#define GL_LO_BIAS_NV 0x8715
+#define GL_DS_BIAS_NV 0x8716
+#define GL_DT_BIAS_NV 0x8717
+#define GL_MAGNITUDE_BIAS_NV 0x8718
+#define GL_VIBRANCE_BIAS_NV 0x8719
+#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
+#define GL_TEXTURE_HI_SIZE_NV 0x871B
+#define GL_TEXTURE_LO_SIZE_NV 0x871C
+#define GL_TEXTURE_DS_SIZE_NV 0x871D
+#define GL_TEXTURE_DT_SIZE_NV 0x871E
+#define GL_TEXTURE_MAG_SIZE_NV 0x871F
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_VERTEX_PROGRAM_NV 0x8620
+#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
+#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
+#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
+#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
+#define GL_CURRENT_ATTRIB_NV 0x8626
+#define GL_PROGRAM_LENGTH_NV 0x8627
+#define GL_PROGRAM_STRING_NV 0x8628
+#define GL_MODELVIEW_PROJECTION_NV 0x8629
+#define GL_IDENTITY_NV 0x862A
+#define GL_INVERSE_NV 0x862B
+#define GL_TRANSPOSE_NV 0x862C
+#define GL_INVERSE_TRANSPOSE_NV 0x862D
+#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
+#define GL_MAX_TRACK_MATRICES_NV 0x862F
+#define GL_MATRIX0_NV 0x8630
+#define GL_MATRIX1_NV 0x8631
+#define GL_MATRIX2_NV 0x8632
+#define GL_MATRIX3_NV 0x8633
+#define GL_MATRIX4_NV 0x8634
+#define GL_MATRIX5_NV 0x8635
+#define GL_MATRIX6_NV 0x8636
+#define GL_MATRIX7_NV 0x8637
+#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
+#define GL_CURRENT_MATRIX_NV 0x8641
+#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
+#define GL_PROGRAM_PARAMETER_NV 0x8644
+#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
+#define GL_PROGRAM_TARGET_NV 0x8646
+#define GL_PROGRAM_RESIDENT_NV 0x8647
+#define GL_TRACK_MATRIX_NV 0x8648
+#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
+#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
+#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
+#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
+#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
+#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
+#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
+#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
+#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
+#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
+#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
+#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
+#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
+#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
+#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
+#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
+#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
+#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
+#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
+#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
+#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
+#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
+#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
+#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
+#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
+#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
+#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
+#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
+#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
+#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
+#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
+#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
+#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
+#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
+#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
+#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
+#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
+#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
+#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
+#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
+#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
+#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
+#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
+#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
+#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
+#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
+#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
+#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
+#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
+#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
+#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
+#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
+#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SCALEBIAS_HINT_SGIX 0x8322
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_INTERLACE_OML 0x8980
+#define GL_INTERLACE_READ_OML 0x8981
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
+#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
+#endif
+
+#ifndef GL_OML_resample
+#define GL_PACK_RESAMPLE_OML 0x8984
+#define GL_UNPACK_RESAMPLE_OML 0x8985
+#define GL_RESAMPLE_REPLICATE_OML 0x8986
+#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
+#define GL_RESAMPLE_AVERAGE_OML 0x8988
+#define GL_RESAMPLE_DECIMATE_OML 0x8989
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
+#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_BUMP_ROT_MATRIX_ATI 0x8775
+#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
+#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
+#define GL_BUMP_TEX_UNITS_ATI 0x8778
+#define GL_DUDV_ATI 0x8779
+#define GL_DU8DV8_ATI 0x877A
+#define GL_BUMP_ENVMAP_ATI 0x877B
+#define GL_BUMP_TARGET_ATI 0x877C
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_FRAGMENT_SHADER_ATI 0x8920
+#define GL_REG_0_ATI 0x8921
+#define GL_REG_1_ATI 0x8922
+#define GL_REG_2_ATI 0x8923
+#define GL_REG_3_ATI 0x8924
+#define GL_REG_4_ATI 0x8925
+#define GL_REG_5_ATI 0x8926
+#define GL_REG_6_ATI 0x8927
+#define GL_REG_7_ATI 0x8928
+#define GL_REG_8_ATI 0x8929
+#define GL_REG_9_ATI 0x892A
+#define GL_REG_10_ATI 0x892B
+#define GL_REG_11_ATI 0x892C
+#define GL_REG_12_ATI 0x892D
+#define GL_REG_13_ATI 0x892E
+#define GL_REG_14_ATI 0x892F
+#define GL_REG_15_ATI 0x8930
+#define GL_REG_16_ATI 0x8931
+#define GL_REG_17_ATI 0x8932
+#define GL_REG_18_ATI 0x8933
+#define GL_REG_19_ATI 0x8934
+#define GL_REG_20_ATI 0x8935
+#define GL_REG_21_ATI 0x8936
+#define GL_REG_22_ATI 0x8937
+#define GL_REG_23_ATI 0x8938
+#define GL_REG_24_ATI 0x8939
+#define GL_REG_25_ATI 0x893A
+#define GL_REG_26_ATI 0x893B
+#define GL_REG_27_ATI 0x893C
+#define GL_REG_28_ATI 0x893D
+#define GL_REG_29_ATI 0x893E
+#define GL_REG_30_ATI 0x893F
+#define GL_REG_31_ATI 0x8940
+#define GL_CON_0_ATI 0x8941
+#define GL_CON_1_ATI 0x8942
+#define GL_CON_2_ATI 0x8943
+#define GL_CON_3_ATI 0x8944
+#define GL_CON_4_ATI 0x8945
+#define GL_CON_5_ATI 0x8946
+#define GL_CON_6_ATI 0x8947
+#define GL_CON_7_ATI 0x8948
+#define GL_CON_8_ATI 0x8949
+#define GL_CON_9_ATI 0x894A
+#define GL_CON_10_ATI 0x894B
+#define GL_CON_11_ATI 0x894C
+#define GL_CON_12_ATI 0x894D
+#define GL_CON_13_ATI 0x894E
+#define GL_CON_14_ATI 0x894F
+#define GL_CON_15_ATI 0x8950
+#define GL_CON_16_ATI 0x8951
+#define GL_CON_17_ATI 0x8952
+#define GL_CON_18_ATI 0x8953
+#define GL_CON_19_ATI 0x8954
+#define GL_CON_20_ATI 0x8955
+#define GL_CON_21_ATI 0x8956
+#define GL_CON_22_ATI 0x8957
+#define GL_CON_23_ATI 0x8958
+#define GL_CON_24_ATI 0x8959
+#define GL_CON_25_ATI 0x895A
+#define GL_CON_26_ATI 0x895B
+#define GL_CON_27_ATI 0x895C
+#define GL_CON_28_ATI 0x895D
+#define GL_CON_29_ATI 0x895E
+#define GL_CON_30_ATI 0x895F
+#define GL_CON_31_ATI 0x8960
+#define GL_MOV_ATI 0x8961
+#define GL_ADD_ATI 0x8963
+#define GL_MUL_ATI 0x8964
+#define GL_SUB_ATI 0x8965
+#define GL_DOT3_ATI 0x8966
+#define GL_DOT4_ATI 0x8967
+#define GL_MAD_ATI 0x8968
+#define GL_LERP_ATI 0x8969
+#define GL_CND_ATI 0x896A
+#define GL_CND0_ATI 0x896B
+#define GL_DOT2_ADD_ATI 0x896C
+#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
+#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
+#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
+#define GL_NUM_PASSES_ATI 0x8970
+#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
+#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
+#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
+#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
+#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
+#define GL_SWIZZLE_STR_ATI 0x8976
+#define GL_SWIZZLE_STQ_ATI 0x8977
+#define GL_SWIZZLE_STR_DR_ATI 0x8978
+#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
+#define GL_SWIZZLE_STRQ_ATI 0x897A
+#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
+#define GL_RED_BIT_ATI 0x00000001
+#define GL_GREEN_BIT_ATI 0x00000002
+#define GL_BLUE_BIT_ATI 0x00000004
+#define GL_2X_BIT_ATI 0x00000001
+#define GL_4X_BIT_ATI 0x00000002
+#define GL_8X_BIT_ATI 0x00000004
+#define GL_HALF_BIT_ATI 0x00000008
+#define GL_QUARTER_BIT_ATI 0x00000010
+#define GL_EIGHTH_BIT_ATI 0x00000020
+#define GL_SATURATE_BIT_ATI 0x00000040
+#define GL_COMP_BIT_ATI 0x00000002
+#define GL_NEGATE_BIT_ATI 0x00000004
+#define GL_BIAS_BIT_ATI 0x00000008
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_PN_TRIANGLES_ATI 0x87F0
+#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
+#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
+#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
+#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
+#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
+#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
+#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
+#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_STATIC_ATI 0x8760
+#define GL_DYNAMIC_ATI 0x8761
+#define GL_PRESERVE_ATI 0x8762
+#define GL_DISCARD_ATI 0x8763
+#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
+#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
+#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
+#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_VERTEX_SHADER_EXT 0x8780
+#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
+#define GL_OP_INDEX_EXT 0x8782
+#define GL_OP_NEGATE_EXT 0x8783
+#define GL_OP_DOT3_EXT 0x8784
+#define GL_OP_DOT4_EXT 0x8785
+#define GL_OP_MUL_EXT 0x8786
+#define GL_OP_ADD_EXT 0x8787
+#define GL_OP_MADD_EXT 0x8788
+#define GL_OP_FRAC_EXT 0x8789
+#define GL_OP_MAX_EXT 0x878A
+#define GL_OP_MIN_EXT 0x878B
+#define GL_OP_SET_GE_EXT 0x878C
+#define GL_OP_SET_LT_EXT 0x878D
+#define GL_OP_CLAMP_EXT 0x878E
+#define GL_OP_FLOOR_EXT 0x878F
+#define GL_OP_ROUND_EXT 0x8790
+#define GL_OP_EXP_BASE_2_EXT 0x8791
+#define GL_OP_LOG_BASE_2_EXT 0x8792
+#define GL_OP_POWER_EXT 0x8793
+#define GL_OP_RECIP_EXT 0x8794
+#define GL_OP_RECIP_SQRT_EXT 0x8795
+#define GL_OP_SUB_EXT 0x8796
+#define GL_OP_CROSS_PRODUCT_EXT 0x8797
+#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
+#define GL_OP_MOV_EXT 0x8799
+#define GL_OUTPUT_VERTEX_EXT 0x879A
+#define GL_OUTPUT_COLOR0_EXT 0x879B
+#define GL_OUTPUT_COLOR1_EXT 0x879C
+#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
+#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
+#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
+#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
+#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
+#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
+#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
+#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
+#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
+#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
+#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
+#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
+#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
+#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
+#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
+#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
+#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
+#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
+#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
+#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
+#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
+#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
+#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
+#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
+#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
+#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
+#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
+#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
+#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
+#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
+#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
+#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
+#define GL_OUTPUT_FOG_EXT 0x87BD
+#define GL_SCALAR_EXT 0x87BE
+#define GL_VECTOR_EXT 0x87BF
+#define GL_MATRIX_EXT 0x87C0
+#define GL_VARIANT_EXT 0x87C1
+#define GL_INVARIANT_EXT 0x87C2
+#define GL_LOCAL_CONSTANT_EXT 0x87C3
+#define GL_LOCAL_EXT 0x87C4
+#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
+#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
+#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
+#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
+#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD
+#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
+#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
+#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
+#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
+#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
+#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
+#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
+#define GL_X_EXT 0x87D5
+#define GL_Y_EXT 0x87D6
+#define GL_Z_EXT 0x87D7
+#define GL_W_EXT 0x87D8
+#define GL_NEGATIVE_X_EXT 0x87D9
+#define GL_NEGATIVE_Y_EXT 0x87DA
+#define GL_NEGATIVE_Z_EXT 0x87DB
+#define GL_NEGATIVE_W_EXT 0x87DC
+#define GL_ZERO_EXT 0x87DD
+#define GL_ONE_EXT 0x87DE
+#define GL_NEGATIVE_ONE_EXT 0x87DF
+#define GL_NORMALIZED_RANGE_EXT 0x87E0
+#define GL_FULL_RANGE_EXT 0x87E1
+#define GL_CURRENT_VERTEX_EXT 0x87E2
+#define GL_MVP_MATRIX_EXT 0x87E3
+#define GL_VARIANT_VALUE_EXT 0x87E4
+#define GL_VARIANT_DATATYPE_EXT 0x87E5
+#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
+#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
+#define GL_VARIANT_ARRAY_EXT 0x87E8
+#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
+#define GL_INVARIANT_VALUE_EXT 0x87EA
+#define GL_INVARIANT_DATATYPE_EXT 0x87EB
+#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
+#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
+#endif
+
+/* Support for GL_EXT_texture_rectangle on non-nVidia cards */
+#ifndef GL_EXT_texture_rectangle
+#define GL_EXT_texture_rectangle 1
+#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8
+#endif /* GL_TEXTURE_RECTANGLE_EXT */
+
+
+#ifndef GL_ATI_vertex_streams
+#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
+#define GL_VERTEX_STREAM0_ATI 0x876C
+#define GL_VERTEX_STREAM1_ATI 0x876D
+#define GL_VERTEX_STREAM2_ATI 0x876E
+#define GL_VERTEX_STREAM3_ATI 0x876F
+#define GL_VERTEX_STREAM4_ATI 0x8770
+#define GL_VERTEX_STREAM5_ATI 0x8771
+#define GL_VERTEX_STREAM6_ATI 0x8772
+#define GL_VERTEX_STREAM7_ATI 0x8773
+#define GL_VERTEX_SOURCE_ATI 0x8774
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ELEMENT_ARRAY_ATI 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_QUAD_MESH_SUN 0x8614
+#define GL_TRIANGLE_MESH_SUN 0x8615
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SLICE_ACCUM_SUN 0x85CC
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_DEPTH_CLAMP_NV 0x864F
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_PIXEL_COUNTER_BITS_NV 0x8864
+#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
+#define GL_PIXEL_COUNT_NV 0x8866
+#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_POINT_SPRITE_NV 0x8861
+#define GL_COORD_REPLACE_NV 0x8862
+#define GL_POINT_SPRITE_R_MODE_NV 0x8863
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
+#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
+#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
+#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
+#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
+#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
+#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
+#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
+#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
+#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
+#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
+#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
+#define GL_HILO8_NV 0x885E
+#define GL_SIGNED_HILO8_NV 0x885F
+#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
+#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_ELEMENT_ARRAY_APPLE 0x8768
+#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_DRAW_PIXELS_APPLE 0x8A0A
+#define GL_FENCE_APPLE 0x8A0B
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
+#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
+#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520
+#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
+#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
+#define GL_STORAGE_PRIVATE_APPLE 0x85BD
+#define GL_STORAGE_CACHED_APPLE 0x85BE
+#define GL_STORAGE_SHARED_APPLE 0x85BF
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_YCBCR_422_APPLE 0x85B9
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_RGB_S3TC 0x83A0
+#define GL_RGB4_S3TC 0x83A1
+#define GL_RGBA_S3TC 0x83A2
+#define GL_RGBA4_S3TC 0x83A3
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
+#define GL_DRAW_BUFFER0_ATI 0x8825
+#define GL_DRAW_BUFFER1_ATI 0x8826
+#define GL_DRAW_BUFFER2_ATI 0x8827
+#define GL_DRAW_BUFFER3_ATI 0x8828
+#define GL_DRAW_BUFFER4_ATI 0x8829
+#define GL_DRAW_BUFFER5_ATI 0x882A
+#define GL_DRAW_BUFFER6_ATI 0x882B
+#define GL_DRAW_BUFFER7_ATI 0x882C
+#define GL_DRAW_BUFFER8_ATI 0x882D
+#define GL_DRAW_BUFFER9_ATI 0x882E
+#define GL_DRAW_BUFFER10_ATI 0x882F
+#define GL_DRAW_BUFFER11_ATI 0x8830
+#define GL_DRAW_BUFFER12_ATI 0x8831
+#define GL_DRAW_BUFFER13_ATI 0x8832
+#define GL_DRAW_BUFFER14_ATI 0x8833
+#define GL_DRAW_BUFFER15_ATI 0x8834
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_TYPE_RGBA_FLOAT_ATI 0x8820
+#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_MODULATE_ADD_ATI 0x8744
+#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
+#define GL_MODULATE_SUBTRACT_ATI 0x8746
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_RGBA_FLOAT32_ATI 0x8814
+#define GL_RGB_FLOAT32_ATI 0x8815
+#define GL_ALPHA_FLOAT32_ATI 0x8816
+#define GL_INTENSITY_FLOAT32_ATI 0x8817
+#define GL_LUMINANCE_FLOAT32_ATI 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
+#define GL_RGBA_FLOAT16_ATI 0x881A
+#define GL_RGB_FLOAT16_ATI 0x881B
+#define GL_ALPHA_FLOAT16_ATI 0x881C
+#define GL_INTENSITY_FLOAT16_ATI 0x881D
+#define GL_LUMINANCE_FLOAT16_ATI 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_FLOAT_R_NV 0x8880
+#define GL_FLOAT_RG_NV 0x8881
+#define GL_FLOAT_RGB_NV 0x8882
+#define GL_FLOAT_RGBA_NV 0x8883
+#define GL_FLOAT_R16_NV 0x8884
+#define GL_FLOAT_R32_NV 0x8885
+#define GL_FLOAT_RG16_NV 0x8886
+#define GL_FLOAT_RG32_NV 0x8887
+#define GL_FLOAT_RGB16_NV 0x8888
+#define GL_FLOAT_RGB32_NV 0x8889
+#define GL_FLOAT_RGBA16_NV 0x888A
+#define GL_FLOAT_RGBA32_NV 0x888B
+#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
+#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
+#define GL_FLOAT_RGBA_MODE_NV 0x888E
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
+#define GL_FRAGMENT_PROGRAM_NV 0x8870
+#define GL_MAX_TEXTURE_COORDS_NV 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
+#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
+#define GL_PROGRAM_ERROR_STRING_NV 0x8874
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_HALF_FLOAT_NV 0x140B
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
+#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
+#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
+#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
+#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
+#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_PRIMITIVE_RESTART_NV 0x8558
+#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
+#endif
+
+#ifndef GL_NV_vertex_program2
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_STENCIL_BACK_FUNC_ATI 0x8800
+#define GL_STENCIL_BACK_FAIL_ATI 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
+#define GL_DEPTH_BOUNDS_EXT 0x8891
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_MIRROR_CLAMP_EXT 0x8742
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
+#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_PACK_INVERT_MESA 0x8758
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
+#define GL_YCBCR_MESA 0x8757
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
+#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
+#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
+#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
+#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */
+/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */
+#endif
+
+#ifndef GL_NV_vertex_program3
+/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
+#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
+#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
+#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
+#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
+#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
+#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
+#define GL_FRAMEBUFFER_EXT 0x8D40
+#define GL_RENDERBUFFER_EXT 0x8D41
+#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
+#define GL_STENCIL_INDEX_EXT 0x8D45
+#define GL_STENCIL_INDEX1_EXT 0x8D46
+#define GL_STENCIL_INDEX4_EXT 0x8D47
+#define GL_STENCIL_INDEX8_EXT 0x8D48
+#define GL_STENCIL_INDEX16_EXT 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_DEPTH_STENCIL_EXT 0x84F9
+#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
+#define GL_DEPTH24_STENCIL8_EXT 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_STENCIL_TAG_BITS_EXT 0x88F2
+#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_SRGB_EXT 0x8C40
+#define GL_SRGB8_EXT 0x8C41
+#define GL_SRGB_ALPHA_EXT 0x8C42
+#define GL_SRGB8_ALPHA8_EXT 0x8C43
+#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
+#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
+#define GL_SLUMINANCE_EXT 0x8C46
+#define GL_SLUMINANCE8_EXT 0x8C47
+#define GL_COMPRESSED_SRGB_EXT 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
+#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
+#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CAA
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT 0x8D57
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_TEXTURE_1D_STACK_MESAX 0x8759
+#define GL_TEXTURE_2D_STACK_MESAX 0x875A
+#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
+#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
+#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
+#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_TIME_ELAPSED_EXT 0x88BF
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
+#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
+#endif
+
+#ifndef GL_EXT_Cg_shader
+#define GL_CG_VERTEX_SHADER_EXT 0x890E
+#define GL_CG_FRAGMENT_SHADER_EXT 0x890F
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_TEXTURE_BUFFER_EXT 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
+#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
+#define GL_SAMPLER_BUFFER_EXT 0x8DC2
+#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
+#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
+#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
+#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
+#define GL_INT_SAMPLER_1D_EXT 0x8DC9
+#define GL_INT_SAMPLER_2D_EXT 0x8DCA
+#define GL_INT_SAMPLER_3D_EXT 0x8DCB
+#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
+#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
+#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
+#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD
+#endif
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_GEOMETRY_SHADER_EXT 0x8DD9
+#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
+#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
+#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
+#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
+#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_LINES_ADJACENCY_EXT 0xA
+#define GL_LINE_STRIP_ADJACENCY_EXT 0xB
+#define GL_TRIANGLES_ADJACENCY_EXT 0xC
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
+#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
+#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
+#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
+#define GL_UNIFORM_BUFFER_EXT 0x8DEE
+#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
+#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_RGB9_E5_EXT 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
+/* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_RGBA32UI_EXT 0x8D70
+#define GL_RGB32UI_EXT 0x8D71
+#define GL_ALPHA32UI_EXT 0x8D72
+#define GL_INTENSITY32UI_EXT 0x8D73
+#define GL_LUMINANCE32UI_EXT 0x8D74
+#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
+#define GL_RGBA16UI_EXT 0x8D76
+#define GL_RGB16UI_EXT 0x8D77
+#define GL_ALPHA16UI_EXT 0x8D78
+#define GL_INTENSITY16UI_EXT 0x8D79
+#define GL_LUMINANCE16UI_EXT 0x8D7A
+#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
+#define GL_RGBA8UI_EXT 0x8D7C
+#define GL_RGB8UI_EXT 0x8D7D
+#define GL_ALPHA8UI_EXT 0x8D7E
+#define GL_INTENSITY8UI_EXT 0x8D7F
+#define GL_LUMINANCE8UI_EXT 0x8D80
+#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
+#define GL_RGBA32I_EXT 0x8D82
+#define GL_RGB32I_EXT 0x8D83
+#define GL_ALPHA32I_EXT 0x8D84
+#define GL_INTENSITY32I_EXT 0x8D85
+#define GL_LUMINANCE32I_EXT 0x8D86
+#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
+#define GL_RGBA16I_EXT 0x8D88
+#define GL_RGB16I_EXT 0x8D89
+#define GL_ALPHA16I_EXT 0x8D8A
+#define GL_INTENSITY16I_EXT 0x8D8B
+#define GL_LUMINANCE16I_EXT 0x8D8C
+#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
+#define GL_RGBA8I_EXT 0x8D8E
+#define GL_RGB8I_EXT 0x8D8F
+#define GL_ALPHA8I_EXT 0x8D90
+#define GL_INTENSITY8I_EXT 0x8D91
+#define GL_LUMINANCE8I_EXT 0x8D92
+#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
+#define GL_RED_INTEGER_EXT 0x8D94
+#define GL_GREEN_INTEGER_EXT 0x8D95
+#define GL_BLUE_INTEGER_EXT 0x8D96
+#define GL_ALPHA_INTEGER_EXT 0x8D97
+#define GL_RGB_INTEGER_EXT 0x8D98
+#define GL_RGBA_INTEGER_EXT 0x8D99
+#define GL_BGR_INTEGER_EXT 0x8D9A
+#define GL_BGRA_INTEGER_EXT 0x8D9B
+#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
+#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
+#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
+#endif
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
+#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
+#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
+#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
+#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
+#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
+#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
+#define GL_TEXTURE_COORD_NV 0x8C79
+#define GL_CLIP_DISTANCE_NV 0x8C7A
+#define GL_VERTEX_ID_NV 0x8C7B
+#define GL_PRIMITIVE_ID_NV 0x8C7C
+#define GL_GENERIC_ATTRIB_NV 0x8C7D
+#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
+#define GL_ACTIVE_VARYINGS_NV 0x8C81
+#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
+#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
+#define GL_PRIMITIVES_GENERATED_NV 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
+#define GL_RASTERIZER_DISCARD_NV 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
+#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_GEOMETRY_PROGRAM_NV 0x8C26
+#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
+#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
+#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
+#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
+#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
+#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
+#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
+#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
+#endif
+
+#ifndef NV_parameter_buffer_object
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
+#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
+#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
+#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
+#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
+#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
+#define GL_MAX_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8D57
+#define GL_MAX_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E11
+#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
+#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E13
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif
+
+#ifndef GL_NV_present_video
+#define GL_FRAME_NV 0x8E26
+#define GL_FIELDS_NV 0x8E27
+#define GL_CURRENT_TIME_NV 0x8E28
+#define GL_NUM_FILL_STREAMS_NV 0x8E29
+#define GL_PRESENT_TIME_NV 0x8E2A
+#define GL_PRESENT_DURATION_NV 0x8E2B
+#endif
+
+#ifndef GL_NV_conditional_render
+#define GL_QUERY_WAIT_NV 0x8E13
+#define GL_QUERY_NO_WAIT_NV 0x8E14
+#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
+#endif
+
+#ifndef GL_EXT_transform_feedback
+#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
+#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
+#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
+#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
+#define GL_RASTERIZER_DISCARD_EXT 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
+#endif
+
+#ifndef GL_EXT_direct_state_access
+#define GL_PROGRAM_MATRIX_EXT 0x8E2D
+#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
+#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
+#endif
+
+#ifndef GL_EXT_vertex_array_bgra
+/* reuse GL_BGRA */
+#endif
+
+#ifndef GL_EXT_texture_swizzle
+#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
+#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
+#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
+#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
+#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
+#endif
+
+#ifndef GL_NV_explicit_multisample
+#define GL_SAMPLE_POSITION_NV 0x8E50
+#define GL_SAMPLE_MASK_NV 0x8E51
+#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
+#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
+#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
+#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
+#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
+#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
+#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
+#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
+#endif
+
+#ifndef GL_NV_transform_feedback2
+#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
+#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
+#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar; /* native character */
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for handling shader object handles and program/shader text */
+typedef char GLcharARB; /* native character */
+typedef unsigned int GLhandleARB; /* shader object handle */
+#endif
+
+/* GL types for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+/* GL type for representing NVIDIA "half" floating point type in host memory */
+typedef unsigned short GLhalfNV;
+#endif
+
+#include "glext-64bit-types.h"
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void APIENTRY glBlendEquation (GLenum);
+GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogram (GLenum);
+GLAPI void APIENTRY glResetMinmax (GLenum);
+GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTexture (GLenum);
+GLAPI void APIENTRY glClientActiveTexture (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *);
+GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
+GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glFogCoordf (GLfloat);
+GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
+GLAPI void APIENTRY glFogCoordd (GLdouble);
+GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
+GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3iv (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2i (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2iv (const GLint *);
+GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2sv (const GLshort *);
+GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dv (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fv (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3iv (const GLint *);
+GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQuery (GLuint);
+GLAPI void APIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void APIENTRY glEndQuery (GLenum);
+GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBuffer (GLuint);
+GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum);
+GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void APIENTRY glCompileShader (GLuint);
+GLAPI GLuint APIENTRY glCreateProgram (void);
+GLAPI GLuint APIENTRY glCreateShader (GLenum);
+GLAPI void APIENTRY glDeleteProgram (GLuint);
+GLAPI void APIENTRY glDeleteShader (GLuint);
+GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgram (GLuint);
+GLAPI GLboolean APIENTRY glIsShader (GLuint);
+GLAPI void APIENTRY glLinkProgram (GLuint);
+GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void APIENTRY glUseProgram (GLuint);
+GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1i (GLint, GLint);
+GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glValidateProgram (GLuint);
+GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+/* OpenGL 3.0 also reuses entry points from these extensions: */
+/* ARB_framebuffer_object */
+/* ARB_map_buffer_range */
+/* ARB_vertex_array_object */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *);
+GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *);
+GLAPI void APIENTRY glEnablei (GLenum, GLuint);
+GLAPI void APIENTRY glDisablei (GLenum, GLuint);
+GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint);
+GLAPI void APIENTRY glBeginTransformFeedback (GLenum);
+GLAPI void APIENTRY glEndTransformFeedback (void);
+GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
+GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar **, GLenum);
+GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLint *);
+GLAPI void APIENTRY glClampColor (GLenum, GLenum);
+GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum);
+GLAPI void APIENTRY glEndConditionalRender (void);
+GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint);
+GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint);
+GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *);
+GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *);
+GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *);
+GLAPI void APIENTRY glUniform1ui (GLint, GLuint);
+GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint);
+GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *);
+GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *);
+GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *);
+GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *);
+GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *);
+GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *);
+GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint);
+GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLint *location);
+typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
+typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
+typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
+#endif
+
+#ifndef GL_ARB_multitexture
+#define GL_ARB_multitexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveTextureARB (GLenum);
+GLAPI void APIENTRY glClientActiveTextureARB (GLenum);
+GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint);
+GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort);
+GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *);
+GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *);
+GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
+GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *);
+GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
+#endif
+
+#ifndef GL_ARB_transpose_matrix
+#define GL_ARB_transpose_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
+GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *);
+GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m);
+typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_ARB_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
+#endif
+
+#ifndef GL_ARB_texture_env_add
+#define GL_ARB_texture_env_add 1
+#endif
+
+#ifndef GL_ARB_texture_cube_map
+#define GL_ARB_texture_cube_map 1
+#endif
+
+#ifndef GL_ARB_texture_compression
+#define GL_ARB_texture_compression 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_ARB_texture_border_clamp
+#define GL_ARB_texture_border_clamp 1
+#endif
+
+#ifndef GL_ARB_point_parameters
+#define GL_ARB_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_ARB_vertex_blend
+#define GL_ARB_vertex_blend 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *);
+GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *);
+GLAPI void APIENTRY glWeightivARB (GLint, const GLint *);
+GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *);
+GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *);
+GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexBlendARB (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights);
+typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights);
+typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights);
+typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count);
+#endif
+
+#ifndef GL_ARB_matrix_palette
+#define GL_ARB_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint);
+GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *);
+GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *);
+GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *);
+GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices);
+typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_ARB_texture_env_combine
+#define GL_ARB_texture_env_combine 1
+#endif
+
+#ifndef GL_ARB_texture_env_crossbar
+#define GL_ARB_texture_env_crossbar 1
+#endif
+
+#ifndef GL_ARB_texture_env_dot3
+#define GL_ARB_texture_env_dot3 1
+#endif
+
+#ifndef GL_ARB_texture_mirrored_repeat
+#define GL_ARB_texture_mirrored_repeat 1
+#endif
+
+#ifndef GL_ARB_depth_texture
+#define GL_ARB_depth_texture 1
+#endif
+
+#ifndef GL_ARB_shadow
+#define GL_ARB_shadow 1
+#endif
+
+#ifndef GL_ARB_shadow_ambient
+#define GL_ARB_shadow_ambient 1
+#endif
+
+#ifndef GL_ARB_window_pos
+#define GL_ARB_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
+GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_ARB_vertex_program
+#define GL_ARB_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *);
+GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *);
+GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *);
+GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint);
+GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *);
+GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *);
+GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramARB (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
+typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
+typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program);
+#endif
+
+#ifndef GL_ARB_fragment_program
+#define GL_ARB_fragment_program 1
+/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+#define GL_ARB_vertex_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsBufferARB (GLuint);
+GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
+GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *);
+GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *);
+GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum);
+GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum);
+GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
+typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers);
+typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
+typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
+typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_ARB_occlusion_query
+#define GL_ARB_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsQueryARB (GLuint);
+GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint);
+GLAPI void APIENTRY glEndQueryARB (GLenum);
+GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_ARB_shader_objects
+#define GL_ARB_shader_objects 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum);
+GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum);
+GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *);
+GLAPI void APIENTRY glCompileShaderARB (GLhandleARB);
+GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void);
+GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB);
+GLAPI void APIENTRY glLinkProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB);
+GLAPI void APIENTRY glValidateProgramARB (GLhandleARB);
+GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat);
+GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glUniform1iARB (GLint, GLint);
+GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *);
+GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *);
+GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
+GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *);
+GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *);
+GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
+typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
+typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
+typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
+typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
+typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
+typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
+typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog);
+typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params);
+typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
+#endif
+
+#ifndef GL_ARB_vertex_shader
+#define GL_ARB_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *);
+GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *);
+GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name);
+typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
+typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name);
+#endif
+
+#ifndef GL_ARB_fragment_shader
+#define GL_ARB_fragment_shader 1
+#endif
+
+#ifndef GL_ARB_shading_language_100
+#define GL_ARB_shading_language_100 1
+#endif
+
+#ifndef GL_ARB_texture_non_power_of_two
+#define GL_ARB_texture_non_power_of_two 1
+#endif
+
+#ifndef GL_ARB_point_sprite
+#define GL_ARB_point_sprite 1
+#endif
+
+#ifndef GL_ARB_fragment_program_shadow
+#define GL_ARB_fragment_program_shadow 1
+#endif
+
+#ifndef GL_ARB_draw_buffers
+#define GL_ARB_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ARB_texture_rectangle
+#define GL_ARB_texture_rectangle 1
+#endif
+
+#ifndef GL_ARB_color_buffer_float
+#define GL_ARB_color_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
+#endif
+
+#ifndef GL_ARB_half_float_pixel
+#define GL_ARB_half_float_pixel 1
+#endif
+
+#ifndef GL_ARB_texture_float
+#define GL_ARB_texture_float 1
+#endif
+
+#ifndef GL_ARB_pixel_buffer_object
+#define GL_ARB_pixel_buffer_object 1
+#endif
+
+#ifndef GL_ARB_depth_buffer_float
+#define GL_ARB_depth_buffer_float 1
+#endif
+
+#ifndef GL_ARB_draw_instanced
+#define GL_ARB_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_ARB_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint);
+GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint);
+GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmap (GLenum);
+GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#ifndef GL_ARB_framebuffer_sRGB
+#define GL_ARB_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_ARB_geometry_shader4
+#define GL_ARB_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_ARB_half_float_vertex
+#define GL_ARB_half_float_vertex 1
+#endif
+
+#ifndef GL_ARB_instanced_arrays
+#define GL_ARB_instanced_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribDivisor (GLuint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_ARB_map_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield);
+GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+
+#ifndef GL_ARB_texture_buffer_object
+#define GL_ARB_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_ARB_texture_compression_rgtc
+#define GL_ARB_texture_compression_rgtc 1
+#endif
+
+#ifndef GL_ARB_texture_rg
+#define GL_ARB_texture_rg 1
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_ARB_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArray (GLuint);
+GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArray (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
+#endif
+
+#ifndef GL_EXT_abgr
+#define GL_EXT_abgr 1
+#endif
+
+#ifndef GL_EXT_blend_color
+#define GL_EXT_blend_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+#endif
+
+#ifndef GL_EXT_polygon_offset
+#define GL_EXT_polygon_offset 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
+#endif
+
+#ifndef GL_EXT_texture
+#define GL_EXT_texture 1
+#endif
+
+#ifndef GL_EXT_texture3D
+#define GL_EXT_texture3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGIS_texture_filter4
+#define GL_SGIS_texture_filter4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights);
+typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
+#endif
+
+#ifndef GL_EXT_subtexture
+#define GL_EXT_subtexture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_EXT_copy_texture
+#define GL_EXT_copy_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_histogram
+#define GL_EXT_histogram 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean);
+GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean);
+GLAPI void APIENTRY glResetHistogramEXT (GLenum);
+GLAPI void APIENTRY glResetMinmaxEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
+typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_EXT_convolution
+#define GL_EXT_convolution 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *);
+GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params);
+typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
+typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
+#endif
+
+#ifndef GL_SGI_color_matrix
+#define GL_SGI_color_matrix 1
+#endif
+
+#ifndef GL_SGI_color_table
+#define GL_SGI_color_table 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei);
+GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
+typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_SGIX_pixel_texture
+#define GL_SGIX_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenSGIX (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
+#endif
+
+#ifndef GL_SGIS_pixel_texture
+#define GL_SGIS_pixel_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint);
+GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *);
+GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_texture4D
+#define GL_SGIS_texture4D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
+#endif
+
+#ifndef GL_SGI_texture_color_table
+#define GL_SGI_texture_color_table 1
+#endif
+
+#ifndef GL_EXT_cmyka
+#define GL_EXT_cmyka 1
+#endif
+
+#ifndef GL_EXT_texture_object
+#define GL_EXT_texture_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint);
+GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
+typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures);
+typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
+#endif
+
+#ifndef GL_SGIS_detail_texture
+#define GL_SGIS_detail_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_SGIS_sharpen_texture
+#define GL_SGIS_sharpen_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points);
+#endif
+
+#ifndef GL_EXT_packed_pixels
+#define GL_EXT_packed_pixels 1
+#endif
+
+#ifndef GL_SGIS_texture_lod
+#define GL_SGIS_texture_lod 1
+#endif
+
+#ifndef GL_SGIS_multisample
+#define GL_SGIS_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternSGIS (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_EXT_rescale_normal
+#define GL_EXT_rescale_normal 1
+#endif
+
+#ifndef GL_EXT_vertex_array
+#define GL_EXT_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glArrayElementEXT (GLint);
+GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *);
+GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *);
+GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i);
+typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer);
+typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
+typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_misc_attribute
+#define GL_EXT_misc_attribute 1
+#endif
+
+#ifndef GL_SGIS_generate_mipmap
+#define GL_SGIS_generate_mipmap 1
+#endif
+
+#ifndef GL_SGIX_clipmap
+#define GL_SGIX_clipmap 1
+#endif
+
+#ifndef GL_SGIX_shadow
+#define GL_SGIX_shadow 1
+#endif
+
+#ifndef GL_SGIS_texture_edge_clamp
+#define GL_SGIS_texture_edge_clamp 1
+#endif
+
+#ifndef GL_SGIS_texture_border_clamp
+#define GL_SGIS_texture_border_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_blend_subtract
+#define GL_EXT_blend_subtract 1
+#endif
+
+#ifndef GL_EXT_blend_logic_op
+#define GL_EXT_blend_logic_op 1
+#endif
+
+#ifndef GL_SGIX_interlace
+#define GL_SGIX_interlace 1
+#endif
+
+#ifndef GL_SGIX_pixel_tiles
+#define GL_SGIX_pixel_tiles 1
+#endif
+
+#ifndef GL_SGIX_texture_select
+#define GL_SGIX_texture_select 1
+#endif
+
+#ifndef GL_SGIX_sprite
+#define GL_SGIX_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint);
+GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_texture_multi_buffer
+#define GL_SGIX_texture_multi_buffer 1
+#endif
+
+#ifndef GL_EXT_point_parameters
+#define GL_EXT_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIS_point_parameters
+#define GL_SGIS_point_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
+GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_instruments
+#define GL_SGIX_instruments 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glGetInstrumentsSGIX (void);
+GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *);
+GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *);
+GLAPI void APIENTRY glReadInstrumentsSGIX (GLint);
+GLAPI void APIENTRY glStartInstrumentsSGIX (void);
+GLAPI void APIENTRY glStopInstrumentsSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer);
+typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p);
+typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker);
+typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void);
+typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker);
+#endif
+
+#ifndef GL_SGIX_texture_scale_bias
+#define GL_SGIX_texture_scale_bias 1
+#endif
+
+#ifndef GL_SGIX_framezoom
+#define GL_SGIX_framezoom 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFrameZoomSGIX (GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
+#endif
+
+#ifndef GL_SGIX_tag_sample_buffer
+#define GL_SGIX_tag_sample_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTagSampleBufferSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_polynomial_ffd
+#define GL_SGIX_polynomial_ffd 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
+GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
+GLAPI void APIENTRY glDeformSGIX (GLbitfield);
+GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
+typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
+typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask);
+typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
+#endif
+
+#ifndef GL_SGIX_reference_plane
+#define GL_SGIX_reference_plane 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation);
+#endif
+
+#ifndef GL_SGIX_flush_raster
+#define GL_SGIX_flush_raster 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRasterSGIX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void);
+#endif
+
+#ifndef GL_SGIX_depth_texture
+#define GL_SGIX_depth_texture 1
+#endif
+
+#ifndef GL_SGIS_fog_function
+#define GL_SGIS_fog_function 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *);
+GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points);
+typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points);
+#endif
+
+#ifndef GL_SGIX_fog_offset
+#define GL_SGIX_fog_offset 1
+#endif
+
+#ifndef GL_HP_image_transform
+#define GL_HP_image_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_HP_convolution_border_modes
+#define GL_HP_convolution_border_modes 1
+#endif
+
+#ifndef GL_SGIX_texture_add_env
+#define GL_SGIX_texture_add_env 1
+#endif
+
+#ifndef GL_EXT_color_subtable
+#define GL_EXT_color_subtable 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
+typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
+#endif
+
+#ifndef GL_PGI_vertex_hints
+#define GL_PGI_vertex_hints 1
+#endif
+
+#ifndef GL_PGI_misc_hints
+#define GL_PGI_misc_hints 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glHintPGI (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode);
+#endif
+
+#ifndef GL_EXT_paletted_texture
+#define GL_EXT_paletted_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *);
+GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_EXT_clip_volume_hint
+#define GL_EXT_clip_volume_hint 1
+#endif
+
+#ifndef GL_SGIX_list_priority
+#define GL_SGIX_list_priority 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat);
+GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *);
+GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint);
+GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_SGIX_ir_instrument1
+#define GL_SGIX_ir_instrument1 1
+#endif
+
+#ifndef GL_SGIX_calligraphic_fragment
+#define GL_SGIX_calligraphic_fragment 1
+#endif
+
+#ifndef GL_SGIX_texture_lod_bias
+#define GL_SGIX_texture_lod_bias 1
+#endif
+
+#ifndef GL_SGIX_shadow_ambient
+#define GL_SGIX_shadow_ambient 1
+#endif
+
+#ifndef GL_EXT_index_texture
+#define GL_EXT_index_texture 1
+#endif
+
+#ifndef GL_EXT_index_material
+#define GL_EXT_index_material 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_EXT_index_func
+#define GL_EXT_index_func 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref);
+#endif
+
+#ifndef GL_EXT_index_array_formats
+#define GL_EXT_index_array_formats 1
+#endif
+
+#ifndef GL_EXT_compiled_vertex_array
+#define GL_EXT_compiled_vertex_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei);
+GLAPI void APIENTRY glUnlockArraysEXT (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void);
+#endif
+
+#ifndef GL_EXT_cull_vertex
+#define GL_EXT_cull_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *);
+GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_SGIX_ycrcb
+#define GL_SGIX_ycrcb 1
+#endif
+
+#ifndef GL_SGIX_fragment_lighting
+#define GL_SGIX_fragment_lighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum);
+GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint);
+GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *);
+GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_IBM_rasterpos_clip
+#define GL_IBM_rasterpos_clip 1
+#endif
+
+#ifndef GL_HP_texture_lighting
+#define GL_HP_texture_lighting 1
+#endif
+
+#ifndef GL_EXT_draw_range_elements
+#define GL_EXT_draw_range_elements 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+#endif
+
+#ifndef GL_WIN_phong_shading
+#define GL_WIN_phong_shading 1
+#endif
+
+#ifndef GL_WIN_specular_fog
+#define GL_WIN_specular_fog 1
+#endif
+
+#ifndef GL_EXT_light_texture
+#define GL_EXT_light_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glApplyTextureEXT (GLenum);
+GLAPI void APIENTRY glTextureLightEXT (GLenum);
+GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
+typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
+typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
+#endif
+
+#ifndef GL_SGIX_blend_alpha_minmax
+#define GL_SGIX_blend_alpha_minmax 1
+#endif
+
+#ifndef GL_EXT_bgra
+#define GL_EXT_bgra 1
+#endif
+
+#ifndef GL_SGIX_async
+#define GL_SGIX_async 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint);
+GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *);
+GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *);
+GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
+GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
+GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
+typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
+typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
+typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
+typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
+typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
+#endif
+
+#ifndef GL_SGIX_async_pixel
+#define GL_SGIX_async_pixel 1
+#endif
+
+#ifndef GL_SGIX_async_histogram
+#define GL_SGIX_async_histogram 1
+#endif
+
+#ifndef GL_INTEL_parallel_arrays
+#define GL_INTEL_parallel_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *);
+GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *);
+GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_HP_occlusion_test
+#define GL_HP_occlusion_test 1
+#endif
+
+#ifndef GL_EXT_pixel_transform
+#define GL_EXT_pixel_transform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat);
+GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params);
+#endif
+
+#ifndef GL_EXT_pixel_transform_color_table
+#define GL_EXT_pixel_transform_color_table 1
+#endif
+
+#ifndef GL_EXT_shared_texture_palette
+#define GL_EXT_shared_texture_palette 1
+#endif
+
+#ifndef GL_EXT_separate_specular_color
+#define GL_EXT_separate_specular_color 1
+#endif
+
+#ifndef GL_EXT_secondary_color
+#define GL_EXT_secondary_color 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *);
+GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *);
+GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *);
+GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *);
+GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort);
+GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *);
+GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_perturb_normal
+#define GL_EXT_texture_perturb_normal 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureNormalEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
+#endif
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFogCoordfEXT (GLfloat);
+GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *);
+GLAPI void APIENTRY glFogCoorddEXT (GLdouble);
+GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *);
+GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_REND_screen_coordinates
+#define GL_REND_screen_coordinates 1
+#endif
+
+#ifndef GL_EXT_coordinate_frame
+#define GL_EXT_coordinate_frame 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glTangent3ivEXT (const GLint *);
+GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glTangent3svEXT (const GLshort *);
+GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *);
+GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *);
+GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *);
+GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint);
+GLAPI void APIENTRY glBinormal3ivEXT (const GLint *);
+GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glBinormal3svEXT (const GLshort *);
+GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz);
+typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz);
+typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz);
+typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz);
+typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz);
+typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz);
+typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v);
+typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz);
+typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz);
+typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz);
+typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz);
+typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_EXT_texture_env_combine
+#define GL_EXT_texture_env_combine 1
+#endif
+
+#ifndef GL_APPLE_specular_vector
+#define GL_APPLE_specular_vector 1
+#endif
+
+#ifndef GL_APPLE_transform_hint
+#define GL_APPLE_transform_hint 1
+#endif
+
+#ifndef GL_SGIX_fog_scale
+#define GL_SGIX_fog_scale 1
+#endif
+
+#ifndef GL_SUNX_constant_data
+#define GL_SUNX_constant_data 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFinishTextureSUNX (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void);
+#endif
+
+#ifndef GL_SUN_global_alpha
+#define GL_SUN_global_alpha 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte);
+GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort);
+GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint);
+GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
+GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble);
+GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte);
+GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort);
+GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
+typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
+#endif
+
+#ifndef GL_SUN_triangle_list
+#define GL_SUN_triangle_list 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint);
+GLAPI void APIENTRY glReplacementCodeusSUN (GLushort);
+GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte);
+GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *);
+GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *);
+GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *);
+GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer);
+#endif
+
+#ifndef GL_SUN_vertex
+#define GL_SUN_vertex 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
+#endif
+
+#ifndef GL_EXT_blend_func_separate
+#define GL_EXT_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_blend_func_separate
+#define GL_INGR_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+#endif
+
+#ifndef GL_INGR_color_clamp
+#define GL_INGR_color_clamp 1
+#endif
+
+#ifndef GL_INGR_interlace_read
+#define GL_INGR_interlace_read 1
+#endif
+
+#ifndef GL_EXT_stencil_wrap
+#define GL_EXT_stencil_wrap 1
+#endif
+
+#ifndef GL_EXT_422_pixels
+#define GL_EXT_422_pixels 1
+#endif
+
+#ifndef GL_NV_texgen_reflection
+#define GL_NV_texgen_reflection 1
+#endif
+
+#ifndef GL_SUN_convolution_border_modes
+#define GL_SUN_convolution_border_modes 1
+#endif
+
+#ifndef GL_EXT_texture_env_add
+#define GL_EXT_texture_env_add 1
+#endif
+
+#ifndef GL_EXT_texture_lod_bias
+#define GL_EXT_texture_lod_bias 1
+#endif
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifndef GL_EXT_vertex_weighting
+#define GL_EXT_vertex_weighting 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexWeightfEXT (GLfloat);
+GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *);
+GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_light_max_exponent
+#define GL_NV_light_max_exponent 1
+#endif
+
+#ifndef GL_NV_vertex_array_range
+#define GL_NV_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushVertexArrayRangeNV (void);
+GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer);
+#endif
+
+#ifndef GL_NV_register_combiners
+#define GL_NV_register_combiners 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
+GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
+GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
+GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
+GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
+typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_NV_fog_distance
+#define GL_NV_fog_distance 1
+#endif
+
+#ifndef GL_NV_texgen_emboss
+#define GL_NV_texgen_emboss 1
+#endif
+
+#ifndef GL_NV_blend_square
+#define GL_NV_blend_square 1
+#endif
+
+#ifndef GL_NV_texture_env_combine4
+#define GL_NV_texture_env_combine4 1
+#endif
+
+#ifndef GL_MESA_resize_buffers
+#define GL_MESA_resize_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glResizeBuffersMESA (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
+#endif
+
+#ifndef GL_MESA_window_pos
+#define GL_MESA_window_pos 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint);
+GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *);
+GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *);
+GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *);
+GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *);
+GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v);
+#endif
+
+#ifndef GL_IBM_cull_vertex
+#define GL_IBM_cull_vertex 1
+#endif
+
+#ifndef GL_IBM_multimode_draw_arrays
+#define GL_IBM_multimode_draw_arrays 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint);
+GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
+typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
+#endif
+
+#ifndef GL_IBM_vertex_array_lists
+#define GL_IBM_vertex_array_lists 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint);
+GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
+#endif
+
+#ifndef GL_SGIX_subsample
+#define GL_SGIX_subsample 1
+#endif
+
+#ifndef GL_SGIX_ycrcba
+#define GL_SGIX_ycrcba 1
+#endif
+
+#ifndef GL_SGIX_ycrcb_subsample
+#define GL_SGIX_ycrcb_subsample 1
+#endif
+
+#ifndef GL_SGIX_depth_pass_instrument
+#define GL_SGIX_depth_pass_instrument 1
+#endif
+
+#ifndef GL_3DFX_texture_compression_FXT1
+#define GL_3DFX_texture_compression_FXT1 1
+#endif
+
+#ifndef GL_3DFX_multisample
+#define GL_3DFX_multisample 1
+#endif
+
+#ifndef GL_3DFX_tbuffer
+#define GL_3DFX_tbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTbufferMask3DFX (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
+#endif
+
+#ifndef GL_EXT_multisample
+#define GL_EXT_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean);
+GLAPI void APIENTRY glSamplePatternEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
+typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
+#endif
+
+#ifndef GL_SGIX_vertex_preclip
+#define GL_SGIX_vertex_preclip 1
+#endif
+
+#ifndef GL_SGIX_convolution_accuracy
+#define GL_SGIX_convolution_accuracy 1
+#endif
+
+#ifndef GL_SGIX_resample
+#define GL_SGIX_resample 1
+#endif
+
+#ifndef GL_SGIS_point_line_texgen
+#define GL_SGIS_point_line_texgen 1
+#endif
+
+#ifndef GL_SGIS_texture_color_mask
+#define GL_SGIS_texture_color_mask 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+#endif
+
+#ifndef GL_SGIX_igloo_interface
+#define GL_SGIX_igloo_interface 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
+#endif
+
+#ifndef GL_EXT_texture_env_dot3
+#define GL_EXT_texture_env_dot3 1
+#endif
+
+#ifndef GL_ATI_texture_mirror_once
+#define GL_ATI_texture_mirror_once 1
+#endif
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
+GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFinishFenceNV (GLuint);
+GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+#ifndef GL_NV_evaluators
+#define GL_NV_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *);
+GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *);
+GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *);
+GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
+typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
+#endif
+
+#ifndef GL_NV_packed_depth_stencil
+#define GL_NV_packed_depth_stencil 1
+#endif
+
+#ifndef GL_NV_register_combiners2
+#define GL_NV_register_combiners2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params);
+#endif
+
+#ifndef GL_NV_texture_compression_vtc
+#define GL_NV_texture_compression_vtc 1
+#endif
+
+#ifndef GL_NV_texture_rectangle
+#define GL_NV_texture_rectangle 1
+#endif
+
+#ifndef GL_NV_texture_shader
+#define GL_NV_texture_shader 1
+#endif
+
+#ifndef GL_NV_texture_shader2
+#define GL_NV_texture_shader2 1
+#endif
+
+#ifndef GL_NV_vertex_array_range2
+#define GL_NV_vertex_array_range2 1
+#endif
+
+#ifndef GL_NV_vertex_program
+#define GL_NV_vertex_program 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
+GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
+GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *);
+GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
+GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
+GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
+GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
+GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
+GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
+GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
+GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
+GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
+GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
+GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
+GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
+GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
+GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
+typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
+typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
+typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
+typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
+typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
+#endif
+
+#ifndef GL_SGIX_texture_coordinate_clamp
+#define GL_SGIX_texture_coordinate_clamp 1
+#endif
+
+#ifndef GL_SGIX_scalebias_hint
+#define GL_SGIX_scalebias_hint 1
+#endif
+
+#ifndef GL_OML_interlace
+#define GL_OML_interlace 1
+#endif
+
+#ifndef GL_OML_subsample
+#define GL_OML_subsample 1
+#endif
+
+#ifndef GL_OML_resample
+#define GL_OML_resample 1
+#endif
+
+#ifndef GL_NV_copy_depth_to_color
+#define GL_NV_copy_depth_to_color 1
+#endif
+
+#ifndef GL_ATI_envmap_bumpmap
+#define GL_ATI_envmap_bumpmap 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *);
+GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param);
+typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
+typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
+#endif
+
+#ifndef GL_ATI_fragment_shader
+#define GL_ATI_fragment_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint);
+GLAPI void APIENTRY glBindFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint);
+GLAPI void APIENTRY glBeginFragmentShaderATI (void);
+GLAPI void APIENTRY glEndFragmentShaderATI (void);
+GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum);
+GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void);
+typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
+typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
+typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
+typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value);
+#endif
+
+#ifndef GL_ATI_pn_triangles
+#define GL_ATI_pn_triangles 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint);
+GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_vertex_array_object
+#define GL_ATI_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum);
+GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum);
+GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glFreeObjectBufferATI (GLuint);
+GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
+typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_EXT_vertex_shader
+#define GL_EXT_vertex_shader 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginVertexShaderEXT (void);
+GLAPI void APIENTRY glEndVertexShaderEXT (void);
+GLAPI void APIENTRY glBindVertexShaderEXT (GLuint);
+GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint);
+GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint);
+GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint);
+GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint);
+GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *);
+GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *);
+GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *);
+GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *);
+GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *);
+GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *);
+GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *);
+GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *);
+GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *);
+GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *);
+GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint);
+GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint);
+GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum);
+GLAPI GLuint APIENTRY glBindParameterEXT (GLenum);
+GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum);
+GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *);
+GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *);
+GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void);
+typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
+typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
+typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
+typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
+typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
+typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
+typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components);
+typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr);
+typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr);
+typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr);
+typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr);
+typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr);
+typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr);
+typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr);
+typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr);
+typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
+typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
+typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value);
+typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
+typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
+typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
+#endif
+
+#ifndef GL_ATI_vertex_streams
+#define GL_ATI_vertex_streams 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
+GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
+GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
+GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
+GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
+GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
+GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
+GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
+GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
+GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
+GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
+GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
+GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
+GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
+GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
+GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
+typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
+#endif
+
+#ifndef GL_ATI_element_array
+#define GL_ATI_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
+#endif
+
+#ifndef GL_SUN_mesh_array
+#define GL_SUN_mesh_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
+#endif
+
+#ifndef GL_SUN_slice_accum
+#define GL_SUN_slice_accum 1
+#endif
+
+#ifndef GL_NV_multisample_filter_hint
+#define GL_NV_multisample_filter_hint 1
+#endif
+
+#ifndef GL_NV_depth_clamp
+#define GL_NV_depth_clamp 1
+#endif
+
+#ifndef GL_NV_occlusion_query
+#define GL_NV_occlusion_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
+GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
+GLAPI void APIENTRY glEndOcclusionQueryNV (void);
+GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
+typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
+typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
+#endif
+
+#ifndef GL_NV_point_sprite
+#define GL_NV_point_sprite 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
+GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_NV_texture_shader3
+#define GL_NV_texture_shader3 1
+#endif
+
+#ifndef GL_NV_vertex_program1_1
+#define GL_NV_vertex_program1_1 1
+#endif
+
+#ifndef GL_EXT_shadow_funcs
+#define GL_EXT_shadow_funcs 1
+#endif
+
+#ifndef GL_EXT_stencil_two_side
+#define GL_EXT_stencil_two_side 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
+#endif
+
+#ifndef GL_ATI_text_fragment_shader
+#define GL_ATI_text_fragment_shader 1
+#endif
+
+#ifndef GL_APPLE_client_storage
+#define GL_APPLE_client_storage 1
+#endif
+
+#ifndef GL_APPLE_element_array
+#define GL_APPLE_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *);
+GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei);
+GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei);
+GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+#ifndef GL_APPLE_fence
+#define GL_APPLE_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glSetFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint);
+GLAPI void APIENTRY glFinishFenceAPPLE (GLuint);
+GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint);
+GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences);
+typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences);
+typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
+typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
+typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
+typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
+#endif
+
+#ifndef GL_APPLE_vertex_array_object
+#define GL_APPLE_vertex_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
+GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *);
+GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
+typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
+typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
+#endif
+
+#ifndef GL_APPLE_vertex_array_range
+#define GL_APPLE_vertex_array_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *);
+GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
+#endif
+
+#ifndef GL_APPLE_ycbcr_422
+#define GL_APPLE_ycbcr_422 1
+#endif
+
+#ifndef GL_S3_s3tc
+#define GL_S3_s3tc 1
+#endif
+
+#ifndef GL_ATI_draw_buffers
+#define GL_ATI_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+#ifndef GL_ATI_pixel_format_float
+#define GL_ATI_pixel_format_float 1
+/* This is really a WGL extension, but defines some associated GL enums.
+ * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
+ */
+#endif
+
+#ifndef GL_ATI_texture_env_combine3
+#define GL_ATI_texture_env_combine3 1
+#endif
+
+#ifndef GL_ATI_texture_float
+#define GL_ATI_texture_float 1
+#endif
+
+#ifndef GL_NV_float_buffer
+#define GL_NV_float_buffer 1
+#endif
+
+#ifndef GL_NV_fragment_program
+#define GL_NV_fragment_program 1
+/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *);
+GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *);
+GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *);
+GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v);
+typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
+#endif
+
+#ifndef GL_NV_half_float
+#define GL_NV_half_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV);
+GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *);
+GLAPI void APIENTRY glFogCoordhNV (GLhalfNV);
+GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *);
+GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV);
+GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV);
+GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *);
+GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz);
+typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha);
+typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s);
+typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q);
+typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog);
+typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue);
+typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight);
+typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v);
+#endif
+
+#ifndef GL_NV_pixel_data_range
+#define GL_NV_pixel_data_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *);
+GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
+typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
+#endif
+
+#ifndef GL_NV_primitive_restart
+#define GL_NV_primitive_restart 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPrimitiveRestartNV (void);
+GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void);
+typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
+#endif
+
+#ifndef GL_NV_texture_expand_normal
+#define GL_NV_texture_expand_normal 1
+#endif
+
+#ifndef GL_NV_vertex_program2
+#define GL_NV_vertex_program2 1
+#endif
+
+#ifndef GL_ATI_map_object_buffer
+#define GL_ATI_map_object_buffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint);
+GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
+#endif
+
+#ifndef GL_ATI_separate_stencil
+#define GL_ATI_separate_stencil 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum);
+GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+#endif
+
+#ifndef GL_ATI_vertex_attrib_array_object
+#define GL_ATI_vertex_attrib_array_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *);
+GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
+#endif
+
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+#ifndef GL_EXT_depth_bounds_test
+#define GL_EXT_depth_bounds_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
+#endif
+
+#ifndef GL_EXT_texture_mirror_clamp
+#define GL_EXT_texture_mirror_clamp 1
+#endif
+
+#ifndef GL_EXT_blend_equation_separate
+#define GL_EXT_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+#ifndef GL_MESA_pack_invert
+#define GL_MESA_pack_invert 1
+#endif
+
+#ifndef GL_MESA_ycbcr_texture
+#define GL_MESA_ycbcr_texture 1
+#endif
+
+#ifndef GL_EXT_pixel_buffer_object
+#define GL_EXT_pixel_buffer_object 1
+#endif
+
+#ifndef GL_NV_fragment_program_option
+#define GL_NV_fragment_program_option 1
+#endif
+
+#ifndef GL_NV_fragment_program2
+#define GL_NV_fragment_program2 1
+#endif
+
+#ifndef GL_NV_vertex_program2_option
+#define GL_NV_vertex_program2_option 1
+#endif
+
+#ifndef GL_NV_vertex_program3
+#define GL_NV_vertex_program3 1
+#endif
+
+#ifndef GL_EXT_framebuffer_object
+#define GL_EXT_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
+GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
+GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
+GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
+GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
+GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
+GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
+GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
+GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
+GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
+GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
+typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
+typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
+#endif
+
+#ifndef GL_GREMEDY_string_marker
+#define GL_GREMEDY_string_marker 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
+#endif
+
+#ifndef GL_EXT_packed_depth_stencil
+#define GL_EXT_packed_depth_stencil 1
+#endif
+
+#ifndef GL_EXT_stencil_clear_tag
+#define GL_EXT_stencil_clear_tag 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
+#endif
+
+#ifndef GL_EXT_texture_sRGB
+#define GL_EXT_texture_sRGB 1
+#endif
+
+#ifndef GL_EXT_framebuffer_blit
+#define GL_EXT_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+#ifndef GL_EXT_framebuffer_multisample
+#define GL_EXT_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_MESAX_texture_stack
+#define GL_MESAX_texture_stack 1
+#endif
+
+#ifndef GL_EXT_timer_query
+#define GL_EXT_timer_query 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *);
+GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
+#endif
+
+#ifndef GL_EXT_gpu_program_parameters
+#define GL_EXT_gpu_program_parameters 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
+#endif
+
+#ifndef GL_APPLE_flush_buffer_range
+#define GL_APPLE_flush_buffer_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint);
+GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
+#endif
+
+#ifndef GL_EXT_Cg_shader
+#define GL_EXT_Cg_shader 1
+#endif
+
+#ifndef GL_EXT_texture_buffer_object
+#define GL_EXT_texture_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+#endif
+
+#ifndef GL_NV_transform_feedback
+#define GL_NV_transform_feedback 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode);
+GLAPI void APIENTRY glEndTransformFeedbackNV (void);
+GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode);
+GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer);
+GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name);
+GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
+typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
+typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
+typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
+#endif
+
+
+#ifndef GL_NV_depth_buffer_float
+#define GL_NV_depth_buffer_float 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar);
+GLAPI void APIENTRY glClearDepthdNV (GLdouble depth);
+GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
+typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
+typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
+#endif
+
+#ifndef GL_EXT_texture_compression_latc
+#define GL_EXT_texture_compression_latc 1
+#endif
+
+#ifndef GL_EXT_framebuffer_sRGB
+#define GL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GL_EXT_texture_shared_exponent
+#define GL_EXT_texture_shared_exponent 1
+#endif
+
+#ifndef GL_EXT_packed_float
+#define GL_EXT_packed_float 1
+#endif
+
+#ifndef GL_EXT_texture_array
+#define GL_EXT_texture_array 1
+#endif
+
+#ifndef GL_EXT_draw_buffers2
+#define GL_EXT_draw_buffers2 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data);
+GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data);
+GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index);
+GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index);
+GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
+typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
+#endif
+
+#ifndef GL_EXT_texture_integer
+#define GL_EXT_texture_integer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha);
+GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
+#endif
+
+#ifndef GL_EXT_bindable_uniform
+#define GL_EXT_bindable_uniform 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer);
+GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location);
+GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
+typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
+typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
+#endif
+
+#ifndef GL_EXT_gpu_shader4
+#define GL_EXT_gpu_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params);
+GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name);
+GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name);
+GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
+GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1);
+GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value);
+GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x);
+GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y);
+GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z);
+GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x);
+GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y);
+GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z);
+GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v);
+GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v);
+GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v);
+GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v);
+GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v);
+GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v);
+GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params);
+GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
+typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
+typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
+typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
+#endif
+
+
+#ifndef GL_EXT_geometry_shader4
+#define GL_EXT_geometry_shader4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
+#endif
+
+#ifndef GL_NV_geometry_program4
+#define GL_NV_geometry_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
+#endif
+
+#ifndef GL_NV_gpu_program4
+#define GL_NV_gpu_program4 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params);
+GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params);
+GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
+typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
+typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
+#endif
+
+#ifndef GL_NV_parameter_buffer_object
+#define GL_NV_parameter_buffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
+typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
+#endif
+
+#ifndef GL_NV_framebuffer_multisample_coverage
+#define GL_NV_framebuffer_multisample_coverage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+#endif
+
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#endif
+
+/*
+ * ------------------------------------------------
+ * Everything here and below was added manually
+ * by ckline, kbr and yvg to the version of glext.h obtained from:
+ * http://oss.sgi.com/projects/ogl-sample/registry/index.html
+ * ------------------------------------------------
+ */
+
+#ifndef GL_NV_element_array
+#define GL_ELEMENT_ARRAY_TYPE_NV 0x8769
+#define GL_ELEMENT_ARRAY_POINTER_NV 0x876A
+#endif
+
+#ifndef GL_NV_element_array
+#define GL_NV_element_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glElementPointerNV(GLenum type, const GLvoid *pointer);
+GLAPI void APIENTRY glDrawElementArrayNV(GLenum mode, GLint first, GLsizei count);
+GLAPI void APIENTRY glDrawRangeElementArrayNV(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+GLAPI void APIENTRY glMultiDrawElementArrayNV(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GLAPI void APIENTRY glMultiDrawRangeElementArrayNV(GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+typedef void (APIENTRYP PFNGLELEMENTPOINTERNVPROC) (GLenum type, const GLvoid *pointer);
+typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYNVPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYNVPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYNVPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYNVPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
+#endif
+
+/*
+ * note(yvg): manually created this definition from the description at http://www.west.net/~brittain/3dsmax2.htm
+*/
+#ifndef GL_KTX_buffer_region
+#define GL_KTX_FRONT_REGION 0
+#define GL_KTX_BACK_REGION 1
+#define GL_KTX_Z_REGION 2
+#define GL_KTX_STENCIL_REGION 3
+#endif
+
+#ifndef GL_KTX_buffer_region
+#define GL_KTX_buffer_region 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLuint APIENTRY glNewBufferRegion(GLenum);
+GLAPI void APIENTRY glDeleteBufferRegion(GLuint);
+GLAPI void APIENTRY glReadBufferRegion(GLuint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void APIENTRY glDrawBufferRegion(GLuint, GLint, GLint, GLsizei, GLsizei, GLint, GLint);
+GLAPI GLuint APIENTRY glBufferRegionEnabled(GLvoid);
+#endif
+typedef GLuint (APIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum type);
+typedef void (APIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLuint region);
+typedef void (APIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest);
+typedef GLuint (APIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (GLvoid);
+#endif
+
+/*
+ * Note: (kbr) imported these extensions from Apple's glext.h
+ */
+#ifndef GL_APPLE_texture_range
+#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
+#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
+#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
+#define GL_TEXTURE_MINIMIZE_STORAGE_APPLE 0x85B6
+#endif
+#ifndef GL_APPLE_texture_range
+#define GL_APPLE_texture_range 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void glTextureRangeAPPLE(GLenum target, GLsizei length, const GLvoid *pointer);
+GLAPI void glGetTexParameterPointervAPPLE(GLenum target, GLenum pname, GLvoid **params);
+#endif
+typedef void (APIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer);
+typedef void (APIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params);
+#endif
+
+#ifndef GL_APPLE_float_pixels
+#define GL_HALF_APPLE 0x140B
+#define GL_COLOR_FLOAT_APPLE 0x8A0F
+#define GL_RGBA_FLOAT32_APPLE 0x8814
+#define GL_RGB_FLOAT32_APPLE 0x8815
+#define GL_ALPHA_FLOAT32_APPLE 0x8816
+#define GL_INTENSITY_FLOAT32_APPLE 0x8817
+#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
+#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
+#define GL_RGBA_FLOAT16_APPLE 0x881A
+#define GL_RGB_FLOAT16_APPLE 0x881B
+#define GL_ALPHA_FLOAT16_APPLE 0x881C
+#define GL_INTENSITY_FLOAT16_APPLE 0x881D
+#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
+#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
+#endif
+
+#ifndef GL_APPLE_pixel_buffer
+#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10
+#endif
+
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
+#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
+#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
+#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
+#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
+#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
+#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
+#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
+#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
+#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
+#endif
+#ifndef GL_APPLE_vertex_program_evaluators
+#define GL_APPLE_vertex_program_evaluators 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEnableVertexAttribAPPLE(GLuint index, GLenum pname);
+GLAPI void APIENTRY glDisableVertexAttribAPPLE(GLuint index, GLenum pname);
+GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE(GLuint index, GLenum pname);
+GLAPI void APIENTRY glMapVertexAttrib1dAPPLE(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib1fAPPLE(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+GLAPI void APIENTRY glMapVertexAttrib2dAPPLE(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+GLAPI void APIENTRY glMapVertexAttrib2fAPPLE(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#endif
+typedef void (APIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
+typedef GLboolean (APIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
+typedef void (APIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+typedef void (APIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+typedef void (APIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+typedef void (APIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+#endif
+
+#ifndef GL_APPLE_flush_render
+#define GL_APPLE_flush_render 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFlushRenderAPPLE(void);
+GLAPI void APIENTRY glFinishRenderAPPLE(void);
+GLAPI void APIENTRY glSwapAPPLE(void);
+#endif
+typedef void (APIENTRY * PFNGLFLUSHRENDERAPPLEPROC) (void);
+typedef void (APIENTRY * PFNGLFINISHRENDERAPPLEPROC) (void);
+typedef void (APIENTRY * PFNGLSWAPAPPLEPROC) (void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/make/stub_includes/opengl/GL/glu.h b/make/stub_includes/opengl/GL/glu.h
new file mode 100644
index 000000000..bccda7f8e
--- /dev/null
+++ b/make/stub_includes/opengl/GL/glu.h
@@ -0,0 +1,408 @@
+/*
+ * This file is was based upon the OpenGL 1.2.1 Sample implementation publised
+ * by SGI; as such the original license information is preserved below.
+ *
+ */
+
+/*
+** License Applicability. Except 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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#ifndef __glu_h__
+#define __glu_h__
+
+#include <GL/gl.h>
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef GLAPI
+#define GLAPI
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*************************************************************/
+
+/* Extensions */
+#define GLU_EXT_object_space_tess 1
+#define GLU_EXT_nurbs_tessellator 1
+
+/* Boolean */
+#define GLU_FALSE 0
+#define GLU_TRUE 1
+
+/* Version */
+#define GLU_VERSION_1_1 1
+#define GLU_VERSION_1_2 1
+#define GLU_VERSION_1_3 1
+
+/* StringName */
+#define GLU_VERSION 100800
+#define GLU_EXTENSIONS 100801
+
+/* ErrorCode */
+#define GLU_INVALID_ENUM 100900
+#define GLU_INVALID_VALUE 100901
+#define GLU_OUT_OF_MEMORY 100902
+#define GLU_INVALID_OPERATION 100904
+
+/* NurbsDisplay */
+/* GLU_FILL */
+#define GLU_OUTLINE_POLYGON 100240
+#define GLU_OUTLINE_PATCH 100241
+
+/* NurbsCallback */
+#define GLU_NURBS_ERROR 100103
+#define GLU_ERROR 100103
+#define GLU_NURBS_BEGIN 100164
+#define GLU_NURBS_BEGIN_EXT 100164
+#define GLU_NURBS_VERTEX 100165
+#define GLU_NURBS_VERTEX_EXT 100165
+#define GLU_NURBS_NORMAL 100166
+#define GLU_NURBS_NORMAL_EXT 100166
+#define GLU_NURBS_COLOR 100167
+#define GLU_NURBS_COLOR_EXT 100167
+#define GLU_NURBS_TEXTURE_COORD 100168
+#define GLU_NURBS_TEX_COORD_EXT 100168
+#define GLU_NURBS_END 100169
+#define GLU_NURBS_END_EXT 100169
+#define GLU_NURBS_BEGIN_DATA 100170
+#define GLU_NURBS_BEGIN_DATA_EXT 100170
+#define GLU_NURBS_VERTEX_DATA 100171
+#define GLU_NURBS_VERTEX_DATA_EXT 100171
+#define GLU_NURBS_NORMAL_DATA 100172
+#define GLU_NURBS_NORMAL_DATA_EXT 100172
+#define GLU_NURBS_COLOR_DATA 100173
+#define GLU_NURBS_COLOR_DATA_EXT 100173
+#define GLU_NURBS_TEXTURE_COORD_DATA 100174
+#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
+#define GLU_NURBS_END_DATA 100175
+#define GLU_NURBS_END_DATA_EXT 100175
+
+/* NurbsError */
+#define GLU_NURBS_ERROR1 100251
+#define GLU_NURBS_ERROR2 100252
+#define GLU_NURBS_ERROR3 100253
+#define GLU_NURBS_ERROR4 100254
+#define GLU_NURBS_ERROR5 100255
+#define GLU_NURBS_ERROR6 100256
+#define GLU_NURBS_ERROR7 100257
+#define GLU_NURBS_ERROR8 100258
+#define GLU_NURBS_ERROR9 100259
+#define GLU_NURBS_ERROR10 100260
+#define GLU_NURBS_ERROR11 100261
+#define GLU_NURBS_ERROR12 100262
+#define GLU_NURBS_ERROR13 100263
+#define GLU_NURBS_ERROR14 100264
+#define GLU_NURBS_ERROR15 100265
+#define GLU_NURBS_ERROR16 100266
+#define GLU_NURBS_ERROR17 100267
+#define GLU_NURBS_ERROR18 100268
+#define GLU_NURBS_ERROR19 100269
+#define GLU_NURBS_ERROR20 100270
+#define GLU_NURBS_ERROR21 100271
+#define GLU_NURBS_ERROR22 100272
+#define GLU_NURBS_ERROR23 100273
+#define GLU_NURBS_ERROR24 100274
+#define GLU_NURBS_ERROR25 100275
+#define GLU_NURBS_ERROR26 100276
+#define GLU_NURBS_ERROR27 100277
+#define GLU_NURBS_ERROR28 100278
+#define GLU_NURBS_ERROR29 100279
+#define GLU_NURBS_ERROR30 100280
+#define GLU_NURBS_ERROR31 100281
+#define GLU_NURBS_ERROR32 100282
+#define GLU_NURBS_ERROR33 100283
+#define GLU_NURBS_ERROR34 100284
+#define GLU_NURBS_ERROR35 100285
+#define GLU_NURBS_ERROR36 100286
+#define GLU_NURBS_ERROR37 100287
+
+/* NurbsProperty */
+#define GLU_AUTO_LOAD_MATRIX 100200
+#define GLU_CULLING 100201
+#define GLU_SAMPLING_TOLERANCE 100203
+#define GLU_DISPLAY_MODE 100204
+#define GLU_PARAMETRIC_TOLERANCE 100202
+#define GLU_SAMPLING_METHOD 100205
+#define GLU_U_STEP 100206
+#define GLU_V_STEP 100207
+#define GLU_NURBS_MODE 100160
+#define GLU_NURBS_MODE_EXT 100160
+#define GLU_NURBS_TESSELLATOR 100161
+#define GLU_NURBS_TESSELLATOR_EXT 100161
+#define GLU_NURBS_RENDERER 100162
+#define GLU_NURBS_RENDERER_EXT 100162
+
+/* NurbsSampling */
+#define GLU_OBJECT_PARAMETRIC_ERROR 100208
+#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
+#define GLU_OBJECT_PATH_LENGTH 100209
+#define GLU_OBJECT_PATH_LENGTH_EXT 100209
+#define GLU_PATH_LENGTH 100215
+#define GLU_PARAMETRIC_ERROR 100216
+#define GLU_DOMAIN_DISTANCE 100217
+
+/* NurbsTrim */
+#define GLU_MAP1_TRIM_2 100210
+#define GLU_MAP1_TRIM_3 100211
+
+/* QuadricDrawStyle */
+#define GLU_POINT 100010
+#define GLU_LINE 100011
+#define GLU_FILL 100012
+#define GLU_SILHOUETTE 100013
+
+/* QuadricCallback */
+/* GLU_ERROR */
+
+/* QuadricNormal */
+#define GLU_SMOOTH 100000
+#define GLU_FLAT 100001
+#define GLU_NONE 100002
+
+/* QuadricOrientation */
+#define GLU_OUTSIDE 100020
+#define GLU_INSIDE 100021
+
+/* TessCallback */
+#define GLU_TESS_BEGIN 100100
+#define GLU_BEGIN 100100
+#define GLU_TESS_VERTEX 100101
+#define GLU_VERTEX 100101
+#define GLU_TESS_END 100102
+#define GLU_END 100102
+#define GLU_TESS_ERROR 100103
+#define GLU_TESS_EDGE_FLAG 100104
+#define GLU_EDGE_FLAG 100104
+#define GLU_TESS_COMBINE 100105
+#define GLU_TESS_BEGIN_DATA 100106
+#define GLU_TESS_VERTEX_DATA 100107
+#define GLU_TESS_END_DATA 100108
+#define GLU_TESS_ERROR_DATA 100109
+#define GLU_TESS_EDGE_FLAG_DATA 100110
+#define GLU_TESS_COMBINE_DATA 100111
+
+/* TessContour */
+#define GLU_CW 100120
+#define GLU_CCW 100121
+#define GLU_INTERIOR 100122
+#define GLU_EXTERIOR 100123
+#define GLU_UNKNOWN 100124
+
+/* TessProperty */
+#define GLU_TESS_WINDING_RULE 100140
+#define GLU_TESS_BOUNDARY_ONLY 100141
+#define GLU_TESS_TOLERANCE 100142
+
+/* TessError */
+#define GLU_TESS_ERROR1 100151
+#define GLU_TESS_ERROR2 100152
+#define GLU_TESS_ERROR3 100153
+#define GLU_TESS_ERROR4 100154
+#define GLU_TESS_ERROR5 100155
+#define GLU_TESS_ERROR6 100156
+#define GLU_TESS_ERROR7 100157
+#define GLU_TESS_ERROR8 100158
+#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
+#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
+#define GLU_TESS_MISSING_END_POLYGON 100153
+#define GLU_TESS_MISSING_END_CONTOUR 100154
+#define GLU_TESS_COORD_TOO_LARGE 100155
+#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
+
+/* TessWinding */
+#define GLU_TESS_WINDING_ODD 100130
+#define GLU_TESS_WINDING_NONZERO 100131
+#define GLU_TESS_WINDING_POSITIVE 100132
+#define GLU_TESS_WINDING_NEGATIVE 100133
+#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
+
+/*************************************************************/
+
+
+#ifdef __cplusplus
+class GLUnurbs;
+class GLUquadric;
+class GLUtesselator;
+#else
+typedef struct GLUnurbs GLUnurbs;
+typedef struct GLUquadric GLUquadric;
+typedef struct GLUtesselator GLUtesselator;
+#endif
+
+typedef GLUnurbs GLUnurbsObj;
+typedef GLUquadric GLUquadricObj;
+typedef GLUtesselator GLUtesselatorObj;
+typedef GLUtesselator GLUtriangulatorObj;
+
+#define GLU_TESS_MAX_COORD 1.0e150
+
+/* Internal convenience typedefs */
+typedef void (GLAPIENTRY *_GLUfuncptr)();
+
+GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
+GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad);
+GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb);
+GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb);
+GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error);
+GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
+GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name);
+GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
+GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void);
+GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void);
+GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void);
+GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
+GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
+GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
+GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal);
+GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
+GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture);
+GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
+GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess);
+GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
+GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+
+typedef void (GLAPIENTRY * PFNGLUBEGINCURVEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUBEGINPOLYGONPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUBEGINSURFACEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUBEGINTRIMPROC) (GLUnurbs* nurb);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD1DMIPMAPLEVELSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD1DMIPMAPSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD2DMIPMAPLEVELSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD2DMIPMAPSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD3DMIPMAPLEVELSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
+typedef GLint (GLAPIENTRY * PFNGLUBUILD3DMIPMAPSPROC) (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
+typedef GLboolean (GLAPIENTRY * PFNGLUCHECKEXTENSIONPROC) (const GLubyte *extName, const GLubyte *extString);
+typedef void (GLAPIENTRY * PFNGLUCYLINDERPROC) (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
+typedef void (GLAPIENTRY * PFNGLUDELETENURBSRENDERERPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUDELETEQUADRICPROC) (GLUquadric* quad);
+typedef void (GLAPIENTRY * PFNGLUDELETETESSPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUDISKPROC) (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
+typedef void (GLAPIENTRY * PFNGLUENDCURVEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUENDPOLYGONPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUENDSURFACEPROC) (GLUnurbs* nurb);
+typedef void (GLAPIENTRY * PFNGLUENDTRIMPROC) (GLUnurbs* nurb);
+typedef const GLubyte * (GLAPIENTRY * PFNGLUERRORSTRINGPROC) (GLenum error);
+typedef void (GLAPIENTRY * PFNGLUGETNURBSPROPERTYPROC) (GLUnurbs* nurb, GLenum property, GLfloat* data);
+typedef const GLubyte * (GLAPIENTRY * PFNGLUGETSTRINGPROC) (GLenum name);
+typedef void (GLAPIENTRY * PFNGLUGETTESSPROPERTYPROC) (GLUtesselator* tess, GLenum which, GLdouble* data);
+typedef void (GLAPIENTRY * PFNGLULOADSAMPLINGMATRICESPROC) (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
+typedef void (GLAPIENTRY * PFNGLULOOKATPROC) (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
+typedef GLUnurbs* (GLAPIENTRY * PFNGLUNEWNURBSRENDERERPROC) (void);
+typedef GLUquadric* (GLAPIENTRY * PFNGLUNEWQUADRICPROC) (void);
+typedef GLUtesselator* (GLAPIENTRY * PFNGLUNEWTESSPROC) (void);
+typedef void (GLAPIENTRY * PFNGLUNEXTCONTOURPROC) (GLUtesselator* tess, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUNURBSCALLBACKPROC) (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
+typedef void (GLAPIENTRY * PFNGLUNURBSCALLBACKDATAPROC) (GLUnurbs* nurb, GLvoid* userData);
+typedef void (GLAPIENTRY * PFNGLUNURBSCALLBACKDATAEXTPROC) (GLUnurbs* nurb, GLvoid* userData);
+typedef void (GLAPIENTRY * PFNGLUNURBSCURVEPROC) (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUNURBSPROPERTYPROC) (GLUnurbs* nurb, GLenum property, GLfloat value);
+typedef void (GLAPIENTRY * PFNGLUNURBSSURFACEPROC) (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUORTHO2DPROC) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
+typedef void (GLAPIENTRY * PFNGLUPARTIALDISKPROC) (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
+typedef void (GLAPIENTRY * PFNGLUPERSPECTIVEPROC) (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
+typedef void (GLAPIENTRY * PFNGLUPICKMATRIXPROC) (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
+typedef GLint (GLAPIENTRY * PFNGLUPROJECTPROC) (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
+typedef void (GLAPIENTRY * PFNGLUPWLCURVEPROC) (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
+typedef void (GLAPIENTRY * PFNGLUQUADRICCALLBACKPROC) (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
+typedef void (GLAPIENTRY * PFNGLUQUADRICDRAWSTYLEPROC) (GLUquadric* quad, GLenum draw);
+typedef void (GLAPIENTRY * PFNGLUQUADRICNORMALSPROC) (GLUquadric* quad, GLenum normal);
+typedef void (GLAPIENTRY * PFNGLUQUADRICORIENTATIONPROC) (GLUquadric* quad, GLenum orientation);
+typedef void (GLAPIENTRY * PFNGLUQUADRICTEXTUREPROC) (GLUquadric* quad, GLboolean texture);
+typedef GLint (GLAPIENTRY * PFNGLUSCALEIMAGEPROC) (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
+typedef void (GLAPIENTRY * PFNGLUSPHEREPROC) (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
+typedef void (GLAPIENTRY * PFNGLUTESSBEGINCONTOURPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUTESSBEGINPOLYGONPROC) (GLUtesselator* tess, GLvoid* data);
+typedef void (GLAPIENTRY * PFNGLUTESSCALLBACKPROC) (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
+typedef void (GLAPIENTRY * PFNGLUTESSENDCONTOURPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUTESSENDPOLYGONPROC) (GLUtesselator* tess);
+typedef void (GLAPIENTRY * PFNGLUTESSNORMALPROC) (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
+typedef void (GLAPIENTRY * PFNGLUTESSPROPERTYPROC) (GLUtesselator* tess, GLenum which, GLdouble data);
+typedef void (GLAPIENTRY * PFNGLUTESSVERTEXPROC) (GLUtesselator* tess, GLdouble *location, GLvoid* data);
+typedef GLint (GLAPIENTRY * PFNGLUUNPROJECTPROC) (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
+typedef GLint (GLAPIENTRY * PFNGLUUNPROJECT4PROC) (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glu_h__ */
diff --git a/make/stub_includes/opengl/GL/glx.h b/make/stub_includes/opengl/GL/glx.h
new file mode 100644
index 000000000..4032f45da
--- /dev/null
+++ b/make/stub_includes/opengl/GL/glx.h
@@ -0,0 +1,461 @@
+/* $Id$ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 4.1
+ *
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef GLX_H
+#define GLX_H
+
+
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+# ifdef __cplusplus
+/* VMS Xlib.h gives problems with C++.
+ * this avoids a bunch of trivial warnings */
+#pragma message disable nosimpint
+#endif
+#endif
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#ifdef __VMS
+# ifdef __cplusplus
+#pragma message enable nosimpint
+#endif
+#endif
+#include <GL/gl.h>
+
+
+#if defined(USE_MGL_NAMESPACE)
+#include <GL/glx_mangle.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* For some reason gcc ignores #undef directives for these definitions when placed outside this file,
+ which are necessary when including both glx.h and glxext.h as is necessary to compile
+ X11GLImpl_JNI.c. Looks like a bug; couldn't boil down a smaller test case.
+ gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)
+#define GLX_VERSION_1_1 1
+#define GLX_VERSION_1_2 1
+#define GLX_VERSION_1_3 1
+#define GLX_VERSION_1_4 1
+ */
+
+#define GLX_EXTENSION_NAME "GLX"
+
+
+
+/*
+ * Tokens for glXChooseVisual and glXGetConfig:
+ */
+#define GLX_USE_GL 1
+#define GLX_BUFFER_SIZE 2
+#define GLX_LEVEL 3
+#define GLX_RGBA 4
+#define GLX_DOUBLEBUFFER 5
+#define GLX_STEREO 6
+#define GLX_AUX_BUFFERS 7
+#define GLX_RED_SIZE 8
+#define GLX_GREEN_SIZE 9
+#define GLX_BLUE_SIZE 10
+#define GLX_ALPHA_SIZE 11
+#define GLX_DEPTH_SIZE 12
+#define GLX_STENCIL_SIZE 13
+#define GLX_ACCUM_RED_SIZE 14
+#define GLX_ACCUM_GREEN_SIZE 15
+#define GLX_ACCUM_BLUE_SIZE 16
+#define GLX_ACCUM_ALPHA_SIZE 17
+
+
+/*
+ * Error codes returned by glXGetConfig:
+ */
+#define GLX_BAD_SCREEN 1
+#define GLX_BAD_ATTRIBUTE 2
+#define GLX_NO_EXTENSION 3
+#define GLX_BAD_VISUAL 4
+#define GLX_BAD_CONTEXT 5
+#define GLX_BAD_VALUE 6
+#define GLX_BAD_ENUM 7
+
+
+/*
+ * GLX 1.1 and later:
+ */
+#define GLX_VENDOR 1
+#define GLX_VERSION 2
+#define GLX_EXTENSIONS 3
+
+
+/*
+ * GLX 1.3 and later:
+ */
+#define GLX_CONFIG_CAVEAT 0x20
+#define GLX_DONT_CARE 0xFFFFFFFF
+#define GLX_SLOW_CONFIG 0x8001
+#define GLX_NON_CONFORMANT_CONFIG 0x800D
+#define GLX_X_VISUAL_TYPE 0x22
+#define GLX_TRANSPARENT_TYPE 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE 0x24
+#define GLX_TRANSPARENT_RED_VALUE 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
+#define GLX_MAX_PBUFFER_WIDTH 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT 0x8017
+#define GLX_MAX_PBUFFER_PIXELS 0x8018
+#define GLX_PRESERVED_CONTENTS 0x801B
+#define GLX_LARGEST_PBUFFER 0x801C
+#define GLX_WIDTH 0x801D
+#define GLX_HEIGHT 0x801E
+#define GLX_EVENT_MASK 0x801F
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_FBCONFIG_ID 0x8013
+#define GLX_VISUAL_ID 0x800B
+#define GLX_WINDOW_BIT 0x00000001
+#define GLX_PIXMAP_BIT 0x00000002
+#define GLX_PBUFFER_BIT 0x00000004
+#define GLX_AUX_BUFFERS_BIT 0x00000010
+#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
+#define GLX_DEPTH_BUFFER_BIT 0x00000020
+#define GLX_STENCIL_BUFFER_BIT 0x00000040
+#define GLX_ACCUM_BUFFER_BIT 0x00000080
+#define GLX_DRAWABLE_TYPE 0x8010
+#define GLX_RENDER_TYPE 0x8011
+#define GLX_X_RENDERABLE 0x8012
+#define GLX_NONE 0x8000
+#define GLX_TRUE_COLOR 0x8002
+#define GLX_DIRECT_COLOR 0x8003
+#define GLX_PSEUDO_COLOR 0x8004
+#define GLX_STATIC_COLOR 0x8005
+#define GLX_GRAY_SCALE 0x8006
+#define GLX_STATIC_GRAY 0x8007
+#define GLX_TRANSPARENT_RGB 0x8008
+#define GLX_TRANSPARENT_INDEX 0x8009
+#define GLX_RGBA_TYPE 0x8014
+#define GLX_COLOR_INDEX_TYPE 0x8015
+#define GLX_COLOR_INDEX_BIT 0x00000002
+#define GLX_RGBA_BIT 0x00000001
+#define GLX_SCREEN 0x800C
+#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
+#define GLX_DAMAGED 0x8020
+#define GLX_SAVED 0x8021
+#define GLX_WINDOW 0x8022
+#define GLX_PBUFFER 0x8023
+#define GLX_PBUFFER_HEIGHT 0x8040
+#define GLX_PBUFFER_WIDTH 0x8041
+
+
+/*
+ * GLX 1.4 and later:
+ */
+#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
+#define GLX_SAMPLES 0x186a1 /*100001*/
+
+
+
+typedef struct __GLXcontextRec *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+
+
+extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
+ int *attribList );
+
+extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
+ GLXContext shareList, Bool direct );
+
+extern void glXDestroyContext( Display *dpy, GLXContext ctx );
+
+extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
+ GLXContext ctx);
+
+extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
+ unsigned long mask );
+
+extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
+
+extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
+ Pixmap pixmap );
+
+extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
+
+extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
+
+extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
+
+extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
+ int attrib, int *value );
+
+extern GLXContext glXGetCurrentContext( void );
+
+extern GLXDrawable glXGetCurrentDrawable( void );
+
+extern void glXWaitGL( void );
+
+extern void glXWaitX( void );
+
+extern void glXUseXFont( Font font, int first, int count, int list );
+
+
+
+/* GLX 1.1 and later */
+extern const char *glXQueryExtensionsString( Display *dpy, int screen );
+
+extern const char *glXQueryServerString( Display *dpy, int screen, int name );
+
+extern const char *glXGetClientString( Display *dpy, int name );
+
+
+/* GLX 1.2 and later */
+extern Display *glXGetCurrentDisplay( void );
+
+
+/* GLX 1.3 and later */
+extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
+ const int *attribList, int *nitems );
+
+extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
+ int attribute, int *value );
+
+extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
+ int *nelements );
+
+extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
+ GLXFBConfig config );
+
+extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
+ Window win, const int *attribList );
+
+extern void glXDestroyWindow( Display *dpy, GLXWindow window );
+
+extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
+ Pixmap pixmap, const int *attribList );
+
+extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
+
+extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
+ const int *attribList );
+
+extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
+
+extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
+ unsigned int *value );
+
+extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
+ int renderType, GLXContext shareList,
+ Bool direct );
+
+extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
+ GLXDrawable read, GLXContext ctx );
+
+extern GLXDrawable glXGetCurrentReadDrawable( void );
+
+extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
+ int *value );
+
+extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long mask );
+
+extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
+ unsigned long *mask );
+
+/* GLX 1.4 and later */
+extern void (*glXGetProcAddress(const GLubyte *procname))();
+
+#ifndef GLX_GLXEXT_LEGACY
+
+#include <GL/glxext.h>
+
+#else
+
+
+/*
+ * 28. GLX_EXT_visual_info extension
+ */
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+
+#endif /* 28. GLX_EXT_visual_info extension */
+
+
+
+/*
+ * 41. GLX_SGI_video_sync
+ */
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+
+extern int glXGetVideoSyncSGI(unsigned int *count);
+extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
+
+#endif /* GLX_SGI_video_sync */
+
+
+
+/*
+ * 42. GLX_EXT_visual_rating
+ */
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+/*#define GLX_NONE_EXT 0x8000*/
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+
+#endif /* GLX_EXT_visual_rating */
+
+
+
+/*
+ * 47. GLX_EXT_import_context
+ */
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+
+#define GLX_SHARE_CONTEXT_EXT 0x800A
+#define GLX_VISUAL_ID_EXT 0x800B
+#define GLX_SCREEN_EXT 0x800C
+
+extern void glXFreeContextEXT(Display *dpy, GLXContext context);
+
+extern GLXContextID glXGetContextIDEXT(const GLXContext context);
+
+extern Display *glXGetCurrentDisplayEXT(void);
+
+extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
+
+extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
+ int attribute,int *value);
+
+#endif /* GLX_EXT_import_context */
+
+
+
+/*
+ * 215. GLX_MESA_copy_sub_buffer
+ */
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+
+extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
+ int x, int y, int width, int height );
+
+#endif
+
+
+
+/*
+ * 216. GLX_MESA_pixmap_colormap
+ */
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+
+extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
+ Pixmap pixmap, Colormap cmap );
+
+#endif /* GLX_MESA_pixmap_colormap */
+
+
+
+/*
+ * 217. GLX_MESA_release_buffers
+ */
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+
+extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
+
+#endif /* GLX_MESA_release_buffers */
+
+
+
+/*
+ * 218. GLX_MESA_set_3dfx_mode
+ */
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+
+#define GLX_3DFX_WINDOW_MODE_MESA 0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
+
+extern Bool glXSet3DfxModeMESA( int mode );
+
+#endif /* GLX_MESA_set_3dfx_mode */
+
+
+
+/*
+ * ARB 2. GLX_ARB_get_proc_address
+ */
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+
+extern void (*glXGetProcAddressARB(const GLubyte *procName))();
+
+#endif /* GLX_ARB_get_proc_address */
+
+
+
+#endif /* GLX_GLXEXT_LEGACY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/make/stub_includes/opengl/GL/glxext.h b/make/stub_includes/opengl/GL/glxext.h
new file mode 100644
index 000000000..2d6036bcd
--- /dev/null
+++ b/make/stub_includes/opengl/GL/glxext.h
@@ -0,0 +1,895 @@
+#ifndef __glxext_h_
+#define __glxext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number, required by OpenGL ABI for Linux */
+/* glxext.h last updated 2009/01/08 */
+/* Current version at http://www.opengl.org/registry/ */
+#define GLX_GLXEXT_VERSION 21
+
+#ifndef GLX_ARB_multisample
+#define GLX_SAMPLE_BUFFERS_ARB 100000
+#define GLX_SAMPLES_ARB 100001
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
+#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
+#endif
+
+#ifndef GLX_ARB_create_context
+#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
+#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
+#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define GLX_CONTEXT_FLAGS_ARB 0x2094
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SAMPLE_BUFFERS_SGIS 100000
+#define GLX_SAMPLES_SGIS 100001
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_X_VISUAL_TYPE_EXT 0x22
+#define GLX_TRANSPARENT_TYPE_EXT 0x23
+#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
+#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
+#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
+#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
+#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
+#define GLX_NONE_EXT 0x8000
+#define GLX_TRUE_COLOR_EXT 0x8002
+#define GLX_DIRECT_COLOR_EXT 0x8003
+#define GLX_PSEUDO_COLOR_EXT 0x8004
+#define GLX_STATIC_COLOR_EXT 0x8005
+#define GLX_GRAY_SCALE_EXT 0x8006
+#define GLX_STATIC_GRAY_EXT 0x8007
+#define GLX_TRANSPARENT_RGB_EXT 0x8008
+#define GLX_TRANSPARENT_INDEX_EXT 0x8009
+#endif
+
+#ifndef GLX_SGI_swap_control
+#endif
+
+#ifndef GLX_SGI_video_sync
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#endif
+
+#ifndef GLX_SGIX_video_source
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_VISUAL_CAVEAT_EXT 0x20
+#define GLX_SLOW_VISUAL_EXT 0x8001
+#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
+/* reuse GLX_NONE_EXT */
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_SHARE_CONTEXT_EXT 0x800A
+#define GLX_VISUAL_ID_EXT 0x800B
+#define GLX_SCREEN_EXT 0x800C
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_WINDOW_BIT_SGIX 0x00000001
+#define GLX_PIXMAP_BIT_SGIX 0x00000002
+#define GLX_RGBA_BIT_SGIX 0x00000001
+#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
+#define GLX_DRAWABLE_TYPE_SGIX 0x8010
+#define GLX_RENDER_TYPE_SGIX 0x8011
+#define GLX_X_RENDERABLE_SGIX 0x8012
+#define GLX_FBCONFIG_ID_SGIX 0x8013
+#define GLX_RGBA_TYPE_SGIX 0x8014
+#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
+/* reuse GLX_SCREEN_EXT */
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_PBUFFER_BIT_SGIX 0x00000004
+#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
+#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
+#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
+#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
+#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
+#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
+#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
+#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
+#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
+#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
+#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
+#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
+#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
+#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
+#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
+#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
+#define GLX_LARGEST_PBUFFER_SGIX 0x801C
+#define GLX_WIDTH_SGIX 0x801D
+#define GLX_HEIGHT_SGIX 0x801E
+#define GLX_EVENT_MASK_SGIX 0x801F
+#define GLX_DAMAGED_SGIX 0x8020
+#define GLX_SAVED_SGIX 0x8021
+#define GLX_WINDOW_SGIX 0x8022
+#define GLX_PBUFFER_SGIX 0x8023
+#endif
+
+#ifndef GLX_SGI_cushion
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SYNC_FRAME_SGIX 0x00000000
+#define GLX_SYNC_SWAP_SGIX 0x00000001
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#endif
+
+#ifndef GLX_SGIS_blended_overlay
+#define GLX_BLENDED_RGBA_SGIS 0x8025
+#endif
+
+#ifndef GLX_SGIS_shared_multisample
+#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
+#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#endif
+
+#ifndef GLX_3DFX_multisample
+#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
+#define GLX_SAMPLES_3DFX 0x8051
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_3DFX_WINDOW_MODE_MESA 0x1
+#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_SWAP_METHOD_OML 0x8060
+#define GLX_SWAP_EXCHANGE_OML 0x8061
+#define GLX_SWAP_COPY_OML 0x8062
+#define GLX_SWAP_UNDEFINED_OML 0x8063
+#endif
+
+#ifndef GLX_OML_sync_control
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_FLOAT_COMPONENTS_NV 0x20B0
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
+#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
+#define GLX_BAD_HYPERPIPE_SGIX 92
+#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
+#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
+#define GLX_PIPE_RECT_SGIX 0x00000001
+#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
+#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
+#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
+#define GLX_HYPERPIPE_ID_SGIX 0x8030
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#endif
+
+
+/*************************************************************/
+
+typedef void (*__GLXextFuncPtr)(void);
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
+
+#ifndef GLX_ARB_get_proc_address
+#define GLX_ARB_get_proc_address 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
+#endif
+
+
+#ifndef GLX_SGIX_video_source
+typedef XID GLXVideoSourceSGIX;
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+typedef XID GLXFBConfigIDSGIX;
+typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+typedef XID GLXPbufferSGIX;
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came for SendEvent request */
+ Display *display; /* display the event was read from */
+ GLXDrawable drawable; /* i.d. of Drawable */
+ int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
+ int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
+ unsigned int mask; /* mask indicating which buffers are affected*/
+ int x, y;
+ int width, height;
+ int count; /* if nonzero, at least this many more */
+} GLXBufferClobberEventSGIX;
+#endif
+
+#ifndef GLX_NV_swap_group
+#endif
+
+#ifndef GLX_NV_video_out
+/*
+ * GLXVideoDeviceNV is an opaque handle to a video device (part of the
+ * GLX_NV_video_out extension).
+ */
+typedef unsigned int GLXVideoDeviceNV;
+
+/* glXBindVideoImageNV iVideoBuffer values (NV_video_out) */
+#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
+#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
+#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
+#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+
+/* glXSendPbufferToVideoNV iBufferType values (NV_video_out) */
+#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
+#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
+#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
+#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
+#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
+#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+/* New glXGetFBConfigAttrib <attrib_list> tokens */
+#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
+#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
+#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
+#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
+#define GLX_Y_INVERTED_EXT 0x20D4
+
+/* New glXCreatePixmap attributes and glXQueryDrawable attributes */
+#define GLX_TEXTURE_FORMAT_EXT 0x20D5
+#define GLX_TEXTURE_TARGET_EXT 0x20D6
+#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
+
+/* Values for GLX_TEXTURE_FORMAT_EXT */
+#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
+#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
+#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
+
+/* Bits for GLX_BIND_TO_TEXTURE_TARGETS_EXT mask */
+#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
+#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
+#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
+
+/* Values for GLX_TEXTURE_TARGET_EXT */
+#define GLX_TEXTURE_1D_EXT 0x20DB
+#define GLX_TEXTURE_2D_EXT 0x20DC
+#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
+
+/*
+ * Values for the buffer parameter of glXBindTexImageEXT and
+ * glXReleaseTexImageEXT
+ */
+#define GLX_FRONT_LEFT_EXT 0x20DE
+#define GLX_FRONT_RIGHT_EXT 0x20DF
+#define GLX_BACK_LEFT_EXT 0x20E0
+#define GLX_BACK_RIGHT_EXT 0x20E1
+#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
+#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
+#define GLX_AUX0_EXT 0x20E2
+#define GLX_AUX1_EXT 0x20E3
+#define GLX_AUX2_EXT 0x20E4
+#define GLX_AUX3_EXT 0x20E5
+#define GLX_AUX4_EXT 0x20E6
+#define GLX_AUX5_EXT 0x20E7
+#define GLX_AUX6_EXT 0x20E8
+#define GLX_AUX7_EXT 0x20E9
+#define GLX_AUX8_EXT 0x20EA
+#define GLX_AUX9_EXT 0x20EB
+
+#endif
+
+#ifndef GLX_NV_multisample_coverage
+#define GLX_COVERAGE_SAMPLES_NV GLX_SAMPLES_ARB
+#define GLX_COLOR_SAMPLES_NV 0x20B3
+#endif
+
+/* Define int32_t and int64_t types for UST/MSC */
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GLX_OML_sync_control extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS )
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+#include <inttypes.h> /* Fallback option */
+#endif
+#endif
+
+#ifndef GLX_ARB_get_proc_address
+/* Moved to glx.h */
+#endif
+
+#ifndef GLX_ARB_multisample
+#define GLX_ARB_multisample 1
+#endif
+
+#ifndef GLX_ARB_fbconfig_float
+#define GLX_ARB_fbconfig_float 1
+#endif
+
+#ifndef GLX_ARB_create_context
+#define GLX_ARB_create_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXContext glXCreateContextAttribsARB (Display *, GLXFBConfig, GLXContext, Bool, const int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
+#endif
+
+#ifndef GLX_SGIS_multisample
+#define GLX_SGIS_multisample 1
+#endif
+
+#ifndef GLX_EXT_visual_info
+#define GLX_EXT_visual_info 1
+#endif
+
+#ifndef GLX_SGI_swap_control
+#define GLX_SGI_swap_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXSwapIntervalSGI (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
+#endif
+
+#ifndef GLX_SGI_video_sync
+#define GLX_SGI_video_sync 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoSyncSGI (unsigned int *);
+extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
+extern int glXGetRefreshRateSGI(unsigned int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
+typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
+typedef int ( * PFNGLXGETREFRESHRATESGIPROC) (unsigned int *);
+#endif
+
+#ifndef GLX_SGI_make_current_read
+#define GLX_SGI_make_current_read 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
+extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
+typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
+#endif
+
+#ifndef GLX_SGIX_video_source
+#define GLX_SGIX_video_source 1
+#ifdef _VL_H
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
+extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
+typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
+#endif /* _VL_H */
+#endif
+
+#ifndef GLX_EXT_visual_rating
+#define GLX_EXT_visual_rating 1
+#endif
+
+#ifndef GLX_EXT_import_context
+#define GLX_EXT_import_context 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Display * glXGetCurrentDisplayEXT (void);
+extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
+extern GLXContextID glXGetContextIDEXT (const GLXContext);
+extern GLXContext glXImportContextEXT (Display *, GLXContextID);
+extern void glXFreeContextEXT (Display *, GLXContext);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
+typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
+typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
+typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
+typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
+#endif
+
+#ifndef GLX_SGIX_fbconfig
+#define GLX_SGIX_fbconfig 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
+extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
+extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
+extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
+extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
+extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
+typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
+typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
+typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
+typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
+#endif
+
+#ifndef GLX_SGIX_pbuffer
+#define GLX_SGIX_pbuffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
+extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
+extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
+extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
+extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
+typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
+typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
+typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
+typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
+#endif
+
+#ifndef GLX_SGI_cushion
+#define GLX_SGI_cushion 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCushionSGI (Display *, Window, float);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
+#endif
+
+#ifndef GLX_SGIX_video_resize
+#define GLX_SGIX_video_resize 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
+extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
+extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
+extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
+typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
+typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
+typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
+typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
+#endif
+
+#ifndef GLX_SGIX_dmbuffer
+#define GLX_SGIX_dmbuffer 1
+#ifdef _DM_BUFFER_H_
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
+#endif /* _DM_BUFFER_H_ */
+#endif
+
+#ifndef GLX_SGIX_swap_group
+#define GLX_SGIX_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
+#endif
+
+#ifndef GLX_SGIX_swap_barrier
+#define GLX_SGIX_swap_barrier 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
+extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
+typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
+#endif
+
+#ifndef GLX_SUN_get_transparent_index
+#define GLX_SUN_get_transparent_index 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
+#endif
+
+#ifndef GLX_MESA_copy_sub_buffer
+#define GLX_MESA_copy_sub_buffer 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
+#endif
+
+#ifndef GLX_MESA_pixmap_colormap
+#define GLX_MESA_pixmap_colormap 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
+#endif
+
+#ifndef GLX_MESA_release_buffers
+#define GLX_MESA_release_buffers 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
+#endif
+
+#ifndef GLX_MESA_set_3dfx_mode
+#define GLX_MESA_set_3dfx_mode 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXSet3DfxModeMESA (int);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
+#endif
+
+#ifndef GLX_SGIX_visual_select_group
+#define GLX_SGIX_visual_select_group 1
+#endif
+
+#ifndef GLX_OML_swap_method
+#define GLX_OML_swap_method 1
+#endif
+
+#ifndef GLX_OML_sync_control
+#define GLX_OML_sync_control 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
+extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
+extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
+extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
+extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
+typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
+typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
+typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
+#endif
+
+#ifndef GLX_NV_float_buffer
+#define GLX_NV_float_buffer 1
+#endif
+
+#ifndef GLX_SGIX_hyperpipe
+#define GLX_SGIX_hyperpipe 1
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int networkId;
+} GLXHyperpipeNetworkSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int channel;
+ unsigned int
+ participationType;
+ int timeSlice;
+} GLXHyperpipeConfigSGIX;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
+ int destXOrigin, destYOrigin, destWidth, destHeight;
+} GLXPipeRect;
+
+typedef struct {
+ char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
+ int XOrigin, YOrigin, maxHeight, maxWidth;
+} GLXPipeRectLimits;
+
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLXHyperpipeNetworkSGIX * glXQueryHyperpipeNetworkSGIX (Display *, int *);
+extern int glXHyperpipeConfigSGIX (Display *, int, int, GLXHyperpipeConfigSGIX *, int *);
+extern GLXHyperpipeConfigSGIX * glXQueryHyperpipeConfigSGIX (Display *, int, int *);
+extern int glXDestroyHyperpipeConfigSGIX (Display *, int);
+extern int glXBindHyperpipeSGIX (Display *, int);
+extern int glXQueryHyperpipeBestAttribSGIX (Display *, int, int, int, void *, void *);
+extern int glXHyperpipeAttribSGIX (Display *, int, int, int, void *);
+extern int glXQueryHyperpipeAttribSGIX (Display *, int, int, int, void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
+typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
+typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
+typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
+typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
+typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
+typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
+#endif
+
+#ifndef GLX_MESA_agp_offset
+#define GLX_MESA_agp_offset 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int glXGetAGPOffsetMESA (const void *);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
+#endif
+
+/*
+ * GLX_NV_vertex_array_range is not a real extension name...
+ */
+#ifndef GLX_NV_vertex_array_range
+#define GLX_NV_vertex_array_range 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern GLvoid* glXAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+extern void glXFreeMemoryNV (GLvoid *pointer);
+#endif /* GLX_GLXEXT_PROTOTYPES */
+typedef GLvoid* ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
+#endif
+
+#ifndef GLX_NV_swap_group
+#define GLX_NV_swap_group 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern Bool glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable,
+ GLuint group);
+
+extern Bool glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier);
+
+extern Bool glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable,
+ GLuint *group, GLuint *barrier);
+
+extern Bool glXQueryMaxSwapGroupsNV(Display *dpy, int screen,
+ GLuint *maxGroups, GLuint *maxBarriers);
+
+extern Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count);
+
+extern Bool glXResetFrameCountNV(Display *dpy, int screen);
+#endif
+typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy,
+ GLXDrawable drawable,
+ GLuint group);
+
+typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy,
+ GLuint group,
+ GLuint barrier);
+
+typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy,
+ GLXDrawable drawable,
+ GLuint *group,
+ GLuint *barrier);
+
+typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy,
+ int screen,
+ GLuint *maxGroups,
+ GLuint *maxBarriers);
+
+typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy,
+ int screen,
+ GLuint *count);
+
+typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
+#endif
+
+#ifndef GLX_NV_video_out
+#define GLX_NV_video_out 1
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern int glXGetVideoDeviceNV(Display *dpy, int screen, int numVideoDevices,
+ GLXVideoDeviceNV *pVideoDevice);
+
+extern int glXReleaseVideoDeviceNV(Display *dpy, int screen,
+ GLXVideoDeviceNV VideoDevice);
+
+extern int glXBindVideoImageNV(Display *dpy, GLXVideoDeviceNV VideoDevice,
+ GLXPbuffer pbuf, int iVideoBuffer);
+
+extern int glXReleaseVideoImageNV(Display *dpy, GLXPbuffer pbuf);
+
+extern int glXSendPbufferToVideoNV(Display *dpy, GLXPbuffer pbuf,
+ int iBufferType,
+ unsigned long *pulCounterPbuffer,
+ GLboolean bBlock);
+
+extern int glXGetVideoInfoNV(Display *dpy, int screen,
+ GLXVideoDeviceNV VideoDevice,
+ unsigned long *pulCounterOutputPbuffer,
+ unsigned long *pulCounterOutputVideo);
+#endif
+typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display *dpy,
+ int screen,
+ int numVideoDevices,
+ GLXVideoDeviceNV *pVideoDevice);
+
+typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy,
+ int screen,
+ GLXVideoDeviceNV VideoDevice);
+
+typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy,
+ GLXVideoDeviceNV VideoDevice,
+ GLXPbuffer pbuf,
+ int iVideoBuffer);
+
+typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy,
+ GLXPbuffer pbuf);
+
+typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy,
+ GLXPbuffer pbuf,
+ int iBufferType,
+ unsigned long *pulCounterPbuffer,
+ GLboolean bBlock);
+
+typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen,
+ GLXVideoDeviceNV VideoDevice,
+ unsigned long *pulCounterOutputPbuffer,
+ unsigned long *pulCounterOutputVideo);
+#endif
+
+#ifndef GLX_EXT_fbconfig_packed_float
+#define GLX_EXT_fbconfig_packed_float 1
+#endif
+
+#ifndef GLX_EXT_framebuffer_sRGB
+#define GLX_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef GLX_EXT_texture_from_pixmap
+#define GLX_EXT_texture_from_pixmap
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable,
+ int buffer, const int *attrib_list);
+extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable,
+ int buffer);
+#endif
+typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy,
+ GLXDrawable drawable,
+ int buffer,
+ const int *attrib_list);
+typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy,
+ GLXDrawable drawable,
+ int buffer);
+#endif
+
+#ifndef GLX_NV_present_video
+#define GLX_NV_present_video
+#ifdef GLX_GLXEXT_PROTOTYPES
+extern unsigned int *glXEnumerateVideoDevicesNV(Display *dpy,
+ int screen,
+ int *nelements);
+extern int glXBindVideoDeviceNV(Display *dpy,
+ unsigned int video_slot,
+ unsigned int video_device,
+ const int *attrib_list);
+#endif
+typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy,
+ int screen,
+ int *nelements);
+typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy,
+ unsigned int video_slot,
+ unsigned int video_device,
+ const int *attrib_list);
+#endif
+
+#ifndef GLX_NV_multisample_coverage
+#define GLX_NV_multisample_coverage 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __glxext_h_
diff --git a/make/stub_includes/opengl/GL/wglext.h b/make/stub_includes/opengl/GL/wglext.h
new file mode 100644
index 000000000..6f367c09b
--- /dev/null
+++ b/make/stub_includes/opengl/GL/wglext.h
@@ -0,0 +1,742 @@
+#ifndef __wglext_h_
+#define __wglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: This software was created using the
+** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
+** not been independently verified as being compliant with the OpenGL(R)
+** version 1.2.1 Specification.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number */
+/* wglext.h last updated 2006/08/17 */
+/* Current version at http://www.opengl.org/registry/ */
+#define WGL_WGLEXT_VERSION 8
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
+#define WGL_PBUFFER_LARGEST_ARB 0x2033
+#define WGL_PBUFFER_WIDTH_ARB 0x2034
+#define WGL_PBUFFER_HEIGHT_ARB 0x2035
+#define WGL_PBUFFER_LOST_ARB 0x2036
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
+#define WGL_TEXTURE_FORMAT_ARB 0x2072
+#define WGL_TEXTURE_TARGET_ARB 0x2073
+#define WGL_MIPMAP_TEXTURE_ARB 0x2074
+#define WGL_TEXTURE_RGB_ARB 0x2075
+#define WGL_TEXTURE_RGBA_ARB 0x2076
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
+#define WGL_TEXTURE_1D_ARB 0x2079
+#define WGL_TEXTURE_2D_ARB 0x207A
+#define WGL_MIPMAP_LEVEL_ARB 0x207B
+#define WGL_CUBE_MAP_FACE_ARB 0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB 0x2083
+#define WGL_FRONT_RIGHT_ARB 0x2084
+#define WGL_BACK_LEFT_ARB 0x2085
+#define WGL_BACK_RIGHT_ARB 0x2086
+#define WGL_AUX0_ARB 0x2087
+#define WGL_AUX1_ARB 0x2088
+#define WGL_AUX2_ARB 0x2089
+#define WGL_AUX3_ARB 0x208A
+#define WGL_AUX4_ARB 0x208B
+#define WGL_AUX5_ARB 0x208C
+#define WGL_AUX6_ARB 0x208D
+#define WGL_AUX7_ARB 0x208E
+#define WGL_AUX8_ARB 0x208F
+#define WGL_AUX9_ARB 0x2090
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
+#define ERROR_INVALID_VERSION_ARB 0x2095
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
+#define WGL_DRAW_TO_WINDOW_EXT 0x2001
+#define WGL_DRAW_TO_BITMAP_EXT 0x2002
+#define WGL_ACCELERATION_EXT 0x2003
+#define WGL_NEED_PALETTE_EXT 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
+#define WGL_SWAP_METHOD_EXT 0x2007
+#define WGL_NUMBER_OVERLAYS_EXT 0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
+#define WGL_TRANSPARENT_EXT 0x200A
+#define WGL_TRANSPARENT_VALUE_EXT 0x200B
+#define WGL_SHARE_DEPTH_EXT 0x200C
+#define WGL_SHARE_STENCIL_EXT 0x200D
+#define WGL_SHARE_ACCUM_EXT 0x200E
+#define WGL_SUPPORT_GDI_EXT 0x200F
+#define WGL_SUPPORT_OPENGL_EXT 0x2010
+#define WGL_DOUBLE_BUFFER_EXT 0x2011
+#define WGL_STEREO_EXT 0x2012
+#define WGL_PIXEL_TYPE_EXT 0x2013
+#define WGL_COLOR_BITS_EXT 0x2014
+#define WGL_RED_BITS_EXT 0x2015
+#define WGL_RED_SHIFT_EXT 0x2016
+#define WGL_GREEN_BITS_EXT 0x2017
+#define WGL_GREEN_SHIFT_EXT 0x2018
+#define WGL_BLUE_BITS_EXT 0x2019
+#define WGL_BLUE_SHIFT_EXT 0x201A
+#define WGL_ALPHA_BITS_EXT 0x201B
+#define WGL_ALPHA_SHIFT_EXT 0x201C
+#define WGL_ACCUM_BITS_EXT 0x201D
+#define WGL_ACCUM_RED_BITS_EXT 0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
+#define WGL_DEPTH_BITS_EXT 0x2022
+#define WGL_STENCIL_BITS_EXT 0x2023
+#define WGL_AUX_BUFFERS_EXT 0x2024
+#define WGL_NO_ACCELERATION_EXT 0x2025
+#define WGL_GENERIC_ACCELERATION_EXT 0x2026
+#define WGL_FULL_ACCELERATION_EXT 0x2027
+#define WGL_SWAP_EXCHANGE_EXT 0x2028
+#define WGL_SWAP_COPY_EXT 0x2029
+#define WGL_SWAP_UNDEFINED_EXT 0x202A
+#define WGL_TYPE_RGBA_EXT 0x202B
+#define WGL_TYPE_COLORINDEX_EXT 0x202C
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT 0x2033
+#define WGL_PBUFFER_WIDTH_EXT 0x2034
+#define WGL_PBUFFER_HEIGHT_EXT 0x2035
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_DEPTH_FLOAT_EXT 0x2040
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
+#define WGL_SAMPLES_3DFX 0x2061
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_SAMPLE_BUFFERS_EXT 0x2041
+#define WGL_SAMPLES_EXT 0x2042
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#endif
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV 0x20A7
+#endif
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+#define WGL_RGBA_FLOAT_MODE_ATI 0x8820
+#define WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_FLOAT_COMPONENTS_NV 0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
+#endif
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
+#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
+#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
+#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
+#endif
+
+#ifndef WGL_NV_swap_group
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
+#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
+#endif
+
+/*************************************************************/
+
+/* NOTE: following DECLARE_HANDLE macros have to be elided (PCPP
+ doesn't support them); effects placed in stub_includes/win32/windows.h */
+#ifndef SKIP_WGL_HANDLE_DEFINITIONS
+#ifndef WGL_ARB_pbuffer
+DECLARE_HANDLE(HPBUFFERARB);
+#endif
+#ifndef WGL_EXT_pbuffer
+DECLARE_HANDLE(HPBUFFEREXT);
+#endif
+#endif /* !SKIP_WGL_HANDLE_DEFINITIONS */
+
+#ifndef WGL_NV_gpu_affinity
+#ifndef SKIP_WGL_HANDLE_DEFINITIONS
+DECLARE_HANDLE(HGPUNV);
+#endif /* !SKIP_WGL_HANDLE_DEFINITIONS */
+typedef struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+} GPU_DEVICE, *PGPU_DEVICE;
+#endif
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_ARB_buffer_region 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
+extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
+extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
+extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringARB (HDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
+extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
+extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define WGL_ARB_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
+extern HDC WINAPI wglGetCurrentReadDCARB (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_ARB_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
+extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
+extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
+extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
+extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_ARB_render_texture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
+extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
+extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_ARB_pixel_format_float 1
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_ARB_create_context 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HGLRC WINAPI wglCreateContextAttribsARB(HDC hDC, HGLRC hshareContext, const int *attribList);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hshareContext, const int *attribList);
+#endif
+
+#ifndef WGL_EXT_display_color_table
+#define WGL_EXT_display_color_table 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
+extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
+extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
+extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
+typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+#endif
+
+#ifndef WGL_EXT_extensions_string
+#define WGL_EXT_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define WGL_EXT_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
+extern HDC WINAPI wglGetCurrentReadDCEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_EXT_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
+extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
+extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
+extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
+extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_EXT_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
+extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
+extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSwapIntervalEXT (int);
+extern int WINAPI wglGetSwapIntervalEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+#endif
+
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
+extern void WINAPI wglFreeMemoryNV (void *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+#endif
+
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
+extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
+extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
+extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
+extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
+extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_I3D_digital_video_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
+extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_I3D_gamma 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
+extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
+extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
+extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_I3D_genlock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableGenlockI3D (HDC);
+extern BOOL WINAPI wglDisableGenlockI3D (HDC);
+extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
+extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
+extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
+typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_I3D_image_buffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
+extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
+extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
+extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
+typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
+typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#define WGL_I3D_swap_frame_lock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableFrameLockI3D (void);
+extern BOOL WINAPI wglDisableFrameLockI3D (void);
+extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
+extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
+#endif
+
+#ifndef WGL_I3D_swap_frame_usage
+#define WGL_I3D_swap_frame_usage 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetFrameUsageI3D (float *);
+extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
+extern BOOL WINAPI wglEndFrameTrackingI3D (void);
+extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
+typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_ATI_pixel_format_float 1
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_NV_float_buffer 1
+#endif
+
+#ifndef WGL_NV_swap_group
+#define WGL_NV_swap_group 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglJoinSwapGroupNV(HDC hDC, GLuint group);
+extern BOOL WINAPI wglBindSwapBarrierNV(GLuint group, GLuint barrier);
+extern BOOL WINAPI wglQuerySwapGroupNV(HDC hDC, GLuint *group, GLuint *barrier);
+extern BOOL WINAPI wglQueryMaxSwapGroupsNV(HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+extern BOOL WINAPI wglQueryFrameCountNV(HDC hDC, GLuint *count);
+extern BOOL WINAPI wglResetFrameCountNV(HDC hDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
+typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
+typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_NV_gpu_affinity 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnumGpusNV (UINT iIndex, HGPUNV *hGpu);
+extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iIndex, PGPU_DEVICE pGpuDevice);
+extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *pGpuList);
+extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iIndex, HGPUNV *hGpu);
+extern BOOL WINAPI wglDeleteDCNV (HDC hAffinityDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iIndex, PGPU_DEVICE pGpuDevice);
+typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *pGpuList);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hAffinityDC);
+#endif
+
+/*
+ * -----------------------------------------------------------
+ * Everything here and below was added manually
+ * by ckline and kbr to the version of wglext.h obtained from:
+ * http://oss.sgi.com/projects/ogl-sample/registry/index.html
+ * -----------------------------------------------------------
+ */
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_NV_render_texture_rectangle 1
+#endif
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_NV_render_depth_texture 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/make/stub_includes/opengl/GL3/gl3.h b/make/stub_includes/opengl/GL3/gl3.h
new file mode 100755
index 000000000..5fae6986d
--- /dev/null
+++ b/make/stub_includes/opengl/GL3/gl3.h
@@ -0,0 +1,1774 @@
+#ifndef __gl3_h_
+#define __gl3_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* This is a draft release of gl3.h, a new header intended for use with
+ * core OpenGL 3.1 implementations. The current version is always
+ * available at http://www.opengl.org/registry/ . Please don't package
+ * gl3.h for release with other software until it's out of draft status.
+ * The structure of the file may change significantly, and the details
+ * will probably change slightly as we make sure exactly the right set
+ * of interfaces is included.
+ *
+ * gl3.h last updated on $Date: 2009-05-05 15:53:39 -0700 (Tue, 05 May 2009) $
+ *
+ * RELEASE NOTES
+ *
+ * gl3.h should be placed under a directory 'GL3' and included as
+ * '<GL3/gl3.h>'.
+ *
+ * gl3.h only includes interfaces supported in a core OpenGL 3.1
+ * implementation, as well as interfaces for a few ARB extensions which
+ * have identical enums and entry points. It does not, and never will
+ * include functionality removed from core OpenGL 3.1, such as
+ * fixed-function vertex and fragment processing.
+ *
+ * Implementations of OpenGL 3.1 supporting the optional
+ * GL_ARB_compatibility extension continue to provide that functionality,
+ * and source code requiring it should use the traditional <GL/gl.h> and
+ * <GL/glext.h> headers instead of <GL3/gl3.h>.
+ *
+ * It is not possible to #include both <GL3/gl3.h> and either of
+ * <GL/gl.h> or <GL/glext.h> in the same source file.
+ *
+ * We welcome feedback on gl3.h. Please register for the Khronos Bugzilla
+ * (www.khronos.org/bugzilla) and file issues there under product
+ * "OpenGL", category "Registry". Feedback on the opengl.org forums
+ * may not be responded to in a timely fashion.
+ */
+
+/* Function declaration macros - to move into glplatform.h */
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# endif /* _STATIC_MESA support */
+# define GLAPIENTRY __stdcall
+#else
+/* non-Windows compilation */
+# define GLAPI extern
+# define GLAPIENTRY
+#endif /* WIN32 / CYGWIN bracket */
+
+#ifndef GLAPIENTRYP
+# define GLAPIENTRYP GLAPIENTRY*
+#endif
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*
+ * WINDOWS: Include windows.h here to define APIENTRY.
+ * It is also useful when applications include this file by
+ * including only glut.h, since glut.h depends on windows.h.
+ * Applications needing to include windows.h with parms other
+ * than "WIN32_LEAN_AND_MEAN" may include windows.h before
+ * glut.h or gl.h.
+ */
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
+#include <gl/mesa_wgl.h>
+#endif
+
+#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED
+#pragma import on
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+#ifdef CENTERLINE_CLPP
+#define signed
+#endif
+
+#if defined(PRAGMA_EXPORT_SUPPORTED)
+#pragma export on
+#endif
+
+/*
+ * End system-specific stuff.
+ **********************************************************************/
+
+/* Base GL types */
+
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef double GLdouble;
+typedef double GLclampd;
+typedef void GLvoid;
+
+/*************************************************************/
+
+#ifndef GL_VERSION_1_1
+/* AttribMask */
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+/* Boolean */
+#define GL_FALSE 0
+#define GL_TRUE 1
+/* BeginMode */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+/* AlphaFunction */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+/* BlendingFactorDest */
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+/* BlendingFactorSrc */
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+/* DrawBufferMode */
+#define GL_NONE 0
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_LEFT 0x0406
+#define GL_RIGHT 0x0407
+#define GL_FRONT_AND_BACK 0x0408
+/* ErrorCode */
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_OUT_OF_MEMORY 0x0505
+/* FrontFaceDirection */
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+/* GetPName */
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_RANGE 0x0B12
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_RANGE 0x0B22
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_VIEWPORT 0x0BA2
+#define GL_DITHER 0x0BD0
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND 0x0BE2
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_READ_BUFFER 0x0C02
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_STEREO 0x0C33
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_2D 0x8069
+/* GetTextureParameter */
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+/* HintMode */
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+/* DataType */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_DOUBLE 0x140A
+/* LogicOp */
+#define GL_CLEAR 0x1500
+#define GL_AND 0x1501
+#define GL_AND_REVERSE 0x1502
+#define GL_COPY 0x1503
+#define GL_AND_INVERTED 0x1504
+#define GL_NOOP 0x1505
+#define GL_XOR 0x1506
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_EQUIV 0x1509
+#define GL_INVERT 0x150A
+#define GL_OR_REVERSE 0x150B
+#define GL_COPY_INVERTED 0x150C
+#define GL_OR_INVERTED 0x150D
+#define GL_NAND 0x150E
+#define GL_SET 0x150F
+/* MatrixMode (for gl3.h, FBO attachment type) */
+#define GL_TEXTURE 0x1702
+/* PixelCopyType */
+#define GL_COLOR 0x1800
+#define GL_DEPTH 0x1801
+#define GL_STENCIL 0x1802
+/* PixelFormat */
+#define GL_STENCIL_INDEX 0x1901
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_RED 0x1903
+#define GL_GREEN 0x1904
+#define GL_BLUE 0x1905
+#define GL_ALPHA 0x1906
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+/* PolygonMode */
+#define GL_POINT 0x1B00
+#define GL_LINE 0x1B01
+#define GL_FILL 0x1B02
+/* StencilOp */
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+/* StringName */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+/* TextureMagFilter */
+#define GL_NEAREST 0x2600
+#define GL_LINEAR 0x2601
+/* TextureMinFilter */
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+/* TextureTarget */
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_2D 0x8064
+/* TextureWrapMode */
+#define GL_REPEAT 0x2901
+/* PixelInternalFormat */
+#define GL_R3_G3_B2 0x2A10
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB8 0x8051
+#define GL_RGB10 0x8052
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGBA2 0x8055
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA8 0x8058
+#define GL_RGB10_A2 0x8059
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_TEXTURE_3D 0x806F
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_ARB_imaging
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+#define GL_FUNC_ADD 0x8006
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
+#define GL_BLEND_EQUATION 0x8009
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CLAMP_TO_BORDER 0x812D
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_CURRENT_QUERY 0x8865
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_READ_ONLY 0x88B8
+#define GL_WRITE_ONLY 0x88B9
+#define GL_READ_WRITE 0x88BA
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_STREAM_COPY 0x88E2
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STATIC_COPY 0x88E6
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_SAMPLES_PASSED 0x8914
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#define GL_DRAW_BUFFER0 0x8825
+#define GL_DRAW_BUFFER1 0x8826
+#define GL_DRAW_BUFFER2 0x8827
+#define GL_DRAW_BUFFER3 0x8828
+#define GL_DRAW_BUFFER4 0x8829
+#define GL_DRAW_BUFFER5 0x882A
+#define GL_DRAW_BUFFER6 0x882B
+#define GL_DRAW_BUFFER7 0x882C
+#define GL_DRAW_BUFFER8 0x882D
+#define GL_DRAW_BUFFER9 0x882E
+#define GL_DRAW_BUFFER10 0x882F
+#define GL_DRAW_BUFFER11 0x8830
+#define GL_DRAW_BUFFER12 0x8831
+#define GL_DRAW_BUFFER13 0x8832
+#define GL_DRAW_BUFFER14 0x8833
+#define GL_DRAW_BUFFER15 0x8834
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_DELETE_STATUS 0x8B80
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_COMPARE_REF_TO_TEXTURE 0x884E
+#define GL_CLIP_DISTANCE0 0x3000
+#define GL_CLIP_DISTANCE1 0x3001
+#define GL_CLIP_DISTANCE2 0x3002
+#define GL_CLIP_DISTANCE3 0x3003
+#define GL_CLIP_DISTANCE4 0x3004
+#define GL_CLIP_DISTANCE5 0x3005
+#define GL_MAX_CLIP_DISTANCES 0x0D32
+#define GL_MAJOR_VERSION 0x821B
+#define GL_MINOR_VERSION 0x821C
+#define GL_NUM_EXTENSIONS 0x821D
+#define GL_CONTEXT_FLAGS 0x821E
+#define GL_DEPTH_BUFFER 0x8223
+#define GL_STENCIL_BUFFER 0x8224
+#define GL_COMPRESSED_RED 0x8225
+#define GL_COMPRESSED_RG 0x8226
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
+#define GL_RGBA32F 0x8814
+#define GL_RGB32F 0x8815
+#define GL_RGBA16F 0x881A
+#define GL_RGB16F 0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
+#define GL_CLAMP_READ_COLOR 0x891C
+#define GL_FIXED_ONLY 0x891D
+#define GL_MAX_VARYING_COMPONENTS 0x8B4B
+#define GL_TEXTURE_1D_ARRAY 0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
+#define GL_TEXTURE_2D_ARRAY 0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
+#define GL_R11F_G11F_B10F 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
+#define GL_RGB9_E5 0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
+#define GL_TEXTURE_SHARED_SIZE 0x8C3F
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_PRIMITIVES_GENERATED 0x8C87
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD 0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS 0x8C8C
+#define GL_SEPARATE_ATTRIBS 0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI 0x8D70
+#define GL_RGB32UI 0x8D71
+#define GL_RGBA16UI 0x8D76
+#define GL_RGB16UI 0x8D77
+#define GL_RGBA8UI 0x8D7C
+#define GL_RGB8UI 0x8D7D
+#define GL_RGBA32I 0x8D82
+#define GL_RGB32I 0x8D83
+#define GL_RGBA16I 0x8D88
+#define GL_RGB16I 0x8D89
+#define GL_RGBA8I 0x8D8E
+#define GL_RGB8I 0x8D8F
+#define GL_RED_INTEGER 0x8D94
+#define GL_GREEN_INTEGER 0x8D95
+#define GL_BLUE_INTEGER 0x8D96
+#define GL_RGB_INTEGER 0x8D98
+#define GL_RGBA_INTEGER 0x8D99
+#define GL_BGR_INTEGER 0x8D9A
+#define GL_BGRA_INTEGER 0x8D9B
+#define GL_SAMPLER_1D_ARRAY 0x8DC0
+#define GL_SAMPLER_2D_ARRAY 0x8DC1
+#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
+#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
+#define GL_UNSIGNED_INT_VEC2 0x8DC6
+#define GL_UNSIGNED_INT_VEC3 0x8DC7
+#define GL_UNSIGNED_INT_VEC4 0x8DC8
+#define GL_INT_SAMPLER_1D 0x8DC9
+#define GL_INT_SAMPLER_2D 0x8DCA
+#define GL_INT_SAMPLER_3D 0x8DCB
+#define GL_INT_SAMPLER_CUBE 0x8DCC
+#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
+#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
+#define GL_QUERY_WAIT 0x8E13
+#define GL_QUERY_NO_WAIT 0x8E14
+#define GL_QUERY_BY_REGION_WAIT 0x8E15
+#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
+/* Reuse tokens from ARB_depth_buffer_float */
+/* reuse GL_DEPTH_COMPONENT32F */
+/* reuse GL_DEPTH32F_STENCIL8 */
+/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */
+/* Reuse tokens from ARB_framebuffer_object */
+/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_DEFAULT */
+/* reuse GL_FRAMEBUFFER_UNDEFINED */
+/* reuse GL_DEPTH_STENCIL_ATTACHMENT */
+/* reuse GL_INDEX */
+/* reuse GL_MAX_RENDERBUFFER_SIZE */
+/* reuse GL_DEPTH_STENCIL */
+/* reuse GL_UNSIGNED_INT_24_8 */
+/* reuse GL_DEPTH24_STENCIL8 */
+/* reuse GL_TEXTURE_STENCIL_SIZE */
+/* reuse GL_TEXTURE_RED_TYPE */
+/* reuse GL_TEXTURE_GREEN_TYPE */
+/* reuse GL_TEXTURE_BLUE_TYPE */
+/* reuse GL_TEXTURE_ALPHA_TYPE */
+/* reuse GL_TEXTURE_DEPTH_TYPE */
+/* reuse GL_UNSIGNED_NORMALIZED */
+/* reuse GL_FRAMEBUFFER_BINDING */
+/* reuse GL_DRAW_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_BINDING */
+/* reuse GL_READ_FRAMEBUFFER */
+/* reuse GL_DRAW_FRAMEBUFFER */
+/* reuse GL_READ_FRAMEBUFFER_BINDING */
+/* reuse GL_RENDERBUFFER_SAMPLES */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */
+/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */
+/* reuse GL_FRAMEBUFFER_COMPLETE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */
+/* reuse GL_FRAMEBUFFER_UNSUPPORTED */
+/* reuse GL_MAX_COLOR_ATTACHMENTS */
+/* reuse GL_COLOR_ATTACHMENT0 */
+/* reuse GL_COLOR_ATTACHMENT1 */
+/* reuse GL_COLOR_ATTACHMENT2 */
+/* reuse GL_COLOR_ATTACHMENT3 */
+/* reuse GL_COLOR_ATTACHMENT4 */
+/* reuse GL_COLOR_ATTACHMENT5 */
+/* reuse GL_COLOR_ATTACHMENT6 */
+/* reuse GL_COLOR_ATTACHMENT7 */
+/* reuse GL_COLOR_ATTACHMENT8 */
+/* reuse GL_COLOR_ATTACHMENT9 */
+/* reuse GL_COLOR_ATTACHMENT10 */
+/* reuse GL_COLOR_ATTACHMENT11 */
+/* reuse GL_COLOR_ATTACHMENT12 */
+/* reuse GL_COLOR_ATTACHMENT13 */
+/* reuse GL_COLOR_ATTACHMENT14 */
+/* reuse GL_COLOR_ATTACHMENT15 */
+/* reuse GL_DEPTH_ATTACHMENT */
+/* reuse GL_STENCIL_ATTACHMENT */
+/* reuse GL_FRAMEBUFFER */
+/* reuse GL_RENDERBUFFER */
+/* reuse GL_RENDERBUFFER_WIDTH */
+/* reuse GL_RENDERBUFFER_HEIGHT */
+/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */
+/* reuse GL_STENCIL_INDEX1 */
+/* reuse GL_STENCIL_INDEX4 */
+/* reuse GL_STENCIL_INDEX8 */
+/* reuse GL_STENCIL_INDEX16 */
+/* reuse GL_RENDERBUFFER_RED_SIZE */
+/* reuse GL_RENDERBUFFER_GREEN_SIZE */
+/* reuse GL_RENDERBUFFER_BLUE_SIZE */
+/* reuse GL_RENDERBUFFER_ALPHA_SIZE */
+/* reuse GL_RENDERBUFFER_DEPTH_SIZE */
+/* reuse GL_RENDERBUFFER_STENCIL_SIZE */
+/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */
+/* reuse GL_MAX_SAMPLES */
+/* Reuse tokens from ARB_framebuffer_sRGB */
+/* reuse GL_FRAMEBUFFER_SRGB */
+/* Reuse tokens from ARB_half_float_vertex */
+/* reuse GL_HALF_FLOAT */
+/* Reuse tokens from ARB_map_buffer_range */
+/* reuse GL_MAP_READ_BIT */
+/* reuse GL_MAP_WRITE_BIT */
+/* reuse GL_MAP_INVALIDATE_RANGE_BIT */
+/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */
+/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */
+/* reuse GL_MAP_UNSYNCHRONIZED_BIT */
+/* Reuse tokens from ARB_texture_compression_rgtc */
+/* reuse GL_COMPRESSED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */
+/* reuse GL_COMPRESSED_RG_RGTC2 */
+/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */
+/* Reuse tokens from ARB_texture_rg */
+/* reuse GL_RG */
+/* reuse GL_RG_INTEGER */
+/* reuse GL_R8 */
+/* reuse GL_R16 */
+/* reuse GL_RG8 */
+/* reuse GL_RG16 */
+/* reuse GL_R16F */
+/* reuse GL_R32F */
+/* reuse GL_RG16F */
+/* reuse GL_RG32F */
+/* reuse GL_R8I */
+/* reuse GL_R8UI */
+/* reuse GL_R16I */
+/* reuse GL_R16UI */
+/* reuse GL_R32I */
+/* reuse GL_R32UI */
+/* reuse GL_RG8I */
+/* reuse GL_RG8UI */
+/* reuse GL_RG16I */
+/* reuse GL_RG16UI */
+/* reuse GL_RG32I */
+/* reuse GL_RG32UI */
+/* Reuse tokens from ARB_vertex_array_object */
+/* reuse GL_VERTEX_ARRAY_BINDING */
+#endif
+
+#ifndef GL_VERSION_3_1
+#define GL_SAMPLER_2D_RECT 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
+#define GL_SAMPLER_BUFFER 0x8DC2
+#define GL_INT_SAMPLER_2D_RECT 0x8DCD
+#define GL_INT_SAMPLER_BUFFER 0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
+#define GL_TEXTURE_BUFFER 0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
+#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
+#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
+#define GL_RED_SNORM 0x8F90
+#define GL_RG_SNORM 0x8F91
+#define GL_RGB_SNORM 0x8F92
+#define GL_RGBA_SNORM 0x8F93
+#define GL_R8_SNORM 0x8F94
+#define GL_RG8_SNORM 0x8F95
+#define GL_RGB8_SNORM 0x8F96
+#define GL_RGBA8_SNORM 0x8F97
+#define GL_R16_SNORM 0x8F98
+#define GL_RG16_SNORM 0x8F99
+#define GL_RGB16_SNORM 0x8F9A
+#define GL_RGBA16_SNORM 0x8F9B
+#define GL_SIGNED_NORMALIZED 0x8F9C
+#define GL_PRIMITIVE_RESTART 0x8F9D
+#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
+/* Reuse tokens from ARB_copy_buffer */
+/* reuse GL_COPY_READ_BUFFER */
+/* reuse GL_COPY_WRITE_BUFFER */
+/* Would reuse tokens from ARB_draw_instanced, but it has none */
+/* Reuse tokens from ARB_uniform_buffer_object */
+/* reuse GL_UNIFORM_BUFFER */
+/* reuse GL_UNIFORM_BUFFER_BINDING */
+/* reuse GL_UNIFORM_BUFFER_START */
+/* reuse GL_UNIFORM_BUFFER_SIZE */
+/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
+/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
+/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
+/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
+/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
+/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
+/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
+/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
+/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
+/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
+/* reuse GL_UNIFORM_TYPE */
+/* reuse GL_UNIFORM_SIZE */
+/* reuse GL_UNIFORM_NAME_LENGTH */
+/* reuse GL_UNIFORM_BLOCK_INDEX */
+/* reuse GL_UNIFORM_OFFSET */
+/* reuse GL_UNIFORM_ARRAY_STRIDE */
+/* reuse GL_UNIFORM_MATRIX_STRIDE */
+/* reuse GL_UNIFORM_IS_ROW_MAJOR */
+/* reuse GL_UNIFORM_BLOCK_BINDING */
+/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
+/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
+/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
+/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
+/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
+/* reuse GL_INVALID_INDEX */
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT 0x8218
+#define GL_FRAMEBUFFER_UNDEFINED 0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_DEPTH_STENCIL 0x84F9
+#define GL_UNSIGNED_INT_24_8 0x84FA
+#define GL_DEPTH24_STENCIL8 0x88F0
+#define GL_TEXTURE_STENCIL_SIZE 0x88F1
+#define GL_TEXTURE_RED_TYPE 0x8C10
+#define GL_TEXTURE_GREEN_TYPE 0x8C11
+#define GL_TEXTURE_BLUE_TYPE 0x8C12
+#define GL_TEXTURE_ALPHA_TYPE 0x8C13
+#define GL_TEXTURE_DEPTH_TYPE 0x8C16
+#define GL_UNSIGNED_NORMALIZED 0x8C17
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
+#define GL_RENDERBUFFER_SAMPLES 0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_COLOR_ATTACHMENT1 0x8CE1
+#define GL_COLOR_ATTACHMENT2 0x8CE2
+#define GL_COLOR_ATTACHMENT3 0x8CE3
+#define GL_COLOR_ATTACHMENT4 0x8CE4
+#define GL_COLOR_ATTACHMENT5 0x8CE5
+#define GL_COLOR_ATTACHMENT6 0x8CE6
+#define GL_COLOR_ATTACHMENT7 0x8CE7
+#define GL_COLOR_ATTACHMENT8 0x8CE8
+#define GL_COLOR_ATTACHMENT9 0x8CE9
+#define GL_COLOR_ATTACHMENT10 0x8CEA
+#define GL_COLOR_ATTACHMENT11 0x8CEB
+#define GL_COLOR_ATTACHMENT12 0x8CEC
+#define GL_COLOR_ATTACHMENT13 0x8CED
+#define GL_COLOR_ATTACHMENT14 0x8CEE
+#define GL_COLOR_ATTACHMENT15 0x8CEF
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_STENCIL_INDEX1 0x8D46
+#define GL_STENCIL_INDEX4 0x8D47
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_INDEX16 0x8D49
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES 0x8D57
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_WRITE_BIT 0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#endif
+
+#ifndef GL_ARB_uniform_buffer_object
+#define GL_UNIFORM_BUFFER 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING 0x8A28
+#define GL_UNIFORM_BUFFER_START 0x8A29
+#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
+#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
+#define GL_UNIFORM_TYPE 0x8A37
+#define GL_UNIFORM_SIZE 0x8A38
+#define GL_UNIFORM_NAME_LENGTH 0x8A39
+#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
+#define GL_UNIFORM_OFFSET 0x8A3B
+#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
+#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
+#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
+#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
+#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX 0xFFFFFFFFu
+#endif
+
+#ifndef GL_ARB_copy_buffer
+#define GL_COPY_READ_BUFFER 0x8F36
+#define GL_COPY_WRITE_BUFFER 0x8F37
+#endif
+
+
+/*************************************************************/
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for program/shader text and shader object handles */
+typedef char GLcharARB;
+typedef unsigned int GLhandleARB;
+#endif
+
+/* GL type for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#include "glext-64bit-types.h"
+
+#ifndef GL_VERSION_1_0
+#define GL_VERSION_1_0 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glCullFace (GLenum);
+GLAPI void GLAPIENTRY glFrontFace (GLenum);
+GLAPI void GLAPIENTRY glHint (GLenum, GLenum);
+GLAPI void GLAPIENTRY glLineWidth (GLfloat);
+GLAPI void GLAPIENTRY glPointSize (GLfloat);
+GLAPI void GLAPIENTRY glPolygonMode (GLenum, GLenum);
+GLAPI void GLAPIENTRY glScissor (GLint, GLint, GLsizei, GLsizei);
+GLAPI void GLAPIENTRY glTexParameterf (GLenum, GLenum, GLfloat);
+GLAPI void GLAPIENTRY glTexParameterfv (GLenum, GLenum, const GLfloat *);
+GLAPI void GLAPIENTRY glTexParameteri (GLenum, GLenum, GLint);
+GLAPI void GLAPIENTRY glTexParameteriv (GLenum, GLenum, const GLint *);
+GLAPI void GLAPIENTRY glTexImage1D (GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glTexImage2D (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glDrawBuffer (GLenum);
+GLAPI void GLAPIENTRY glClear (GLbitfield);
+GLAPI void GLAPIENTRY glClearColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void GLAPIENTRY glClearStencil (GLint);
+GLAPI void GLAPIENTRY glClearDepth (GLclampd);
+GLAPI void GLAPIENTRY glStencilMask (GLuint);
+GLAPI void GLAPIENTRY glColorMask (GLboolean, GLboolean, GLboolean, GLboolean);
+GLAPI void GLAPIENTRY glDepthMask (GLboolean);
+GLAPI void GLAPIENTRY glDisable (GLenum);
+GLAPI void GLAPIENTRY glEnable (GLenum);
+GLAPI void GLAPIENTRY glFinish (void);
+GLAPI void GLAPIENTRY glFlush (void);
+GLAPI void GLAPIENTRY glBlendFunc (GLenum, GLenum);
+GLAPI void GLAPIENTRY glLogicOp (GLenum);
+GLAPI void GLAPIENTRY glStencilFunc (GLenum, GLint, GLuint);
+GLAPI void GLAPIENTRY glStencilOp (GLenum, GLenum, GLenum);
+GLAPI void GLAPIENTRY glDepthFunc (GLenum);
+GLAPI void GLAPIENTRY glPixelStoref (GLenum, GLfloat);
+GLAPI void GLAPIENTRY glPixelStorei (GLenum, GLint);
+GLAPI void GLAPIENTRY glReadBuffer (GLenum);
+GLAPI void GLAPIENTRY glReadPixels (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *);
+GLAPI void GLAPIENTRY glGetBooleanv (GLenum, GLboolean *);
+GLAPI void GLAPIENTRY glGetDoublev (GLenum, GLdouble *);
+GLAPI GLenum GLAPIENTRY glGetError (void);
+GLAPI void GLAPIENTRY glGetFloatv (GLenum, GLfloat *);
+GLAPI void GLAPIENTRY glGetIntegerv (GLenum, GLint *);
+GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum);
+GLAPI void GLAPIENTRY glGetTexImage (GLenum, GLint, GLenum, GLenum, GLvoid *);
+GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum, GLenum, GLfloat *);
+GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum, GLint, GLenum, GLfloat *);
+GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum, GLint, GLenum, GLint *);
+GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum);
+GLAPI void GLAPIENTRY glDepthRange (GLclampd, GLclampd);
+GLAPI void GLAPIENTRY glViewport (GLint, GLint, GLsizei, GLsizei);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
+typedef void (GLAPIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
+typedef void (GLAPIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
+typedef void (GLAPIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
+typedef void (GLAPIENTRYP PFNGLPOINTSIZEPROC) (GLfloat size);
+typedef void (GLAPIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
+typedef void (GLAPIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAPIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GLAPIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GLAPIENTRYP PFNGLTEXIMAGE1DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLDRAWBUFFERPROC) (GLenum mode);
+typedef void (GLAPIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
+typedef void (GLAPIENTRYP PFNGLCLEARCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (GLAPIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
+typedef void (GLAPIENTRYP PFNGLCLEARDEPTHPROC) (GLclampd depth);
+typedef void (GLAPIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
+typedef void (GLAPIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+typedef void (GLAPIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
+typedef void (GLAPIENTRYP PFNGLDISABLEPROC) (GLenum cap);
+typedef void (GLAPIENTRYP PFNGLENABLEPROC) (GLenum cap);
+typedef void (GLAPIENTRYP PFNGLFINISHPROC) (void);
+typedef void (GLAPIENTRYP PFNGLFLUSHPROC) (void);
+typedef void (GLAPIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
+typedef void (GLAPIENTRYP PFNGLLOGICOPPROC) (GLenum opcode);
+typedef void (GLAPIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
+typedef void (GLAPIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
+typedef void (GLAPIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
+typedef void (GLAPIENTRYP PFNGLPIXELSTOREFPROC) (GLenum pname, GLfloat param);
+typedef void (GLAPIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
+typedef void (GLAPIENTRYP PFNGLREADBUFFERPROC) (GLenum mode);
+typedef void (GLAPIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *params);
+typedef void (GLAPIENTRYP PFNGLGETDOUBLEVPROC) (GLenum pname, GLdouble *params);
+typedef GLenum (GLAPIENTRYP PFNGLGETERRORPROC) (void);
+typedef void (GLAPIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
+typedef const GLubyte * (GLAPIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
+typedef void (GLAPIENTRYP PFNGLGETTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC) (GLenum target, GLint level, GLenum pname, GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
+typedef GLboolean (GLAPIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
+typedef void (GLAPIENTRYP PFNGLDEPTHRANGEPROC) (GLclampd _near, GLclampd _far); /* MSVC can't handle near or far var names */
+typedef void (GLAPIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_1
+#define GL_VERSION_1_1 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glDrawArrays (GLenum, GLint, GLsizei);
+GLAPI void GLAPIENTRY glDrawElements (GLenum, GLsizei, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glGetPointerv (GLenum, GLvoid* *);
+GLAPI void GLAPIENTRY glPolygonOffset (GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint);
+GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
+GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum, GLint, GLint, GLint, GLint, GLsizei);
+GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+GLAPI void GLAPIENTRY glTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glBindTexture (GLenum, GLuint);
+GLAPI void GLAPIENTRY glDeleteTextures (GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glGenTextures (GLsizei, GLuint *);
+GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
+typedef void (GLAPIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (GLAPIENTRYP PFNGLGETPOINTERVPROC) (GLenum pname, GLvoid* *params);
+typedef void (GLAPIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
+typedef void (GLAPIENTRYP PFNGLCOPYTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (GLAPIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GLAPIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (GLAPIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRYP PFNGLTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
+typedef void (GLAPIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
+typedef void (GLAPIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
+typedef GLboolean (GLAPIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
+#endif
+
+#ifndef GL_VERSION_1_2
+#define GL_VERSION_1_2 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
+GLAPI void GLAPIENTRY glBlendEquation (GLenum);
+GLAPI void GLAPIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+GLAPI void GLAPIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+typedef void (GLAPIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
+typedef void (GLAPIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
+typedef void (GLAPIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
+typedef void (GLAPIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+#endif
+
+#ifndef GL_VERSION_1_3
+#define GL_VERSION_1_3 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glActiveTexture (GLenum);
+GLAPI void GLAPIENTRY glSampleCoverage (GLclampf, GLboolean);
+GLAPI void GLAPIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (GLAPIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
+typedef void (GLAPIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
+#endif
+
+#ifndef GL_VERSION_1_4
+#define GL_VERSION_1_4 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void GLAPIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
+GLAPI void GLAPIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
+GLAPI void GLAPIENTRY glPointParameterf (GLenum, GLfloat);
+GLAPI void GLAPIENTRY glPointParameterfv (GLenum, const GLfloat *);
+GLAPI void GLAPIENTRY glPointParameteri (GLenum, GLint);
+GLAPI void GLAPIENTRY glPointParameteriv (GLenum, const GLint *);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (GLAPIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+typedef void (GLAPIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+typedef void (GLAPIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
+typedef void (GLAPIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
+typedef void (GLAPIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
+#endif
+
+#ifndef GL_VERSION_1_5
+#define GL_VERSION_1_5 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glGenQueries (GLsizei, GLuint *);
+GLAPI void GLAPIENTRY glDeleteQueries (GLsizei, const GLuint *);
+GLAPI GLboolean GLAPIENTRY glIsQuery (GLuint);
+GLAPI void GLAPIENTRY glBeginQuery (GLenum, GLuint);
+GLAPI void GLAPIENTRY glEndQuery (GLenum);
+GLAPI void GLAPIENTRY glGetQueryiv (GLenum, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *);
+GLAPI void GLAPIENTRY glBindBuffer (GLenum, GLuint);
+GLAPI void GLAPIENTRY glDeleteBuffers (GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glGenBuffers (GLsizei, GLuint *);
+GLAPI GLboolean GLAPIENTRY glIsBuffer (GLuint);
+GLAPI void GLAPIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+GLAPI void GLAPIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *);
+GLAPI void GLAPIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *);
+GLAPI GLvoid* GLAPIENTRY glMapBuffer (GLenum, GLenum);
+GLAPI GLboolean GLAPIENTRY glUnmapBuffer (GLenum);
+GLAPI void GLAPIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids);
+typedef void (GLAPIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (GLAPIENTRYP PFNGLISQUERYPROC) (GLuint id);
+typedef void (GLAPIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
+typedef void (GLAPIENTRYP PFNGLENDQUERYPROC) (GLenum target);
+typedef void (GLAPIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (GLAPIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
+typedef void (GLAPIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
+typedef void (GLAPIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
+typedef GLboolean (GLAPIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
+typedef void (GLAPIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+typedef void (GLAPIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (GLAPIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
+typedef GLvoid* (GLAPIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
+typedef GLboolean (GLAPIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target);
+typedef void (GLAPIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
+#endif
+
+#ifndef GL_VERSION_2_0
+#define GL_VERSION_2_0 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glBlendEquationSeparate (GLenum, GLenum);
+GLAPI void GLAPIENTRY glDrawBuffers (GLsizei, const GLenum *);
+GLAPI void GLAPIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
+GLAPI void GLAPIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
+GLAPI void GLAPIENTRY glStencilMaskSeparate (GLenum, GLuint);
+GLAPI void GLAPIENTRY glAttachShader (GLuint, GLuint);
+GLAPI void GLAPIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
+GLAPI void GLAPIENTRY glCompileShader (GLuint);
+GLAPI GLuint GLAPIENTRY glCreateProgram (void);
+GLAPI GLuint GLAPIENTRY glCreateShader (GLenum);
+GLAPI void GLAPIENTRY glDeleteProgram (GLuint);
+GLAPI void GLAPIENTRY glDeleteShader (GLuint);
+GLAPI void GLAPIENTRY glDetachShader (GLuint, GLuint);
+GLAPI void GLAPIENTRY glDisableVertexAttribArray (GLuint);
+GLAPI void GLAPIENTRY glEnableVertexAttribArray (GLuint);
+GLAPI void GLAPIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void GLAPIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
+GLAPI void GLAPIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
+GLAPI GLint GLAPIENTRY glGetAttribLocation (GLuint, const GLchar *);
+GLAPI void GLAPIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void GLAPIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void GLAPIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLint GLAPIENTRY glGetUniformLocation (GLuint, const GLchar *);
+GLAPI void GLAPIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
+GLAPI void GLAPIENTRY glGetUniformiv (GLuint, GLint, GLint *);
+GLAPI void GLAPIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
+GLAPI void GLAPIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
+GLAPI void GLAPIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
+GLAPI GLboolean GLAPIENTRY glIsProgram (GLuint);
+GLAPI GLboolean GLAPIENTRY glIsShader (GLuint);
+GLAPI void GLAPIENTRY glLinkProgram (GLuint);
+GLAPI void GLAPIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
+GLAPI void GLAPIENTRY glUseProgram (GLuint);
+GLAPI void GLAPIENTRY glUniform1f (GLint, GLfloat);
+GLAPI void GLAPIENTRY glUniform2f (GLint, GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glUniform1i (GLint, GLint);
+GLAPI void GLAPIENTRY glUniform2i (GLint, GLint, GLint);
+GLAPI void GLAPIENTRY glUniform3i (GLint, GLint, GLint, GLint);
+GLAPI void GLAPIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
+GLAPI void GLAPIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
+GLAPI void GLAPIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
+GLAPI void GLAPIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
+GLAPI void GLAPIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
+GLAPI void GLAPIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
+GLAPI void GLAPIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
+GLAPI void GLAPIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
+GLAPI void GLAPIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
+GLAPI void GLAPIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glValidateProgram (GLuint);
+GLAPI void GLAPIENTRY glVertexAttrib1d (GLuint, GLdouble);
+GLAPI void GLAPIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
+GLAPI void GLAPIENTRY glVertexAttrib1f (GLuint, GLfloat);
+GLAPI void GLAPIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
+GLAPI void GLAPIENTRY glVertexAttrib1s (GLuint, GLshort);
+GLAPI void GLAPIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
+GLAPI void GLAPIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
+GLAPI void GLAPIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
+GLAPI void GLAPIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
+GLAPI void GLAPIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
+GLAPI void GLAPIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
+GLAPI void GLAPIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
+GLAPI void GLAPIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
+GLAPI void GLAPIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
+GLAPI void GLAPIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
+GLAPI void GLAPIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
+GLAPI void GLAPIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
+GLAPI void GLAPIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
+GLAPI void GLAPIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
+GLAPI void GLAPIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
+GLAPI void GLAPIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
+GLAPI void GLAPIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
+GLAPI void GLAPIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
+GLAPI void GLAPIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
+GLAPI void GLAPIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
+GLAPI void GLAPIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
+GLAPI void GLAPIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
+GLAPI void GLAPIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
+GLAPI void GLAPIENTRY glVertexAttrib4iv (GLuint, const GLint *);
+GLAPI void GLAPIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
+GLAPI void GLAPIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
+GLAPI void GLAPIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
+GLAPI void GLAPIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
+GLAPI void GLAPIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
+GLAPI void GLAPIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
+typedef void (GLAPIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
+typedef void (GLAPIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (GLAPIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
+typedef void (GLAPIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
+typedef void (GLAPIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GLAPIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
+typedef void (GLAPIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
+typedef GLuint (GLAPIENTRYP PFNGLCREATEPROGRAMPROC) (void);
+typedef GLuint (GLAPIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
+typedef void (GLAPIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
+typedef void (GLAPIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
+typedef void (GLAPIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (GLAPIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
+typedef void (GLAPIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (GLAPIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+typedef void (GLAPIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
+typedef GLint (GLAPIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GLAPIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GLAPIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GLAPIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+typedef GLint (GLAPIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GLAPIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
+typedef void (GLAPIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
+typedef void (GLAPIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
+typedef GLboolean (GLAPIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
+typedef GLboolean (GLAPIENTRYP PFNGLISSHADERPROC) (GLuint shader);
+typedef void (GLAPIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (GLAPIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
+typedef void (GLAPIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
+typedef void (GLAPIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GLAPIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GLAPIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
+typedef void (GLAPIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
+typedef void (GLAPIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GLAPIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GLAPIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
+#endif
+
+#ifndef GL_VERSION_2_1
+#define GL_VERSION_2_1 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
+GLAPI void GLAPIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+
+#ifndef GL_VERSION_3_0
+#define GL_VERSION_3_0 1
+/* OpenGL 3.0 also reuses entry points from these extensions: */
+/* ARB_framebuffer_object */
+/* ARB_map_buffer_range */
+/* ARB_vertex_array_object */
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
+GLAPI void GLAPIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *);
+GLAPI void GLAPIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *);
+GLAPI void GLAPIENTRY glEnablei (GLenum, GLuint);
+GLAPI void GLAPIENTRY glDisablei (GLenum, GLuint);
+GLAPI GLboolean GLAPIENTRY glIsEnabledi (GLenum, GLuint);
+GLAPI void GLAPIENTRY glBeginTransformFeedback (GLenum);
+GLAPI void GLAPIENTRY glEndTransformFeedback (void);
+GLAPI void GLAPIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
+GLAPI void GLAPIENTRY glBindBufferBase (GLenum, GLuint, GLuint);
+GLAPI void GLAPIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum);
+GLAPI void GLAPIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
+GLAPI void GLAPIENTRY glClampColor (GLenum, GLenum);
+GLAPI void GLAPIENTRY glBeginConditionalRender (GLuint, GLenum);
+GLAPI void GLAPIENTRY glEndConditionalRender (void);
+GLAPI void GLAPIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
+GLAPI void GLAPIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *);
+GLAPI void GLAPIENTRY glGetUniformuiv (GLuint, GLint, GLuint *);
+GLAPI void GLAPIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *);
+GLAPI GLint GLAPIENTRY glGetFragDataLocation (GLuint, const GLchar *);
+GLAPI void GLAPIENTRY glUniform1ui (GLint, GLuint);
+GLAPI void GLAPIENTRY glUniform2ui (GLint, GLuint, GLuint);
+GLAPI void GLAPIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint);
+GLAPI void GLAPIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint);
+GLAPI void GLAPIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *);
+GLAPI void GLAPIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *);
+GLAPI void GLAPIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *);
+GLAPI void GLAPIENTRY glClearBufferiv (GLenum, GLint, const GLint *);
+GLAPI void GLAPIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *);
+GLAPI void GLAPIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *);
+GLAPI void GLAPIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint);
+GLAPI const GLubyte * GLAPIENTRY glGetStringi (GLenum, GLuint);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (GLAPIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data);
+typedef void (GLAPIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data);
+typedef void (GLAPIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index);
+typedef void (GLAPIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index);
+typedef GLboolean (GLAPIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index);
+typedef void (GLAPIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode);
+typedef void (GLAPIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void);
+typedef void (GLAPIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (GLAPIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
+typedef void (GLAPIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
+typedef void (GLAPIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+typedef void (GLAPIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
+typedef void (GLAPIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
+typedef void (GLAPIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
+typedef void (GLAPIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (GLAPIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
+typedef void (GLAPIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params);
+typedef void (GLAPIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name);
+typedef GLint (GLAPIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name);
+typedef void (GLAPIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0);
+typedef void (GLAPIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1);
+typedef void (GLAPIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GLAPIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GLAPIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value);
+typedef void (GLAPIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GLAPIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (GLAPIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (GLAPIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value);
+typedef void (GLAPIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value);
+typedef void (GLAPIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+typedef void (GLAPIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef const GLubyte * (GLAPIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
+#endif
+
+#ifndef GL_VERSION_3_1
+#define GL_VERSION_3_1 1
+/* OpenGL 3.1 also reuses entry points from these extensions: */
+/* ARB_copy_buffer */
+/* ARB_uniform_buffer_object */
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei);
+GLAPI void GLAPIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
+GLAPI void GLAPIENTRY glTexBuffer (GLenum, GLenum, GLuint);
+GLAPI void GLAPIENTRY glPrimitiveRestartIndex (GLuint);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (GLAPIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
+typedef void (GLAPIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GLAPIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
+#endif
+
+#ifndef GL_ARB_framebuffer_object
+#define GL_ARB_framebuffer_object 1
+#ifdef GL3_PROTOTYPES
+GLAPI GLboolean GLAPIENTRY glIsRenderbuffer (GLuint);
+GLAPI void GLAPIENTRY glBindRenderbuffer (GLenum, GLuint);
+GLAPI void GLAPIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glGenRenderbuffers (GLsizei, GLuint *);
+GLAPI void GLAPIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei);
+GLAPI void GLAPIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *);
+GLAPI GLboolean GLAPIENTRY glIsFramebuffer (GLuint);
+GLAPI void GLAPIENTRY glBindFramebuffer (GLenum, GLuint);
+GLAPI void GLAPIENTRY glDeleteFramebuffers (GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glGenFramebuffers (GLsizei, GLuint *);
+GLAPI GLenum GLAPIENTRY glCheckFramebufferStatus (GLenum);
+GLAPI void GLAPIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void GLAPIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint);
+GLAPI void GLAPIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
+GLAPI void GLAPIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint);
+GLAPI void GLAPIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGenerateMipmap (GLenum);
+GLAPI void GLAPIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+GLAPI void GLAPIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GLAPI void GLAPIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint);
+#endif /* GL3_PROTOTYPES */
+typedef GLboolean (GLAPIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
+typedef void (GLAPIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GLAPIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
+typedef void (GLAPIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
+typedef void (GLAPIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
+typedef GLboolean (GLAPIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
+typedef void (GLAPIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
+typedef void (GLAPIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
+typedef void (GLAPIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
+typedef GLenum (GLAPIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
+typedef void (GLAPIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAPIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (GLAPIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GLAPIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
+typedef void (GLAPIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (GLAPIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAPIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#ifndef GL_ARB_map_buffer_range
+#define GL_ARB_map_buffer_range 1
+#ifdef GL3_PROTOTYPES
+GLAPI GLvoid* GLAPIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield);
+GLAPI void GLAPIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr);
+#endif /* GL3_PROTOTYPES */
+typedef GLvoid* (GLAPIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GLAPIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+
+#ifndef GL_ARB_vertex_array_object
+#define GL_ARB_vertex_array_object 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glBindVertexArray (GLuint);
+GLAPI void GLAPIENTRY glDeleteVertexArrays (GLsizei, const GLuint *);
+GLAPI void GLAPIENTRY glGenVertexArrays (GLsizei, GLuint *);
+GLAPI GLboolean GLAPIENTRY glIsVertexArray (GLuint);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array);
+typedef void (GLAPIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GLAPIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GLAPIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array);
+#endif
+
+#ifndef GL_ARB_uniform_buffer_object
+#define GL_ARB_uniform_buffer_object 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *);
+GLAPI void GLAPIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI GLuint GLAPIENTRY glGetUniformBlockIndex (GLuint, const GLchar *);
+GLAPI void GLAPIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *);
+GLAPI void GLAPIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void GLAPIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices);
+typedef void (GLAPIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName);
+typedef GLuint (GLAPIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName);
+typedef void (GLAPIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+typedef void (GLAPIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+typedef void (GLAPIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+#endif
+
+#ifndef GL_ARB_copy_buffer
+#define GL_ARB_copy_buffer 1
+#ifdef GL3_PROTOTYPES
+GLAPI void GLAPIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr);
+#endif /* GL3_PROTOTYPES */
+typedef void (GLAPIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/make/stub_includes/opengl/GL3/gl3ext.h b/make/stub_includes/opengl/GL3/gl3ext.h
new file mode 100644
index 000000000..2042a3acd
--- /dev/null
+++ b/make/stub_includes/opengl/GL3/gl3ext.h
@@ -0,0 +1,6 @@
+#ifndef __gl3ext_h_
+#define __gl3ext_h_
+
+#endif
+
+
diff --git a/make/stub_includes/opengl/GLES/gl.h b/make/stub_includes/opengl/GLES/gl.h
new file mode 100755
index 000000000..da71230b5
--- /dev/null
+++ b/make/stub_includes/opengl/GLES/gl.h
@@ -0,0 +1,801 @@
+#ifndef __gl_h_
+#define __gl_h_
+
+/* $Id$ */
+
+#include <GLES/glplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef void GLvoid;
+typedef int GLfixed;
+typedef int GLclampx;
+
+typedef int GLintptr;
+typedef int GLsizeiptr;
+
+
+/*************************************************************/
+
+/* OpenGL ES core versions */
+#define GL_VERSION_ES_CM_1_0 1
+#define GL_VERSION_ES_CL_1_0 1
+#define GL_VERSION_ES_CM_1_1 1
+#define GL_VERSION_ES_CL_1_1 1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+
+/* Boolean */
+#define GL_FALSE 0
+#define GL_TRUE 1
+
+/* BeginMode */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+
+/* AlphaFunction */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+
+/* BlendingFactorDest */
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+
+/* BlendingFactorSrc */
+/* GL_ZERO */
+/* GL_ONE */
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+/* GL_SRC_ALPHA */
+/* GL_ONE_MINUS_SRC_ALPHA */
+/* GL_DST_ALPHA */
+/* GL_ONE_MINUS_DST_ALPHA */
+
+/* ClipPlaneName */
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+
+/* ColorMaterialFace */
+/* GL_FRONT_AND_BACK */
+
+/* ColorMaterialParameter */
+/* GL_AMBIENT_AND_DIFFUSE */
+
+/* ColorPointerType */
+/* GL_UNSIGNED_BYTE */
+/* GL_FLOAT */
+/* GL_FIXED */
+
+/* CullFaceMode */
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+
+/* DepthFunction */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* EnableCap */
+#define GL_FOG 0x0B60
+#define GL_LIGHTING 0x0B50
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_BLEND 0x0BE2
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+/* GL_LIGHT0 */
+/* GL_LIGHT1 */
+/* GL_LIGHT2 */
+/* GL_LIGHT3 */
+/* GL_LIGHT4 */
+/* GL_LIGHT5 */
+/* GL_LIGHT6 */
+/* GL_LIGHT7 */
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_NORMALIZE 0x0BA1
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_COLOR_ARRAY 0x8076
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_MULTISAMPLE 0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_COVERAGE 0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* FogMode */
+/* GL_LINEAR */
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+
+/* FogParameter */
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_START 0x0B63
+#define GL_FOG_END 0x0B64
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_COLOR 0x0B66
+
+/* FrontFaceDirection */
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+
+/* GetPName */
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_LINE_WIDTH 0x0B21
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_SHADE_MODEL 0x0B54
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_VIEWPORT 0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_SRC 0x0BE1
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+
+/* GetTextureParameter */
+/* GL_TEXTURE_MAG_FILTER */
+/* GL_TEXTURE_MIN_FILTER */
+/* GL_TEXTURE_WRAP_S */
+/* GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* HintTarget */
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_FOG_HINT 0x0C54
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+
+/* LightModelParameter */
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+
+/* LightParameter */
+#define GL_AMBIENT 0x1200
+#define GL_DIFFUSE 0x1201
+#define GL_SPECULAR 0x1202
+#define GL_POSITION 0x1203
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_QUADRATIC_ATTENUATION 0x1209
+
+/* DataType */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_FLOAT 0x1406
+#define GL_FIXED 0x140C
+
+/* LogicOp */
+#define GL_CLEAR 0x1500
+#define GL_AND 0x1501
+#define GL_AND_REVERSE 0x1502
+#define GL_COPY 0x1503
+#define GL_AND_INVERTED 0x1504
+#define GL_NOOP 0x1505
+#define GL_XOR 0x1506
+#define GL_OR 0x1507
+#define GL_NOR 0x1508
+#define GL_EQUIV 0x1509
+#define GL_INVERT 0x150A
+#define GL_OR_REVERSE 0x150B
+#define GL_COPY_INVERTED 0x150C
+#define GL_OR_INVERTED 0x150D
+#define GL_NAND 0x150E
+#define GL_SET 0x150F
+
+/* MaterialFace */
+/* GL_FRONT_AND_BACK */
+
+/* MaterialParameter */
+#define GL_EMISSION 0x1600
+#define GL_SHININESS 0x1601
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+/* GL_AMBIENT */
+/* GL_DIFFUSE */
+/* GL_SPECULAR */
+
+/* MatrixMode */
+#define GL_MODELVIEW 0x1700
+#define GL_PROJECTION 0x1701
+#define GL_TEXTURE 0x1702
+
+/* NormalPointerType */
+/* GL_BYTE */
+/* GL_SHORT */
+/* GL_FLOAT */
+/* GL_FIXED */
+
+/* PixelFormat */
+#define GL_ALPHA 0x1906
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+
+/* PixelStoreParameter */
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+
+/* PixelType */
+/* GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+
+/* ShadingModel */
+#define GL_FLAT 0x1D00
+#define GL_SMOOTH 0x1D01
+
+/* StencilFunction */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* StencilOp */
+/* GL_ZERO */
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+/* GL_INVERT */
+
+/* StringName */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* TexCoordPointerType */
+/* GL_SHORT */
+/* GL_FLOAT */
+/* GL_FIXED */
+/* GL_BYTE */
+
+/* TextureEnvMode */
+#define GL_MODULATE 0x2100
+#define GL_DECAL 0x2101
+/* GL_BLEND */
+#define GL_ADD 0x0104
+/* GL_REPLACE */
+
+/* TextureEnvParameter */
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_ENV_COLOR 0x2201
+
+/* TextureEnvTarget */
+#define GL_TEXTURE_ENV 0x2300
+
+/* TextureMagFilter */
+#define GL_NEAREST 0x2600
+#define GL_LINEAR 0x2601
+
+/* TextureMinFilter */
+/* GL_NEAREST */
+/* GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_GENERATE_MIPMAP 0x8191
+
+/* TextureTarget */
+/* GL_TEXTURE_2D */
+
+/* TextureUnit */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+
+/* TextureWrapMode */
+#define GL_REPEAT 0x2901
+#define GL_CLAMP_TO_EDGE 0x812F
+
+/* VertexPointerType */
+/* GL_SHORT */
+/* GL_FLOAT */
+/* GL_FIXED */
+/* GL_BYTE */
+
+/* LightName */
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+
+/* Texture combine + dot3 */
+#define GL_SUBTRACT 0x84E7
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_RGB_SCALE 0x8573
+#define GL_ADD_SIGNED 0x8574
+#define GL_INTERPOLATE 0x8575
+#define GL_CONSTANT 0x8576
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PREVIOUS 0x8578
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND2_ALPHA 0x859A
+
+#define GL_ALPHA_SCALE 0x0D1C
+
+#define GL_SRC0_RGB 0x8580
+#define GL_SRC1_RGB 0x8581
+#define GL_SRC2_RGB 0x8582
+#define GL_SRC0_ALPHA 0x8588
+#define GL_SRC1_ALPHA 0x8589
+#define GL_SRC2_ALPHA 0x858A
+
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+
+/*------------------------------------------------------------------------*
+ * required OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES 0x8B90
+#define GL_PALETTE4_RGBA8_OES 0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
+#define GL_PALETTE4_RGBA4_OES 0x8B93
+#define GL_PALETTE4_RGB5_A1_OES 0x8B94
+#define GL_PALETTE8_RGB8_OES 0x8B95
+#define GL_PALETTE8_RGBA8_OES 0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
+#define GL_PALETTE8_RGBA4_OES 0x8B98
+#define GL_PALETTE8_RGB5_A1_OES 0x8B99
+#endif
+
+/* OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
+#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
+#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
+#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
+#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_POINT_SPRITE_OES 0x8861
+#define GL_COORD_REPLACE_OES 0x8862
+#endif
+
+/*************************************************************/
+
+/* Available only in Common profile */
+GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
+GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+/* FIXME: GlueGen generates incorrect code for this one */
+/* GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]); */
+GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat* eqn);
+GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexEnvfv (GLenum tenv, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLineWidth (GLfloat width);
+GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glPointSize (GLfloat size);
+GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+
+/* Available in both Common and Common-Lite profiles */
+GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GL_API void GL_APIENTRY glClear (GLbitfield mask);
+GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
+GL_API void GL_APIENTRY glClearStencil (GLint s);
+GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glCullFace (GLenum mode);
+GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_API void GL_APIENTRY glDepthFunc (GLenum func);
+GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glDisable (GLenum cap);
+GL_API void GL_APIENTRY glDisableClientState (GLenum array);
+GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+GL_API void GL_APIENTRY glEnable (GLenum cap);
+GL_API void GL_APIENTRY glEnableClientState (GLenum array);
+GL_API void GL_APIENTRY glFinish (void);
+GL_API void GL_APIENTRY glFlush (void);
+GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrontFace (GLenum mode);
+GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
+GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+/* FIXME: GlueGen generates incorrect code for this one */
+/* GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]); */
+GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed* eqn);
+GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_API GLenum GL_APIENTRY glGetError (void);
+GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
+GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
+GL_API void GL_APIENTRY glGetTexEnviv (GLenum tenv, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexEnvxv (GLenum tenv, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
+GL_API void GL_APIENTRY glLoadIdentity (void);
+GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
+GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
+GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizex (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glPopMatrix (void);
+GL_API void GL_APIENTRY glPushMatrix (void);
+GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glShadeModel (GLenum mode);
+GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_API void GL_APIENTRY glStencilMask (GLuint mask);
+GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+/*------------------------------------------------------------------------*
+ * Required OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#endif
+
+/* GL_OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_OES_point_size_array 1
+GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_OES_point_sprite 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
diff --git a/make/stub_includes/opengl/GLES/glext.h b/make/stub_includes/opengl/GLES/glext.h
new file mode 100755
index 000000000..ee6ebae20
--- /dev/null
+++ b/make/stub_includes/opengl/GLES/glext.h
@@ -0,0 +1,662 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef __glext_h_
+#define __glext_h_
+
+/* $Id$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+#ifndef GL_APIENTRYP
+# define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */
+#define GL_BLEND_EQUATION_RGB_OES 0x8009
+#define GL_BLEND_EQUATION_ALPHA_OES 0x883D
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_BLEND_DST_RGB_OES 0x80C8
+#define GL_BLEND_SRC_RGB_OES 0x80C9
+#define GL_BLEND_DST_ALPHA_OES 0x80CA
+#define GL_BLEND_SRC_ALPHA_OES 0x80CB
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_BLEND_EQUATION_OES 0x8009
+#define GL_FUNC_ADD_OES 0x8006
+#define GL_FUNC_SUBTRACT_OES 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES 0x8D64
+#endif
+
+/* OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
+#endif
+
+/* OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_FIXED_OES 0x140C
+#endif
+
+/* OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_NONE_OES 0
+#define GL_FRAMEBUFFER_OES 0x8D40
+#define GL_RENDERBUFFER_OES 0x8D41
+#define GL_RGBA4_OES 0x8056
+#define GL_RGB5_A1_OES 0x8057
+#define GL_RGB565_OES 0x8D62
+#define GL_DEPTH_COMPONENT16_OES 0x81A5
+#define GL_RENDERBUFFER_WIDTH_OES 0x8D42
+#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3
+#define GL_COLOR_ATTACHMENT0_OES 0x8CE0
+#define GL_DEPTH_ATTACHMENT_OES 0x8D00
+#define GL_STENCIL_ATTACHMENT_OES 0x8D20
+#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA
+#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD
+#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6
+#define GL_RENDERBUFFER_BINDING_OES 0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506
+#endif
+
+/* OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
+#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
+#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
+#endif
+
+/* OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_MAX_VERTEX_UNITS_OES 0x86A4
+#define GL_MAX_PALETTE_MATRICES_OES 0x8842
+#define GL_MATRIX_PALETTE_OES 0x8840
+#define GL_MATRIX_INDEX_ARRAY_OES 0x8844
+#define GL_WEIGHT_ARRAY_OES 0x86AD
+#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843
+#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849
+#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E
+#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB
+#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA
+#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_INCR_WRAP_OES 0x8507
+#define GL_DECR_WRAP_OES 0x8508
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_NORMAL_MAP_OES 0x8511
+#define GL_REFLECTION_MAP_OES 0x8512
+#define GL_TEXTURE_CUBE_MAP_OES 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C
+#define GL_TEXTURE_GEN_MODE_OES 0x2500
+#define GL_TEXTURE_GEN_STR_OES 0x8D60
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_OES 0x8370
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_DEPTH_COMPONENT24_OES 0x81A6
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_DEPTH_COMPONENT32_OES 0x81A7
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_WRITE_ONLY_OES 0x88B9
+#define GL_BUFFER_ACCESS_OES 0x88BB
+#define GL_BUFFER_MAPPED_OES 0x88BC
+#define GL_BUFFER_MAP_POINTER_OES 0x88BD
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES 0x8051
+#define GL_RGBA8_OES 0x8058
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_STENCIL_INDEX1_OES 0x8D46
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_STENCIL_INDEX4_OES 0x8D47
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_STENCIL_INDEX8_OES 0x8D48
+#endif
+
+/* GL_OES_vertex_half_float */
+#ifndef GL_OES_vertex_half_float
+#define GL_HALF_FLOAT_OES 0x8D61
+#endif
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_3DC_X_AMD 0x87F9
+#define GL_3DC_XY_AMD 0x87FA
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_ATC_RGB_AMD 0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#endif
+
+/* GL_EXT_texture_compression_s3tc */
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+#define GL_OES_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_OES_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_OES_blend_subtract 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
+#endif
+
+/* GL_OES_byte_coordinates */
+#ifndef GL_OES_byte_coordinates
+#define GL_OES_byte_coordinates 1
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_OES_draw_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
+GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
+GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
+GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
+GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
+#endif
+
+/* GL_OES_extended_matrix_palette */
+#ifndef GL_OES_extended_matrix_palette
+#define GL_OES_extended_matrix_palette 1
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_OES_fixed_point 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth);
+GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+/* FIXME: GlueGen generates incorrect code for this one */
+/* GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]); */
+GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed* eqn);
+GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum tenv, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width);
+GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizexOES (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref);
+typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
+typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar);
+typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+/* FIXME: GlueGen generates incorrect code for this one */
+/* typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]); */
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed* eqn);
+typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum tenv, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
+typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
+typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
+typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert);
+typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_OES_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer);
+GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer);
+GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers);
+GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers);
+GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params);
+GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer);
+GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer);
+GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers);
+GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers);
+GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target);
+GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target);
+#endif
+typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers);
+typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers);
+typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_OES_matrix_get 1
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_OES_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex);
+GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void);
+GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
+typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
+typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_query_matrix */
+#ifndef GL_OES_query_matrix
+#define GL_OES_query_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+/* FIXME: GlueGen generates incorrect code for this one */
+/* GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]); */
+GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed* mantissa, GLint* exponent);
+#endif
+/* FIXME: GlueGen generates incorrect code for this one */
+/* typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]); */
+typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed* mantissa, GLint* exponent);
+#endif
+
+/* GL_OES_single_precision */
+#ifndef GL_OES_single_precision
+#define GL_OES_single_precision 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
+/* FIXME: GlueGen generates incorrect code for this one */
+/* GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]); */
+GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat* eqn);
+GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
+/* FIXME: GlueGen generates incorrect code for this one */
+/* typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]); */
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat* eqn);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_OES_stencil_wrap 1
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_OES_texture_cube_map 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+
+/* GL_OES_texture_env_crossbar */
+#ifndef GL_OES_texture_env_crossbar
+#define GL_OES_texture_env_crossbar 1
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_OES_texture_mirrored_repeat 1
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif
+
+/* GL_OES_fbo_render_mipmap */
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params);
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_OES_stencil8 1
+#endif
+
+/* GL_OES_vertex_half_float */
+#ifndef GL_OES_vertex_half_float
+#define GL_OES_vertex_half_float 1
+#endif
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
+/* GL_EXT_texture_compression_s3tc */
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_EXT_texture_compression_s3tc 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glext_h_ */
+
diff --git a/make/stub_includes/opengl/GLES/glplatform.h b/make/stub_includes/opengl/GLES/glplatform.h
new file mode 100755
index 000000000..dd2f20ec3
--- /dev/null
+++ b/make/stub_includes/opengl/GLES/glplatform.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef __glplatform_h_
+#define __glplatform_h_
+
+/* $Id$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+/*-------------------------------------------------------------------------
+ * Definition of GL_API and GL_APIENTRY
+ *-----------------------------------------------------------------------*/
+
+#if defined(AEE_SIMULATOR)
+#define __GL_EXPORTS
+#endif
+
+#ifdef __GL_EXPORTS
+# define GL_API
+#else
+# define GL_API extern
+#endif
+
+#define GL_APIENTRY
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glplatform_h_ */
diff --git a/make/stub_includes/opengl/GLES/glu.h b/make/stub_includes/opengl/GLES/glu.h
new file mode 100755
index 000000000..50a94f34e
--- /dev/null
+++ b/make/stub_includes/opengl/GLES/glu.h
@@ -0,0 +1 @@
+// Empty glu.h so that we pick up only the Java routines
diff --git a/make/stub_includes/opengl/GLES2/gl2.h b/make/stub_includes/opengl/GLES2/gl2.h
new file mode 100755
index 000000000..9c68b1e7a
--- /dev/null
+++ b/make/stub_includes/opengl/GLES2/gl2.h
@@ -0,0 +1,687 @@
+#ifndef __gl2_h_
+#define __gl2_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+/*-------------------------------------------------------------------------
+ * Definition of GL_APICALL and GL_APIENTRY
+ *-----------------------------------------------------------------------*/
+
+#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
+#define __WIN32__
+#endif
+
+#if !defined(GL_APICALL)
+# if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
+# if defined (_DLL_EXPORTS)
+# define GL_APICALL __declspec(dllexport)
+# else
+# define GL_APICALL __declspec(dllimport)
+# endif
+# define GL_APIENTRY __stdcall
+# elif defined (__ARMCC_VERSION) // ADS
+# define GL_APICALL
+# define GL_APIENTRY
+# elif defined (__SYMBIAN32__) && defined (__GCC32__) // Symbian GCC
+# define GL_APICALL __declspec(dllexport)
+# define GL_APIENTRY
+# else
+# define GL_APICALL extern
+# define GL_APIENTRY
+# endif
+#endif
+
+#if !defined (GL_APICALL)
+# error Unsupported platform!
+#endif
+
+#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
+# define PRAGMA_EXPORT_SUPPORTED 1
+#endif
+
+/*-------------------------------------------------------------------------
+ * Data type definitions
+ *-----------------------------------------------------------------------*/
+
+typedef void GLvoid;
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef signed char GLbyte;
+typedef short GLshort;
+typedef int GLint;
+typedef int GLsizei;
+typedef unsigned char GLubyte;
+typedef unsigned short GLushort;
+typedef unsigned int GLuint;
+typedef float GLfloat;
+typedef float GLclampf;
+typedef int GLfixed;
+typedef int GLclampx;
+
+/* GL types for handling large vertex buffer objects */
+typedef int GLintptr;
+typedef int GLsizeiptr;
+
+/* OpenGL ES core versions */
+#define GL_ES_VERSION_2_0 1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_COLOR_BUFFER_BIT 0x00004000
+
+/* Boolean */
+#define GL_FALSE 0
+#define GL_TRUE 1
+
+/* \todo check that this should be in core. */
+#define GL_NONE 0
+
+/* BeginMode */
+#define GL_POINTS 0x0000
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_FAN 0x0006
+
+/* AlphaFunction (not supported in ES20) */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* BlendingFactorDest */
+#define GL_ZERO 0
+#define GL_ONE 1
+#define GL_SRC_COLOR 0x0300
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_SRC_ALPHA 0x0302
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_DST_ALPHA 0x0304
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+
+/* BlendingFactorSrc */
+/* GL_ZERO */
+/* GL_ONE */
+#define GL_DST_COLOR 0x0306
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_SRC_ALPHA_SATURATE 0x0308
+/* GL_SRC_ALPHA */
+/* GL_ONE_MINUS_SRC_ALPHA */
+/* GL_DST_ALPHA */
+/* GL_ONE_MINUS_DST_ALPHA */
+
+/* BlendEquationSeparate */
+#define GL_FUNC_ADD 0x8006
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+
+/* BlendSubtract */
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+
+/* Separate Blend Functions */
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_BLEND_COLOR 0x8005
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STATIC_DRAW 0x88E4
+#define GL_DYNAMIC_DRAW 0x88E8
+
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+
+/* CullFaceMode */
+#define GL_FRONT 0x0404
+#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
+
+/* DepthFunction */
+/* GL_NEVER */
+/* GL_LESS */
+/* GL_EQUAL */
+/* GL_LEQUAL */
+/* GL_GREATER */
+/* GL_NOTEQUAL */
+/* GL_GEQUAL */
+/* GL_ALWAYS */
+
+/* EnableCap */
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_CULL_FACE 0x0B44
+#define GL_BLEND 0x0BE2
+#define GL_DITHER 0x0BD0
+#define GL_STENCIL_TEST 0x0B90
+#define GL_DEPTH_TEST 0x0B71
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_COVERAGE 0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR 0
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVALID_OPERATION 0x0502
+#define GL_OUT_OF_MEMORY 0x0505
+
+/* FrontFaceDirection */
+#define GL_CW 0x0900
+#define GL_CCW 0x0901
+
+/* GetPName */
+#define GL_LINE_WIDTH 0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_FRONT_FACE 0x0B46
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_VIEWPORT 0x0BA2
+#define GL_SCISSOR_BOX 0x0C10
+/* GL_SCISSOR_TEST */
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_RED_BITS 0x0D52
+#define GL_GREEN_BITS 0x0D53
+#define GL_BLUE_BITS 0x0D54
+#define GL_ALPHA_BITS 0x0D55
+#define GL_DEPTH_BITS 0x0D56
+#define GL_STENCIL_BITS 0x0D57
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+/* GL_POLYGON_OFFSET_FILL */
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+
+/* GetTextureParameter */
+/* GL_TEXTURE_MAG_FILTER */
+/* GL_TEXTURE_MIN_FILTER */
+/* GL_TEXTURE_WRAP_S */
+/* GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE 0x1100
+#define GL_FASTEST 0x1101
+#define GL_NICEST 0x1102
+
+/* HintTarget */
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+
+/* DataType */
+#define GL_BYTE 0x1400
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_SHORT 0x1402
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_INT 0x1404
+#define GL_UNSIGNED_INT 0x1405
+#define GL_FLOAT 0x1406
+#define GL_FIXED 0x140C
+
+/* PixelFormat */
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_ALPHA 0x1906
+#define GL_RGB 0x1907
+#define GL_RGBA 0x1908
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+
+/* PixelType */
+/* GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+
+/* Shaders */
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_DELETE_STATUS 0x8B80
+#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_CURRENT_PROGRAM 0x8B8D
+
+/* StencilFunction */
+#define GL_NEVER 0x0200
+#define GL_LESS 0x0201
+#define GL_EQUAL 0x0202
+#define GL_LEQUAL 0x0203
+#define GL_GREATER 0x0204
+#define GL_NOTEQUAL 0x0205
+#define GL_GEQUAL 0x0206
+#define GL_ALWAYS 0x0207
+
+/* StencilOp */
+/* GL_ZERO */
+#define GL_KEEP 0x1E00
+#define GL_REPLACE 0x1E01
+#define GL_INCR 0x1E02
+#define GL_DECR 0x1E03
+#define GL_INVERT 0x150A
+#define GL_INCR_WRAP 0x8507
+#define GL_DECR_WRAP 0x8508
+
+/* StringName */
+#define GL_VENDOR 0x1F00
+#define GL_RENDERER 0x1F01
+#define GL_VERSION 0x1F02
+#define GL_EXTENSIONS 0x1F03
+
+/* TextureMagFilter */
+#define GL_NEAREST 0x2600
+#define GL_LINEAR 0x2601
+
+/* TextureMinFilter */
+/* GL_NEAREST */
+/* GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+
+/* TextureTarget */
+/* GL_TEXTURE_2D */
+#define GL_TEXTURE 0x1702
+
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+
+/* TextureUnit */
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_ACTIVE_TEXTURE 0x84E0
+
+/* TextureWrapMode */
+#define GL_REPEAT 0x2901
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_MIRRORED_REPEAT 0x8370
+
+/* Uniform Types */
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_CUBE 0x8B60
+
+/* Vertex Arrays */
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+
+/* Read Format */
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+
+/* Shader Source */
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_SHADER_COMPILER 0x8DFA
+
+/* Shader Binary */
+#define GL_PLATFORM_BINARY 0x8D63
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+
+/* Shader Precision-Specified Types */
+#define GL_LOW_FLOAT 0x8DF0
+#define GL_MEDIUM_FLOAT 0x8DF1
+#define GL_HIGH_FLOAT 0x8DF2
+#define GL_LOW_INT 0x8DF3
+#define GL_MEDIUM_INT 0x8DF4
+#define GL_HIGH_INT 0x8DF5
+
+/* Framebuffer Object. */
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_RENDERBUFFER 0x8D41
+
+#define GL_RGBA4 0x8056
+#define GL_RGB5_A1 0x8057
+#define GL_RGB565 0x8D62
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_STENCIL_INDEX 0x1901
+#define GL_STENCIL_INDEX8 0x8D48
+
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_STENCIL_ATTACHMENT 0x8D20
+
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 0x8CDA
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+
+/*-------------------------------------------------------------------------
+ * GL core functions.
+ *-----------------------------------------------------------------------*/
+
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation( GLenum mode );
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const char* name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
+GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const char* name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl2_h_ */
+
diff --git a/make/stub_includes/opengl/GLES2/gl2ext.h b/make/stub_includes/opengl/GLES2/gl2ext.h
new file mode 100755
index 000000000..8580e2bdf
--- /dev/null
+++ b/make/stub_includes/opengl/GLES2/gl2ext.h
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2005-2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef __gl2ext_h_
+#define __gl2ext_h_
+
+#ifndef __gl2_h_
+# include <GLES2/gl2.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** License Applicability. Except 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.0 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+#ifndef GL_APIENTRYP
+# define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+#define GL_GLEXT_PROTOTYPES
+
+#define GL_NVIDIA_PLATFORM_BINARY_NV 0x890B
+
+#define GL_OES_EGL_image 1
+
+#ifdef GL_OES_EGL_image
+/** sgothel: wrong defines and/or numbers:
+ *
+#define GL_TEXTURE_2D_OES 0x1
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x3
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x4
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x5
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x6
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x7
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x8
+#define GL_RENDERBUFFER_OES 0x9
+#define GL_TEXTURE_RECTANGLE_NV_OES 0xb
+ */
+
+typedef void *GLeglImageOES;
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+#ifdef GL_GLEXT_PROTOTYPES
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+
+#endif
+#endif
+
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+#ifndef GL_OES_texture_half_float
+#define GL_OES_texture_half_float 1
+#define GL_HALF_FLOAT_OES 0x8D61
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_BUFFER_MAPPED_OES 0x88BC
+#define GL_BUFFER_MAP_POINTER_OES 0x88BD
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES 0x8051
+#define GL_RGBA8_OES 0x8058
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointerivNV (GLenum target, GLenum pname, void **params );
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERIVNVPROC) (GLenum target, GLenum pname, void **params );
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_framebuffer_mixed_formats */
+#ifndef GL_EXT_framebuffer_mixed_formats
+#define GL_EXT_framebuffer_mixed_formats 1
+#endif
+
+/* GL_EXT_packed_float */
+#ifndef GL_EXT_packed_float
+#define GL_R11F_G11F_B10F_EXT 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
+#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
+#endif
+
+/* GL_EXT_texture_array */
+#ifndef GL_EXT_texture_array
+#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
+#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#endif
+
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
+#endif
+
+/* GL_EXT_texture_compression_s3tc */
+#ifndef GL_EXT_texture_compression_s3tc
+/* GL_COMPRESSED_RGB_S3TC_DXT1_EXT defined in GL_EXT_texture_compression_dxt1 already. */
+/* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT defined in GL_EXT_texture_compression_dxt1 already. */
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif
+
+
+/* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#endif
+
+/* GL_EXT_texture_compression_s3tc */
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_EXT_texture_compression_s3tc 1
+#endif
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#define GL_TEXTURE_MAX_LEVEL_NV 0x813D
+
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_COVERAGE_COMPONENT_NV 0x8522
+#define GL_COVERAGE_COMPONENT4_NV 0x8523
+#define GL_COVERAGE_ATTACHMENT_NV 0x8527
+#define GL_COVERAGE_BUFFER_BIT_NV 0x8000
+#define GL_COVERAGE_BUFFERS_NV 0x8528
+#define GL_COVERAGE_SAMPLES_NV 0x8529
+#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8524
+#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8525
+#define GL_COVERAGE_AUTOMATIC_NV 0x8526
+#endif
+
+
+/* GL_NV_framebuffer_vertex_attrib_array */
+#ifndef GL_NV_framebuffer_vertex_attrib_array
+#define GL_FRAMEBUFFER_ATTACHABLE_NV 0x852A
+#define GL_VERTEX_ATTRIB_ARRAY_NV 0x852B
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_SIZE_NV 0x852C
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_TYPE_NV 0x852D
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_NORMALIZED_NV 0x852E
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_OFFSET_NV 0x852F
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_WIDTH_NV 0x8530
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_STRIDE_NV 0x8531
+#define GL_FRAMEBUFFER_ATTACHMENT_VERTEX_ATTRIB_ARRAY_HEIGHT_NV 0x8532
+#endif
+
+
+/* GL_NV_framebuffer_vertex_attrib_array */
+#ifndef GL_NV_framebuffer_vertex_attrib_array
+#define GL_NV_framebuffer_vertex_attrib_array 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferVertexAttribArrayNV (GLenum target, GLenum attachment, GLenum buffertarget, GLuint bufferobject, GLint size, GLenum type, GLboolean normalized, GLintptr offset, GLsizeiptr width, GLsizeiptr height, GLsizei stride);
+#endif
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERVERTEXATTRIBARRAYNVPROC) (GLenum target, GLenum attachment, GLenum buffertarget, GLuint bufferobject, GLint size, GLenum type, GLboolean normalized, GLintptr offset, GLsizeiptr width, GLsizeiptr height, GLsizei stride);
+#endif
+
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#endif
+
+
+
+/*------------------------------------------------------------------------*
+ * NV extension tokens
+ *------------------------------------------------------------------------*/
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl2ext_h_ */
diff --git a/make/stub_includes/opengl/cg.c b/make/stub_includes/opengl/cg.c
new file mode 100644
index 000000000..98c824285
--- /dev/null
+++ b/make/stub_includes/opengl/cg.c
@@ -0,0 +1,26 @@
+// Define __gl_h_ so that GL/gl.h doesn't get bound as part of CgGL.java
+// because cgGL.h tries to include it
+#define __gl_h_
+
+// Define some types so that cgGL.h has the types it expected to get by
+// including GL/gl.h (which we disabled above)
+typedef unsigned int GLenum;
+typedef unsigned char GLboolean;
+typedef unsigned int GLbitfield;
+typedef void GLvoid;
+typedef signed char GLbyte; /* 1-byte signed */
+typedef short GLshort; /* 2-byte signed */
+typedef int GLint; /* 4-byte signed */
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+typedef unsigned short GLushort; /* 2-byte unsigned */
+typedef unsigned int GLuint; /* 4-byte unsigned */
+typedef int GLsizei; /* 4-byte signed */
+typedef float GLfloat; /* single precision float */
+typedef float GLclampf; /* single precision float in [0,1] */
+typedef double GLdouble; /* double precision float */
+typedef double GLclampd; /* double precision float in [0,1] */
+
+#define CGDLL_API
+#include <CG/cgGL.h>
+
+
diff --git a/make/stub_includes/opengl/gl2.c b/make/stub_includes/opengl/gl2.c
new file mode 100644
index 000000000..e91ee95f3
--- /dev/null
+++ b/make/stub_includes/opengl/gl2.c
@@ -0,0 +1,7 @@
+#define GLAPI
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GL/gl.h>
diff --git a/make/stub_includes/opengl/gl3.c b/make/stub_includes/opengl/gl3.c
new file mode 100644
index 000000000..3326c58ad
--- /dev/null
+++ b/make/stub_includes/opengl/gl3.c
@@ -0,0 +1,7 @@
+#define GLAPI
+
+// Define GL3_PROTOTYPES so that the OpenGL prototypes in
+// "gl3.h" are parsed.
+#define GL3_PROTOTYPES
+
+#include <GL3/gl3.h>
diff --git a/make/stub_includes/opengl/gles1.c b/make/stub_includes/opengl/gles1.c
new file mode 100755
index 000000000..63df1c967
--- /dev/null
+++ b/make/stub_includes/opengl/gles1.c
@@ -0,0 +1,9 @@
+#define GLAPI
+#define GL_APICALL
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GLES/gl.h>
+#include <GLES/glext.h>
diff --git a/make/stub_includes/opengl/gles2.c b/make/stub_includes/opengl/gles2.c
new file mode 100755
index 000000000..f74b1686f
--- /dev/null
+++ b/make/stub_includes/opengl/gles2.c
@@ -0,0 +1,8 @@
+#define GL_APIENTRY
+#define GL_APICALL
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GLES2/gl2ext.h>
diff --git a/make/stub_includes/opengl/glext-64bit-types.h b/make/stub_includes/opengl/glext-64bit-types.h
new file mode 100644
index 000000000..cc36d5ef0
--- /dev/null
+++ b/make/stub_includes/opengl/glext-64bit-types.h
@@ -0,0 +1,46 @@
+#ifndef __glext_64bit_types_h_
+#define __glext_64bit_types_h_
+
+#ifndef GLEXT_64_TYPES_DEFINED
+ /* This code block is duplicated in glext.h, so must be protected */
+ #define GLEXT_64_TYPES_DEFINED
+ /* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+ /* (as used in the GL_EXT_timer_query extension). */
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #include <inttypes.h>
+ #elif defined(__sun__)
+ #include <inttypes.h>
+ #if defined(__STDC__)
+ #if defined(__arch64__)
+ typedef long int int64_t;
+ typedef unsigned long int uint64_t;
+ #else
+ typedef long long int int64_t;
+ typedef unsigned long long int uint64_t;
+ #endif /* __arch64__ */
+ #endif /* __STDC__ */
+ #elif defined( __VMS )
+ #include <inttypes.h>
+ #elif defined(__SCO__) || defined(__USLC__)
+ #include <stdint.h>
+ #elif defined(__UNIXOS2__) || defined(__SOL64__)
+ typedef long int int32_t;
+ typedef long long int int64_t;
+ typedef unsigned long long int uint64_t;
+ #elif defined(WIN32) && defined(__GNUC__)
+ #include <stdint.h>
+ #elif defined(_WIN32)
+ typedef __int32 int32_t;
+ typedef __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
+ #else
+ #include <inttypes.h> /* Fallback option */
+ #endif
+#endif
+
+#ifndef GL_EXT_timer_query
+ typedef int64_t GLint64EXT;
+ typedef uint64_t GLuint64EXT;
+#endif
+
+#endif /* __glext_64bit_types_h_ */
diff --git a/make/stub_includes/opengl/glu-impl.c b/make/stub_includes/opengl/glu-impl.c
new file mode 100644
index 000000000..2328639d8
--- /dev/null
+++ b/make/stub_includes/opengl/glu-impl.c
@@ -0,0 +1,3 @@
+#include <GL/glu.h>
+
+
diff --git a/make/stub_includes/opengl/glu.c b/make/stub_includes/opengl/glu.c
new file mode 100644
index 000000000..91020e365
--- /dev/null
+++ b/make/stub_includes/opengl/glu.c
@@ -0,0 +1,2 @@
+#include <GL/glu.h>
+
diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h
new file mode 100644
index 000000000..f43adb546
--- /dev/null
+++ b/make/stub_includes/opengl/macosx-window-system.h
@@ -0,0 +1,50 @@
+/* C routines encapsulating small amounts of Objective C code to allow
+ nsContext creation and manipulation to occur from Java
+
+ It's unfortunate this couldn't be placed in the macosx
+ stub_includes directory, but due to the presence of the jni.h stub
+ headers in that directory, if that is in the include path during
+ compilation then the build fails.
+*/
+
+typedef int Bool;
+
+void* createPixelFormat(int* iattrs, int niattrs, int* ivalues);
+void queryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int* ivalues);
+void deletePixelFormat(void* pixelFormat);
+
+void* createContext(void* shareContext,
+ void* nsView,
+ void* pixelFormat,
+ int* viewNotReady);
+Bool makeCurrentContext(void* nsContext);
+Bool clearCurrentContext(void* nsContext);
+Bool deleteContext(void* nsContext);
+Bool flushBuffer(void* nsContext);
+void setContextOpacity(void* context, int opacity);
+void updateContext(void* nsContext);
+void copyContext(void* destContext, void* srcContext, int mask);
+
+void* updateContextRegister(void* nsContext, void* nsView);
+void updateContextUnregister(void* nsContext, void* nsView, void* updater);
+
+void* createPBuffer(int renderTarget, int internalFormat, int width, int height);
+Bool destroyPBuffer(void* nsContext, void* pBuffer);
+void setContextPBuffer(void* nsContext, void* pBuffer);
+void setContextTextureImageToPBuffer(void* nsContext, void* pBuffer, int colorBuffer);
+
+void* getProcAddress(const char *procName);
+
+void setSwapInterval(void* nsContext, int interval);
+
+/* Gamma-related functionality */
+Bool setGammaRamp(int tableSize, float* redRamp, float* greenRamp, float* blueRamp);
+void resetGammaRamp();
+
+/****************************************************************************************/
+/* Java2D/JOGL bridge support; need to be able to create pbuffers and
+ contexts using the CGL APIs to be able to share textures, etc. with
+ contexts created by Java2D/JOGL bridge, which are CGLContextObjs */
+
+/* Pick up copies of CGL signatures from Mac OS X stub_includes/window-system-build directory */
+#include <OpenGL/OpenGL.h>
diff --git a/make/stub_includes/openmax/NVOMX_ComponentBase.h b/make/stub_includes/openmax/NVOMX_ComponentBase.h
new file mode 100755
index 000000000..00d1d1217
--- /dev/null
+++ b/make/stub_includes/openmax/NVOMX_ComponentBase.h
@@ -0,0 +1,342 @@
+/* Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/**
+ * @defgroup nv_omx_il_comp_base NVIDIA OMX Component Base Interface
+ *
+ * This is the NVIDIA OMX component base interface. See also \link samp_impl Sample
+ * Implementations\endlink in this document.
+ *
+ * @ingroup nv_omx_il_core
+ * @{
+ */
+
+#ifndef _NVOMX_ComponentBase_h_
+#define _NVOMX_ComponentBase_h_
+
+#include <OMX_Core.h>
+#include <OMX_Component.h>
+
+#define NVOMX_COMPONENT_MAX_PORTS 8 /** Max number of ports NVOMX_Component may have. */
+
+/**
+ Defines a simple port abstraction used in NVOMX_Component.
+ */
+typedef struct NVOMX_Port
+{
+ OMX_PARAM_PORTDEFINITIONTYPE *pPortDef; /**< Holds a pointer to the OMX port definition
+ for this port */
+ OMX_AUDIO_PARAM_PCMMODETYPE *pPCMMode; /**< Holds a pointer to the PCM description of this component, if pertinent. */
+ OMX_BUFFERHEADERTYPE *pCurrentBufferHdr; /**< Holds a pointer to the current
+ buffer on this port, if any. */
+} NVOMX_Port;
+
+/**
+ Defines a simple OMX component template that abstracts most of the
+ complexity away from the user.
+
+ To use:
+ -# Call NVOMX_CreateComponent() from the OMX component's init functions to create this
+ structure.
+ -# Call NVOMX_AddRole() to set what OMX roles this component will fill.
+ -# Call NVOMX_InitPort() once for each port on this component to setup the ports.
+ -# Fill in the function pointers in the NVOMX_Component structure as
+ appropriate -- at a minimum _NVOMX_Component::WorkerFunction and
+ _NVOMX_Component::DeInit must point to valid functions.
+ */
+typedef struct _NVOMX_Component NVOMX_Component;
+/**
+ Defines a simple OMX component.
+ */
+struct _NVOMX_Component
+{
+ OMX_PTR pBase; /**< Internal pointer, do not touch. */
+
+ OMX_U32 nPorts; /**< Holds the number of valid ports for this component. */
+ NVOMX_Port pPorts[NVOMX_COMPONENT_MAX_PORTS]; /**< Holds an array of port structures
+ for this component. */
+
+ OMX_PTR pComponentData; /**< An opaque pointer to any data this component desires
+ to keep track of. */
+
+ /**
+ Frees any remaining memory/resources
+ allocated by the component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @retval OMX_ERRORTYPE
+ This generally should not have an error, but should return as appropriate.
+ */
+ OMX_ERRORTYPE (*DeInit)(NVOMX_Component *pComp);
+
+ /**
+ Called whenever an OMX_GetParameter has been done on the
+ component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nIndex
+ Specifies what type of configuration this is.
+ @param [inout] pComponentParameterStructure
+ Any data associated with this parameter call.
+ @param [out] bHandled
+ OMX_TRUE if this call was processed, otherwise OMX_FALSE.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+ OMX_ERRORTYPE (*GetParameter)(NVOMX_Component *pComp,
+ OMX_INDEXTYPE nParamIndex,
+ OMX_PTR pComponentParameterStructure,
+ OMX_BOOL *bHandled);
+
+ /**
+ Called whenever an OMX_SetParameter has been done on the
+ component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nIndex
+ Specifies what type of configuration this is.
+ @param [in] pComponentParameterStructure
+ Any data associated with this parameter call.
+ @param [out] bHandled
+ OMX_TRUE if this call was processed, otherwise OMX_FALSE.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+ OMX_ERRORTYPE (*SetParameter)(NVOMX_Component *pComp,
+ OMX_INDEXTYPE nIndex,
+ OMX_PTR pComponentParameterStructure,
+ OMX_BOOL *bHandled);
+
+ /**
+ Called whenever an OMX_GetConfig has been done on the component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nIndex
+ Specifies what type of configuration this is.
+ @param [inout] pComponentConfigStructure
+ Any data associated with this config call.
+ @param [out] bHandled
+ OMX_TRUE if this call was processed, otherwise OMX_FALSE.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+ OMX_ERRORTYPE (*GetConfig)(NVOMX_Component *pComp,
+ OMX_INDEXTYPE nIndex,
+ OMX_PTR pComponentConfigStructure,
+ OMX_BOOL *bHandled);
+
+ /**
+ Called whenever an OMX_SetConfig has been done on the component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nIndex
+ Specifies what type of configuration this is.
+ @param [in] pComponentConfigStructure
+ Any data associated with this config call.
+ @param [out] bHandled
+ OMX_TRUE if this call was processed, otherwise OMX_FALSE.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+ OMX_ERRORTYPE (*SetConfig)(NVOMX_Component *pComp,
+ OMX_INDEXTYPE nIndex,
+ OMX_PTR pComponentConfigStructure,
+ OMX_BOOL *bHandled);
+
+ /**
+ Called whenever all ports of this component have a
+ valid buffer and there needs to be work done to process them.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [out] pbMoreWork
+ OMX_TRUE if there is still more work to be done on a given
+ input buffer.
+ @retval OMX_ERRORTYPE
+ This generally should not fail, but returns an appropriate error type.
+ */
+ OMX_ERRORTYPE (*WorkerFunction)(NVOMX_Component *pComp,
+ OMX_BOOL *pbMoreWork);
+
+ /**
+ Called on the transition to OMX_StateIdle (from Loaded).
+ Allocates/acquires any resources in this function.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @retval OMX_ERRORTYPE
+ This generally should not fail, but returns an appropriate error type.
+ @retval OMX_ErrorNotReady
+ If OMX_ErrorNotReady is returned, the component core will retry the
+ transtion periodically until it succeeds. If any other error than
+ OMX_ErrorNone is returned, the error will be sent back to the component.
+ */
+ OMX_ERRORTYPE (*AcquireResources)(NVOMX_Component *pComp);
+
+ /**
+ Called when this component needs to release its hold
+ on any resources acquired by _NVOMX_Component::AcquireResources.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @retval OMX_ERRORTYPE
+ This generally should not fail, but returns an appropriate error type.
+ */
+ OMX_ERRORTYPE (*ReleaseResources)(NVOMX_Component *pComp);
+
+};
+
+/**
+ Creates an NVOMX_Component.
+
+ @param [in] hComponent
+ A pointer to the OMX handle passed into the component's init function.
+ @param [in] nPorts
+ Specifies how many ports this component will have.
+ @param [in] name
+ The name of this component, must be unique
+ @param [out] ppComp
+ A pointer to the created NVOMX_Component; use this for calling any other
+ NVOMX_Component functions.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_CreateComponent(
+ OMX_HANDLETYPE hComponent,
+ OMX_U32 nPorts,
+ OMX_STRING name,
+ NVOMX_Component **ppComp);
+
+/**
+ Adds a role name to this component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] roleName
+ A pointer to a static char string with the role name.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_AddRole(
+ NVOMX_Component *pComp,
+ OMX_STRING roleName);
+
+/**
+ Registers an index extension with this component.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] indexName
+ A pointer to a static char string with the role name.
+ @param [in] indexType
+ The index to register
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_AddExtensionIndex(
+ NVOMX_Component *pComp,
+ OMX_STRING indexName,
+ OMX_INDEXTYPE indexType);
+
+/**
+ Creates a port structure.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nPort
+ Specifies the port number to create.
+ @param [in] eDir
+ Specifies the direction (input/output) of the port.
+ @param [in] nBufferCount
+ Specifies the minimum number of buffers to create on this port.
+ @param [in] nBufferSize
+ Specifies the minimum buffer size to create.
+ @param [in] eDomain
+ Specifies what port type (other, image, video, audio) this port will be.
+ @param [in] pFormat
+ A pointer to the format type of the port. May be one of type
+ OMX_OTHER_FORMATTYPE, OMX_AUDIO_CODINGTYPE, OMX_VIDEO_CODINGTYPE, or
+ OMX_IMAGE_CODINGTYPE.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_InitPort(
+ NVOMX_Component *pComp,
+ OMX_U32 nPort,
+ OMX_DIRTYPE eDir,
+ OMX_U32 nBufferCount,
+ OMX_U32 nBufferSize,
+ OMX_PORTDOMAINTYPE eDomain,
+ OMX_PTR pFormat);
+
+/**
+ Copies any buffer metadata (flags, marks, etc.) from one port to another.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nSourcePort
+ Specifies the source port from which to copy metadata.
+ @param [in] nDestPort
+ Specifies the port to which to copy metadata.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_CopyBufferMetadata(
+ NVOMX_Component *pComp,
+ OMX_U32 nSourcePort,
+ OMX_U32 nDestPort);
+
+/**
+ Gets an empty buffer to an input port.
+ The buffer will be queued for delivery either to the tunneled component
+ associated with the given port, or back to the IL client via the
+ EmptyBufferDone callback.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nPort
+ Specifies the input port in which to return the buffer.
+ @param [in] pBuffer
+ Specifies the buffer to return to the input port.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_ReleaseEmptyBuffer(
+ NVOMX_Component *pComp,
+ OMX_U32 nPort,
+ OMX_BUFFERHEADERTYPE *pBuffer);
+
+/**
+ Delivers a full buffer to an output port.
+ The buffer will be queued for delivery either to the tunneled component
+ associated with the given port, or back to the IL client via the
+ FillBufferDone callback.
+
+ @param [in] pComp
+ A pointer to the NVOMX_Component structure.
+ @param [in] nPort
+ Specifies the output port in which to deliver the buffer.
+ @param [in] pBuffer
+ Specifies the buffer to deliver to the output port.
+ @retval OMX_ERRORTYPE
+ Returns an appropriate error.
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_DeliverFullBuffer(
+ NVOMX_Component *pComp,
+ OMX_U32 nPort,
+ OMX_BUFFERHEADERTYPE *pBuffer);
+
+#endif
+/** @} */
+
diff --git a/make/stub_includes/openmax/NVOMX_ComponentRegister.h b/make/stub_includes/openmax/NVOMX_ComponentRegister.h
new file mode 100755
index 000000000..550dd5912
--- /dev/null
+++ b/make/stub_includes/openmax/NVOMX_ComponentRegister.h
@@ -0,0 +1,76 @@
+/* Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/**
+ * @file
+ * <b>NVIDIA Tegra ODM Kit:
+ * OMX Component Register Interface</b>
+ *
+ * @b Description: Defines the interface to register/deregister OMX components.
+ *
+ */
+
+#ifndef NVOMX_ComponentRegister_h
+#define NVOMX_ComponentRegister_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <OMX_Core.h>
+
+/**
+ * @defgroup nv_omx_il_comp_reg NVIDIA OMX Component Register Interface
+ *
+ * This is the NVIDIA OMX component register interface.
+ *
+ * @ingroup nv_omx_il_core
+ * @{
+ */
+
+/**
+ * Dynamically registers a component with the core.
+ * The core should return from this call in 20 msec.
+ *
+ * @pre OMX_Init()
+ *
+ * @param [in] pComponentReg A pointer to a component register
+ * structure. Both \c pName and \c pInitialize values of this structure
+ * shall be non-null. The \c pName value must be unique, otherwise an
+ * error is returned.
+ * @retval OMX_ErrorNone If successful, or the appropriate OMX error code.
+ * @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_RegisterComponent(
+ OMX_IN OMX_COMPONENTREGISTERTYPE *pComponentReg);
+
+/**
+ * Deregisters a component with the core.
+ * A dynamically registered component is not required to be deregistered
+ * with a call to this function. OMX_DeInit() will deregister
+ * all components.
+ * The core should return from this call in 20 msec.
+ *
+ * @pre OMX_Init()
+ *
+ * @param [in] pComponentName The name of the component to deregister.
+ * @retval OMX_ErrorNone If successful, or the appropriate OMX error code.
+ * @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY NVOMX_DeRegisterComponent(
+ OMX_IN OMX_STRING pComponentName);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/** @} */
+/* File EOF */
+
diff --git a/make/stub_includes/openmax/NVOMX_IndexExtensions.h b/make/stub_includes/openmax/NVOMX_IndexExtensions.h
new file mode 100755
index 000000000..5a312f255
--- /dev/null
+++ b/make/stub_includes/openmax/NVOMX_IndexExtensions.h
@@ -0,0 +1,397 @@
+/* Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef _NVOMX_IndexExtensions_h_
+#define _NVOMX_IndexExtensions_h_
+
+#include <OMX_Core.h>
+#include <OMX_Component.h>
+
+#include "OMX_Core.h"
+
+/** representation of timeout values, in milliseconds */
+typedef OMX_U32 NvxTimeMs;
+/** maximum timeout value, used to mean never timeout */
+#define NVX_TIMEOUT_NEVER 0xffffffff
+/** minimum timeout value */
+#define NVX_TIMEOUT_MIN 0
+
+typedef float NVX_F32;
+
+#define NVX_INDEX_PARAM_FILENAME "OMX.Nvidia.index.param.filename" /**< Filename parameter for source, demux, and sink components that read/write files. */
+typedef struct NVX_PARAM_FILENAME {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< NVX extensions specification version information (1.0.0.0)*/
+ OMX_STRING pFilename; /**< name of file as supported by stdio implementation */
+} NVX_PARAM_FILENAME;
+
+#define NVX_INDEX_PARAM_DURATION "OMX.Nvidia.index.param.duration"
+typedef struct NVX_PARAM_DURATION {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_TICKS nDuration; /** Duration in us */
+} NVX_PARAM_DURATION;
+
+typedef enum
+{
+ NvxStreamType_NONE,
+ NvxStreamType_MPEG4,
+ NvxStreamType_H264,
+ NvxStreamType_H263,
+ NvxStreamType_WMV,
+ NvxStreamType_JPG,
+ NvxStreamType_MP3,
+ NvxStreamType_WAV,
+ NvxStreamType_AAC,
+ NvxStreamType_AACSBR,
+ NvxStreamType_BSAC,
+ NvxStreamType_WMA,
+ NvxStreamType_WMAPro,
+ NvxStreamType_WMALossless,
+ NvxStreamType_AMRWB,
+ NvxStreamType_AMRNB,
+ NvxStreamType_VORBIS
+} ENvxStreamType;
+
+#define NVX_INDEX_PARAM_STREAMTYPE "OMX.Nvidia.index.param.streamtype"
+typedef struct NVX_PARAM_STREAMTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPort;
+ ENvxStreamType eStreamType;
+} NVX_PARAM_STREAMTYPE;
+
+typedef enum
+{
+ NvxRecordingMode_Enable = 1,
+ NvxRecordingMode_EnableExclusive,
+ NvxRecordingMode_Disable,
+ NvxRecordingMode_Force32 = 0x7FFFFFFF
+} ENvxRecordingMode;
+
+#define NVX_INDEX_PARAM_RECORDINGMODE "OMX.Nvidia.index.param.recordingmode"
+typedef struct NVX_PARAM_RECORDINGMODE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ ENvxRecordingMode RecordingMode;
+} NVX_PARAM_RECORDINGMODE;
+
+#define NVX_INDEX_PARAM_CHANNELID "OMX.Nvidia.index.param.channelid"
+typedef struct NVX_PARAM_CHANNELID
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 ChannelID;
+} NVX_PARAM_CHANNELID;
+
+#define NVX_INDEX_PARAM_LOWMEMMODE "OMX.Nvidia.index.param.lowmemmode"
+typedef struct NVX_PARAM_LOWMEMMODE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bLowMemMode;
+} NVX_PARAM_LOWMEMMODE;
+
+typedef enum
+{
+ NvxMetadata_Artist,
+ NvxMetadata_Album,
+ NvxMetadata_Genre,
+ NvxMetadata_Title,
+ NvxMetadata_Year,
+ NvxMetadata_TrackNum,
+ NvMMetadata_Encoded,
+ NvxMetadata_Comment,
+ NvxMetadata_Composer,
+ NvxMetadata_Publisher,
+ NvxMetadata_OriginalArtist,
+ NvxMetadata_AlbumArtist,
+ NvxMetadata_Copyright,
+ NvxMetadata_Url,
+ NvxMetadata_BPM,
+ NvxMetadata_CoverArt,
+ NvxMetadata_CoverArtURL,
+ NvxMetadata_MAX = 0x7FFFFFFF
+} ENvxMetadataType;
+
+/* Charset define to extend OMX_METADATACHARSETTYPE for a U32 type */
+#define NVOMX_MetadataCharsetU32 0x10000000
+#define NVOMX_MetadataFormatJPEG 0x10000001
+#define NVOMX_MetadataFormatPNG 0x10000002
+#define NVOMX_MetadataFormatBMP 0x10000003
+#define NVOMX_MetadataFormatUnknown 0x10000004
+
+/* If specified metadata not found, returns empty string.
+ * or OMX_ErrorInsufficientResources if sValueStr is too small */
+#define NVX_INDEX_CONFIG_QUERYMETADATA "OMX.Nvidia.index.config.querymetadata"
+typedef struct NVX_CONFIG_QUERYMETADATA {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ ENvxMetadataType eType;
+ OMX_STRING sValueStr;
+ OMX_U32 nValueLen;
+ OMX_METADATACHARSETTYPE eCharSet;
+} NVX_CONFIG_QUERYMETADATA;
+
+#define NVX_INDEX_CONFIG_KEEPASPECT "OMX.Nvidia.index.config.keepaspect"
+typedef struct NVX_CONFIG_KEEPASPECT {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bKeepAspect;
+} NVX_CONFIG_KEEPASPECT;
+
+#define NVX_INDEX_CONFIG_ULPMODE "OMX.Nvidia.index.config.ulpmode"
+typedef struct NVX_CONFIG_ULPMODE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL enableUlpMode;
+ OMX_U32 kpiMode;
+} NVX_CONFIG_ULPMODE;
+
+#define NVX_INDEX_CONFIG_AUDIO_OUTPUT "OMX.Nvidia.index.config.audio.output"
+typedef enum NVX_AUDIO_OUTPUTTYPE {
+ NVX_AUDIO_OutputI2S = 0,
+ NVX_AUDIO_OutputHdmi,
+ NVX_AUDIO_Force32 = 0x7FFFFFFF
+} NVX_AUDIO_OUTPUTTYPE;
+
+typedef struct NVX_CONFIG_AUDIOOUTPUT {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ NVX_AUDIO_OUTPUTTYPE eOutputType;
+} NVX_CONFIG_AUDIOOUTPUT;
+
+#define NVX_INDEX_CONFIG_WHITEBALANCEOVERRIDE "OMX.Nvidia.index.config.whitebalanceoverride"
+typedef struct NVX_CONFIG_WHITEBALANCEOVERRIDE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_S32 wbIlluminantOverride;
+ OMX_S32 wbGainAndColorCorrectionOverride[13];
+} NVX_CONFIG_WHITEBALANCEOVERRIDE;
+
+#define NVX_INDEX_CONFIG_PREVIEWENABLE "OMX.Nvidia.index.config.previewenable"
+
+#define NVX_INDEX_CONFIG_CAPTUREPAUSE "OMX.Nvidia.index.config.capturepause"
+
+#define NVX_INDEX_CONFIG_CONVERGEANDLOCK "OMX.Nvidia.index.config.convergeandlock"
+typedef struct NVX_CONFIG_CONVERGEANDLOCK
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_BOOL bUnlock;
+ OMX_BOOL bAutoFocus;
+ OMX_BOOL bAutoExposure;
+ OMX_BOOL bAutoWhiteBalance;
+ OMX_U32 nTimeOutMS;
+} NVX_CONFIG_CONVERGEANDLOCK;
+
+#define NVX_INDEX_CONFIG_PRECAPTURECONVERGE "OMX.Nvidia.index.config.precaptureconverge"
+typedef struct NVX_CONFIG_PRECAPTURECONVERGE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_BOOL bPrecaptureConverge;
+ OMX_BOOL bContinueDuringCapture;
+ OMX_U32 nTimeOutMS;
+} NVX_CONFIG_PRECAPTURECONVERGE;
+
+#define NVX_INDEX_CONFIG_AUTOFRAMERATE "OMX.Nvidia.index.config.autoframerate"
+typedef struct NVX_CONFIG_AUTOFRAMERATE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_BOOL bEnabled;
+ OMX_S32 low;
+ OMX_S32 high;
+} NVX_CONFIG_AUTOFRAMERATE;
+
+#define NVX_INDEX_CONFIG_CAMERARAWCAPTURE "OMX.Nvidia.index.config.camera.rawcapture"
+typedef struct NVX_CONFIG_CAMERARAWCAPTURE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_U32 nCaptureCount;
+ OMX_STRING Filename;
+} NVX_CONFIG_CAMERARAWCAPTURE;
+
+typedef enum
+{
+ NvxFlicker_Off,
+ NvxFlicker_Auto,
+ NvxFlicker_50HZ,
+ NvxFlicker_60HZ
+} ENvxFlickerType;
+#define NVX_INDEX_CONFIG_FLICKER "OMX.Nvidia.index.config.flicker"
+typedef struct NVX_CONFIG_FLICKER
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ ENvxFlickerType eFlicker;
+} NVX_CONFIG_FLICKER;
+
+// this is used for isp data dump
+#define NVX_INDEX_CONFIG_ISPDATA "OMX.Nvidia.index.config.ispdata"
+typedef struct NVX_CONFIG_ISPDATA
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ NVX_F32 ilData;
+ NVX_F32 ilData2;
+} NVX_CONFIG_ISPDATA;
+
+#define NVX_INDEX_PARAM_VIDEO_ENCODE_PROPERTY "OMX.Nvidia.index.param.video.encode.prop"
+typedef enum NVX_VIDEO_ERROR_RESILIENCY_LEVEL_TYPE {
+ NVX_VIDEO_ErrorResiliency_None = 0,
+ NVX_VIDEO_ErrorResiliency_Low,
+ NVX_VIDEO_ErrorResiliency_High,
+ NVX_VIDEO_ErrorResiliency_Invalid = 0x7FFFFFFF
+} NVX_VIDEO_ERROR_RESILIENCY_LEVEL_TYPE;
+
+typedef enum NVX_VIDEO_APPLICATION_TYPE {
+ NVX_VIDEO_Application_Camcorder = 0,
+ NVX_VIDEO_Application_VideoTelephony,
+ NVX_VIDEO_Application_Invalid = 0x7FFFFFFF
+} NVX_VIDEO_APPLICATION_TYPE;
+
+/*new parameter to fine tune video encoder configuration*/
+typedef struct NVX_PARAM_VIDENCPROPERTY
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ NVX_VIDEO_APPLICATION_TYPE eApplicationType;
+ NVX_VIDEO_ERROR_RESILIENCY_LEVEL_TYPE eErrorResiliencyLevel;
+} NVX_PARAM_VIDENCPROPERTY;
+
+#define NVX_INDEX_PARAM_VIDEO_ENCODE_STRINGENTBITRATE "OMX.Nvidia.index.param.video.encode.stringentbitrate"
+
+#define NVX_INDEX_PARAM_OTHER_3GPMUX_BUFFERCONFIG "OMX.Nvidia.index.param.other.3gpmux.bufferconfig"
+typedef struct NVX_PARAM_OTHER_3GPMUX_BUFFERCONFIG
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_BOOL bUseCache;
+ OMX_U32 nBufferSize;
+ OMX_U32 nPageSize;
+} NVX_PARAM_OTHER_3GPMUX_BUFFERCONFIG;
+
+#define NVX_INDEX_CONFIG_THUMBNAIL "OMX.Nvidia.index.config.thumbnail"
+typedef struct NVX_CONFIG_THUMBNAIL
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_BOOL bEnabled;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} NVX_CONFIG_THUMBNAIL;
+
+#define NVX_INDEX_CONFIG_PROFILE "OMX.Nvidia.index.config.profile"
+typedef struct NVX_CONFIG_PROFILE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_BOOL bProfile;
+ OMX_BOOL bVerbose;
+ OMX_BOOL bStubOutput;
+ OMX_U32 nForceLocale; // 0 - no, 1 -cpu, 2 - avp
+ OMX_U32 nNvMMProfile;
+ OMX_BOOL bNoAVSync;
+ OMX_BOOL enableUlpMode;
+ OMX_U32 ulpkpiMode;
+ OMX_S32 nAVSyncOffset;
+ OMX_BOOL bFlip;
+ OMX_U32 nFrameDrop;
+
+ OMX_BOOL bSanity;
+ OMX_U32 nAvgFPS;
+ OMX_U32 nTotFrameDrops;
+
+ // for camera
+ OMX_U64 nTSPreviewStart;
+ OMX_U64 nTSCaptureStart;
+ OMX_U64 nTSCaptureEnd;
+ OMX_U64 nTSPreviewEnd;
+ OMX_U32 nPreviewStartFrameCount;
+ OMX_U32 nPreviewEndFrameCount;
+ OMX_U32 nCaptureStartFrameCount;
+ OMX_U32 nCaptureEndFrameCount;
+
+} NVX_CONFIG_PROFILE;
+
+
+// put event extension here for now;
+typedef enum NVX_EVENTTYPE_ENUM {
+ NVX_EventVendorStartUnused = 0x70000000,
+
+ NVX_EventCameraStart = (NVX_EventVendorStartUnused | 0xD00000),
+ NVX_EventCamera_AlgorithmsLocked = NVX_EventCameraStart,
+ NVX_EventCamera_AutoFocusAchieved,
+ NVX_EventCamera_AutoExposureAchieved,
+ NVX_EventCamera_AutoWhiteBalanceAchieved,
+ NVX_EventCamera_AutoFocusTimedOut,
+ NVX_EventCamera_AutoExposureTimedOut,
+ NVX_EventCamera_AutoWhiteBalanceTimedOut,
+ NVX_EventCamera_CaptureAborted,
+ NVX_EventCamera_CaptureStarted,
+
+ NVX_EventCamera_StillCaptureReady,
+
+ NVX_EventMax = OMX_EventMax,
+} NVX_EVENTTYPE;
+
+
+// Allow manual override on WinA to permit power optimizations from client side
+typedef enum
+{
+ NvxWindow_A = 0,
+ NvxWindow_MAX = 0x7FFFFFFF
+} ENvxWindowType;
+
+typedef enum
+{
+ NvxWindowAction_TurnOn = 0,
+ NvxWindowAction_TurnOff,
+ NvxWindowAction_MAX = 0x7FFFFFFF
+} ENvxWindowDispActionType;
+
+#define NVX_INDEX_CONFIG_WINDOW_DISP_OVERRIDE "OMX.Nvidia.index.config.windisp"
+typedef struct NVX_CONFIG_WINDOWOVERRIDE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ ENvxWindowType eWindow;
+ ENvxWindowDispActionType eAction;
+} NVX_CONFIG_WINDOWOVERRIDE;
+
+#endif
+
diff --git a/make/stub_includes/openmax/OMX_Audio.h b/make/stub_includes/openmax/OMX_Audio.h
new file mode 100755
index 000000000..ef9b51fde
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Audio.h
@@ -0,0 +1,1263 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_Audio.h - OpenMax IL version 1.1.1
+ * The structures needed by Audio components to exchange
+ * parameters and configuration data with the componenmilts.
+ */
+
+#ifndef OMX_Audio_h
+#define OMX_Audio_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Core.h>
+
+/** @defgroup midi MIDI
+ * @ingroup audio
+ */
+
+/** @defgroup effects Audio effects
+ * @ingroup audio
+ */
+
+/** @defgroup audio OpenMAX IL Audio Domain
+ * Structures for OpenMAX IL Audio domain
+ * @{
+ */
+
+/** Enumeration used to define the possible audio codings.
+ * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must
+ * be done in a vendor specific way. Since this is for an audio
+ * processing element this enum is relevant. However, for another
+ * type of component other enums would be in this area.
+ */
+typedef enum OMX_AUDIO_CODINGTYPE {
+ OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */
+ OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */
+ OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */
+ OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */
+ OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */
+ OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */
+ OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/
+ OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */
+ OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */
+ OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */
+ OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */
+ OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */
+ OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */
+ OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */
+ OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */
+ OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */
+ OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */
+ OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */
+ OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */
+ OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */
+ OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */
+ OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */
+ OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */
+ OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */
+ OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */
+ OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */
+ OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */
+ OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */
+ OMX_AUDIO_CodingMax = 0x7FFFFFFF
+} OMX_AUDIO_CODINGTYPE;
+
+
+/** The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output audio
+ * path. If additional information is needed to define the parameters of the
+ * port (such as frequency), additional structures must be sent such as the
+ * OMX_AUDIO_PCMTYPE structure to supply the extra parameters for the port.
+ */
+typedef struct OMX_AUDIO_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType; /**< MIME type of data for the port */
+ OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference
+ for an output device,
+ otherwise this field is 0 */
+ OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is
+ supported by the OMX component */
+ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this
+ port (e.g. PCM, AMR, MP3, etc) */
+} OMX_AUDIO_PORTDEFINITIONTYPE;
+
+
+/** Port format parameter. This structure is used to enumerate
+ * the various data input/output format supported by the port.
+ */
+typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Indicates which port to set */
+ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
+ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */
+} OMX_AUDIO_PARAM_PORTFORMATTYPE;
+
+
+/** PCM mode type */
+typedef enum OMX_AUDIO_PCMMODETYPE {
+ OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */
+ OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */
+ OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */
+ OMX_AUDIO_PCMModeMax = 0x7FFFFFFF
+} OMX_AUDIO_PCMMODETYPE;
+
+
+typedef enum OMX_AUDIO_CHANNELTYPE {
+ OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */
+ OMX_AUDIO_ChannelLF = 0x1, /**< Left front */
+ OMX_AUDIO_ChannelRF = 0x2, /**< Right front */
+ OMX_AUDIO_ChannelCF = 0x3, /**< Center front */
+ OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */
+ OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */
+ OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */
+ OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */
+ OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */
+ OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */
+ OMX_AUDIO_ChannelMax = 0x7FFFFFFF
+} OMX_AUDIO_CHANNELTYPE;
+
+#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */
+#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */
+
+/** PCM format description */
+typedef struct OMX_AUDIO_PARAM_PCMMODETYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */
+ OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */
+ OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */
+ OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for
+ non-interleaved data (e.g. block data) */
+ OMX_U32 nBitPerSample; /**< Bit per sample */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */
+ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */
+
+} OMX_AUDIO_PARAM_PCMMODETYPE;
+
+
+/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate
+ * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC.
+ */
+typedef enum OMX_AUDIO_CHANNELMODETYPE {
+ OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those
+ two channels changes accordingly to each channel information */
+ OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between
+ 2 channels for higher compression gain */
+ OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half
+ the bitrate of the overall bitrate */
+ OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */
+ OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF
+} OMX_AUDIO_CHANNELMODETYPE;
+
+
+typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE {
+ OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_MP3STREAMFORMATTYPE;
+
+/** MP3 params */
+typedef struct OMX_AUDIO_PARAM_MP3TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+ OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */
+} OMX_AUDIO_PARAM_MP3TYPE;
+
+
+typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE {
+ OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */
+ OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */
+ OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */
+ OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */
+ OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */
+ OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */
+ OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */
+ OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_AACSTREAMFORMATTYPE;
+
+
+/** AAC mode type. Note that the term profile is used with the MPEG-2
+ * standard and the term object type and profile is used with MPEG-4 */
+typedef enum OMX_AUDIO_AACPROFILETYPE{
+ OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */
+ OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */
+ OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */
+ OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */
+ OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */
+ OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */
+ OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */
+ OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */
+ OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */
+ OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */
+ OMX_AUDIO_AACObjectMax = 0x7FFFFFFF
+} OMX_AUDIO_AACPROFILETYPE;
+
+
+/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
+ * Required for encoder configuration and optional as decoder info output.
+ * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */
+#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */
+#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */
+#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */
+#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */
+#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */
+#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */
+#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/
+
+/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
+ * Required for ER encoder configuration and optional as decoder info output */
+#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */
+#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */
+#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */
+#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */
+#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */
+
+
+/** AAC params */
+typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec.
+ Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD).
+ Use 0 to let encoder decide */
+ OMX_U32 nAACtools; /**< AAC tool usage */
+ OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */
+ OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */
+ OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+} OMX_AUDIO_PARAM_AACPROFILETYPE;
+
+
+/** VORBIS params */
+typedef struct OMX_AUDIO_PARAM_VORBISTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable
+ rate or unknown bit rates. Encoding is set to the
+ bitrate closest to specified value (in bps) */
+ OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */
+ OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */
+
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high).
+ In the default mode of operation, teh quality level is 3.
+ Normal quality range is 0 - 10. */
+ OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the
+ normal VBR encoding, but allows hard or soft bitrate
+ constraints to be enforced by the encoder. This mode can
+ be slower, and may also be lower quality. It is
+ primarily useful for streaming. */
+ OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on
+ non-stereo streams). Useful for lower-bitrate encoding. */
+} OMX_AUDIO_PARAM_VORBISTYPE;
+
+
+/** WMA Version */
+typedef enum OMX_AUDIO_WMAFORMATTYPE {
+ OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */
+ OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */
+ OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */
+ OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */
+ OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_WMAFORMATTYPE;
+
+
+/** WMA Profile */
+typedef enum OMX_AUDIO_WMAPROFILETYPE {
+ OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */
+ OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */
+ OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */
+ OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */
+ OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF
+} OMX_AUDIO_WMAPROFILETYPE;
+
+
+/** WMA params */
+typedef struct OMX_AUDIO_PARAM_WMATYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */
+ OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data */
+ OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */
+ OMX_U16 nEncodeOptions; /**< WMA Type-specific data */
+ OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */
+} OMX_AUDIO_PARAM_WMATYPE;
+
+/**
+ * RealAudio format
+ */
+typedef enum OMX_AUDIO_RAFORMATTYPE {
+ OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */
+ OMX_AUDIO_RA8, /**< RealAudio 8 codec */
+ OMX_AUDIO_RA9, /**< RealAudio 9 codec */
+ OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */
+ OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */
+ OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */
+ OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */
+ OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */
+ OMX_VIDEO_RAFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_RAFORMATTYPE;
+
+/** RA (Real Audio) params */
+typedef struct OMX_AUDIO_PARAM_RATYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */
+ OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */
+ OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */
+ OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */
+ OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */
+ OMX_U32 nNumRegions; /**< is the number of regions value */
+ OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */
+} OMX_AUDIO_PARAM_RATYPE;
+
+
+/** SBC Allocation Method Type */
+typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE {
+ OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */
+ OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */
+ OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF
+} OMX_AUDIO_SBCALLOCMETHODTYPE;
+
+
+/** SBC params */
+typedef struct OMX_AUDIO_PARAM_SBCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nBlocks; /**< Number of blocks */
+ OMX_U32 nSubbands; /**< Number of subbands */
+ OMX_U32 nBitPool; /**< Bitpool value */
+ OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+ OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */
+} OMX_AUDIO_PARAM_SBCTYPE;
+
+
+/** ADPCM stream format parameters */
+typedef struct OMX_AUDIO_PARAM_ADPCMTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_U32 nBitsPerSample; /**< Number of bits in each sample */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+} OMX_AUDIO_PARAM_ADPCMTYPE;
+
+
+/** G723 rate */
+typedef enum OMX_AUDIO_G723RATE {
+ OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */
+ OMX_AUDIO_G723ModeLow, /**< 5300 bps */
+ OMX_AUDIO_G723ModeHigh, /**< 6300 bps */
+ OMX_AUDIO_G723ModeMax = 0x7FFFFFFF
+} OMX_AUDIO_G723RATE;
+
+
+/** G723 - Sample rate must be 8 KHz */
+typedef struct OMX_AUDIO_PARAM_G723TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+ OMX_BOOL bPostFilter; /**< Enable Post Filter */
+} OMX_AUDIO_PARAM_G723TYPE;
+
+
+/** ITU G726 (ADPCM) rate */
+typedef enum OMX_AUDIO_G726MODE {
+ OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */
+ OMX_AUDIO_G726Mode16, /**< 16 kbps */
+ OMX_AUDIO_G726Mode24, /**< 24 kbps */
+ OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */
+ OMX_AUDIO_G726Mode40, /**< 40 kbps */
+ OMX_AUDIO_G726ModeMax = 0x7FFFFFFF
+} OMX_AUDIO_G726MODE;
+
+
+/** G.726 stream format parameters - must be at 8KHz */
+typedef struct OMX_AUDIO_PARAM_G726TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_G726MODE eG726Mode;
+} OMX_AUDIO_PARAM_G726TYPE;
+
+
+/** G729 coder type */
+typedef enum OMX_AUDIO_G729TYPE {
+ OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */
+ OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */
+ OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */
+ OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */
+ OMX_AUDIO_G729Max = 0x7FFFFFFF
+} OMX_AUDIO_G729TYPE;
+
+
+/** G729 stream format parameters - fixed 6KHz sample rate */
+typedef struct OMX_AUDIO_PARAM_G729TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_AUDIO_G729TYPE eBitType;
+} OMX_AUDIO_PARAM_G729TYPE;
+
+
+/** AMR Frame format */
+typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE {
+ OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance
+ (Standard) Format */
+ OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface
+ Format 1 */
+ OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface
+ Format 2*/
+ OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage
+ Format */
+ OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time
+ Transport Protocol Payload Format */
+ OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */
+ OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRFRAMEFORMATTYPE;
+
+
+/** AMR band mode */
+typedef enum OMX_AUDIO_AMRBANDMODETYPE {
+ OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */
+ OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */
+ OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */
+ OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */
+ OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */
+ OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */
+ OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */
+ OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */
+ OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */
+ OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */
+ OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */
+ OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */
+ OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */
+ OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */
+ OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */
+ OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */
+ OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */
+ OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */
+ OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRBANDMODETYPE;
+
+
+/** AMR Discontinuous Transmission mode */
+typedef enum OMX_AUDIO_AMRDTXMODETYPE {
+ OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */
+ OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using
+ Voice Activity Detector 1 (VAD1) is enabled */
+ OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using
+ Voice Activity Detector 2 (VAD2) is enabled */
+ OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between
+ Off, VAD1 or VAD2 modes */
+
+ OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */
+
+ OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRDTXMODETYPE;
+
+
+/** AMR params */
+typedef struct OMX_AUDIO_PARAM_AMRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate read only field */
+ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */
+ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */
+ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */
+} OMX_AUDIO_PARAM_AMRTYPE;
+
+
+/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMFRTYPE;
+
+
+/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMHRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMHRTYPE;
+
+
+/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMEFRTYPE;
+
+
+/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_TDMAFRTYPE;
+
+
+/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_TDMAEFRTYPE;
+
+
+/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCFRTYPE;
+
+
+/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCEFRTYPE;
+
+/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCHRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCHRTYPE;
+
+
+/** CDMA Rate types */
+typedef enum OMX_AUDIO_CDMARATETYPE {
+ OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */
+ OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */
+ OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */
+ OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */
+ OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/
+ OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */
+ OMX_AUDIO_CDMARateMax = 0x7FFFFFFF
+} OMX_AUDIO_CDMARATETYPE;
+
+
+/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_QCELP8TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+} OMX_AUDIO_PARAM_QCELP8TYPE;
+
+
+/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_QCELP13TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+} OMX_AUDIO_PARAM_QCELP13TYPE;
+
+
+/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_EVRCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */
+ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */
+ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
+ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */
+} OMX_AUDIO_PARAM_EVRCTYPE;
+
+
+/** SMV ( up to 8.55kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_SMVTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/
+ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/
+ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
+ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/
+} OMX_AUDIO_PARAM_SMVTYPE;
+
+
+/** MIDI Format
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDIFORMATTYPE
+{
+ OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */
+ OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */
+ OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */
+ OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */
+ OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */
+ OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */
+ OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */
+ OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */
+ OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDIFORMATTYPE;
+
+
+/** MIDI params
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_PARAM_MIDITYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire
+ MIDI file passed in, otherwise if 0x0, the MIDI data
+ is merged and streamed (instead of passed as an
+ entire MIDI file) */
+ OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
+ voices. A value of zero indicates that the default
+ polyphony of the device is used */
+ OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound
+ bank at initialization */
+ OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */
+} OMX_AUDIO_PARAM_MIDITYPE;
+
+
+/** Type of the MIDI sound bank
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE {
+ OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */
+ OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */
+ OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */
+ OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */
+ OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */
+ OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDISOUNDBANKTYPE;
+
+
+/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE {
+ OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */
+ OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */
+ OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */
+ OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */
+ OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE;
+
+
+/** MIDI params to load/unload user soundbank
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nDLSIndex; /**< DLS file index to be loaded */
+ OMX_U32 nDLSSize; /**< Size in bytes */
+ OMX_PTR pDLSData; /**< Pointer to DLS file data */
+ OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */
+ OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */
+} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE;
+
+
+/** Structure for Live MIDI events and MIP messages.
+ * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.)
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */
+ OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an
+ array for the MIP message buffer, where the size is
+ indicated by nMidiEventSize */
+} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE;
+
+
+/** MIDI sound bank/ program pair in a given channel
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */
+ OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */
+ OMX_U16 nIDSoundBank; /**< Sound bank ID */
+ OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks
+ by index if multiple banks are present */
+} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE;
+
+
+/** MIDI control
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10
+ format based on JAVA MMAPI (JSR-135) requirement */
+ OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point
+ number based on JSR-135 requirement */
+ OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10
+ fixed-point number based on JSR-135 requirement */
+ OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
+ voices. A value of zero indicates that the default
+ polyphony of the device is used */
+ OMX_U32 nNumRepeat; /**< Number of times to repeat playback */
+ OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback
+ will stop automatically. Set to zero if not used */
+ OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */
+ OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */
+ OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */
+ OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */
+ OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */
+ OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */
+
+} OMX_AUDIO_CONFIG_MIDICONTROLTYPE;
+
+
+/** MIDI Playback States
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE {
+ OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to
+ other defined states */
+ OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open.
+ The MIDI engine is currently processing
+ MIDI events. */
+ OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being
+ primed. The MIDI engine is currently
+ processing MIDI events. */
+ OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but
+ not playing. The MIDI engine is currently
+ processing MIDI events. The transition to
+ this state is only possible from the
+ OMX_AUDIO_MIDIPlayBackStatePlaying state,
+ when the 'playback head' reaches the end
+ of media data or the playback stops due
+ to stop time set.*/
+ OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently
+ playing. The MIDI engine is currently
+ processing MIDI events.*/
+ OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS
+ resource constraints */
+ OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and
+ SP-MIDI content constraints, there is
+ no audible MIDI content during playback
+ currently. The situation may change if
+ resources are freed later.*/
+ OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDIPLAYBACKSTATETYPE;
+
+
+/** MIDI status
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field.
+ NOTE: May not return a meaningful value until the entire
+ file is parsed and buffered. */
+ OMX_U32 nDuration; /**< The length of the currently open MIDI resource
+ in milliseconds. NOTE: May not return a meaningful value
+ until the entire file is parsed and buffered. */
+ OMX_U32 nPosition; /**< Current Position of the MIDI resource being played
+ in milliseconds */
+ OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful
+ value until the entire file is parsed and buffered. */
+ OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently
+ open MIDI resource. NOTE: May not return a meaningful value
+ until the entire file is parsed and buffered. */
+ OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing
+ MIDI resource. NOTE: May not return a meaningful value until
+ the entire file is parsed and buffered. */
+ OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */
+} OMX_AUDIO_CONFIG_MIDISTATUSTYPE;
+
+
+/** MIDI Meta Event structure one per Meta Event.
+ * MIDI Meta Events are like audio metadata, except that they are interspersed
+ * with the MIDI content throughout the file and are not localized in the header.
+ * As such, it is necessary to retrieve information about these Meta Events from
+ * the engine, as it encounters these Meta Events within the MIDI content.
+ * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright,
+ * author, default tempo, etc.) scattered throughout the file.
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nIndex; /**< Index of Meta Event */
+ OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */
+ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
+ OMX_U32 nTrack; /**< track number for the meta event */
+ OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */
+} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE;
+
+
+/** MIDI Meta Event Data structure - one per Meta Event.
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nIndex; /**< Index of Meta Event */
+ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
+ OMX_U8 nData[1]; /**< array of one or more bytes of meta data
+ as indicated by the nMetaEventSize field */
+} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE;
+
+
+/** Audio Volume adjustment for a port */
+typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's volume. Select the
+ output port to adjust the master
+ volume. */
+ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100)
+ or logarithmic scale (mB) */
+ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
+ Volume logarithmic setting for this port. The values
+ for volume are in mB (millibels = 1/100 dB) relative
+ to a gain of 1 (e.g. the output is the same as the
+ input level). Values are in mB from nMax
+ (maximum volume) to nMin mB (typically negative).
+ Since the volume is "voltage"
+ and not a "power", it takes a setting of
+ -600 mB to decrease the volume by 1/2. If
+ a component cannot accurately set the
+ volume to the requested value, it must
+ set the volume to the closest value BELOW
+ the requested value. When getting the
+ volume setting, the current actual volume
+ must be returned. */
+} OMX_AUDIO_CONFIG_VOLUMETYPE;
+
+
+/** Audio Volume adjustment for a channel */
+typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's volume. Select the
+ output port to adjust the master
+ volume. */
+ OMX_U32 nChannel; /**< channel to select from 0 to N-1,
+ using OMX_ALL to apply volume settings
+ to all channels */
+ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or
+ logarithmic scale (mB) */
+ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
+ Volume logarithmic setting for this port.
+ The values for volume are in mB
+ (millibels = 1/100 dB) relative to a gain
+ of 1 (e.g. the output is the same as the
+ input level). Values are in mB from nMax
+ (maximum volume) to nMin mB (typically negative).
+ Since the volume is "voltage"
+ and not a "power", it takes a setting of
+ -600 mB to decrease the volume by 1/2. If
+ a component cannot accurately set the
+ volume to the requested value, it must
+ set the volume to the closest value BELOW
+ the requested value. When getting the
+ volume setting, the current actual volume
+ must be returned. */
+ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
+ FALSE otherwise */
+} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE;
+
+
+/** Audio balance setting */
+typedef struct OMX_AUDIO_CONFIG_BALANCETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's balance. Select the
+ output port to adjust the master
+ balance. */
+ OMX_S32 nBalance; /**< balance setting for this port
+ (-100 to 100, where -100 indicates
+ all left, and no right */
+} OMX_AUDIO_CONFIG_BALANCETYPE;
+
+
+/** Audio Port mute */
+typedef struct OMX_AUDIO_CONFIG_MUTETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's mute. Select the
+ output port to adjust the master
+ mute. */
+ OMX_BOOL bMute; /**< Mute setting for this port */
+} OMX_AUDIO_CONFIG_MUTETYPE;
+
+
+/** Audio Channel mute */
+typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannel; /**< channel to select from 0 to N-1,
+ using OMX_ALL to apply mute settings
+ to all channels */
+ OMX_BOOL bMute; /**< Mute setting for this channel */
+ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
+ FALSE otherwise */
+} OMX_AUDIO_CONFIG_CHANNELMUTETYPE;
+
+
+
+/** Enable / Disable for loudness control, which boosts bass and to a
+ * smaller extent high end frequencies to compensate for hearing
+ * ability at the extreme ends of the audio spectrum
+ */
+typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bLoudness; /**< Enable/disable for loudness */
+} OMX_AUDIO_CONFIG_LOUDNESSTYPE;
+
+
+/** Enable / Disable for bass, which controls low frequencies
+ */
+typedef struct OMX_AUDIO_CONFIG_BASSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for bass control */
+ OMX_S32 nBass; /**< bass setting for the port, as a
+ continuous value from -100 to 100
+ (0 means no change in bass level)*/
+} OMX_AUDIO_CONFIG_BASSTYPE;
+
+
+/** Enable / Disable for treble, which controls high frequencies tones
+ */
+typedef struct OMX_AUDIO_CONFIG_TREBLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for treble control */
+ OMX_S32 nTreble; /**< treble setting for the port, as a
+ continuous value from -100 to 100
+ (0 means no change in treble level) */
+} OMX_AUDIO_CONFIG_TREBLETYPE;
+
+
+/** An equalizer is typically used for two reasons: to compensate for an
+ * sub-optimal frequency response of a system to make it sound more natural
+ * or to create intentionally some unnatural coloring to the sound to create
+ * an effect.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for equalizer */
+ OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is
+ N-1, where N is the number of bands, lower limit is 0 */
+ OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a
+ read only element and is used to determine
+ the lower, center and upper frequency of
+ this band. */
+ OMX_BS32 sBandLevel; /**< band level in millibels */
+} OMX_AUDIO_CONFIG_EQUALIZERTYPE;
+
+
+/** Stereo widening mode type
+ * @ingroup effects
+ */
+typedef enum OMX_AUDIO_STEREOWIDENINGTYPE {
+ OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */
+ OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */
+ OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF
+} OMX_AUDIO_STEREOWIDENINGTYPE;
+
+
+/** Control for stereo widening, which is a special 2-channel
+ * case of the audio virtualizer effect. For example, for 5.1-channel
+ * output, it translates to virtual surround sound.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */
+ OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */
+ OMX_U32 nStereoWidening; /**< stereo widening setting for the port,
+ as a continuous value from 0 to 100 */
+} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE;
+
+
+/** The chorus effect (or ``choralizer'') is any signal processor which makes
+ * one sound source (such as a voice) sound like many such sources singing
+ * (or playing) in unison. Since performance in unison is never exact, chorus
+ * effects simulate this by making independently modified copies of the input
+ * signal. Modifications may include (1) delay, (2) frequency shift, and
+ * (3) amplitude modulation.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for chorus */
+ OMX_BU32 sDelay; /**< average delay in milliseconds */
+ OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */
+ OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of
+ delay (i.e. 0 to 100) */
+ OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */
+} OMX_AUDIO_CONFIG_CHORUSTYPE;
+
+
+/** Reverberation is part of the reflected sound that follows the early
+ * reflections. In a typical room, this consists of a dense succession of
+ * echoes whose energy decays exponentially. The reverberation effect structure
+ * as defined here includes both (early) reflections as well as (late) reverberations.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for reverberation control */
+ OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect
+ (i.e. both early reflections and late
+ reverberation) in millibels */
+ OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies
+ relative to the intensity at low
+ frequencies in millibels */
+ OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections
+ (relative to room value), in millibels */
+ OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative
+ to the direct path, in milliseconds */
+ OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation
+ relative to room level, in millibels */
+ OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection
+ to the beginning of the late reverberation
+ section, in milliseconds */
+ OMX_BU32 sDecayTime; /**< Late reverberation decay time at low
+ frequencies, in milliseconds */
+ OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative
+ to low frequency decay time in percent */
+ OMX_U32 nDensity; /**< Modal density in the late reverberation decay,
+ in percent (i.e. 0 - 100) */
+ OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay,
+ in percent (i.e. 0 - 100) */
+ OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is
+ the frequency used as the reference for all
+ the high-frequency settings above */
+
+} OMX_AUDIO_CONFIG_REVERBERATIONTYPE;
+
+
+/** Possible settings for the Echo Cancelation structure to use
+ * @ingroup effects
+ */
+typedef enum OMX_AUDIO_ECHOCANTYPE {
+ OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */
+ OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation -
+ echo from plastics and face */
+ OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for
+ Hands Free operation */
+ OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for
+ Car Kit (longer echo) */
+ OMX_AUDIO_EchoCanMax = 0x7FFFFFFF
+} OMX_AUDIO_ECHOCANTYPE;
+
+
+/** Enable / Disable for echo cancelation, which removes undesired echo's
+ * from the audio
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */
+} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE;
+
+
+/** Enable / Disable for noise reduction, which undesired noise from
+ * the audio
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */
+} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
diff --git a/make/stub_includes/openmax/OMX_Component.h b/make/stub_includes/openmax/OMX_Component.h
new file mode 100755
index 000000000..7f3ea777b
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Component.h
@@ -0,0 +1,567 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Component.h - OpenMax IL version 1.1.1
+ * The OMX_Component header file contains the definitions used to define
+ * the public interface of a component. This header file is intended to
+ * be used by both the application and the component.
+ */
+
+#ifndef OMX_Component_h
+#define OMX_Component_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Audio.h>
+#include <OMX_Video.h>
+#include <OMX_Image.h>
+#include <OMX_Other.h>
+
+/** @ingroup comp */
+typedef enum OMX_PORTDOMAINTYPE {
+ OMX_PortDomainAudio,
+ OMX_PortDomainVideo,
+ OMX_PortDomainImage,
+ OMX_PortDomainOther,
+ OMX_PortDomainMax = 0x7ffffff
+} OMX_PORTDOMAINTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_PORTDEFINITIONTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port number the structure applies to */
+ OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */
+ OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */
+ OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */
+ OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */
+ OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by
+ OMX_CommandPortEnable/OMX_CommandPortDisable.
+ When disabled a port is unpopulated. A disabled port
+ is not populated with buffers on a transition to IDLE. */
+ OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by
+ nBufferCountActual. A disabled port is always unpopulated.
+ An enabled port is populated on a transition to OMX_StateIdle
+ and unpopulated on a transition to loaded. */
+ OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */
+ union {
+ OMX_AUDIO_PORTDEFINITIONTYPE audio;
+ OMX_VIDEO_PORTDEFINITIONTYPE video;
+ OMX_IMAGE_PORTDEFINITIONTYPE image;
+ OMX_OTHER_PORTDEFINITIONTYPE other;
+ } format;
+ OMX_BOOL bBuffersContiguous;
+ OMX_U32 nBufferAlignment;
+} OMX_PARAM_PORTDEFINITIONTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_U32TYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nU32; /**< U32 value */
+} OMX_PARAM_U32TYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONPOLICYTYPE {
+ OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */
+ OMX_SuspensionEnabled, /**< Suspension allowed */
+ OMX_SuspensionPolicyMax = 0x7fffffff
+} OMX_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_SUSPENSIONPOLICYTYPE ePolicy;
+} OMX_PARAM_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONTYPE {
+ OMX_NotSuspended, /**< component is not suspended */
+ OMX_Suspended, /**< component is suspended */
+ OMX_SuspendMax = 0x7FFFFFFF
+} OMX_SUSPENSIONTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_SUSPENSIONTYPE eType;
+} OMX_PARAM_SUSPENSIONTYPE ;
+
+typedef struct OMX_CONFIG_BOOLEANTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bEnabled;
+} OMX_CONFIG_BOOLEANTYPE;
+
+/* Parameter specifying the content uri to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTURITYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes, including
+ actual URI name */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8 contentURI[1]; /**< The URI name */
+} OMX_PARAM_CONTENTURITYPE;
+
+/* Parameter specifying the pipe to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTPIPETYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_HANDLETYPE hPipe; /**< The pipe handle*/
+} OMX_PARAM_CONTENTPIPETYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_RESOURCECONCEALMENTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment
+ methods (like degrading algorithm quality to
+ lower resource consumption or functional bypass)
+ on a component as a resolution to resource conflicts. */
+} OMX_RESOURCECONCEALMENTTYPE;
+
+
+/** @ingroup metadata */
+typedef enum OMX_METADATACHARSETTYPE {
+ OMX_MetadataCharsetUnknown = 0,
+ OMX_MetadataCharsetASCII,
+ OMX_MetadataCharsetBinary,
+ OMX_MetadataCharsetCodePage1252,
+ OMX_MetadataCharsetUTF8,
+ OMX_MetadataCharsetJavaConformantUTF8,
+ OMX_MetadataCharsetUTF7,
+ OMX_MetadataCharsetImapUTF7,
+ OMX_MetadataCharsetUTF16LE,
+ OMX_MetadataCharsetUTF16BE,
+ OMX_MetadataCharsetGB12345,
+ OMX_MetadataCharsetHZGB2312,
+ OMX_MetadataCharsetGB2312,
+ OMX_MetadataCharsetGB18030,
+ OMX_MetadataCharsetGBK,
+ OMX_MetadataCharsetBig5,
+ OMX_MetadataCharsetISO88591,
+ OMX_MetadataCharsetISO88592,
+ OMX_MetadataCharsetISO88593,
+ OMX_MetadataCharsetISO88594,
+ OMX_MetadataCharsetISO88595,
+ OMX_MetadataCharsetISO88596,
+ OMX_MetadataCharsetISO88597,
+ OMX_MetadataCharsetISO88598,
+ OMX_MetadataCharsetISO88599,
+ OMX_MetadataCharsetISO885910,
+ OMX_MetadataCharsetISO885913,
+ OMX_MetadataCharsetISO885914,
+ OMX_MetadataCharsetISO885915,
+ OMX_MetadataCharsetShiftJIS,
+ OMX_MetadataCharsetISO2022JP,
+ OMX_MetadataCharsetISO2022JP1,
+ OMX_MetadataCharsetISOEUCJP,
+ OMX_MetadataCharsetSMS7Bit,
+ OMX_MetadataCharsetTypeMax= 0x7FFFFFFF
+} OMX_METADATACHARSETTYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASCOPETYPE
+{
+ OMX_MetadataScopeAllLevels,
+ OMX_MetadataScopeTopLevel,
+ OMX_MetadataScopePortLevel,
+ OMX_MetadataScopeNodeLevel,
+ OMX_MetadataScopeTypeMax = 0x7fffffff
+} OMX_METADATASCOPETYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASEARCHMODETYPE
+{
+ OMX_MetadataSearchValueSizeByIndex,
+ OMX_MetadataSearchItemByIndex,
+ OMX_MetadataSearchNextItemByKey,
+ OMX_MetadataSearchTypeMax = 0x7fffffff
+} OMX_METADATASEARCHMODETYPE;
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_METADATASCOPETYPE eScopeMode;
+ OMX_U32 nScopeSpecifier;
+ OMX_U32 nMetadataItemCount;
+} OMX_CONFIG_METADATAITEMCOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_METADATASCOPETYPE eScopeMode;
+ OMX_U32 nScopeSpecifier;
+ OMX_U32 nMetadataItemIndex;
+ OMX_METADATASEARCHMODETYPE eSearchMode;
+ OMX_METADATACHARSETTYPE eKeyCharset;
+ OMX_U8 nKeySizeUsed;
+ OMX_U8 nKey[128];
+ OMX_METADATACHARSETTYPE eValueCharset;
+ OMX_STRING sLanguageCountry;
+ OMX_U32 nValueMaxSize;
+ OMX_U32 nValueSizeUsed;
+ OMX_U8 nValue[1];
+} OMX_CONFIG_METADATAITEMTYPE;
+
+/* @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys;
+ OMX_U32 nParentNodeID;
+ OMX_U32 nNumNodes;
+} OMX_CONFIG_CONTAINERNODECOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys;
+ OMX_U32 nParentNodeID;
+ OMX_U32 nNodeIndex;
+ OMX_U32 nNodeID;
+ OMX_STRING cNodeName;
+ OMX_BOOL bIsLeafType;
+} OMX_CONFIG_CONTAINERNODEIDTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_PARAM_METADATAFILTERTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and
+ * the three key fields below are ignored */
+ OMX_METADATACHARSETTYPE eKeyCharset;
+ OMX_U32 nKeySizeUsed;
+ OMX_U8 nKey [128];
+ OMX_U32 nLanguageCountrySizeUsed;
+ OMX_U8 nLanguageCountry[128];
+ OMX_BOOL bEnabled; /* if true then key is part of filter (e.g.
+ * retained for query later). If false then
+ * key is not part of filter */
+} OMX_PARAM_METADATAFILTERTYPE;
+
+/** The OMX_HANDLETYPE structure defines the component handle. The component
+ * handle is used to access all of the component's public methods and also
+ * contains pointers to the component's private data area. The component
+ * handle is initialized by the OMX core (with help from the component)
+ * during the process of loading the component. After the component is
+ * successfully loaded, the application can safely access any of the
+ * component's public functions (although some may return an error because
+ * the state is inappropriate for the access).
+ *
+ * @ingroup comp
+ */
+typedef struct OMX_COMPONENTTYPE
+{
+ /** The size of this structure, in bytes. It is the responsibility
+ of the allocator of this structure to fill in this value. Since
+ this structure is allocated by the GetHandle function, this
+ function will fill in this value. */
+ OMX_U32 nSize;
+
+ /** nVersion is the version of the OMX specification that the structure
+ is built against. It is the responsibility of the creator of this
+ structure to initialize this value and every user of this structure
+ should verify that it knows how to use the exact version of
+ this structure found herein. */
+ OMX_VERSIONTYPE nVersion;
+
+ /** pComponentPrivate is a pointer to the component private data area.
+ This member is allocated and initialized by the component when the
+ component is first loaded. The application should not access this
+ data area. */
+ OMX_PTR pComponentPrivate;
+
+ /** pApplicationPrivate is a pointer that is a parameter to the
+ OMX_GetHandle method, and contains an application private value
+ provided by the IL client. This application private data is
+ returned to the IL Client by OMX in all callbacks */
+ OMX_PTR pApplicationPrivate;
+
+ /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL
+ specification for details on the GetComponentVersion method.
+ */
+ OMX_ERRORTYPE (*GetComponentVersion)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_STRING pComponentName,
+ OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
+ OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
+ OMX_OUT OMX_UUIDTYPE* pComponentUUID);
+
+ /** refer to OMX_SendCommand in OMX_core.h or the OMX IL
+ specification for details on the SendCommand method.
+ */
+ OMX_ERRORTYPE (*SendCommand)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_COMMANDTYPE Cmd,
+ OMX_IN OMX_U32 nParam1,
+ OMX_IN OMX_PTR pCmdData);
+
+ /** refer to OMX_GetParameter in OMX_core.h or the OMX IL
+ specification for details on the GetParameter method.
+ */
+ OMX_ERRORTYPE (*GetParameter)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure);
+
+
+ /** refer to OMX_SetParameter in OMX_core.h or the OMX IL
+ specification for details on the SetParameter method.
+ */
+ OMX_ERRORTYPE (*SetParameter)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_IN OMX_PTR pComponentParameterStructure);
+
+
+ /** refer to OMX_GetConfig in OMX_core.h or the OMX IL
+ specification for details on the GetConfig method.
+ */
+ OMX_ERRORTYPE (*GetConfig)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_INOUT OMX_PTR pComponentConfigStructure);
+
+
+ /** refer to OMX_SetConfig in OMX_core.h or the OMX IL
+ specification for details on the SetConfig method.
+ */
+ OMX_ERRORTYPE (*SetConfig)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_IN OMX_PTR pComponentConfigStructure);
+
+
+ /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL
+ specification for details on the GetExtensionIndex method.
+ */
+ OMX_ERRORTYPE (*GetExtensionIndex)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName,
+ OMX_OUT OMX_INDEXTYPE* pIndexType);
+
+
+ /** refer to OMX_GetState in OMX_core.h or the OMX IL
+ specification for details on the GetState method.
+ */
+ OMX_ERRORTYPE (*GetState)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_STATETYPE* pState);
+
+
+ /** The ComponentTunnelRequest method will interact with another OMX
+ component to determine if tunneling is possible and to setup the
+ tunneling. The return codes for this method can be used to
+ determine if tunneling is not possible, or if tunneling is not
+ supported.
+
+ Base profile components (i.e. non-interop) do not support this
+ method and should return OMX_ErrorNotImplemented
+
+ The interop profile component MUST support tunneling to another
+ interop profile component with a compatible port parameters.
+ A component may also support proprietary communication.
+
+ If proprietary communication is supported the negotiation of
+ proprietary communication is done outside of OMX in a vendor
+ specific way. It is only required that the proper result be
+ returned and the details of how the setup is done is left
+ to the component implementation.
+
+ When this method is invoked when nPort in an output port, the
+ component will:
+ 1. Populate the pTunnelSetup structure with the output port's
+ requirements and constraints for the tunnel.
+
+ When this method is invoked when nPort in an input port, the
+ component will:
+ 1. Query the necessary parameters from the output port to
+ determine if the ports are compatible for tunneling
+ 2. If the ports are compatible, the component should store
+ the tunnel step provided by the output port
+ 3. Determine which port (either input or output) is the buffer
+ supplier, and call OMX_SetParameter on the output port to
+ indicate this selection.
+
+ The component will return from this call within 5 msec.
+
+ @param [in] hComp
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle method.
+ @param [in] nPort
+ nPort is used to select the port on the component to be used
+ for tunneling.
+ @param [in] hTunneledComp
+ Handle of the component to tunnel with. This is the component
+ handle returned by the call to the OMX_GetHandle method. When
+ this parameter is 0x0 the component should setup the port for
+ communication with the application / IL Client.
+ @param [in] nPortOutput
+ nPortOutput is used indicate the port the component should
+ tunnel with.
+ @param [in] pTunnelSetup
+ Pointer to the tunnel setup structure. When nPort is an output port
+ the component should populate the fields of this structure. When
+ When nPort is an input port the component should review the setup
+ provided by the component with the output port.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup tun
+ */
+
+ OMX_ERRORTYPE (*ComponentTunnelRequest)(
+ OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 nPort,
+ OMX_IN OMX_HANDLETYPE hTunneledComp,
+ OMX_IN OMX_U32 nTunneledPort,
+ OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup);
+
+ /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL
+ specification for details on the UseBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*UseBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN OMX_U32 nSizeBytes,
+ OMX_IN OMX_U8* pBuffer);
+
+ /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL
+ specification for details on the AllocateBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*AllocateBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN OMX_U32 nSizeBytes);
+
+ /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL
+ specification for details on the FreeBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FreeBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL
+ specification for details on the EmptyThisBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*EmptyThisBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL
+ specification for details on the FillThisBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FillThisBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** The SetCallbacks method is used by the core to specify the callback
+ structure from the application to the component. This is a blocking
+ call. The component will return from this call within 5 msec.
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @param [in] pCallbacks
+ pointer to an OMX_CALLBACKTYPE structure used to provide the
+ callback information to the component
+ @param [in] pAppData
+ pointer to an application defined value. It is anticipated that
+ the application will pass a pointer to a data structure or a "this
+ pointer" in this area to allow the callback (in the application)
+ to determine the context of the call
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*SetCallbacks)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_CALLBACKTYPE* pCallbacks,
+ OMX_IN OMX_PTR pAppData);
+
+ /** ComponentDeInit method is used to deinitialize the component
+ providing a means to free any resources allocated at component
+ initialization. NOTE: After this call the component handle is
+ not valid for further use.
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*ComponentDeInit)(
+ OMX_IN OMX_HANDLETYPE hComponent);
+
+ /** @ingroup buf */
+ OMX_ERRORTYPE (*UseEGLImage)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN void* eglImage);
+
+ OMX_ERRORTYPE (*ComponentRoleEnum)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_U8 *cRole,
+ OMX_IN OMX_U32 nIndex);
+
+} OMX_COMPONENTTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/make/stub_includes/openmax/OMX_ContentPipe.h b/make/stub_includes/openmax/OMX_ContentPipe.h
new file mode 100755
index 000000000..c27dc9854
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_ContentPipe.h
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_ContentPipe.h - OpenMax IL version 1.1.1
+ * The OMX_ContentPipe header file contains the definitions used to define
+ * the public interface for content piples. This header file is intended to
+ * be used by the component.
+ */
+
+#ifndef OMX_CONTENTPIPE_H
+#define OMX_CONTENTPIPE_H
+
+#ifndef KD_EACCES
+/* OpenKODE error codes. CPResult values may be zero (indicating success
+ or one of the following values) */
+#define KD_EACCES (13)
+#define KD_EADDRINUSE (98)
+#define KD_EAGAIN (11)
+#define KD_EBADF (9)
+#define KD_EBUSY (16)
+#define KD_ECANCELED (125)
+#define KD_ECONNABORTED (103)
+#define KD_ECONNREFUSED (111)
+#define KD_ECONNRESET (104)
+#define KD_EDEADLK (35)
+#define KD_EDESTADDRREQ (89)
+#define KD_EDOM (33)
+#define KD_ERANGE (34)
+#define KD_EEXIST (17)
+#define KD_EFAULT (14)
+#define KD_EFBIG (27)
+#define KD_EHOSTUNREACH (113)
+#define KD_EINPROGRESS (115)
+#define KD_EINTR (4)
+#define KD_EINVAL (22)
+#define KD_EIO (5)
+#define KD_EISCONN (106)
+#define KD_EISDIR (21)
+#define KD_EMFILE (24)
+#define KD_ENAMETOOLONG (36)
+#define KD_ENETDOWN (100)
+#define KD_ENETRESET (102)
+#define KD_ENETUNREACH (101)
+#define KD_ENOBUFS (105)
+#define KD_ENOENT (2)
+#define KD_ENOMEM (12)
+#define KD_ENOSPC (28)
+#define KD_ENOSYS (28)
+#define KD_ENOTCONN (107)
+#define KD_ENOTDIR (20)
+#define KD_ENOTEMPTY (39)
+#define KD_ENOTSOCK (88)
+#define KD_ENOTSUP (95)
+#define KD_EPERM (1)
+#define KD_EPROTO (71)
+#define KD_ETIMEDOUT (110)
+#define KD_EILSEQ (84)
+#endif
+
+/** Map types from OMX standard types only here so interface is as generic as possible. */
+typedef OMX_U32 CPresult;
+typedef char * CPstring;
+typedef void * CPhandle;
+typedef OMX_U32 CPuint;
+typedef OMX_S32 CPint;
+typedef char CPbyte;
+typedef OMX_BOOL CPbool;
+
+/** enumeration of origin types used in the CP_PIPETYPE's Seek function
+ * @ingroup cp
+ */
+typedef enum CP_ORIGINTYPE {
+ CP_OriginBegin,
+ CP_OriginCur,
+ CP_OriginEnd,
+ CP_OriginMax = 0X7FFFFFFF
+} CP_ORIGINTYPE;
+
+/** enumeration of contact access types used in the CP_PIPETYPE's Open function
+ * @ingroup cp
+ */
+typedef enum CP_ACCESSTYPE {
+ CP_AccessRead,
+ CP_AccessWrite,
+ CP_AccessReadWrite ,
+ CP_AccessMax = 0X7FFFFFFF
+} CP_ACCESSTYPE;
+
+/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
+ * @ingroup cp
+ */
+typedef enum CP_CHECKBYTESRESULTTYPE
+{
+ CP_CheckBytesOk, /**< There are at least the request number
+ of bytes available */
+ CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
+ and presently lacks sufficient bytes.
+ Client will be called when they are
+ sufficient bytes are available. */
+ CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
+ but those available are less than those
+ requested */
+ CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream
+ and no more bytes are available. */
+ CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */
+ CP_CheckBytesMax = 0X7FFFFFFF
+} CP_CHECKBYTESRESULTTYPE;
+
+/** enumeration of content pipe events sent to the client callback.
+ * @ingroup cp
+ */
+typedef enum CP_EVENTTYPE{
+ CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/
+ CP_Overflow, /** enumeration of content pipe events sent to the client callback*/
+ CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/
+ CP_EventMax = 0X7FFFFFFF
+} CP_EVENTTYPE;
+
+/** content pipe definition
+ * @ingroup cp
+ */
+typedef struct CP_PIPETYPE
+{
+ /** Open a content stream for reading or writing. */
+ CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
+
+ /** Close a content stream. */
+ CPresult (*Close)( CPhandle hContent );
+
+ /** Create a content source and open it for writing. */
+ CPresult (*Create)( CPhandle *hContent, CPstring szURI );
+
+ /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
+ CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
+
+ /** Seek to certain position in the content relative to the specified origin. */
+ CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
+
+ /** Retrieve the current position relative to the start of the content. */
+ CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
+
+ /** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
+ Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
+ CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
+
+ /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
+ Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
+ returns the size of the block actually read. Content pointer advances the by the returned size.
+ Note: pipe provides pointer. This function is appropriate for large reads. The client must call
+ ReleaseReadBuffer when done with buffer.
+
+ In some cases the requested block may not reside in contiguous memory within the
+ pipe implementation. For instance if the pipe leverages a circular buffer then the requested
+ block may straddle the boundary of the circular buffer. By default a pipe implementation
+ performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
+ If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
+ boundary. Here the client may retrieve the data in segments over successive calls. */
+ CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
+
+ /** Release a buffer obtained by ReadBuffer back to the pipe. */
+ CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
+
+ /** Write data of the specified size to the content (advance content pointer by size of data).
+ Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
+ CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
+
+ /** Retrieve a buffer allocated by the pipe used to write data to the content.
+ Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
+ for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
+ CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
+
+ /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
+ the contents of the buffer to content and advance content pointer by the size of the buffer */
+ CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
+
+ /** Register a per-handle client callback with the content pipe. */
+ CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
+
+} CP_PIPETYPE;
+
+#endif
+
diff --git a/make/stub_includes/openmax/OMX_Core.h b/make/stub_includes/openmax/OMX_Core.h
new file mode 100755
index 000000000..aecbf2b7f
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Core.h
@@ -0,0 +1,1390 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Core.h - OpenMax IL version 1.1.1
+ * The OMX_Core header file contains the definitions used by both the
+ * application and the component to access common items.
+ */
+
+#ifndef OMX_Core_h
+#define OMX_Core_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Index.h>
+
+
+/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
+ * OMX_SendCommand macro.
+ * @ingroup core
+ */
+typedef enum OMX_COMMANDTYPE
+{
+ OMX_CommandStateSet, /**< Change the component state */
+ OMX_CommandFlush, /**< Flush the data queue(s) of a component */
+ OMX_CommandPortDisable, /**< Disable a port on a component. */
+ OMX_CommandPortEnable, /**< Enable a port on a component. */
+ OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */
+ OMX_CommandMax = 0X7FFFFFFF
+} OMX_COMMANDTYPE;
+
+
+
+/** The OMX_STATETYPE enumeration is used to indicate or change the component
+ * state. This enumeration reflects the current state of the component when
+ * used with the OMX_GetState macro or becomes the parameter in a state change
+ * command when used with the OMX_SendCommand macro.
+ *
+ * The component will be in the Loaded state after the component is initially
+ * loaded into memory. In the Loaded state, the component is not allowed to
+ * allocate or hold resources other than to build it's internal parameter
+ * and configuration tables. The application will send one or more
+ * SetParameters/GetParameters and SetConfig/GetConfig commands to the
+ * component and the component will record each of these parameter and
+ * configuration changes for use later. When the application sends the
+ * Idle command, the component will acquire the resources needed for the
+ * specified configuration and will transition to the idle state if the
+ * allocation is successful. If the component cannot successfully
+ * transition to the idle state for any reason, the state of the component
+ * shall be fully rolled back to the Loaded state (e.g. all allocated
+ * resources shall be released). When the component receives the command
+ * to go to the Executing state, it shall begin processing buffers by
+ * sending all input buffers it holds to the application. While
+ * the component is in the Idle state, the application may also send the
+ * Pause command. If the component receives the pause command while in the
+ * Idle state, the component shall send all input buffers it holds to the
+ * application, but shall not begin processing buffers. This will allow the
+ * application to prefill buffers.
+ *
+ * @ingroup comp
+ */
+
+typedef enum OMX_STATETYPE
+{
+ OMX_StateInvalid, /**< component has detected that it's internal data
+ structures are corrupted to the point that
+ it cannot determine it's state properly */
+ OMX_StateLoaded, /**< component has been loaded but has not completed
+ initialization. The OMX_SetParameter macro
+ and the OMX_GetParameter macro are the only
+ valid macros allowed to be sent to the
+ component in this state. */
+ OMX_StateIdle, /**< component initialization has been completed
+ successfully and the component is ready to
+ to start. */
+ OMX_StateExecuting, /**< component has accepted the start command and
+ is processing data (if data is available) */
+ OMX_StatePause, /**< component has received pause command */
+ OMX_StateWaitForResources, /**< component is waiting for resources, either after
+ preemption or before it gets the resources requested.
+ See specification for complete details. */
+ OMX_StateMax = 0X7FFFFFFF
+} OMX_STATETYPE;
+
+/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These
+ * errors should cover most of the common failure cases. However,
+ * vendors are free to add additional error messages of their own as
+ * long as they follow these rules:
+ * 1. Vendor error messages shall be in the range of 0x90000000 to
+ * 0x9000FFFF.
+ * 2. Vendor error messages shall be defined in a header file provided
+ * with the component. No error messages are allowed that are
+ * not defined.
+ */
+typedef enum OMX_ERRORTYPE
+{
+ OMX_ErrorNone = 0,
+
+ /** There were insufficient resources to perform the requested operation */
+ OMX_ErrorInsufficientResources = 0x80001000,
+
+ /** There was an error, but the cause of the error could not be determined */
+ OMX_ErrorUndefined = 0x80001001,
+
+ /** The component name string was not valid */
+ OMX_ErrorInvalidComponentName = 0x80001002,
+
+ /** No component with the specified name string was found */
+ OMX_ErrorComponentNotFound = 0x80001003,
+
+ /** The component specified did not have a "OMX_ComponentInit" or
+ "OMX_ComponentDeInit entry point */
+ OMX_ErrorInvalidComponent = 0x80001004,
+
+ /** One or more parameters were not valid */
+ OMX_ErrorBadParameter = 0x80001005,
+
+ /** The requested function is not implemented */
+ OMX_ErrorNotImplemented = 0x80001006,
+
+ /** The buffer was emptied before the next buffer was ready */
+ OMX_ErrorUnderflow = 0x80001007,
+
+ /** The buffer was not available when it was needed */
+ OMX_ErrorOverflow = 0x80001008,
+
+ /** The hardware failed to respond as expected */
+ OMX_ErrorHardware = 0x80001009,
+
+ /** The component is in the state OMX_StateInvalid */
+ OMX_ErrorInvalidState = 0x8000100A,
+
+ /** Stream is found to be corrupt */
+ OMX_ErrorStreamCorrupt = 0x8000100B,
+
+ /** Ports being connected are not compatible */
+ OMX_ErrorPortsNotCompatible = 0x8000100C,
+
+ /** Resources allocated to an idle component have been
+ lost resulting in the component returning to the loaded state */
+ OMX_ErrorResourcesLost = 0x8000100D,
+
+ /** No more indicies can be enumerated */
+ OMX_ErrorNoMore = 0x8000100E,
+
+ /** The component detected a version mismatch */
+ OMX_ErrorVersionMismatch = 0x8000100F,
+
+ /** The component is not ready to return data at this time */
+ OMX_ErrorNotReady = 0x80001010,
+
+ /** There was a timeout that occurred */
+ OMX_ErrorTimeout = 0x80001011,
+
+ /** This error occurs when trying to transition into the state you are already in */
+ OMX_ErrorSameState = 0x80001012,
+
+ /** Resources allocated to an executing or paused component have been
+ preempted, causing the component to return to the idle state */
+ OMX_ErrorResourcesPreempted = 0x80001013,
+
+ /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
+ during the allocation of buffers (on a transition from the LOADED to the IDLE state or
+ on a port restart) when it deems that it has waited an unusually long time for the supplier
+ to send it an allocated buffer via a UseBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringAllocation = 0x80001014,
+
+ /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
+ during the deallocation of buffers (on a transition from the IDLE to LOADED state or
+ on a port stop) when it deems that it has waited an unusually long time for the supplier
+ to request the deallocation of a buffer header via a FreeBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringDeallocation = 0x80001015,
+
+ /** A supplier port sends this error to the IL client (via the EventHandler callback)
+ during the stopping of a port (either on a transition from the IDLE to LOADED
+ state or a port stop) when it deems that it has waited an unusually long time for
+ the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringStop = 0x80001016,
+
+ /** Attempting a state transtion that is not allowed */
+ OMX_ErrorIncorrectStateTransition = 0x80001017,
+
+ /* Attempting a command that is not allowed during the present state. */
+ OMX_ErrorIncorrectStateOperation = 0x80001018,
+
+ /** The values encapsulated in the parameter or config structure are not supported. */
+ OMX_ErrorUnsupportedSetting = 0x80001019,
+
+ /** The parameter or config indicated by the given index is not supported. */
+ OMX_ErrorUnsupportedIndex = 0x8000101A,
+
+ /** The port index supplied is incorrect. */
+ OMX_ErrorBadPortIndex = 0x8000101B,
+
+ /** The port has lost one or more of its buffers and it thus unpopulated. */
+ OMX_ErrorPortUnpopulated = 0x8000101C,
+
+ /** Component suspended due to temporary loss of resources */
+ OMX_ErrorComponentSuspended = 0x8000101D,
+
+ /** Component suspended due to an inability to acquire dynamic resources */
+ OMX_ErrorDynamicResourcesUnavailable = 0x8000101E,
+
+ /** When the macroblock error reporting is enabled the component returns new error
+ for every frame that has errors */
+ OMX_ErrorMbErrorsInFrame = 0x8000101F,
+
+ /** A component reports this error when it cannot parse or determine the format of an input stream. */
+ OMX_ErrorFormatNotDetected = 0x80001020,
+
+ /** The content open operation failed. */
+ OMX_ErrorContentPipeOpenFailed = 0x80001021,
+
+ /** The content creation operation failed. */
+ OMX_ErrorContentPipeCreationFailed = 0x80001022,
+
+ /** Separate table information is being used */
+ OMX_ErrorSeperateTablesUsed = 0x80001023,
+
+ /** Tunneling is unsupported by the component*/
+ OMX_ErrorTunnelingUnsupported = 0x80001024,
+
+ OMX_ErrorMax = 0x7FFFFFFF,
+} OMX_ERRORTYPE;
+
+/** @ingroup core */
+typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent);
+
+/** @ingroup core */
+typedef struct OMX_COMPONENTREGISTERTYPE
+{
+ const char * pName; /* Component name, 128 byte limit (including '\0') applies */
+ OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
+} OMX_COMPONENTREGISTERTYPE;
+
+/** @ingroup core */
+extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
+
+/** @ingroup rpm */
+typedef struct OMX_PRIORITYMGMTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nGroupPriority; /**< Priority of the component group */
+ OMX_U32 nGroupID; /**< ID of the component group */
+} OMX_PRIORITYMGMTTYPE;
+
+/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
+#define OMX_MAX_STRINGNAME_SIZE 128
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_COMPONENTROLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */
+} OMX_PARAM_COMPONENTROLETYPE;
+
+/** End of Stream Buffer Flag:
+ *
+ * A component sets EOS when it has no more data to emit on a particular
+ * output port. Thus an output port shall set EOS on the last buffer it
+ * emits. A component's determination of when an output port should
+ * cease sending data is implemenation specific.
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_EOS 0x00000001
+
+/** Start Time Buffer Flag:
+ *
+ * The source of a stream (e.g. a demux component) sets the STARTTIME
+ * flag on the buffer that contains the starting timestamp for the
+ * stream. The starting timestamp corresponds to the first data that
+ * should be displayed at startup or after a seek.
+ * The first timestamp of the stream is not necessarily the start time.
+ * For instance, in the case of a seek to a particular video frame,
+ * the target frame may be an interframe. Thus the first buffer of
+ * the stream will be the intra-frame preceding the target frame and
+ * the starttime will occur with the target frame (with any other
+ * required frames required to reconstruct the target intervening).
+ *
+ * The STARTTIME flag is directly associated with the buffer's
+ * timestamp ' thus its association to buffer data and its
+ * propagation is identical to the timestamp's.
+ *
+ * When a Sync Component client receives a buffer with the
+ * STARTTIME flag it shall perform a SetConfig on its sync port
+ * using OMX_ConfigTimeClientStartTime and passing the buffer's
+ * timestamp.
+ *
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_STARTTIME 0x00000002
+
+
+
+/** Decode Only Buffer Flag:
+ *
+ * The source of a stream (e.g. a demux component) sets the DECODEONLY
+ * flag on any buffer that should shall be decoded but should not be
+ * displayed. This flag is used, for instance, when a source seeks to
+ * a target interframe that requires the decode of frames preceding the
+ * target to facilitate the target's reconstruction. In this case the
+ * source would emit the frames preceding the target downstream
+ * but mark them as decode only.
+ *
+ * The DECODEONLY is associated with buffer data and propagated in a
+ * manner identical to the buffer timestamp.
+ *
+ * A component that renders data should ignore all buffers with
+ * the DECODEONLY flag set.
+ *
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
+
+
+/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
+
+/* End of Frame: The buffer contains exactly one end of frame and no data
+ * occurs after the end of frame. This flag is an optional hint. The absence
+ * of this flag does not imply the absence of an end of frame within the buffer.
+ * @ingroup buf
+*/
+#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
+
+/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
+ * a frame that has no dependency on any other frame information
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
+
+/* Extra data present flag: there is extra data appended to the data stream
+ * residing in the buffer
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
+
+/** @ingroup buf */
+typedef struct OMX_BUFFERHEADERTYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8* pBuffer; /**< Pointer to actual block of memory
+ that is acting as the buffer */
+ OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */
+ OMX_U32 nFilledLen; /**< number of bytes currently in the
+ buffer */
+ OMX_U32 nOffset; /**< start offset of valid data in bytes from
+ the start of the buffer */
+ OMX_PTR pAppPrivate; /**< pointer to any data the application
+ wants to associate with this buffer */
+ OMX_PTR pPlatformPrivate; /**< pointer to any data the platform
+ wants to associate with this buffer */
+ OMX_PTR pInputPortPrivate; /**< pointer to any data the input port
+ wants to associate with this buffer */
+ OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
+ wants to associate with this buffer */
+ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
+ mark event upon processing this buffer. */
+ OMX_PTR pMarkData; /**< Application specific data associated with
+ the mark sent on a mark event to disambiguate
+ this mark from others. */
+ OMX_U32 nTickCount; /**< Optional entry that the component and
+ application can update with a tick count
+ when they access the component. This
+ value should be in microseconds. Since
+ this is a value relative to an arbitrary
+ starting point, this value cannot be used
+ to determine absolute time. This is an
+ optional entry and not all components
+ will update it.*/
+ OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample
+ starting at the first logical sample
+ boundary in the buffer. Timestamps of
+ successive samples within the buffer may
+ be inferred by adding the duration of the
+ of the preceding buffer to the timestamp
+ of the preceding buffer.*/
+ OMX_U32 nFlags; /**< buffer specific flags */
+ OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using
+ this buffer */
+ OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using
+ this buffer */
+} OMX_BUFFERHEADERTYPE;
+
+/* Extra Data flags */
+
+/* Quant Data Flag: This flag is set when the extra data is appended to the buffer containing quantization information */
+#define OMX_EXTRADATAFLAG_QUANT 0x00000001
+
+typedef struct OMX_OTHER_EXTRADATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFlags; /* Extra Data flags */
+ OMX_U32 nDataSize; /* Size of the supporting data to follow */
+ OMX_U8 data[1]; /* Supporting data hint */
+} OMX_OTHER_EXTRADATATYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PORT_PARAM_TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPorts; /**< The number of ports for this component */
+ OMX_U32 nStartPortNumber; /** first port number for this type of port */
+} OMX_PORT_PARAM_TYPE;
+
+/** @ingroup comp */
+typedef enum OMX_EVENTTYPE
+{
+ OMX_EventCmdComplete, /**< component has sucessfully completed a command */
+ OMX_EventError, /**< component has detected an error condition */
+ OMX_EventMark, /**< component has detected a buffer mark */
+ OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
+ OMX_EventBufferFlag, /**< component has detected an EOS */
+ OMX_EventResourcesAcquired, /**< component has been granted resources and is
+ automatically starting the state change from
+ OMX_StateWaitForResources to OMX_StateIdle. */
+ OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */
+ OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
+ OMX_EventPortFormatDetected, /**< Component has detected a supported format. */
+ OMX_EventMax = 0x7FFFFFFF
+} OMX_EVENTTYPE;
+
+typedef struct OMX_CALLBACKTYPE
+{
+ /** The EventHandler method is used to notify the application when an
+ event of interest occurs. Events are defined in the OMX_EVENTTYPE
+ enumeration. Please see that enumeration for details of what will
+ be returned for each type of event. Callbacks should not return
+ an error to the component, so if an error occurs, the application
+ shall handle it internally. This is a blocking call.
+
+ The application should return from this call within 5 msec to avoid
+ blocking the component for an excessively long period of time.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param eEvent
+ Event that the component wants to notify the application about.
+ @param nData1
+ nData will be the OMX_ERRORTYPE for an error event and will be
+ an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
+ @param nData2
+ nData2 will hold further information related to the event. Can be OMX_STATETYPE for
+ a OMX_StateChange command or port index for a OMX_PortSettingsCHanged event.
+ Default value is 0 if not used. )
+ @param pEventData
+ Pointer to additional event-specific data (see spec for meaning).
+ */
+
+ OMX_ERRORTYPE (*EventHandler)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1,
+ OMX_IN OMX_U32 nData2,
+ OMX_IN OMX_PTR pEventData);
+
+ /** The EmptyBufferDone method is used to return emptied buffers from an
+ input port back to the application for reuse. This is a blocking call
+ so the application should not attempt to refill the buffers during this
+ call, but should queue them and refill them in another thread. There
+ is no error return, so the application shall handle any errors generated
+ internally.
+
+ The application should return from this call within 5 msec.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer indicating the buffer that was emptied.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*EmptyBufferDone)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** The FillBufferDone method is used to return filled buffers from an
+ output port back to the application for emptying and then reuse.
+ This is a blocking call so the application should not attempt to
+ empty the buffers during this call, but should queue the buffers
+ and empty them in another thread. There is no error return, so
+ the application shall handle any errors generated internally. The
+ application shall also update the buffer header to indicate the
+ number of bytes placed into the buffer.
+
+ The application should return from this call within 5 msec.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer indicating the buffer that was filled.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FillBufferDone)(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
+
+} OMX_CALLBACKTYPE;
+
+/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
+ preference when tunneling between two ports.
+ @ingroup tun buf
+*/
+typedef enum OMX_BUFFERSUPPLIERTYPE
+{
+ OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
+ or don't care */
+ OMX_BufferSupplyInput, /**< input port supplies the buffers */
+ OMX_BufferSupplyOutput, /**< output port supplies the buffers */
+ OMX_BufferSupplyMax = 0x7FFFFFFF
+} OMX_BUFFERSUPPLIERTYPE;
+
+
+/** buffer supplier parameter
+ * @ingroup tun
+ */
+typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
+} OMX_PARAM_BUFFERSUPPLIERTYPE;
+
+
+/**< indicates that buffers received by an input port of a tunnel
+ may not modify the data in the buffers
+ @ingroup tun
+ */
+#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
+
+
+/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
+ port to an input port as part the two ComponentTunnelRequest calls
+ resulting from a OMX_SetupTunnel call from the IL Client.
+ @ingroup tun
+ */
+typedef struct OMX_TUNNELSETUPTYPE
+{
+ OMX_U32 nTunnelFlags; /**< bit flags for tunneling */
+ OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
+} OMX_TUNNELSETUPTYPE;
+
+/* OMX Component headers is included to enable the core to use
+ macros for functions into the component for OMX release 1.0.
+ Developers should not access any structures or data from within
+ the component header directly */
+/* TO BE REMOVED - #include <OMX_Component.h> */
+
+/** GetComponentVersion will return information about the component.
+ This is a blocking call. This macro will go directly from the
+ application to the component (via a core macro). The
+ component will return from this call within 5 msec.
+ @param [in] hComponent
+ handle of component to execute the command
+ @param [out] pComponentName
+ pointer to an empty string of length 128 bytes. The component
+ will write its name into this string. The name will be
+ terminated by a single zero byte. The name of a component will
+ be 127 bytes or less to leave room for the trailing zero byte.
+ An example of a valid component name is "OMX.ABC.ChannelMixer\0".
+ @param [out] pComponentVersion
+ pointer to an OMX Version structure that the component will fill
+ in. The component will fill in a value that indicates the
+ component version. NOTE: the component version is NOT the same
+ as the OMX Specification version (found in all structures). The
+ component version is defined by the vendor of the component and
+ its value is entirely up to the component vendor.
+ @param [out] pSpecVersion
+ pointer to an OMX Version structure that the component will fill
+ in. The SpecVersion is the version of the specification that the
+ component was built against. Please note that this value may or
+ may not match the structure's version. For example, if the
+ component was built against the 2.0 specification, but the
+ application (which creates the structure is built against the
+ 1.0 specification the versions would be different.
+ @param [out] pComponentUUID
+ pointer to the UUID of the component which will be filled in by
+ the component. The UUID is a unique identifier that is set at
+ RUN time for the component and is unique to each instantion of
+ the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetComponentVersion( \
+ hComponent, \
+ pComponentName, \
+ pComponentVersion, \
+ pSpecVersion, \
+ pComponentUUID) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \
+ hComponent, \
+ pComponentName, \
+ pComponentVersion, \
+ pSpecVersion, \
+ pComponentUUID) /* Macro End */
+
+
+/** Send a command to the component. This call is a non-blocking call.
+ The component should check the parameters and then queue the command
+ to the component thread to be executed. The component thread shall
+ send the EventHandler() callback at the conclusion of the command.
+ This macro will go directly from the application to the component (via
+ a core macro). The component will return from this call within 5 msec.
+
+ When the command is "OMX_CommandStateSet" the component will queue a
+ state transition to the new state idenfied in nParam.
+
+ When the command is "OMX_CommandFlush", to flush a port's buffer queues,
+ the command will force the component to return all buffers NOT CURRENTLY
+ BEING PROCESSED to the application, in the order in which the buffers
+ were received.
+
+ When the command is "OMX_CommandPortDisable" or
+ "OMX_CommandPortEnable", the component's port (given by the value of
+ nParam) will be stopped or restarted.
+
+ When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
+ pCmdData will point to a OMX_MARKTYPE structure containing the component
+ handle of the component to examine the buffer chain for the mark. nParam1
+ contains the index of the port on which the buffer mark is applied.
+
+ Specification text for more details.
+
+ @param [in] hComponent
+ handle of component to execute the command
+ @param [in] Cmd
+ Command for the component to execute
+ @param [in] nParam
+ Parameter for the command to be executed. When Cmd has the value
+ OMX_SetStateCmd, value is a member of OMX_StateType. When Cmd has
+ the value OMX_FlushCmd, value of nParam indicates which port(s)
+ to flush. -1 is used to flush all ports a single port index will
+ only flush that port. When Cmd has the value "OMX_CommandPortDisable"
+ or "OMX_CommandPortEnable", the component's port is given by
+ the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer"
+ the components pot is given by the value of nParam.
+ @param [in] pCmdData
+ Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
+ "OMX_CommandMarkBuffer".
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SendCommand( \
+ hComponent, \
+ Cmd, \
+ nParam, \
+ pCmdData) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \
+ hComponent, \
+ Cmd, \
+ nParam, \
+ pCmdData) /* Macro End */
+
+
+/** The OMX_GetParameter macro will get one of the current parameter
+ settings from the component. This macro cannot only be invoked when
+ the component is in the OMX_IndalidState state. The nParamIndex
+ parameter is used to indicate which structure is being requested from
+ the component. The application shall allocate the correct structure
+ and shall fill in the structure size and version information before
+ invoking this macro. When the parameter applies to a port, the
+ caller shall fill in the appropriate nPortIndex value indicating the
+ port on which the parameter applies. If the component has not had
+ any settings changed, then the component should return a set of
+ valid DEFAULT parameters for the component. This is a blocking
+ call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nParamIndex
+ Index of the structure to be filled. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in,out] pComponentParameterStructure
+ Pointer to application allocated structure to be filled by the
+ component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) /* Macro End */
+
+
+/** The OMX_SetParameter macro will send an initialization parameter
+ structure to a component. Each structure shall be sent one at a time,
+ in a separate invocation of the macro. This macro can only be
+ invoked when the component is in the OMX_LoadedState state, or the
+ port is disabled (when the parameter applies to a port). The
+ nParamIndex parameter is used to indicate which structure is being
+ passed to the component. The application shall allocate the
+ correct structure and shall fill in the structure size and version
+ information (as well as the actual data) before invoking this macro.
+ The application is free to dispose of this structure after the call
+ as the component is required to copy any data it shall retain. This
+ is a blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nIndex
+ Index of the structure to be sent. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in] pComponentParameterStructure
+ pointer to application allocated structure to be used for
+ initialization by the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) /* Macro End */
+
+
+/** The OMX_GetConfig macro will get one of the configuration structures
+ from a component. This macro can be invoked anytime after the
+ component has been loaded. The nParamIndex call parameter is used to
+ indicate which structure is being requested from the component. The
+ application shall allocate the correct structure and shall fill in the
+ structure size and version information before invoking this macro.
+ If the component has not had this configuration parameter sent before,
+ then the component should return a set of valid DEFAULT values for the
+ component. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nIndex
+ Index of the structure to be filled. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in,out] pComponentConfigStructure
+ pointer to application allocated structure to be filled by the
+ component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+*/
+#define OMX_GetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) /* Macro End */
+
+
+/** The OMX_SetConfig macro will send one of the configuration
+ structures to a component. Each structure shall be sent one at a time,
+ each in a separate invocation of the macro. This macro can be invoked
+ anytime after the component has been loaded. The application shall
+ allocate the correct structure and shall fill in the structure size
+ and version information (as well as the actual data) before invoking
+ this macro. The application is free to dispose of this structure after
+ the call as the component is required to copy any data it shall retain.
+ This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nConfigIndex
+ Index of the structure to be sent. This value is from the
+ OMX_INDEXTYPE enumeration above.
+ @param [in] pComponentConfigStructure
+ pointer to application allocated structure to be used for
+ initialization by the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) /* Macro End */
+
+
+/** The OMX_GetExtensionIndex macro will invoke a component to translate
+ a vendor specific configuration or parameter string into an OMX
+ structure index. There is no requirement for the vendor to support
+ this command for the indexes already found in the OMX_INDEXTYPE
+ enumeration (this is done to save space in small components). The
+ component shall support all vendor supplied extension indexes not found
+ in the master OMX_INDEXTYPE enumeration. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @param [in] cParameterName
+ OMX_STRING that shall be less than 128 characters long including
+ the trailing null byte. This is the string that will get
+ translated by the component into a configuration index.
+ @param [out] pIndexType
+ a pointer to a OMX_INDEXTYPE to receive the index value.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetExtensionIndex( \
+ hComponent, \
+ cParameterName, \
+ pIndexType) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \
+ hComponent, \
+ cParameterName, \
+ pIndexType) /* Macro End */
+
+
+/** The OMX_GetState macro will invoke the component to get the current
+ state of the component and place the state value into the location
+ pointed to by pState.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] pState
+ pointer to the location to receive the state. The value returned
+ is one of the OMX_STATETYPE members
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetState( \
+ hComponent, \
+ pState) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetState( \
+ hComponent, \
+ pState) /* Macro End */
+
+
+/** The OMX_UseBuffer macro will request that the component use
+ a buffer (and allocate its own buffer header) already allocated
+ by another component, or by the IL Client. This is a blocking
+ call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
+ pointer to the buffer header
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+
+#define OMX_UseBuffer( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes, \
+ pBuffer)
+
+
+/** The OMX_AllocateBuffer macro will request that the component allocate
+ a new buffer and buffer header. The component will allocate the
+ buffer and the buffer header and return a pointer to the buffer
+ header. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive
+ the pointer to the buffer header
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with. The port can be found by using the nPortIndex
+ value as an index into the Port Definition array of the component.
+ @param [in] pAppPrivate
+ pAppPrivate is used to initialize the pAppPrivate member of the
+ buffer header structure.
+ @param [in] nSizeBytes
+ size of the buffer to allocate. Used when bAllocateNew is true.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_AllocateBuffer( \
+ hComponent, \
+ ppBuffer, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes) \
+ ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \
+ hComponent, \
+ ppBuffer, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes) /* Macro End */
+
+
+/** The OMX_FreeBuffer macro will release a buffer header from the component
+ which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
+ the component allocated the buffer (see the OMX_UseBuffer macro) then
+ the component shall free the buffer and buffer header. This is a
+ blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_FreeBuffer( \
+ hComponent, \
+ nPortIndex, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \
+ hComponent, \
+ nPortIndex, \
+ pBuffer) /* Macro End */
+
+
+/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
+ input port of a component. The buffer will be emptied by the component
+ and returned to the application via the EmptyBufferDone call back.
+ This is a non-blocking call in that the component will record the buffer
+ and return immediately and then empty the buffer, later, at the proper
+ time. As expected, this macro may be invoked only while the component
+ is in the OMX_ExecutingState. If nPortIndex does not specify an input
+ port, the component shall return an error.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_EmptyThisBuffer( \
+ hComponent, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \
+ hComponent, \
+ pBuffer) /* Macro End */
+
+
+/** The OMX_FillThisBuffer macro will send an empty buffer to an
+ output port of a component. The buffer will be filled by the component
+ and returned to the application via the FillBufferDone call back.
+ This is a non-blocking call in that the component will record the buffer
+ and return immediately and then fill the buffer, later, at the proper
+ time. As expected, this macro may be invoked only while the component
+ is in the OMX_ExecutingState. If nPortIndex does not specify an output
+ port, the component shall return an error.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_FillThisBuffer( \
+ hComponent, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \
+ hComponent, \
+ pBuffer) /* Macro End */
+
+
+
+/** The OMX_UseEGLImage macro will request that the component use
+ a EGLImage provided by EGL (and allocate its own buffer header)
+ This is a blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
+ pointer to the buffer header. Note that the memory location used
+ for this buffer is NOT visible to the IL Client.
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with. The port can be found by using the nPortIndex
+ value as an index into the Port Definition array of the component.
+ @param [in] pAppPrivate
+ pAppPrivate is used to initialize the pAppPrivate member of the
+ buffer header structure.
+ @param [in] eglImage
+ eglImage contains the handle of the EGLImage to use as a buffer on the
+ specified port. The component is expected to validate properties of
+ the EGLImage against the configuration of the port to ensure the component
+ can use the EGLImage as a buffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_UseEGLImage( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ eglImage) \
+ ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ eglImage)
+
+/** The OMX_Init method is used to initialize the OMX core. It shall be the
+ first call made into OMX and it should only be executed one time without
+ an interviening OMX_Deinit call.
+
+ The core should return from this call within 20 msec.
+
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
+
+
+/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be
+ the last call made into OMX. In the event that the core determines that
+ thare are components loaded when this call is made, the core may return
+ with an error rather than try to unload the components.
+
+ The core should return from this call within 20 msec.
+
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
+
+
+/** The OMX_ComponentNameEnum method will enumerate through all the names of
+ recognised valid components in the system. This function is provided
+ as a means to detect all the components in the system run-time. There is
+ no strict ordering to the enumeration order of component names, although
+ each name will only be enumerated once. If the OMX core supports run-time
+ installation of new components, it is only requried to detect newly
+ installed components when the first call to enumerate component names
+ is made (i.e. when nIndex is 0x0).
+
+ The core should return from this call in 20 msec.
+
+ @param [out] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] nNameLength
+ number of characters in the cComponentName string. With all
+ component name strings restricted to less than 128 characters
+ (including the trailing null) it is recomended that the caller
+ provide a input string for the cComponentName of 128 characters.
+ @param [in] nIndex
+ number containing the enumeration index for the component.
+ Multiple calls to OMX_ComponentNameEnum with increasing values
+ of nIndex will enumerate through the component names in the
+ system until OMX_ErrorNoMore is returned. The value of nIndex
+ is 0 to (N-1), where N is the number of valid installed components
+ in the system.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. When the value of nIndex exceeds the number of
+ components in the system minus 1, OMX_ErrorNoMore will be
+ returned. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex);
+
+
+/** The OMX_GetHandle method will locate the component specified by the
+ component name given, load that component into memory and then invoke
+ the component's methods to create an instance of the component.
+
+ The core should return from this call within 20 msec.
+
+ @param [out] pHandle
+ pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
+ @param [in] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] pAppData
+ pointer to an application defined value that will be returned
+ during callbacks so that the application can identify the source
+ of the callback.
+ @param [in] pCallBacks
+ pointer to a OMX_CALLBACKTYPE structure that will be passed to the
+ component to initialize it with.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+
+
+/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
+ method. If the component reference count goes to zero, the component will
+ be unloaded from memory.
+
+ The core should return from this call within 20 msec when the component is
+ in the OMX_StateLoaded state.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
+ OMX_IN OMX_HANDLETYPE hComponent);
+
+
+
+/** The OMX_SetupTunnel method will handle the necessary calls to the components
+ to setup the specified tunnel the two components. NOTE: This is
+ an actual method (not a #define macro). This method will make calls into
+ the component ComponentTunnelRequest method to do the actual tunnel
+ connection.
+
+ The ComponentTunnelRequest method on both components will be called.
+ This method shall not be called unless the component is in the
+ OMX_StateLoaded state except when the ports used for the tunnel are
+ disabled. In this case, the component may be in the OMX_StateExecuting,
+ OMX_StatePause, or OMX_StateIdle states.
+
+ The core should return from this call within 20 msec.
+
+ @param [in] hOutput
+ Handle of the component to be accessed. Also this is the handle
+ of the component whose port, specified in the nPortOutput parameter
+ will be used the source for the tunnel. This is the component handle
+ returned by the call to the OMX_GetHandle function. There is a
+ requirement that hOutput be the source for the data when
+ tunelling (i.e. nPortOutput is an output port). If 0x0, the component
+ specified in hInput will have it's port specified in nPortInput
+ setup for communication with the application / IL client.
+ @param [in] nPortOutput
+ nPortOutput is used to select the source port on component to be
+ used in the tunnel.
+ @param [in] hInput
+ This is the component to setup the tunnel with. This is the handle
+ of the component whose port, specified in the nPortInput parameter
+ will be used the destination for the tunnel. This is the component handle
+ returned by the call to the OMX_GetHandle function. There is a
+ requirement that hInput be the destination for the data when
+ tunelling (i.e. nPortInut is an input port). If 0x0, the component
+ specified in hOutput will have it's port specified in nPortPOutput
+ setup for communication with the application / IL client.
+ @param [in] nPortInput
+ nPortInput is used to select the destination port on component to be
+ used in the tunnel.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_NoError. Otherwise the appropriate OMX error will be returned.
+ When OMX_ErrorNotImplemented is returned, one or both components is
+ a non-interop component and does not support tunneling.
+
+ On failure, the ports of both components are setup for communication
+ with the application / IL Client.
+ @ingroup core tun
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
+ OMX_IN OMX_HANDLETYPE hOutput,
+ OMX_IN OMX_U32 nPortOutput,
+ OMX_IN OMX_HANDLETYPE hInput,
+ OMX_IN OMX_U32 nPortInput);
+
+/** @ingroup cp */
+OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
+ OMX_OUT OMX_HANDLETYPE *hPipe,
+ OMX_IN OMX_STRING szURI);
+
+/** The OMX_GetComponentsOfRole method will return the number of components that support the given
+ role and (if the compNames field is non-NULL) the names of those components. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the compNames field NULL to determine the number of component names
+ * second call this function with the compNames field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ The core should return from this call within 5 msec.
+
+ @param [in] role
+ This is generic standard component name consisting only of component class
+ name and the type within that class (e.g. 'audio_decoder.aac').
+ @param [inout] pNumComps
+ This is used both as input and output.
+
+ If compNames is NULL, the input is ignored and the output specifies how many components support
+ the given role.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of components string names listed within the compNames parameter.
+ @param [inout] compNames
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
+ a list of the names of all physical components that implement the specified standard component name.
+ Each name is NULL terminated. numComps indicates the number of names.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames);
+
+/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
+ component and (if the roles field is non-NULL) the names of those roles. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the roles field NULL to determine the number of role names
+ * second call this function with the roles field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ The core should return from this call within 5 msec.
+
+ @param [in] compName
+ This is the name of the component being queried about.
+ @param [inout] pNumRoles
+ This is used both as input and output.
+
+ If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of roles string names listed within the roles parameter.
+ @param [out] roles
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
+ which accepts a list of the names of all standard components roles implemented on the
+ specified component name. numComps indicates the number of names.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
diff --git a/make/stub_includes/openmax/OMX_IVCommon.h b/make/stub_includes/openmax/OMX_IVCommon.h
new file mode 100755
index 000000000..17ccdee1f
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_IVCommon.h
@@ -0,0 +1,896 @@
+/**
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * @file OMX_IVCommon.h - OpenMax IL version 1.1.1
+ * The structures needed by Video and Image components to exchange
+ * parameters and configuration data with the components.
+ */
+#ifndef OMX_IVCommon_h
+#define OMX_IVCommon_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * Each OMX header must include all required header files to allow the header
+ * to compile without errors. The includes below are required for this header
+ * file to compile successfully
+ */
+
+#include <OMX_Core.h>
+
+/** @defgroup iv OpenMAX IL Imaging and Video Domain
+ * Common structures for OpenMAX IL Imaging and Video domains
+ * @{
+ */
+
+
+/**
+ * Enumeration defining possible uncompressed image/video formats.
+ *
+ * ENUMS:
+ * Unused : Placeholder value when format is N/A
+ * Monochrome : black and white
+ * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0
+ * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0
+ * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0
+ * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0
+ * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0
+ * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0
+ * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0
+ * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0
+ * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0
+ * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0
+ * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0
+ * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0
+ * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0
+ * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0
+ * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0
+ * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally
+ * YUV411PackedPlanar : packed per payload in planar slices
+ * YUV420Planar : Three arrays Y,U,V.
+ * YUV420PackedPlanar : packed per payload in planar slices
+ * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V
+ * YUV422Planar : Three arrays Y,U,V.
+ * YUV422PackedPlanar : packed per payload in planar slices
+ * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V
+ * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr)
+ * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb)
+ * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY)
+ * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY)
+ * YUV444Interleaved : Each pixel contains equal parts YUV
+ * RawBayer8bit : SMIA camera output format
+ * RawBayer10bit : SMIA camera output format
+ * RawBayer8bitcompressed : SMIA camera output format
+ */
+typedef enum OMX_COLOR_FORMATTYPE {
+ OMX_COLOR_FormatUnused,
+ OMX_COLOR_FormatMonochrome,
+ OMX_COLOR_Format8bitRGB332,
+ OMX_COLOR_Format12bitRGB444,
+ OMX_COLOR_Format16bitARGB4444,
+ OMX_COLOR_Format16bitARGB1555,
+ OMX_COLOR_Format16bitRGB565,
+ OMX_COLOR_Format16bitBGR565,
+ OMX_COLOR_Format18bitRGB666,
+ OMX_COLOR_Format18bitARGB1665,
+ OMX_COLOR_Format19bitARGB1666,
+ OMX_COLOR_Format24bitRGB888,
+ OMX_COLOR_Format24bitBGR888,
+ OMX_COLOR_Format24bitARGB1887,
+ OMX_COLOR_Format25bitARGB1888,
+ OMX_COLOR_Format32bitBGRA8888,
+ OMX_COLOR_Format32bitARGB8888,
+ OMX_COLOR_FormatYUV411Planar,
+ OMX_COLOR_FormatYUV411PackedPlanar,
+ OMX_COLOR_FormatYUV420Planar,
+ OMX_COLOR_FormatYUV420PackedPlanar,
+ OMX_COLOR_FormatYUV420SemiPlanar,
+ OMX_COLOR_FormatYUV422Planar,
+ OMX_COLOR_FormatYUV422PackedPlanar,
+ OMX_COLOR_FormatYUV422SemiPlanar,
+ OMX_COLOR_FormatYCbYCr,
+ OMX_COLOR_FormatYCrYCb,
+ OMX_COLOR_FormatCbYCrY,
+ OMX_COLOR_FormatCrYCbY,
+ OMX_COLOR_FormatYUV444Interleaved,
+ OMX_COLOR_FormatRawBayer8bit,
+ OMX_COLOR_FormatRawBayer10bit,
+ OMX_COLOR_FormatRawBayer8bitcompressed,
+ OMX_COLOR_FormatL2,
+ OMX_COLOR_FormatL4,
+ OMX_COLOR_FormatL8,
+ OMX_COLOR_FormatL16,
+ OMX_COLOR_FormatL24,
+ OMX_COLOR_FormatL32,
+ OMX_COLOR_FormatYUV420PackedSemiPlanar,
+ OMX_COLOR_FormatYUV422PackedSemiPlanar,
+ OMX_COLOR_Format18BitBGR666,
+ OMX_COLOR_Format24BitARGB6666,
+ OMX_COLOR_Format24BitABGR6666,
+ OMX_COLOR_FormatMax = 0x7FFFFFFF
+} OMX_COLOR_FORMATTYPE;
+
+
+/**
+ * Defines the matrix for conversion from RGB to YUV or vice versa.
+ * iColorMatrix should be initialized with the fixed point values
+ * used in converting between formats.
+ */
+typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+ OMX_U32 nPortIndex; /**< Port that this struct applies to */
+ OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */
+ OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */
+}OMX_CONFIG_COLORCONVERSIONTYPE;
+
+
+/**
+ * Structure defining percent to scale each frame dimension. For example:
+ * To make the width 50% larger, use fWidth = 1.5 and to make the width
+ * 1/2 the original size, use fWidth = 0.5
+ */
+typedef struct OMX_CONFIG_SCALEFACTORTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+ OMX_U32 nPortIndex; /**< Port that this struct applies to */
+ OMX_S32 xWidth; /**< Fixed point value stored as Q16 */
+ OMX_S32 xHeight; /**< Fixed point value stored as Q16 */
+}OMX_CONFIG_SCALEFACTORTYPE;
+
+
+/**
+ * Enumeration of possible image filter types
+ */
+typedef enum OMX_IMAGEFILTERTYPE {
+ OMX_ImageFilterNone,
+ OMX_ImageFilterNoise,
+ OMX_ImageFilterEmboss,
+ OMX_ImageFilterNegative,
+ OMX_ImageFilterSketch,
+ OMX_ImageFilterOilPaint,
+ OMX_ImageFilterHatch,
+ OMX_ImageFilterGpen,
+ OMX_ImageFilterAntialias,
+ OMX_ImageFilterDeRing,
+ OMX_ImageFilterSolarize,
+ OMX_ImageFilterMax = 0x7FFFFFFF
+} OMX_IMAGEFILTERTYPE;
+
+
+/**
+ * Image filter configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eImageFilter : Image filter type enumeration
+ */
+typedef struct OMX_CONFIG_IMAGEFILTERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGEFILTERTYPE eImageFilter;
+} OMX_CONFIG_IMAGEFILTERTYPE;
+
+
+/**
+ * Customized U and V for color enhancement
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bColorEnhancement : Enable/disable color enhancement
+ * nCustomizedU : Practical values: 16-240, range: 0-255, value set for
+ * U component
+ * nCustomizedV : Practical values: 16-240, range: 0-255, value set for
+ * V component
+ */
+typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bColorEnhancement;
+ OMX_U8 nCustomizedU;
+ OMX_U8 nCustomizedV;
+} OMX_CONFIG_COLORENHANCEMENTTYPE;
+
+
+/**
+ * Define color key and color key mask
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nARGBColor : 32bit Alpha, Red, Green, Blue Color
+ * nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels
+ */
+typedef struct OMX_CONFIG_COLORKEYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nARGBColor;
+ OMX_U32 nARGBMask;
+} OMX_CONFIG_COLORKEYTYPE;
+
+
+/**
+ * List of color blend types for pre/post processing
+ *
+ * ENUMS:
+ * None : No color blending present
+ * AlphaConstant : Function is (alpha_constant * src) +
+ * (1 - alpha_constant) * dst)
+ * AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)
+ * Alternate : Function is alternating pixels from src and dst
+ * And : Function is (src & dst)
+ * Or : Function is (src | dst)
+ * Invert : Function is ~src
+ */
+typedef enum OMX_COLORBLENDTYPE {
+ OMX_ColorBlendNone,
+ OMX_ColorBlendAlphaConstant,
+ OMX_ColorBlendAlphaPerPixel,
+ OMX_ColorBlendAlternate,
+ OMX_ColorBlendAnd,
+ OMX_ColorBlendOr,
+ OMX_ColorBlendInvert,
+ OMX_ColorBlendMax = 0x7FFFFFFF
+} OMX_COLORBLENDTYPE;
+
+
+/**
+ * Color blend configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRGBAlphaConstant : Constant global alpha values when global alpha is used
+ * eColorBlend : Color blend type enumeration
+ */
+typedef struct OMX_CONFIG_COLORBLENDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nRGBAlphaConstant;
+ OMX_COLORBLENDTYPE eColorBlend;
+} OMX_CONFIG_COLORBLENDTYPE;
+
+
+/**
+ * Hold frame dimension
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nWidth : Frame width in pixels
+ * nHeight : Frame height in pixels
+ */
+typedef struct OMX_FRAMESIZETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_FRAMESIZETYPE;
+
+
+/**
+ * Rotation configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRotation : +/- integer rotation value
+ */
+typedef struct OMX_CONFIG_ROTATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nRotation;
+} OMX_CONFIG_ROTATIONTYPE;
+
+
+/**
+ * Possible mirroring directions for pre/post processing
+ *
+ * ENUMS:
+ * None : No mirroring
+ * Vertical : Vertical mirroring, flip on X axis
+ * Horizontal : Horizontal mirroring, flip on Y axis
+ * Both : Both vertical and horizontal mirroring
+ */
+typedef enum OMX_MIRRORTYPE {
+ OMX_MirrorNone = 0,
+ OMX_MirrorVertical,
+ OMX_MirrorHorizontal,
+ OMX_MirrorBoth,
+ OMX_MirrorMax = 0x7FFFFFFF
+} OMX_MIRRORTYPE;
+
+
+/**
+ * Mirroring configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eMirror : Mirror type enumeration
+ */
+typedef struct OMX_CONFIG_MIRRORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_MIRRORTYPE eMirror;
+} OMX_CONFIG_MIRRORTYPE;
+
+
+/**
+ * Position information only
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nX : X coordinate for the point
+ * nY : Y coordinate for the point
+ */
+typedef struct OMX_CONFIG_POINTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nX;
+ OMX_S32 nY;
+} OMX_CONFIG_POINTTYPE;
+
+
+/**
+ * Frame size plus position
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLeft : X Coordinate of the top left corner of the rectangle
+ * nTop : Y Coordinate of the top left corner of the rectangle
+ * nWidth : Width of the rectangle
+ * nHeight : Height of the rectangle
+ */
+typedef struct OMX_CONFIG_RECTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_CONFIG_RECTTYPE;
+
+
+/**
+ * Deblocking state; it is required to be set up before starting the codec
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bDeblocking : Enable/disable deblocking mode
+ */
+typedef struct OMX_PARAM_DEBLOCKINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bDeblocking;
+} OMX_PARAM_DEBLOCKINGTYPE;
+
+
+/**
+ * Stabilization state
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bStab : Enable/disable frame stabilization state
+ */
+typedef struct OMX_CONFIG_FRAMESTABTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bStab;
+} OMX_CONFIG_FRAMESTABTYPE;
+
+
+/**
+ * White Balance control type
+ *
+ * STRUCT MEMBERS:
+ * SunLight : Referenced in JSR-234
+ * Flash : Optimal for device's integrated flash
+ */
+typedef enum OMX_WHITEBALCONTROLTYPE {
+ OMX_WhiteBalControlOff = 0,
+ OMX_WhiteBalControlAuto,
+ OMX_WhiteBalControlSunLight,
+ OMX_WhiteBalControlCloudy,
+ OMX_WhiteBalControlShade,
+ OMX_WhiteBalControlTungsten,
+ OMX_WhiteBalControlFluorescent,
+ OMX_WhiteBalControlIncandescent,
+ OMX_WhiteBalControlFlash,
+ OMX_WhiteBalControlHorizon,
+ OMX_WhiteBalControlMax = 0x7FFFFFFF
+} OMX_WHITEBALCONTROLTYPE;
+
+
+/**
+ * White Balance control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eWhiteBalControl : White balance enumeration
+ */
+typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_WHITEBALCONTROLTYPE eWhiteBalControl;
+} OMX_CONFIG_WHITEBALCONTROLTYPE;
+
+
+/**
+ * Exposure control type
+ */
+typedef enum OMX_EXPOSURECONTROLTYPE {
+ OMX_ExposureControlOff = 0,
+ OMX_ExposureControlAuto,
+ OMX_ExposureControlNight,
+ OMX_ExposureControlBackLight,
+ OMX_ExposureControlSpotLight,
+ OMX_ExposureControlSports,
+ OMX_ExposureControlSnow,
+ OMX_ExposureControlBeach,
+ OMX_ExposureControlLargeAperture,
+ OMX_ExposureControlSmallApperture,
+ OMX_ExposureControlMax = 0x7FFFFFFF
+} OMX_EXPOSURECONTROLTYPE;
+
+
+/**
+ * White Balance control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eExposureControl : Exposure control enumeration
+ */
+typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_EXPOSURECONTROLTYPE eExposureControl;
+} OMX_CONFIG_EXPOSURECONTROLTYPE;
+
+
+/**
+ * Defines sensor supported mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nFrameRate : Single shot mode is indicated by a 0
+ * bOneShot : Enable for single shot, disable for streaming
+ * sFrameSize : Framesize
+ */
+typedef struct OMX_PARAM_SENSORMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameRate;
+ OMX_BOOL bOneShot;
+ OMX_FRAMESIZETYPE sFrameSize;
+} OMX_PARAM_SENSORMODETYPE;
+
+
+/**
+ * Defines contrast level
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nContrast : Values allowed for contrast -100 to 100, zero means no change
+ */
+typedef struct OMX_CONFIG_CONTRASTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nContrast;
+} OMX_CONFIG_CONTRASTTYPE;
+
+
+/**
+ * Defines brightness level
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBrightness : 0-100%
+ */
+typedef struct OMX_CONFIG_BRIGHTNESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBrightness;
+} OMX_CONFIG_BRIGHTNESSTYPE;
+
+
+/**
+ * Defines backlight level configuration for a video sink, e.g. LCD panel
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBacklight : Values allowed for backlight 0-100%
+ * nTimeout : Number of milliseconds before backlight automatically turns
+ * off. A value of 0x0 disables backight timeout
+ */
+typedef struct OMX_CONFIG_BACKLIGHTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBacklight;
+ OMX_U32 nTimeout;
+} OMX_CONFIG_BACKLIGHTTYPE;
+
+
+/**
+ * Defines setting for Gamma
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nGamma : Values allowed for gamma -100 to 100, zero means no change
+ */
+typedef struct OMX_CONFIG_GAMMATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nGamma;
+} OMX_CONFIG_GAMMATYPE;
+
+
+/**
+ * Define for setting saturation
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSaturation : Values allowed for saturation -100 to 100, zero means
+ * no change
+ */
+typedef struct OMX_CONFIG_SATURATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nSaturation;
+} OMX_CONFIG_SATURATIONTYPE;
+
+
+/**
+ * Define for setting Lightness
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLightness : Values allowed for lightness -100 to 100, zero means no
+ * change
+ */
+typedef struct OMX_CONFIG_LIGHTNESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLightness;
+} OMX_CONFIG_LIGHTNESSTYPE;
+
+
+/**
+ * Plane blend configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Index of input port associated with the plane.
+ * nDepth : Depth of the plane in relation to the screen. Higher
+ * numbered depths are "behind" lower number depths.
+ * This number defaults to the Port Index number.
+ * nAlpha : Transparency blending component for the entire plane.
+ * See blending modes for more detail.
+ */
+typedef struct OMX_CONFIG_PLANEBLENDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDepth;
+ OMX_U32 nAlpha;
+} OMX_CONFIG_PLANEBLENDTYPE;
+
+
+/**
+ * Define interlace type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnable : Enable control variable for this functionality
+ * (see below)
+ * nInterleavePortIndex : Index of input or output port associated with
+ * the interleaved plane.
+ * pPlanarPortIndexes[4] : Index of input or output planar ports.
+ */
+typedef struct OMX_PARAM_INTERLEAVETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_U32 nInterleavePortIndex;
+} OMX_PARAM_INTERLEAVETYPE;
+
+
+/**
+ * Defines the picture effect used for an input picture
+ */
+typedef enum OMX_TRANSITIONEFFECTTYPE {
+ OMX_EffectNone,
+ OMX_EffectFadeFromBlack,
+ OMX_EffectFadeToBlack,
+ OMX_EffectUnspecifiedThroughConstantColor,
+ OMX_EffectDissolve,
+ OMX_EffectWipe,
+ OMX_EffectUnspecifiedMixOfTwoScenes,
+ OMX_EffectMax = 0x7FFFFFFF
+} OMX_TRANSITIONEFFECTTYPE;
+
+
+/**
+ * Structure used to configure current transition effect
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eEffect : Effect to enable
+ */
+typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TRANSITIONEFFECTTYPE eEffect;
+} OMX_CONFIG_TRANSITIONEFFECTTYPE;
+
+
+/**
+ * Defines possible data unit types for encoded video data. The data unit
+ * types are used both for encoded video input for playback as well as
+ * encoded video output from recording.
+ */
+typedef enum OMX_DATAUNITTYPE {
+ OMX_DataUnitCodedPicture,
+ OMX_DataUnitVideoSegment,
+ OMX_DataUnitSeveralSegments,
+ OMX_DataUnitArbitraryStreamSection,
+ OMX_DataUnitMax = 0x7FFFFFFF
+} OMX_DATAUNITTYPE;
+
+
+/**
+ * Defines possible encapsulation types for coded video data unit. The
+ * encapsulation information is used both for encoded video input for
+ * playback as well as encoded video output from recording.
+ */
+typedef enum OMX_DATAUNITENCAPSULATIONTYPE {
+ OMX_DataEncapsulationElementaryStream,
+ OMX_DataEncapsulationGenericPayload,
+ OMX_DataEncapsulationRtpPayload,
+ OMX_DataEncapsulationMax = 0x7FFFFFFF
+} OMX_DATAUNITENCAPSULATIONTYPE;
+
+
+/**
+ * Structure used to configure the type of being decoded/encoded
+ */
+typedef struct OMX_PARAM_DATAUNITTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_DATAUNITTYPE eUnitType;
+ OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;
+} OMX_PARAM_DATAUNITTYPE;
+
+
+/**
+ * Defines dither types
+ */
+typedef enum OMX_DITHERTYPE {
+ OMX_DitherNone,
+ OMX_DitherOrdered,
+ OMX_DitherErrorDiffusion,
+ OMX_DitherOther,
+ OMX_DitherMax = 0x7FFFFFFF
+} OMX_DITHERTYPE;
+
+
+/**
+ * Structure used to configure current type of dithering
+ */
+typedef struct OMX_CONFIG_DITHERTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_DITHERTYPE eDither; /**< Type of dithering to use */
+} OMX_CONFIG_DITHERTYPE;
+
+typedef struct OMX_CONFIG_CAPTUREMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture
+ * data as fast as possible (otherwise obey port's frame rate). */
+ OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the
+ * specified number of frames (otherwise the port does not
+ * terminate the capture until instructed to do so by the client).
+ * Even if set, the client may manually terminate the capture prior
+ * to reaching the limit. */
+ OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only
+ * valid if bFrameLimited is set). */
+} OMX_CONFIG_CAPTUREMODETYPE;
+
+typedef enum OMX_METERINGTYPE {
+
+ OMX_MeteringModeAverage, /**< Center-weighted average metering. */
+ OMX_MeteringModeSpot, /**< Spot (partial) metering. */
+ OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */
+
+ OMX_EVModeMax = 0x7ffffff
+} OMX_METERINGTYPE;
+
+typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_METERINGTYPE eMetering;
+ OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */
+ OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
+ OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */
+ OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
+ OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */
+ OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
+ OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */
+} OMX_CONFIG_EXPOSUREVALUETYPE;
+
+/**
+ * Focus region configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bCenter : Use center region as focus region of interest
+ * bLeft : Use left region as focus region of interest
+ * bRight : Use right region as focus region of interest
+ * bTop : Use top region as focus region of interest
+ * bBottom : Use bottom region as focus region of interest
+ * bTopLeft : Use top left region as focus region of interest
+ * bTopRight : Use top right region as focus region of interest
+ * bBottomLeft : Use bottom left region as focus region of interest
+ * bBottomRight : Use bottom right region as focus region of interest
+ */
+typedef struct OMX_CONFIG_FOCUSREGIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bCenter;
+ OMX_BOOL bLeft;
+ OMX_BOOL bRight;
+ OMX_BOOL bTop;
+ OMX_BOOL bBottom;
+ OMX_BOOL bTopLeft;
+ OMX_BOOL bTopRight;
+ OMX_BOOL bBottomLeft;
+ OMX_BOOL bBottomRight;
+} OMX_CONFIG_FOCUSREGIONTYPE;
+
+/**
+ * Focus Status type
+ */
+typedef enum OMX_FOCUSSTATUSTYPE {
+ OMX_FocusStatusOff = 0,
+ OMX_FocusStatusRequest,
+ OMX_FocusStatusReached,
+ OMX_FocusStatusUnableToReach,
+ OMX_FocusStatusLost,
+ OMX_FocusStatusMax = 0x7FFFFFFF
+} OMX_FOCUSSTATUSTYPE;
+
+/**
+ * Focus status configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFocusStatus : Specifies the focus status
+ * bCenterStatus : Use center region as focus region of interest
+ * bLeftStatus : Use left region as focus region of interest
+ * bRightStatus : Use right region as focus region of interest
+ * bTopStatus : Use top region as focus region of interest
+ * bBottomStatus : Use bottom region as focus region of interest
+ * bTopLeftStatus : Use top left region as focus region of interest
+ * bTopRightStatus : Use top right region as focus region of interest
+ * bBottomLeftStatus : Use bottom left region as focus region of interest
+ * bBottomRightStatus : Use bottom right region as focus region of interest
+ */
+typedef struct OMX_PARAM_FOCUSSTATUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_FOCUSSTATUSTYPE eFocusStatus;
+ OMX_BOOL bCenterStatus;
+ OMX_BOOL bLeftStatus;
+ OMX_BOOL bRightStatus;
+ OMX_BOOL bTopStatus;
+ OMX_BOOL bBottomStatus;
+ OMX_BOOL bTopLeftStatus;
+ OMX_BOOL bTopRightStatus;
+ OMX_BOOL bBottomLeftStatus;
+ OMX_BOOL bBottomRightStatus;
+} OMX_PARAM_FOCUSSTATUSTYPE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/make/stub_includes/openmax/OMX_Image.h b/make/stub_includes/openmax/OMX_Image.h
new file mode 100755
index 000000000..8a0ee5bca
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Image.h
@@ -0,0 +1,318 @@
+/**
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * @file OMX_Image.h - OpenMax IL version 1.1.1
+ * The structures needed by Image components to exchange parameters and
+ * configuration data with the components.
+ */
+#ifndef OMX_Image_h
+#define OMX_Image_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/**
+ * Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_IVCommon.h>
+
+/** @defgroup imaging OpenMAX IL Imaging Domain
+ * @ingroup iv
+ * Structures for OpenMAX IL Imaging domain
+ * @{
+ */
+
+/**
+ * Enumeration used to define the possible image compression coding.
+ */
+typedef enum OMX_IMAGE_CODINGTYPE {
+ OMX_IMAGE_CodingUnused, /**< Value when format is N/A */
+ OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */
+ OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */
+ OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */
+ OMX_IMAGE_CodingEXIF, /**< EXIF image format */
+ OMX_IMAGE_CodingTIFF, /**< TIFF image format */
+ OMX_IMAGE_CodingGIF, /**< Graphics image format */
+ OMX_IMAGE_CodingPNG, /**< PNG image format */
+ OMX_IMAGE_CodingLZW, /**< LZW image format */
+ OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */
+ OMX_IMAGE_CodingMax = 0x7FFFFFFF
+} OMX_IMAGE_CODINGTYPE;
+
+
+/**
+ * Data structure used to define an image path. The number of image paths
+ * for input and output will vary by type of the image component.
+ *
+ * Input (aka Source) : Zero Inputs, one Output,
+ * Splitter : One Input, 2 or more Outputs,
+ * Processing Element : One Input, one output,
+ * Mixer : 2 or more inputs, one output,
+ * Output (aka Sink) : One Input, zero outputs.
+ *
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output
+ * image path. If additional vendor specific data is required, it should
+ * be transmitted to the component using the CustomCommand function.
+ * Compliant components will prepopulate this structure with optimal
+ * values during the OMX_GetParameter() command.
+ *
+ * STRUCT MEMBERS:
+ * cMIMEType : MIME type of data for the port
+ * pNativeRender : Platform specific reference for a display if a
+ * sync, otherwise this field is 0
+ * nFrameWidth : Width of frame to be used on port if
+ * uncompressed format is used. Use 0 for
+ * unknown, don't care or variable
+ * nFrameHeight : Height of frame to be used on port if
+ * uncompressed format is used. Use 0 for
+ * unknown, don't care or variable
+ * nStride : Number of bytes per span of an image (i.e.
+ * indicates the number of bytes to get from
+ * span N to span N+1, where negative stride
+ * indicates the image is bottom up
+ * nSliceHeight : Height used when encoding in slices
+ * bFlagErrorConcealment : Turns on error concealment if it is supported by
+ * the OMX component
+ * eCompressionFormat : Compression format used in this instance of
+ * the component. When OMX_IMAGE_CodingUnused is
+ * specified, eColorFormat is valid
+ * eColorFormat : Decompressed format used by this component
+ * pNativeWindow : Platform specific reference for a window object if a
+ * display sink , otherwise this field is 0x0.
+ */
+typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType;
+ OMX_NATIVE_DEVICETYPE pNativeRender;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+ OMX_S32 nStride;
+ OMX_U32 nSliceHeight;
+ OMX_BOOL bFlagErrorConcealment;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_NATIVE_WINDOWTYPE pNativeWindow;
+} OMX_IMAGE_PORTDEFINITIONTYPE;
+
+
+/**
+ * Port format parameter. This structure is used to enumerate the various
+ * data input/output format supported by the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Indicates which port to set
+ * nIndex : Indicates the enumeration index for the format from
+ * 0x0 to N-1
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_IMAGE_CodingUnused is specified,
+ * eColorFormat is valid
+ * eColorFormat : Decompressed format used by this component
+ */
+typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+} OMX_IMAGE_PARAM_PORTFORMATTYPE;
+
+
+/**
+ * Flash control type
+ *
+ * ENUMS
+ * Torch : Flash forced constantly on
+ */
+typedef enum OMX_IMAGE_FLASHCONTROLTYPE {
+ OMX_IMAGE_FlashControlOn = 0,
+ OMX_IMAGE_FlashControlOff,
+ OMX_IMAGE_FlashControlAuto,
+ OMX_IMAGE_FlashControlRedEyeReduction,
+ OMX_IMAGE_FlashControlFillin,
+ OMX_IMAGE_FlashControlTorch,
+ OMX_IMAGE_FlashControlMax = 0x7FFFFFFF
+} OMX_IMAGE_FLASHCONTROLTYPE;
+
+
+/**
+ * Flash control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFlashControl : Flash control type
+ */
+typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;
+} OMX_IMAGE_PARAM_FLASHCONTROLTYPE;
+
+
+/**
+ * Focus control type
+ */
+typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {
+ OMX_IMAGE_FocusControlOn = 0,
+ OMX_IMAGE_FocusControlOff,
+ OMX_IMAGE_FocusControlAuto,
+ OMX_IMAGE_FocusControlAutoLock,
+ OMX_IMAGE_FocusControlMax = 0x7FFFFFFF
+} OMX_IMAGE_FOCUSCONTROLTYPE;
+
+
+/**
+ * Focus control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFocusControl : Focus control
+ * nFocusSteps : Focus can take on values from 0 mm to infinity.
+ * Interest is only in number of steps over this range.
+ * nFocusStepIndex : Current focus step index
+ */
+typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;
+ OMX_U32 nFocusSteps;
+ OMX_U32 nFocusStepIndex;
+} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;
+
+
+/**
+ * Q Factor for JPEG compression, which controls the tradeoff between image
+ * quality and size. Q Factor provides a more simple means of controlling
+ * JPEG compression quality, without directly programming Quantization
+ * tables for chroma and luma
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1
+ * produces the smallest, worst quality images, and a factor
+ * of 100 produces the largest, best quality images. A
+ * typical default is 75 for small good quality images
+ */
+typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQFactor;
+} OMX_IMAGE_PARAM_QFACTORTYPE;
+
+/**
+ * Quantization table type
+ */
+
+typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {
+ OMX_IMAGE_QuantizationTableLuma = 0,
+ OMX_IMAGE_QuantizationTableChroma,
+ OMX_IMAGE_QuantizationTableChromaCb,
+ OMX_IMAGE_QuantizationTableChromaCr,
+ OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF
+} OMX_IMAGE_QUANTIZATIONTABLETYPE;
+
+/**
+ * JPEG quantization tables are used to determine DCT compression for
+ * YUV data, as an alternative to specifying Q factor, providing exact
+ * control of compression
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eQuantizationTable : Quantization table type
+ * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored
+ * in increasing columns then by rows of data (i.e.
+ * row 1, ... row 8). Quantization values are in
+ * the range 0-255 and stored in linear order
+ * (i.e. the component will zig-zag the
+ * quantization table data if required internally)
+ */
+typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;
+ OMX_U8 nQuantizationMatrix[64];
+} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;
+
+
+/**
+ * Huffman table type, the same Huffman table is applied for chroma and
+ * luma component
+ */
+typedef enum OMX_IMAGE_HUFFMANTABLETYPE {
+ OMX_IMAGE_HuffmanTableAC = 0,
+ OMX_IMAGE_HuffmanTableDC,
+ OMX_IMAGE_HuffmanTableACLuma,
+ OMX_IMAGE_HuffmanTableACChroma,
+ OMX_IMAGE_HuffmanTableDCLuma,
+ OMX_IMAGE_HuffmanTableDCChroma,
+ OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF
+} OMX_IMAGE_HUFFMANTABLETYPE;
+
+/**
+ * JPEG Huffman table
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eHuffmanTable : Huffman table type
+ * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each
+ * possible length
+ * nHuffmanTable[256] : 0-255, the size used for AC and DC
+ * HuffmanTable are 16 and 162
+ */
+typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;
+ OMX_U8 nNumberOfHuffmanCodeOfLength[16];
+ OMX_U8 nHuffmanTable[256];
+}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/make/stub_includes/openmax/OMX_Index.h b/make/stub_includes/openmax/OMX_Index.h
new file mode 100755
index 000000000..ff7c6f5f9
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Index.h
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_Index.h - OpenMax IL version 1.1.1
+ * The OMX_Index header file contains the definitions for both applications
+ * and components .
+ */
+
+
+#ifndef OMX_Index_h
+#define OMX_Index_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Types.h>
+
+
+/** The OMX_INDEXTYPE enumeration is used to select a structure when either
+ * getting or setting parameters and/or configuration data. Each entry in
+ * this enumeration maps to an OMX specified structure. When the
+ * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods
+ * are used, the second parameter will always be an entry from this enumeration
+ * and the third entry will be the structure shown in the comments for the entry.
+ * For example, if the application is initializing a cropping function, the
+ * OMX_SetConfig command would have OMX_ConfigInputCrop as the second parameter
+ * and would send a pointer to an initialized OMX_RECTTYPE structure as the
+ * third parameter.
+ *
+ * The enumeration entries named with the OMX_Config prefix are sent using
+ * the OMX_SetConfig command and the enumeration entries named with the
+ * OMX_PARAM_ prefix are sent using the OMX_SetParameter command.
+ */
+typedef enum OMX_INDEXTYPE {
+
+ OMX_IndexComponentStartUnused = 0x01000000,
+ OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
+ OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */
+ OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */
+ OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */
+ OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */
+ OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */
+ OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */
+ OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */
+ OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */
+ OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */
+ OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */
+ OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */
+ OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */
+ OMX_IndexParamMetadataFilterType, /** < reference: OMX_PARAM_METADATAFILTERTYPE */
+ OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
+ OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
+ OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */
+
+ OMX_IndexPortStartUnused = 0x02000000,
+ OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */
+ OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE (*/
+ OMX_IndexReservedStartUnused = 0x03000000,
+
+ /* Audio parameters and configurations */
+ OMX_IndexAudioStartUnused = 0x04000000,
+ OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */
+ OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */
+ OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */
+ OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */
+ OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */
+ OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */
+ OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */
+ OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */
+ OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */
+ OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */
+ OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */
+ OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM__GSMFRTYPE */
+ OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */
+ OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */
+ OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */
+ OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */
+ OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */
+ OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */
+ OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */
+ OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */
+ OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */
+ OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */
+ OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */
+ OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */
+ OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */
+ OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */
+
+ OMX_IndexConfigAudioMidiImmediateEvent, /**< OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */
+ OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */
+ OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */
+ OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */
+ OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */
+ OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */
+ OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */
+ OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */
+ OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */
+ OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */
+ OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */
+ OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */
+ OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */
+ OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */
+ OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */
+ OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */
+ OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */
+ OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */
+ OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */
+ OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */
+
+ /* Image specific parameters and configurations */
+ OMX_IndexImageStartUnused = 0x05000000,
+ OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamFlashControl, /**< refer to OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
+ OMX_IndexConfigFocusControl, /**< refer to OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */
+ OMX_IndexParamQFactor, /**< refer to OMX_IMAGE_PARAM_QFACTORTYPE */
+ OMX_IndexParamQuantizationTable, /**< refer to OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */
+ OMX_IndexParamHuffmanTable, /**< For jpeg, refer to OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */
+ OMX_IndexConfigFlashControl, /**< refer to OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
+
+ /* Video specific parameters and configurations */
+ OMX_IndexVideoStartUnused = 0x06000000,
+ OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONPARAMTYPE */
+ OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */
+ OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */
+ OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */
+ OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */
+ OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */
+ OMX_IndexParamVideoVBSMC, /**< reference:OMX_VIDEO_PARAM_VBSMCTYPE */
+ OMX_IndexParamVideoMpeg2, /**< reference:OMX_VIDEO_PARAM_MPEG2TYPE */
+ OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_CONFIG_MPEG4TYPE */
+ OMX_IndexParamVideoWmv, /**< reference:OMX_VIDEO_PARAM_WMVTYPE */
+ OMX_IndexParamVideoRv, /**< reference:OMX_VIDEO_PARAM_RVTYPE */
+ OMX_IndexParamVideoAvc, /**< reference:OMX_VIDEO_PARAM_AVCTYPE */
+ OMX_IndexParamVideoH263, /**< reference:OMX_VIDEO_PARAM_H263TYPE */
+ OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference:OMX_VIDEO_PARAM_PROFILELEVEL */
+ OMX_IndexParamVideoProfileLevelCurrent, /**< reference:OMX_VIDEO_PARAM_PROFILELEVEL */
+ OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */
+ OMX_IndexConfigVideoFramerate, /**< reference:OMX_VIDEO_CONFIG_FRAMERATETYPE */
+ OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */
+ OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
+ OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */
+ OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */
+ OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
+ OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */
+ OMX_IndexConfigVideoAVCIntraPeriod, /** reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */
+ OMX_IndexConfigVideoNalSize, /** reference: OMX_VIDEO_CONFIG_NALSIZE */
+
+ /* Image & Video common Configurations */
+ OMX_IndexCommonStartUnused = 0x07000000,
+ OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */
+ OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */
+ OMX_IndexParamCommonInterleave, /** reference: OMX_PARAM_INTERLEAVETYPE */
+ OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */
+ OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
+ OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */
+ OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */
+ OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */
+ OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */
+ OMX_IndexConfigCommonFrameStabilisation, /**< reference: OMX_CONFIG_FRAMESTABTYPE */
+ OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */
+ OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */
+ OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */
+ OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
+ OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/
+ OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */
+ OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */
+ OMX_IndexConfigCommonContrast, /**< reference to OMX_CONFIG_CONTRASTTYPE */
+ OMX_IndexConfigCommonBrightness, /**< reference to OMX_CONFIG_BRIGHTNESSTYPE */
+ OMX_IndexConfigCommonBacklight, /**< reference to OMX_CONFIG_BACKLIGHTTYPE */
+ OMX_IndexConfigCommonGamma, /**< reference to OMX_CONFIG_GAMMATYPE */
+ OMX_IndexConfigCommonSaturation, /**< reference to OMX_CONFIG_SATURATIONTYPE */
+ OMX_IndexConfigCommonLightness, /**< reference to OMX_CONFIG_LIGHTNESSTYPE */
+ OMX_IndexConfigCommonExclusionRect, /** reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonDithering, /**< reference: OMX_TIME_CONFIG_DITHERTYPE */
+ OMX_IndexConfigCommonPlaneBlend, /** reference: OMX_CONFIG_PLANEBLENDTYPE */
+ OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */
+ OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */
+ OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */
+ OMX_IndexConfigCommonFocusRegion, /**< refer to OMX_PARAM_FOCUSREGIONTYPE */
+ OMX_IndexConfigCommonFocusStatus, /**< refer to OMX_IMAGE_CONFIG_FOCUSSTATUSTYPE */
+
+ /* Reserved Configuration range */
+ OMX_IndexOtherStartUnused = 0x08000000,
+ OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */
+ OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */
+ OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */
+
+
+ /* Reserved Time range */
+ OMX_IndexTimeStartUnused = 0x09000000,
+ OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */
+ OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */
+ OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */
+ OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only)*/
+ OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only)*/
+ OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */
+ OMX_IndexConfigTimeClientStartTime, /**<reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimePosition, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */
+ OMX_IndexConfigTimeSeekMode, /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */
+
+
+ /* Vendor specific area */
+ OMX_IndexVendorStartUnused = 0x7F000000,
+ /* Vendor specific structures should be in the range of 0x7F000000
+ to 0x7FFFFFFE. This range is not broken out by vendor, so
+ private indexes are not guaranteed unique and therefore should
+ only be sent to the appropriate component. */
+
+ OMX_IndexMax = 0x7FFFFFFF
+
+} OMX_INDEXTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/make/stub_includes/openmax/OMX_Other.h b/make/stub_includes/openmax/OMX_Other.h
new file mode 100755
index 000000000..dd2bb8deb
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Other.h
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_Other.h - OpenMax IL version 1.1.1
+ * The structures needed by Other components to exchange
+ * parameters and configuration data with the components.
+ */
+
+#ifndef OMX_Other_h
+#define OMX_Other_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Core.h>
+
+
+/**
+ * Enumeration of possible data types which match to multiple domains or no
+ * domain at all. For types which are vendor specific, a value above
+ * OMX_OTHER_VENDORTSTART should be used.
+ */
+typedef enum OMX_OTHER_FORMATTYPE {
+ OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
+ time deltas, etc */
+ OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power
+ management, setting clocks? */
+ OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames
+ dropped, etc */
+ OMX_OTHER_FormatBinary, /**< Arbitrary binary data */
+ OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
+ formats */
+
+ OMX_OTHER_FormatMax = 0x7FFFFFFF
+} OMX_OTHER_FORMATTYPE;
+
+/**
+ * Enumeration of seek modes.
+ */
+typedef enum OMX_TIME_SEEKMODETYPE {
+ OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
+ * of the requested seek position over
+ * the actual seek position if it
+ * results in a faster seek. */
+ OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
+ * position over an approximation
+ * of the requested seek position even
+ * if it results in a slower seek. */
+ OMX_TIME_SeekModeMax = 0x7FFFFFFF
+} OMX_TIME_SEEKMODETYPE;
+
+/* Structure representing the seekmode of the component */
+typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */
+} OMX_TIME_CONFIG_SEEKMODETYPE;
+
+/** Structure representing a time stamp used with the following configs
+ * on the Clock Component (CC):
+ *
+ * OMX_IndexConfigTimeCurrentWallTime: query of the CC�s current wall
+ * time
+ * OMX_IndexConfigTimeCurrentMediaTime: query of the CC�s current media
+ * time
+ * OMX_IndexConfigTimeAudioReferenceTime and
+ * OMX_IndexConfigTimeVideoReferenceTime: audio/video reference
+ * clock sending SC its reference time
+ * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
+ * this structure to the Clock Component via a SetConfig on its
+ * client port when it receives a buffer with
+ * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
+ * specified by that buffer for nStartTimestamp.
+ *
+ * It�s also used with the following config on components in general:
+ *
+ * OMX_IndexConfigTimePosition: IL client querying component position
+ * (GetConfig) or commanding a component to seek to the given location
+ * (SetConfig)
+ */
+typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version
+ * information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_TICKS nTimestamp; /**< timestamp .*/
+} OMX_TIME_CONFIG_TIMESTAMPTYPE;
+
+/** Enumeration of possible reference clocks to the media time. */
+typedef enum OMX_TIME_UPDATETYPE {
+ OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
+ OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
+ OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
+ OMX_TIME_UpdateMax = 0x7FFFFFFF
+} OMX_TIME_UPDATETYPE;
+
+/** Enumeration of possible reference clocks to the media time. */
+typedef enum OMX_TIME_REFCLOCKTYPE {
+ OMX_TIME_RefClockNone, /**< Use no references. */
+ OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
+ OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
+ OMX_TIME_RefClockMax = 0x7FFFFFFF
+} OMX_TIME_REFCLOCKTYPE;
+
+/** Enumeration of clock states. */
+typedef enum OMX_TIME_CLOCKSTATE {
+ OMX_TIME_ClockStateRunning, /**< Clock running. */
+ OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
+ * prescribed clients emit their
+ * start time. */
+ OMX_TIME_ClockStateStopped, /**< Clock stopped. */
+ OMX_TIME_ClockStateMax = 0x7FFFFFFF
+} OMX_TIME_CLOCKSTATE;
+
+/** Structure representing a media time request to the clock component.
+ *
+ * A client component sends this structure to the Clock Component via a SetConfig
+ * on its client port to specify a media timestamp the Clock Component
+ * should emit. The Clock Component should fulfill the request by sending a
+ * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
+ * timestamp.
+ *
+ * The client may require a media time request be fulfilled slightly
+ * earlier than the media time specified. In this case the client specifies
+ * an offset which is equal to the difference between wall time corresponding
+ * to the requested media time and the wall time when it will be
+ * fulfilled.
+ *
+ * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
+ * time events according to timestamps. If a client must perform an operation O at
+ * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
+ * media time request at T (perhaps specifying an offset to ensure the request fulfillment
+ * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
+ * structure back to the client component, the client may perform operation O (perhaps having
+ * to wait a slight amount more time itself as specified by the return values).
+ */
+
+typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
+ * from others (e.g. the number of the frame to deliver).
+ * Duplicated in the media time structure that fulfills
+ * this request. A value of zero is reserved for time scale
+ * updates. */
+ OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
+ OMX_TICKS nOffset; /**< Amount of wall clock time by which this
+ * request should be fulfilled early */
+} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
+
+/**< Structure sent from the clock component client either when fulfilling
+ * a media time request or when the time scale has changed.
+ *
+ * In the former case the Clock Component fills this structure and times its emission
+ * to a client component (via the client port) according to the corresponding media
+ * time request sent by the client. The Clock Component should time the emission to occur
+ * when the requested timestamp matches the Clock Component's media time but also the
+ * prescribed offset early.
+ *
+ * Upon scale changes the clock component clears the nClientPrivate data, sends the current
+ * media time and sets the nScale to the new scale via the client port. It emits a
+ * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
+ * alter processing to accomodate scaling. For instance a video component might skip inter-frames
+ * in the case of extreme fastforward. Likewise an audio component might add or remove samples
+ * from an audio frame to scale audio data.
+ *
+ * It is expected that some clock components may not be able to fulfill requests
+ * at exactly the prescribed time. This is acceptable so long as the request is
+ * fulfilled at least as early as described and not later. This structure provides
+ * fields the client may use to wait for the remaining time.
+ *
+ * The client may use either the nOffset or nWallTimeAtMedia fields to determine the
+ * wall time until the nMediaTimestamp actually occurs. In the latter case the
+ * client can get a more accurate value for offset by getting the current wall
+ * from the cloc component and subtracting it from nWallTimeAtMedia.
+ */
+
+typedef struct OMX_TIME_MEDIATIMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
+ * from others. Copied from the media time request.
+ * A value of zero is reserved for time scale updates. */
+ OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
+ OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
+ * requested then this is the current media time. */
+ OMX_TICKS nOffset; /**< Amount of wall clock time by which this
+ * request was actually fulfilled early */
+
+ OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
+ * A client may compare this value to current
+ * media time obtained from the Clock Component to determine
+ * the wall time until the media timestamp is really
+ * current. */
+ OMX_S32 xScale; /**< Current media time scale in Q16 format. */
+ OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
+ /**< State of the media time. */
+} OMX_TIME_MEDIATIMETYPE;
+
+/** Structure representing the current media time scale factor. Applicable only to clock
+ * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
+ * the clock component client ports. Upon recieving this config the clock component changes
+ * the rate by which the media time increases or decreases effectively implementing trick modes.
+ */
+typedef struct OMX_TIME_CONFIG_SCALETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_S32 xScale; /**< This is a value in Q16 format which is used for
+ * scaling the media time */
+} OMX_TIME_CONFIG_SCALETYPE;
+
+/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG�s nWaitMask field */
+#define OMX_CLOCKPORT0 0x00000001
+#define OMX_CLOCKPORT1 0x00000002
+#define OMX_CLOCKPORT2 0x00000004
+#define OMX_CLOCKPORT3 0x00000008
+#define OMX_CLOCKPORT4 0x00000010
+#define OMX_CLOCKPORT5 0x00000020
+#define OMX_CLOCKPORT6 0x00000040
+#define OMX_CLOCKPORT7 0x00000080
+
+/** Structure representing the current mode of the media clock.
+ * IL Client uses this config to change or query the mode of the
+ * media clock of the clock component. Applicable only to clock
+ * component.
+ *
+ * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
+ * starts immediately at the prescribed start time. If
+ * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
+ * the given nStartTime and waits for all clients specified in the
+ * nWaitMask to send starttimes (via
+ * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
+ * the media clock using the earliest start time supplied. */
+typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version
+ * information */
+ OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
+ OMX_TICKS nStartTime; /**< Start time of the media time. */
+ OMX_TICKS nOffset; /**< Time to offset the media time by
+ * (e.g. preroll). Media time will be
+ * reported to be nOffset ticks earlier.
+ */
+ OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
+} OMX_TIME_CONFIG_CLOCKSTATETYPE;
+
+/** Structure representing the reference clock currently being used to
+ * compute media time. IL client uses this config to change or query the
+ * clock component's active reference clock */
+typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
+} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
+
+/** Descriptor for setting specifics of power type. */
+typedef struct OMX_OTHER_CONFIG_POWERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
+} OMX_OTHER_CONFIG_POWERTYPE;
+
+
+/** Descriptor for setting specifics of stats type. */
+typedef struct OMX_OTHER_CONFIG_STATSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ /* what goes here */
+} OMX_OTHER_CONFIG_STATSTYPE;
+
+
+/**
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output other
+ * path.
+ */
+typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
+ OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
+} OMX_OTHER_PORTDEFINITIONTYPE;
+
+/** Port format parameter. This structure is used to enumerate
+ * the various data input/output format supported by the port.
+ */
+typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Indicates which port to set */
+ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
+ OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
+} OMX_OTHER_PARAM_PORTFORMATTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/make/stub_includes/openmax/OMX_Types.h b/make/stub_includes/openmax/OMX_Types.h
new file mode 100755
index 000000000..2c2d1bb85
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Types.h
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Types.h - OpenMax IL version 1.1.1
+ * The OMX_Types header file contains the primitive type definitions used by
+ * the core, the application and the component. This file may need to be
+ * modified to be used on systems that do not have "char" set to 8 bits,
+ * "short" set to 16 bits and "long" set to 32 bits.
+ */
+
+#ifndef OMX_Types_h
+#define OMX_Types_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifdef __arm__
+#pragma diag_remark 66
+#endif
+
+/** The OMX_API and OMX_APIENTRY are platform specific definitions used
+ * to declare OMX function prototypes. They are modified to meet the
+ * requirements for a particular platform */
+#ifdef _WIN32
+# ifdef __OMX_EXPORTS
+# define OMX_API __declspec(dllexport)
+# else
+# define OMX_API __declspec(dllimport)
+# endif
+#else
+# ifdef __OMX_EXPORTS
+# define OMX_API
+# else
+# define OMX_API extern
+# endif
+#endif
+
+#ifdef __SYMBIAN32__
+# ifdef __OMX_EXPORTS
+# define OMX_API EXPORT_C
+# else
+# define OMX_API IMPORT_C
+# endif
+#elif defined(_WIN32)
+# ifdef __OMX_EXPORTS
+# define OMX_API __declspec(dllexport)
+# else
+# define OMX_API __declspec(dllimport)
+# endif
+#else
+# ifdef __OMX_EXPORTS
+# define OMX_API
+# else
+# define OMX_API extern
+# endif
+#endif
+
+#ifndef OMX_APIENTRY
+#define OMX_APIENTRY
+#endif
+
+/** OMX_IN is used to identify inputs to an OMX function. This designation
+ will also be used in the case of a pointer that points to a parameter
+ that is used as an output. */
+#ifndef OMX_IN
+#define OMX_IN
+#endif
+
+/** OMX_OUT is used to identify outputs from an OMX function. This
+ designation will also be used in the case of a pointer that points
+ to a parameter that is used as an input. */
+#ifndef OMX_OUT
+#define OMX_OUT
+#endif
+
+
+/** OMX_INOUT is used to identify parameters that may be either inputs or
+ outputs from an OMX function at the same time. This designation will
+ also be used in the case of a pointer that points to a parameter that
+ is used both as an input and an output. */
+#ifndef OMX_INOUT
+#define OMX_INOUT
+#endif
+
+/** OMX_ALL is used to as a wildcard to select all entities of the same type
+ * when specifying the index, or referring to a object by an index. (i.e.
+ * use OMX_ALL to indicate all N channels). When used as a port index
+ * for a config or parameter this OMX_ALL denotes that the config or
+ * parameter applies to the entire component not just one port. */
+#define OMX_ALL 0xFFFFFFFF
+
+/** In the following we define groups that help building doxygen documentation */
+
+/** @defgroup core OpenMAX IL core
+ * Functions and structure related to the OMX IL core
+ */
+
+ /** @defgroup comp OpenMAX IL component
+ * Functions and structure related to the OMX IL component
+ */
+
+/** @defgroup rpm Resource and Policy Management
+ * Structures for resource and policy management of components
+ */
+
+/** @defgroup buf Buffer Management
+ * Buffer handling functions and structures
+ */
+
+/** @defgroup tun Tunneling
+ * @ingroup core comp
+ * Structures and functions to manage tunnels among component ports
+ */
+
+/** @defgroup cp Content Pipes
+ * @ingroup core
+ */
+
+ /** @defgroup metadata Metadata handling
+ *
+ */
+
+/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
+typedef unsigned char OMX_U8;
+
+/** OMX_S8 is an 8 bit signed quantity that is byte aligned */
+typedef signed char OMX_S8;
+
+/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
+typedef unsigned short OMX_U16;
+
+/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
+typedef signed short OMX_S16;
+
+/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
+typedef unsigned long OMX_U32;
+
+/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
+typedef signed long OMX_S32;
+
+
+/* Users with compilers that cannot accept the "long long" designation should
+ define the OMX_SKIP64BIT macro. It should be noted that this may cause
+ some components to fail to compile if the component was written to require
+ 64 bit integral types. However, these components would NOT compile anyway
+ since the compiler does not support the way the component was written.
+*/
+#ifndef OMX_SKIP64BIT
+#ifdef __SYMBIAN32__
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long OMX_S64;
+
+#elif defined(WIN32)
+
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned __int64 OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed __int64 OMX_S64;
+
+#else /* WIN32 */
+
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long OMX_S64;
+
+#endif /* WIN32 */
+#endif
+
+
+/** The OMX_BOOL type is intended to be used to represent a true or a false
+ value when passing parameters to and from the OMX core and components. The
+ OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
+ */
+typedef enum OMX_BOOL {
+ OMX_FALSE = 0,
+ OMX_TRUE = !OMX_FALSE,
+ OMX_BOOL_MAX = 0x7FFFFFFF
+} OMX_BOOL;
+
+/** The OMX_PTR type is intended to be used to pass pointers between the OMX
+ applications and the OMX Core and components. This is a 32 bit pointer and
+ is aligned on a 32 bit boundary.
+ */
+typedef void* OMX_PTR;
+
+/** The OMX_STRING type is intended to be used to pass "C" type strings between
+ the application and the core and component. The OMX_STRING type is a 32
+ bit pointer to a zero terminated string. The pointer is word aligned and
+ the string is byte aligned.
+ */
+typedef char* OMX_STRING;
+
+/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
+ buffers between the application and the component and core. The OMX_BYTE
+ type is a 32 bit pointer to a zero terminated string. The pointer is word
+ aligned and the string is byte aligned.
+ */
+typedef unsigned char* OMX_BYTE;
+
+/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
+ at runtime. This identifier should be generated by a component in a way
+ that guarantees that every instance of the identifier running on the system
+ is unique. */
+typedef unsigned char OMX_UUIDTYPE[128];
+
+/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
+ an output port. This enumeration is common across all component types.
+ */
+typedef enum OMX_DIRTYPE
+{
+ OMX_DirInput, /**< Port is an input port */
+ OMX_DirOutput, /**< Port is an output port */
+ OMX_DirMax = 0x7FFFFFFF
+} OMX_DIRTYPE;
+
+/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
+ for numerical data (i.e. big endian, or little endian).
+ */
+typedef enum OMX_ENDIANTYPE
+{
+ OMX_EndianBig, /**< big endian */
+ OMX_EndianLittle, /**< little endian */
+ OMX_EndianMax = 0x7FFFFFFF
+} OMX_ENDIANTYPE;
+
+
+/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
+ is signed or unsigned
+ */
+typedef enum OMX_NUMERICALDATATYPE
+{
+ OMX_NumericalDataSigned, /**< signed data */
+ OMX_NumericalDataUnsigned, /**< unsigned data */
+ OMX_NumercialDataMax = 0x7FFFFFFF
+} OMX_NUMERICALDATATYPE;
+
+
+/** Unsigned bounded value type */
+typedef struct OMX_BU32 {
+ OMX_U32 nValue; /**< actual value */
+ OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
+ OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
+} OMX_BU32;
+
+
+/** Signed bounded value type */
+typedef struct OMX_BS32 {
+ OMX_S32 nValue; /**< actual value */
+ OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
+ OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
+} OMX_BS32;
+
+
+/** Structure representing some time or duration in microseconds. This structure
+ * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
+ * negative deltas and preroll scenarios. The quantity is represented in microseconds
+ * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
+ * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
+ * individual audio samples delivered at 192 kHz). The quantity is 64 bit to
+ * accommodate a large dynamic range (signed 32 bit values would allow only for plus
+ * or minus 35 minutes).
+ *
+ * Implementations with limited precision may convert the signed 64 bit value to
+ * a signed 32 bit value internally but risk loss of precision.
+ */
+#ifndef OMX_SKIP64BIT
+typedef OMX_S64 OMX_TICKS;
+#else
+typedef struct OMX_TICKS
+{
+ OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */
+ OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */
+} OMX_TICKS;
+#endif
+#define OMX_TICKS_PER_SECOND 1000000
+
+/** Define the public interface for the OMX Handle. The core will not use
+ this value internally, but the application should only use this value.
+ */
+typedef void* OMX_HANDLETYPE;
+
+typedef struct OMX_MARKTYPE
+{
+ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will
+ generate a mark event upon
+ processing the mark. */
+ OMX_PTR pMarkData; /**< Application specific data associated with
+ the mark sent on a mark event to disambiguate
+ this mark from others. */
+} OMX_MARKTYPE;
+
+
+/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
+ * platform & operating specific object used to reference the display
+ * or can be used by a audio port for native audio rendering */
+typedef void* OMX_NATIVE_DEVICETYPE;
+
+/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
+ * platform & operating specific object used to reference the window */
+typedef void* OMX_NATIVE_WINDOWTYPE;
+
+/** The OMX_VERSIONTYPE union is used to specify the version for
+ a structure or component. For a component, the version is entirely
+ specified by the component vendor. Components doing the same function
+ from different vendors may or may not have the same version. For
+ structures, the version shall be set by the entity that allocates the
+ structure. For structures specified in the OMX 1.1 specification, the
+ value of the version shall be set to 1.1.0.0 in all cases. Access to the
+ OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
+ by accessing one of the structure elements to, for example, check only
+ the Major revision.
+ */
+typedef union OMX_VERSIONTYPE
+{
+ struct
+ {
+ OMX_U8 nVersionMajor; /**< Major version accessor element */
+ OMX_U8 nVersionMinor; /**< Minor version accessor element */
+ OMX_U8 nRevision; /**< Revision version accessor element */
+ OMX_U8 nStep; /**< Step version accessor element */
+ } s;
+ OMX_U32 nVersion; /**< 32 bit value to make accessing the
+ version easily done in a single word
+ size copy/compare operation */
+} OMX_VERSIONTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/make/stub_includes/openmax/OMX_Video.h b/make/stub_includes/openmax/OMX_Video.h
new file mode 100755
index 000000000..f75614005
--- /dev/null
+++ b/make/stub_includes/openmax/OMX_Video.h
@@ -0,0 +1,1025 @@
+/**
+ * Copyright (c) 2007 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * @file OMX_Video.h - OpenMax IL version 1.1.1
+ * The structures is needed by Video components to exchange parameters
+ * and configuration data with OMX components.
+ */
+#ifndef OMX_Video_h
+#define OMX_Video_h
+
+/** @defgroup video OpenMAX IL Video Domain
+ * @ingroup iv
+ * Structures for OpenMAX IL Video domain
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/**
+ * Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_IVCommon.h>
+
+
+/**
+ * Enumeration used to define the possible video compression codings.
+ * NOTE: This essentially refers to file extensions. If the coding is
+ * being used to specify the ENCODE type, then additional work
+ * must be done to configure the exact flavor of the compression
+ * to be used. For decode cases where the user application can
+ * not differentiate between MPEG-4 and H.264 bit streams, it is
+ * up to the codec to handle this.
+ */
+typedef enum OMX_VIDEO_CODINGTYPE {
+ OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */
+ OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */
+ OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */
+ OMX_VIDEO_CodingH263, /**< H.263 */
+ OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */
+ OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */
+ OMX_VIDEO_CodingRV, /**< all versions of Real Video */
+ OMX_VIDEO_CodingAVC, /**< H.264/AVC */
+ OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */
+ OMX_VIDEO_CodingMax = 0x7FFFFFFF
+} OMX_VIDEO_CODINGTYPE;
+
+
+/**
+ * Data structure used to define a video path. The number of Video paths for
+ * input and output will vary by type of the Video component.
+ *
+ * Input (aka Source) : zero Inputs, one Output,
+ * Splitter : one Input, 2 or more Outputs,
+ * Processing Element : one Input, one output,
+ * Mixer : 2 or more inputs, one output,
+ * Output (aka Sink) : one Input, zero outputs.
+ *
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output video
+ * path. If additional vendor specific data is required, it should be
+ * transmitted to the component using the CustomCommand function. Compliant
+ * components will prepopulate this structure with optimal values during the
+ * GetDefaultInitParams command.
+ *
+ * STRUCT MEMBERS:
+ * cMIMEType : MIME type of data for the port
+ * pNativeRender : Platform specific reference for a display if a
+ * sync, otherwise this field is 0
+ * nFrameWidth : Width of frame to be used on channel if
+ * uncompressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * nFrameHeight : Height of frame to be used on channel if
+ * uncompressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * nStride : Number of bytes per span of an image
+ * (i.e. indicates the number of bytes to get
+ * from span N to span N+1, where negative stride
+ * indicates the image is bottom up
+ * nSliceHeight : Height used when encoding in slices
+ * nBitrate : Bit rate of frame to be used on channel if
+ * compressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * xFramerate : Frame rate to be used on channel if uncompressed
+ * format is used. Use 0 for unknown, don't care or
+ * variable. Units are Q16 frames per second.
+ * bFlagErrorConcealment : Turns on error concealment if it is supported by
+ * the OMX component
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_VIDEO_CodingUnused is
+ * specified, eColorFormat is used
+ * eColorFormat : Decompressed format used by this component
+ * pNativeWindow : Platform specific reference for a window object if a
+ * display sink , otherwise this field is 0x0.
+ */
+typedef struct OMX_VIDEO_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType;
+ OMX_NATIVE_DEVICETYPE pNativeRender;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+ OMX_S32 nStride;
+ OMX_U32 nSliceHeight;
+ OMX_U32 nBitrate;
+ OMX_U32 xFramerate;
+ OMX_BOOL bFlagErrorConcealment;
+ OMX_VIDEO_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_NATIVE_WINDOWTYPE pNativeWindow;
+} OMX_VIDEO_PORTDEFINITIONTYPE;
+
+/**
+ * Port format parameter. This structure is used to enumerate the various
+ * data input/output format supported by the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Indicates which port to set
+ * nIndex : Indicates the enumeration index for the format from
+ * 0x0 to N-1
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_VIDEO_CodingUnused is specified,
+ * eColorFormat is used
+ * eColorFormat : Decompressed format used by this component
+ * xFrameRate : Indicates the video frame rate in Q16 format
+ */
+typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_VIDEO_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_U32 xFramerate;
+} OMX_VIDEO_PARAM_PORTFORMATTYPE;
+
+
+/**
+ * This is a structure for configuring video compression quantization
+ * parameter values. Codecs may support different QP values for different
+ * frame types.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nQpI : QP value to use for index frames
+ * nQpP : QP value to use for P frames
+ * nQpB : QP values to use for bidirectional frames
+ */
+typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQpI;
+ OMX_U32 nQpP;
+ OMX_U32 nQpB;
+} OMX_VIDEO_PARAM_QUANTIZATIONTYPE;
+
+
+/**
+ * Structure for configuration of video fast update parameters.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * bEnableVFU : Enable/Disable video fast update
+ * nFirstGOB : Specifies the number of the first macroblock row
+ * nFirstMB : specifies the first MB relative to the specified first GOB
+ * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB
+ * and nFirstMB
+ */
+typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableVFU;
+ OMX_U32 nFirstGOB;
+ OMX_U32 nFirstMB;
+ OMX_U32 nNumMBs;
+} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE;
+
+
+/**
+ * Enumeration of possible bitrate control types
+ */
+typedef enum OMX_VIDEO_CONTROLRATETYPE {
+ OMX_Video_ControlRateDisable,
+ OMX_Video_ControlRateVariable,
+ OMX_Video_ControlRateConstant,
+ OMX_Video_ControlRateVariableSkipFrames,
+ OMX_Video_ControlRateConstantSkipFrames,
+ OMX_Video_ControlRateMax = 0x7FFFFFFF
+} OMX_VIDEO_CONTROLRATETYPE;
+
+
+/**
+ * Structure for configuring bitrate mode of a codec.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : Port that this struct applies to
+ * eControlRate : Control rate type enum
+ * nTargetBitrate : Target bitrate to encode with
+ */
+typedef struct OMX_VIDEO_PARAM_BITRATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_CONTROLRATETYPE eControlRate;
+ OMX_U32 nTargetBitrate;
+} OMX_VIDEO_PARAM_BITRATETYPE;
+
+
+/**
+ * Enumeration of possible motion vector (MV) types
+ */
+typedef enum OMX_VIDEO_MOTIONVECTORTYPE {
+ OMX_Video_MotionVectorPixel,
+ OMX_Video_MotionVectorHalfPel,
+ OMX_Video_MotionVectorQuarterPel,
+ OMX_Video_MotionVectorEighthPel,
+ OMX_Video_MotionVectorMax = 0x7FFFFFFF
+} OMX_VIDEO_MOTIONVECTORTYPE;
+
+
+/**
+ * Structure for configuring the number of motion vectors used as well
+ * as their accuracy.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : port that this structure applies to
+ * eAccuracy : Enumerated MV accuracy
+ * bUnrestrictedMVs : Allow unrestricted MVs
+ * bFourMV : Allow use of 4 MVs
+ * sXSearchRange : Search range in horizontal direction for MVs
+ * sYSearchRange : Search range in vertical direction for MVs
+ */
+typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_MOTIONVECTORTYPE eAccuracy;
+ OMX_BOOL bUnrestrictedMVs;
+ OMX_BOOL bFourMV;
+ OMX_S32 sXSearchRange;
+ OMX_S32 sYSearchRange;
+} OMX_VIDEO_PARAM_MOTIONVECTORTYPE;
+
+
+/**
+ * Enumeration of possible methods to use for Intra Refresh
+ */
+typedef enum OMX_VIDEO_INTRAREFRESHTYPE {
+ OMX_VIDEO_IntraRefreshCyclic,
+ OMX_VIDEO_IntraRefreshAdaptive,
+ OMX_VIDEO_IntraRefreshBoth,
+ OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF
+} OMX_VIDEO_INTRAREFRESHTYPE;
+
+
+/**
+ * Structure for configuring intra refresh mode
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eRefreshMode : Cyclic, Adaptive, or Both
+ * nAirMBs : Number of intra macroblocks to refresh in a frame when
+ * AIR is enabled
+ * nAirRef : Number of times a motion marked macroblock has to be
+ * intra coded
+ * nCirMBs : Number of consecutive macroblocks to be coded as "intra"
+ * when CIR is enabled
+ */
+typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode;
+ OMX_U32 nAirMBs;
+ OMX_U32 nAirRef;
+ OMX_U32 nCirMBs;
+} OMX_VIDEO_PARAM_INTRAREFRESHTYPE;
+
+
+/**
+ * Structure for enabling various error correction methods for video
+ * compression.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnableHEC : Enable/disable header extension codes (HEC)
+ * bEnableResync : Enable/disable resynchronization markers
+ * nResynchMarkerSpacing : Resynch markers interval (in bits) to be
+ * applied in the stream
+ * bEnableDataPartitioning : Enable/disable data partitioning
+ * bEnableRVLC : Enable/disable reversible variable length
+ * coding
+ */
+typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableHEC;
+ OMX_BOOL bEnableResync;
+ OMX_U32 nResynchMarkerSpacing;
+ OMX_BOOL bEnableDataPartitioning;
+ OMX_BOOL bEnableRVLC;
+} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE;
+
+
+/**
+ * Configuration of variable block-size motion compensation (VBSMC)
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * b16x16 : Enable inter block search 16x16
+ * b16x8 : Enable inter block search 16x8
+ * b8x16 : Enable inter block search 8x16
+ * b8x8 : Enable inter block search 8x8
+ * b8x4 : Enable inter block search 8x4
+ * b4x8 : Enable inter block search 4x8
+ * b4x4 : Enable inter block search 4x4
+ */
+typedef struct OMX_VIDEO_PARAM_VBSMCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL b16x16;
+ OMX_BOOL b16x8;
+ OMX_BOOL b8x16;
+ OMX_BOOL b8x8;
+ OMX_BOOL b8x4;
+ OMX_BOOL b4x8;
+ OMX_BOOL b4x4;
+} OMX_VIDEO_PARAM_VBSMCTYPE;
+
+
+/**
+ * H.263 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ *
+ * ENUMS:
+ * Baseline : Baseline Profile: H.263 (V1), no optional modes
+ * H320 Coding : H.320 Coding Efficiency Backward Compatibility
+ * Profile: H.263+ (V2), includes annexes I, J, L.4
+ * and T
+ * BackwardCompatible : Backward Compatibility Profile: H.263 (V1),
+ * includes annex F
+ * ISWV2 : Interactive Streaming Wireless Profile: H.263+
+ * (V2), includes annexes I, J, K and T
+ * ISWV3 : Interactive Streaming Wireless Profile: H.263++
+ * (V3), includes profile 3 and annexes V and W.6.3.8
+ * HighCompression : Conversational High Compression Profile: H.263++
+ * (V3), includes profiles 1 & 2 and annexes D and U
+ * Internet : Conversational Internet Profile: H.263++ (V3),
+ * includes profile 5 and annex K
+ * Interlace : Conversational Interlace Profile: H.263++ (V3),
+ * includes profile 5 and annex W.6.3.11
+ * HighLatency : High Latency Profile: H.263++ (V3), includes
+ * profile 6 and annexes O.1 and P.5
+ */
+typedef enum OMX_VIDEO_H263PROFILETYPE {
+ OMX_VIDEO_H263ProfileBaseline = 0x01,
+ OMX_VIDEO_H263ProfileH320Coding = 0x02,
+ OMX_VIDEO_H263ProfileBackwardCompatible = 0x04,
+ OMX_VIDEO_H263ProfileISWV2 = 0x08,
+ OMX_VIDEO_H263ProfileISWV3 = 0x10,
+ OMX_VIDEO_H263ProfileHighCompression = 0x20,
+ OMX_VIDEO_H263ProfileInternet = 0x40,
+ OMX_VIDEO_H263ProfileInterlace = 0x80,
+ OMX_VIDEO_H263ProfileHighLatency = 0x100,
+ OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_H263PROFILETYPE;
+
+
+/**
+ * H.263 level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates.
+ */
+typedef enum OMX_VIDEO_H263LEVELTYPE {
+ OMX_VIDEO_H263Level10 = 0x01,
+ OMX_VIDEO_H263Level20 = 0x02,
+ OMX_VIDEO_H263Level30 = 0x04,
+ OMX_VIDEO_H263Level40 = 0x08,
+ OMX_VIDEO_H263Level45 = 0x10,
+ OMX_VIDEO_H263Level50 = 0x20,
+ OMX_VIDEO_H263Level60 = 0x40,
+ OMX_VIDEO_H263Level70 = 0x80,
+ OMX_VIDEO_H263LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_H263LEVELTYPE;
+
+
+/**
+ * Specifies the picture type. These values should be OR'd to signal all
+ * pictures types which are allowed.
+ *
+ * ENUMS:
+ * Generic Picture Types: I, P and B
+ * H.263 Specific Picture Types: SI and SP
+ * H.264 Specific Picture Types: EI and EP
+ * MPEG-4 Specific Picture Types: S
+ */
+typedef enum OMX_VIDEO_PICTURETYPE {
+ OMX_VIDEO_PictureTypeI = 0x01,
+ OMX_VIDEO_PictureTypeP = 0x02,
+ OMX_VIDEO_PictureTypeB = 0x04,
+ OMX_VIDEO_PictureTypeSI = 0x08,
+ OMX_VIDEO_PictureTypeSP = 0x10,
+ OMX_VIDEO_PictureTypeEI = 0x11,
+ OMX_VIDEO_PictureTypeEP = 0x12,
+ OMX_VIDEO_PictureTypeS = 0x14,
+ OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF
+} OMX_VIDEO_PICTURETYPE;
+
+
+/**
+ * H.263 Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * eProfile : H.263 profile(s) to use
+ * eLevel : H.263 level(s) to use
+ * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE
+ * (specified in the 1998 version of H.263) to
+ * indicate custom picture sizes or clock
+ * frequencies
+ * nAllowedPictureTypes : Specifies the picture types allowed in the
+ * bitstream
+ * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is
+ * not constrained. It is recommended to change
+ * the value of the RTYPE bit for each reference
+ * picture in error-free communication
+ * nPictureHeaderRepetition : Specifies the frequency of picture header
+ * repetition
+ * nGOBHeaderInterval : Specifies the interval of non-empty GOB
+ * headers in units of GOBs
+ */
+typedef struct OMX_VIDEO_PARAM_H263TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_VIDEO_H263PROFILETYPE eProfile;
+ OMX_VIDEO_H263LEVELTYPE eLevel;
+ OMX_BOOL bPLUSPTYPEAllowed;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_BOOL bForceRoundingTypeToZero;
+ OMX_U32 nPictureHeaderRepetition;
+ OMX_U32 nGOBHeaderInterval;
+} OMX_VIDEO_PARAM_H263TYPE;
+
+
+/**
+ * MPEG-2 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_VIDEO_MPEG2PROFILETYPE {
+ OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */
+ OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */
+ OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */
+ OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */
+ OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */
+ OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */
+ OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG2PROFILETYPE;
+
+
+/**
+ * MPEG-2 level types, each level indicates support for various frame
+ * sizes, bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_MPEG2LEVELTYPE {
+ OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */
+ OMX_VIDEO_MPEG2LevelML, /**< Main Level */
+ OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */
+ OMX_VIDEO_MPEG2LevelHL, /**< High Level */
+ OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG2LEVELTYPE;
+
+
+/**
+ * MPEG-2 params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * eProfile : MPEG-2 profile(s) to use
+ * eLevel : MPEG-2 levels(s) to use
+ */
+typedef struct OMX_VIDEO_PARAM_MPEG2TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_VIDEO_MPEG2PROFILETYPE eProfile;
+ OMX_VIDEO_MPEG2LEVELTYPE eLevel;
+} OMX_VIDEO_PARAM_MPEG2TYPE;
+
+
+/**
+ * MPEG-4 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ *
+ * ENUMS:
+ * - Simple Profile, Levels 1-3
+ * - Simple Scalable Profile, Levels 1-2
+ * - Core Profile, Levels 1-2
+ * - Main Profile, Levels 2-4
+ * - N-bit Profile, Level 2
+ * - Scalable Texture Profile, Level 1
+ * - Simple Face Animation Profile, Levels 1-2
+ * - Simple Face and Body Animation (FBA) Profile, Levels 1-2
+ * - Basic Animated Texture Profile, Levels 1-2
+ * - Hybrid Profile, Levels 1-2
+ * - Advanced Real Time Simple Profiles, Levels 1-4
+ * - Core Scalable Profile, Levels 1-3
+ * - Advanced Coding Efficiency Profile, Levels 1-4
+ * - Advanced Core Profile, Levels 1-2
+ * - Advanced Scalable Texture, Levels 2-3
+ */
+typedef enum OMX_VIDEO_MPEG4PROFILETYPE {
+ OMX_VIDEO_MPEG4ProfileSimple = 0x01,
+ OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02,
+ OMX_VIDEO_MPEG4ProfileCore = 0x04,
+ OMX_VIDEO_MPEG4ProfileMain = 0x08,
+ OMX_VIDEO_MPEG4ProfileNbit = 0x10,
+ OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20,
+ OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40,
+ OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80,
+ OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100,
+ OMX_VIDEO_MPEG4ProfileHybrid = 0x200,
+ OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400,
+ OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800,
+ OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000,
+ OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000,
+ OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000,
+ OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG4PROFILETYPE;
+
+
+/**
+ * MPEG-4 level types, each level indicates support for various frame
+ * sizes, bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_MPEG4LEVELTYPE {
+ OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */
+ OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */
+ OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */
+ OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */
+ OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */
+ OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */
+ OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */
+ OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */
+ OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG4LEVELTYPE;
+
+
+/**
+ * MPEG-4 configuration. This structure handles configuration options
+ * which are specific to MPEG4 algorithms
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+
+ * Annex K). Put zero if not used
+ * bSVH : Enable Short Video Header mode
+ * bGov : Flag to enable GOV
+ * nPFrames : Number of P frames between each I frame (also called
+ * GOV period)
+ * nBFrames : Number of B frames between each I frame
+ * nIDCVLCThreshold : Value of intra DC VLC threshold
+ * bACPred : Flag to use ac prediction
+ * nMaxPacketSize : Maximum size of packet in bytes.
+ * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4.
+ * Interpreted as described in MPEG4 standard.
+ * eProfile : MPEG-4 profile(s) to use.
+ * eLevel : MPEG-4 level(s) to use.
+ * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream
+ * nHeaderExtension : Specifies the number of consecutive video packet
+ * headers within a VOP
+ * bReversibleVLC : Specifies whether reversible variable length coding
+ * is in use
+ */
+typedef struct OMX_VIDEO_PARAM_MPEG4TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSliceHeaderSpacing;
+ OMX_BOOL bSVH;
+ OMX_BOOL bGov;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_U32 nIDCVLCThreshold;
+ OMX_BOOL bACPred;
+ OMX_U32 nMaxPacketSize;
+ OMX_U32 nTimeIncRes;
+ OMX_VIDEO_MPEG4PROFILETYPE eProfile;
+ OMX_VIDEO_MPEG4LEVELTYPE eLevel;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_U32 nHeaderExtension;
+ OMX_BOOL bReversibleVLC;
+} OMX_VIDEO_PARAM_MPEG4TYPE;
+
+
+/**
+ * WMV Versions
+ */
+typedef enum OMX_VIDEO_WMVFORMATTYPE {
+ OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */
+ OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */
+ OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */
+ OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */
+ OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF
+} OMX_VIDEO_WMVFORMATTYPE;
+
+
+/**
+ * WMV Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Version of WMV stream / data
+ */
+typedef struct OMX_VIDEO_PARAM_WMVTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_WMVFORMATTYPE eFormat;
+} OMX_VIDEO_PARAM_WMVTYPE;
+
+
+/**
+ * Real Video Version
+ */
+typedef enum OMX_VIDEO_RVFORMATTYPE {
+ OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */
+ OMX_VIDEO_RVFormat8, /**< Real Video format 8 */
+ OMX_VIDEO_RVFormat9, /**< Real Video format 9 */
+ OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */
+ OMX_VIDEO_RVFormatMax = 0x7FFFFFFF
+} OMX_VIDEO_RVFORMATTYPE;
+
+
+/**
+ * Real Video Params
+ *
+ * STUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Version of RV stream / data
+ * nBitsPerPixel : Bits per pixel coded in the frame
+ * nPaddedWidth : Padded width in pixel of a video frame
+ * nPaddedHeight : Padded Height in pixels of a video frame
+ * nFrameRate : Rate of video in frames per second
+ * nBitstreamFlags : Flags which internal information about the bitstream
+ * nBitstreamVersion : Bitstream version
+ * nMaxEncodeFrameSize: Max encoded frame size
+ * bEnablePostFilter : Turn on/off post filter
+ * bEnableTemporalInterpolation : Turn on/off temporal interpolation
+ * bEnableLatencyMode : When enabled, the decoder does not display a decoded
+ * frame until it has detected that no enhancement layer
+ * frames or dependent B frames will be coming. This
+ * detection usually occurs when a subsequent non-B
+ * frame is encountered
+ */
+typedef struct OMX_VIDEO_PARAM_RVTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_RVFORMATTYPE eFormat;
+ OMX_U16 nBitsPerPixel;
+ OMX_U16 nPaddedWidth;
+ OMX_U16 nPaddedHeight;
+ OMX_U32 nFrameRate;
+ OMX_U32 nBitstreamFlags;
+ OMX_U32 nBitstreamVersion;
+ OMX_U32 nMaxEncodeFrameSize;
+ OMX_BOOL bEnablePostFilter;
+ OMX_BOOL bEnableTemporalInterpolation;
+ OMX_BOOL bEnableLatencyMode;
+} OMX_VIDEO_PARAM_RVTYPE;
+
+
+/**
+ * AVC profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_VIDEO_AVCPROFILETYPE {
+ OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */
+ OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */
+ OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */
+ OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */
+ OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */
+ OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */
+ OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */
+ OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCPROFILETYPE;
+
+
+/**
+ * AVC level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_AVCLEVELTYPE {
+ OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */
+ OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */
+ OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */
+ OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */
+ OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */
+ OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */
+ OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */
+ OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */
+ OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */
+ OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */
+ OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */
+ OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */
+ OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */
+ OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */
+ OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */
+ OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */
+ OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCLEVELTYPE;
+
+
+/**
+ * AVC loop filter modes
+ *
+ * OMX_VIDEO_AVCLoopFilterEnable : Enable
+ * OMX_VIDEO_AVCLoopFilterDisable : Disable
+ * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries
+ */
+typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE {
+ OMX_VIDEO_AVCLoopFilterEnable = 0,
+ OMX_VIDEO_AVCLoopFilterDisable,
+ OMX_VIDEO_AVCLoopFilterDisableSliceBoundary,
+ OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCLOOPFILTERTYPE;
+
+
+/**
+ * AVC params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSliceHeaderSpacing : Number of macroblocks between slice header, put
+ * zero if not used
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * bUseHadamard : Enable/disable Hadamard transform
+ * nRefFrames : Max number of reference frames to use for inter
+ * motion search (1-16)
+ * nRefIdxTrailing : Pic param set ref frame index (index into ref
+ * frame buffer of trailing frames list), B frame
+ * support
+ * nRefIdxForward : Pic param set ref frame index (index into ref
+ * frame buffer of forward frames list), B frame
+ * support
+ * bEnableUEP : Enable/disable unequal error protection. This
+ * is only valid of data partitioning is enabled.
+ * bEnableFMO : Enable/disable flexible macroblock ordering
+ * bEnableASO : Enable/disable arbitrary slice ordering
+ * bEnableRS : Enable/disable sending of redundant slices
+ * eProfile : AVC profile(s) to use
+ * eLevel : AVC level(s) to use
+ * nAllowedPictureTypes : Specifies the picture types allowed in the
+ * bitstream
+ * bFrameMBsOnly : specifies that every coded picture of the
+ * coded video sequence is a coded frame
+ * containing only frame macroblocks
+ * bMBAFF : Enable/disable switching between frame and
+ * field macroblocks within a picture
+ * bEntropyCodingCABAC : Entropy decoding method to be applied for the
+ * syntax elements for which two descriptors appear
+ * in the syntax tables
+ * bWeightedPPrediction : Enable/disable weighted prediction shall not
+ * be applied to P and SP slices
+ * nWeightedBipredicitonMode : Default weighted prediction is applied to B
+ * slices
+ * bConstIpred : Enable/disable intra prediction
+ * bDirect8x8Inference : Specifies the method used in the derivation
+ * process for luma motion vectors for B_Skip,
+ * B_Direct_16x16 and B_Direct_8x8 as specified
+ * in subclause 8.4.1.2 of the AVC spec
+ * bDirectSpatialTemporal : Flag indicating spatial or temporal direct
+ * mode used in B slice coding (related to
+ * bDirect8x8Inference) . Spatial direct mode is
+ * more common and should be the default.
+ * nCabacInitIdx : Index used to init CABAC contexts
+ * eLoopFilterMode : Enable/disable loop filter
+ */
+typedef struct OMX_VIDEO_PARAM_AVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSliceHeaderSpacing;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_BOOL bUseHadamard;
+ OMX_U32 nRefFrames;
+ OMX_U32 nRefIdx10ActiveMinus1;
+ OMX_U32 nRefIdx11ActiveMinus1;
+ OMX_BOOL bEnableUEP;
+ OMX_BOOL bEnableFMO;
+ OMX_BOOL bEnableASO;
+ OMX_BOOL bEnableRS;
+ OMX_VIDEO_AVCPROFILETYPE eProfile;
+ OMX_VIDEO_AVCLEVELTYPE eLevel;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_BOOL bFrameMBsOnly;
+ OMX_BOOL bMBAFF;
+ OMX_BOOL bEntropyCodingCABAC;
+ OMX_BOOL bWeightedPPrediction;
+ OMX_U32 nWeightedBipredicitonMode;
+ OMX_BOOL bconstIpred ;
+ OMX_BOOL bDirect8x8Inference;
+ OMX_BOOL bDirectSpatialTemporal;
+ OMX_U32 nCabacInitIdc;
+ OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode;
+} OMX_VIDEO_PARAM_AVCTYPE;
+
+typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE,
+ or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
+ OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE,
+ or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
+ OMX_U32 nProfileIndex; /**< Used to query for individual profile support information,
+ This parameter is valid only for
+ OMX_IndexParamVideoProfileLevelQuerySupported index,
+ For all other indices this parameter is to be ignored. */
+} OMX_VIDEO_PARAM_PROFILELEVELTYPE;
+
+/**
+ * Structure for dynamically configuring bitrate mode of a codec.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : Port that this struct applies to
+ * nEncodeBitrate : Target average bitrate to be generated in bps
+ */
+typedef struct OMX_VIDEO_CONFIG_BITRATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nEncodeBitrate;
+} OMX_VIDEO_CONFIG_BITRATETYPE;
+
+/**
+ * Defines Encoder Frame Rate setting
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * xEncodeFramerate : Encoding framerate represented in Q16 format
+ */
+typedef struct OMX_CONFIG_FRAMERATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 xEncodeFramerate; /* Q16 format */
+} OMX_CONFIG_FRAMERATETYPE;
+
+typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL IntraRefreshVOP;
+} OMX_CONFIG_INTRAREFRESHVOPTYPE;
+
+typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */
+ OMX_U8 ErrMap[1]; /* Error map hint */
+} OMX_CONFIG_MACROBLOCKERRORMAPTYPE;
+
+typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+} OMX_CONFIG_MBERRORREPORTINGTYPE;
+
+typedef struct OMX_PARAM_MACROBLOCKSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nMacroblocks;
+} OMX_PARAM_MACROBLOCKSTYPE;
+
+/**
+ * AVC Slice Mode modes
+ *
+ * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame
+ * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame
+ * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame
+ */
+typedef enum OMX_VIDEO_AVCSLICEMODETYPE {
+ OMX_VIDEO_SLICEMODE_AVCDefault = 0,
+ OMX_VIDEO_SLICEMODE_AVCMBSlice,
+ OMX_VIDEO_SLICEMODE_AVCByteSlice,
+ OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCSLICEMODETYPE;
+
+/**
+ * AVC FMO Slice Mode Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nNumSliceGroups : Specifies the number of slice groups
+ * nSliceGroupMapType : Specifies the type of slice groups
+ * eSliceMode : Specifies the type of slice
+ */
+typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nNumSliceGroups;
+ OMX_U8 nSliceGroupMapType;
+ OMX_VIDEO_AVCSLICEMODETYPE eSliceMode;
+} OMX_VIDEO_PARAM_AVCSLICEFMO;
+
+/**
+ * AVC IDR Period Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nIDRPeriod : Specifies periodicity of IDR frames
+ * nPFrames : Specifies internal of coding Intra frames
+ */
+typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIDRPeriod;
+ OMX_U32 nPFrames;
+} OMX_VIDEO_CONFIG_AVCINTRAPERIOD;
+
+/**
+ * AVC NAL Size Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nNaluBytes : Specifies the NAL unit size
+ */
+typedef struct OMX_VIDEO_CONFIG_NALSIZE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nNaluBytes;
+} OMX_VIDEO_CONFIG_NALSIZE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
diff --git a/make/stub_includes/win32/jni.h b/make/stub_includes/win32/jni.h
new file mode 100644
index 000000000..be01d0187
--- /dev/null
+++ b/make/stub_includes/win32/jni.h
@@ -0,0 +1,78 @@
+/* Stub header for JNI which provides needed declarations without more
+ complicated and unnecessary constructs */
+
+/*
+ * JNI Types
+ */
+
+#include "jni_md.h"
+
+typedef unsigned char jboolean;
+typedef unsigned short jchar;
+typedef short jshort;
+typedef float jfloat;
+typedef double jdouble;
+
+typedef jint jsize;
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+typedef jobject jweak;
+
+typedef union jvalue {
+ jboolean z;
+ jbyte b;
+ jchar c;
+ jshort s;
+ jint i;
+ jlong j;
+ jfloat f;
+ jdouble d;
+ jobject l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK 0 /* success */
+#define JNI_ERR (-1) /* unknown error */
+#define JNI_EDETACHED (-2) /* thread detached from the VM */
+#define JNI_EVERSION (-3) /* JNI version error */
+#define JNI_ENOMEM (-4) /* not enough memory */
+#define JNI_EEXIST (-5) /* VM already created */
+#define JNI_EINVAL (-6) /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
diff --git a/make/stub_includes/win32/jni_md.h b/make/stub_includes/win32/jni_md.h
new file mode 100644
index 000000000..0c020e8e9
--- /dev/null
+++ b/make/stub_includes/win32/jni_md.h
@@ -0,0 +1,10 @@
+#define _JNI_IMPORT_OR_EXPORT_
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef int jint;
+typedef __int64 jlong;
+typedef signed char jbyte;
+
+typedef long JNIEnv;
diff --git a/make/stub_includes/win32/wglext.c b/make/stub_includes/win32/wglext.c
new file mode 100755
index 000000000..9c6120411
--- /dev/null
+++ b/make/stub_includes/win32/wglext.c
@@ -0,0 +1,13 @@
+#define GLAPI
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GL/gl.h>
+
+// Bring in the wgl extensions
+#define WGL_WGLEXT_PROTOTYPES
+#define SKIP_WGL_HANDLE_DEFINITIONS
+#include <windows.h>
+#include <GL/wglext.h>
diff --git a/make/stub_includes/win32/window-system.c b/make/stub_includes/win32/window-system.c
new file mode 100644
index 000000000..c5c5d37b9
--- /dev/null
+++ b/make/stub_includes/win32/window-system.c
@@ -0,0 +1,2 @@
+#include <windows.h>
+#include <wingdi.h>
diff --git a/make/stub_includes/win32/windows.h b/make/stub_includes/win32/windows.h
new file mode 100644
index 000000000..647a5733d
--- /dev/null
+++ b/make/stub_includes/win32/windows.h
@@ -0,0 +1,49 @@
+/* Windows #defines and typedefs required for processing of extracts
+ from WINGDI.H and jawt_md.h */
+
+#define FAR
+#define WINBASEAPI
+#define WINGDIAPI
+#define WINUSERAPI
+#define WINAPI
+#define APIENTRY
+#define CONST const
+#define VOID void
+typedef int BOOL;
+typedef unsigned char BYTE;
+typedef char CHAR;
+typedef unsigned int DWORD;
+typedef int INT;
+typedef int INT32;
+typedef __int64 INT64;
+typedef float FLOAT;
+typedef struct _handle* HANDLE;
+typedef HANDLE HBITMAP;
+typedef HANDLE HDC;
+typedef HANDLE HGDIOBJ;
+typedef HANDLE HGLRC;
+typedef HANDLE HMODULE;
+typedef HANDLE HPALETTE;
+typedef HANDLE HWND;
+typedef long LONG;
+typedef const char* LPCSTR;
+typedef void* LPVOID;
+typedef struct _proc* PROC;
+typedef unsigned int* PUINT;
+typedef unsigned int UINT;
+typedef unsigned short USHORT;
+typedef unsigned short WORD;
+
+typedef struct tagRECT
+ {
+ LONG left;
+ LONG top;
+ LONG right;
+ LONG bottom;
+ } RECT;
+
+/* Necessary handle typedefs for parsing wglext.h */
+
+typedef HANDLE HPBUFFERARB;
+typedef HANDLE HPBUFFEREXT;
+typedef HANDLE HGPUNV;
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
new file mode 100644
index 000000000..4d980755b
--- /dev/null
+++ b/make/stub_includes/win32/wingdi.h
@@ -0,0 +1,216 @@
+/*
+ * Essential wgl and supporting routines and data structures extracted
+ * from WINGDI.H.
+ *
+ * Copyright (c) 1985-1997, Microsoft Corp. All rights reserved.
+ *
+ */
+
+typedef struct tagRGBQUAD {
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+} RGBQUAD;
+typedef RGBQUAD FAR* LPRGBQUAD;
+
+typedef struct tagBITMAPINFOHEADER{
+ DWORD biSize;
+ LONG biWidth;
+ LONG biHeight;
+ WORD biPlanes;
+ WORD biBitCount;
+ DWORD biCompression;
+ DWORD biSizeImage;
+ LONG biXPelsPerMeter;
+ LONG biYPelsPerMeter;
+ DWORD biClrUsed;
+ DWORD biClrImportant;
+} BITMAPINFOHEADER, FAR *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER;
+
+typedef struct tagBITMAPINFO {
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO, FAR *LPBITMAPINFO, *PBITMAPINFO;
+
+/* constants for the biCompression field */
+#define BI_RGB 0
+#define BI_RLE8 1
+#define BI_RLE4 2
+#define BI_BITFIELDS 3
+
+/* DIB color table identifiers */
+
+#define DIB_RGB_COLORS 0 /* color table in RGBs */
+#define DIB_PAL_COLORS 1 /* color table in palette indices */
+
+/* Pixel format descriptor */
+typedef struct tagPIXELFORMATDESCRIPTOR
+{
+ WORD nSize;
+ WORD nVersion;
+ DWORD dwFlags;
+ BYTE iPixelType;
+ BYTE cColorBits;
+ BYTE cRedBits;
+ BYTE cRedShift;
+ BYTE cGreenBits;
+ BYTE cGreenShift;
+ BYTE cBlueBits;
+ BYTE cBlueShift;
+ BYTE cAlphaBits;
+ BYTE cAlphaShift;
+ BYTE cAccumBits;
+ BYTE cAccumRedBits;
+ BYTE cAccumGreenBits;
+ BYTE cAccumBlueBits;
+ BYTE cAccumAlphaBits;
+ BYTE cDepthBits;
+ BYTE cStencilBits;
+ BYTE cAuxBuffers;
+ BYTE iLayerType;
+ BYTE bReserved;
+ DWORD dwLayerMask;
+ DWORD dwVisibleMask;
+ DWORD dwDamageMask;
+} PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, FAR *LPPIXELFORMATDESCRIPTOR;
+
+/* pixel types */
+#define PFD_TYPE_RGBA 0
+#define PFD_TYPE_COLORINDEX 1
+
+/* layer types */
+#define PFD_MAIN_PLANE 0
+#define PFD_OVERLAY_PLANE 1
+#define PFD_UNDERLAY_PLANE (-1)
+#define WGL_SWAP_MAIN_PLANE 1
+#define WGL_SWAP_OVERLAY1 2
+#define WGL_SWAP_OVERLAY2 4
+#define WGL_SWAP_OVERLAY3 8
+#define WGL_SWAP_OVERLAY4 16
+#define WGL_SWAP_OVERLAY5 32
+#define WGL_SWAP_OVERLAY6 64
+#define WGL_SWAP_OVERLAY7 128
+#define WGL_SWAP_OVERLAY8 256
+#define WGL_SWAP_OVERLAY9 512
+#define WGL_SWAP_OVERLAY10 1024
+#define WGL_SWAP_OVERLAY11 2048
+#define WGL_SWAP_OVERLAY12 4096
+#define WGL_SWAP_OVERLAY13 8192
+#define WGL_SWAP_OVERLAY14 16384
+#define WGL_SWAP_OVERLAY15 32768
+#define WGL_SWAP_UNDERLAY1 65536
+#define WGL_SWAP_UNDERLAY2 0x20000
+#define WGL_SWAP_UNDERLAY3 0x40000
+#define WGL_SWAP_UNDERLAY4 0x80000
+#define WGL_SWAP_UNDERLAY5 0x100000
+#define WGL_SWAP_UNDERLAY6 0x200000
+#define WGL_SWAP_UNDERLAY7 0x400000
+#define WGL_SWAP_UNDERLAY8 0x800000
+#define WGL_SWAP_UNDERLAY9 0x1000000
+#define WGL_SWAP_UNDERLAY10 0x2000000
+#define WGL_SWAP_UNDERLAY11 0x4000000
+#define WGL_SWAP_UNDERLAY12 0x8000000
+#define WGL_SWAP_UNDERLAY13 0x10000000
+#define WGL_SWAP_UNDERLAY14 0x20000000
+#define WGL_SWAP_UNDERLAY15 0x40000000
+
+/* PIXELFORMATDESCRIPTOR flags */
+#define PFD_DOUBLEBUFFER 0x00000001
+#define PFD_STEREO 0x00000002
+#define PFD_DRAW_TO_WINDOW 0x00000004
+#define PFD_DRAW_TO_BITMAP 0x00000008
+#define PFD_SUPPORT_GDI 0x00000010
+#define PFD_SUPPORT_OPENGL 0x00000020
+#define PFD_GENERIC_FORMAT 0x00000040
+#define PFD_NEED_PALETTE 0x00000080
+#define PFD_NEED_SYSTEM_PALETTE 0x00000100
+#define PFD_SWAP_EXCHANGE 0x00000200
+#define PFD_SWAP_COPY 0x00000400
+#define PFD_SWAP_LAYER_BUFFERS 0x00000800
+#define PFD_GENERIC_ACCELERATED 0x00001000
+#define PFD_SUPPORT_DIRECTDRAW 0x00002000
+
+/* PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only */
+#define PFD_DEPTH_DONTCARE 0x20000000
+#define PFD_DOUBLEBUFFER_DONTCARE 0x40000000
+#define PFD_STEREO_DONTCARE 0x80000000
+
+/* OpenGL error codes (from winerror.h) */
+/* FIXME: these should have a trailing "L" but apparently PCPP doesn't handle that syntax */
+#define ERROR_INVALID_PIXEL_FORMAT 2000
+#define ERROR_NO_SYSTEM_RESOURCES 1450
+#define ERROR_INVALID_DATA 13
+#define ERROR_PROC_NOT_FOUND 127
+#define ERROR_INVALID_WINDOW_HANDLE 1400
+
+/*
+ * ShowWindow() Commands
+ */
+#define SW_HIDE 0
+#define SW_SHOWNORMAL 1
+#define SW_NORMAL 1
+#define SW_SHOWMINIMIZED 2
+#define SW_SHOWMAXIMIZED 3
+#define SW_MAXIMIZE 3
+#define SW_SHOWNOACTIVATE 4
+#define SW_SHOW 5
+#define SW_MINIMIZE 6
+#define SW_SHOWMINNOACTIVE 7
+#define SW_SHOWNA 8
+#define SW_RESTORE 9
+#define SW_SHOWDEFAULT 10
+#define SW_FORCEMINIMIZE 11
+#define SW_MAX 11
+
+// Windows routines
+WINBASEAPI DWORD WINAPI GetLastError(VOID);
+WINBASEAPI HMODULE WINAPI LoadLibraryA(LPCSTR lpLibFileName);
+WINBASEAPI PROC WINAPI GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
+
+// OpenGL-related routines
+WINGDIAPI int WINAPI ChoosePixelFormat(HDC, CONST PIXELFORMATDESCRIPTOR *);
+WINGDIAPI int WINAPI DescribePixelFormat(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR);
+WINGDIAPI int WINAPI GetPixelFormat(HDC);
+WINGDIAPI BOOL WINAPI SetPixelFormat(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
+WINGDIAPI BOOL WINAPI wglCopyContext(HGLRC, HGLRC, UINT);
+WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
+WINGDIAPI BOOL WINAPI wglDeleteContext(HGLRC);
+WINGDIAPI HGLRC WINAPI wglGetCurrentContext(VOID);
+WINGDIAPI HDC WINAPI wglGetCurrentDC(VOID);
+WINGDIAPI BOOL WINAPI wglMakeCurrent(HDC, HGLRC);
+WINGDIAPI BOOL WINAPI wglShareLists(HGLRC, HGLRC);
+WINGDIAPI BOOL WINAPI SwapBuffers(HDC);
+WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
+WINGDIAPI BOOL WINAPI wglSwapLayerBuffers(HDC,UINT);
+
+/* --- FIXME: need to handle these entry points!
+WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC, int);
+WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD);
+WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD);
+#ifdef UNICODE
+#define wglUseFontBitmaps wglUseFontBitmapsW
+#else
+#define wglUseFontBitmaps wglUseFontBitmapsA
+#endif // !UNICODE
+*/
+
+// Routines related to bitmap creation for off-screen rendering
+WINGDIAPI HDC WINAPI CreateCompatibleDC(HDC);
+WINGDIAPI HBITMAP WINAPI CreateDIBSection(HDC, CONST BITMAPINFO *, UINT, VOID **, HANDLE, DWORD);
+WINGDIAPI BOOL WINAPI DeleteDC(HDC);
+WINGDIAPI BOOL WINAPI DeleteObject(HGDIOBJ);
+WINGDIAPI HGDIOBJ WINAPI SelectObject(HDC, HGDIOBJ);
+
+// Routines for creation of a dummy window, device context and OpenGL
+// context for the purposes of getting wglChoosePixelFormatARB and
+// associated routines
+HDC CreateDummyWindow(int,int,int,int);
+WINUSERAPI BOOL WINAPI ShowWindow(HWND hWnd, int nCmdShow);
+WINUSERAPI HDC WINAPI GetDC(HWND);
+WINUSERAPI int WINAPI ReleaseDC(HWND hWnd, HDC hDC);
+WINUSERAPI BOOL WINAPI DestroyWindow(HWND hWnd);
+
+// Routines for changing gamma ramp of display device
+WINGDIAPI BOOL WINAPI GetDeviceGammaRamp(HDC,LPVOID);
+WINGDIAPI BOOL WINAPI SetDeviceGammaRamp(HDC,LPVOID);
diff --git a/make/stub_includes/x11/X11/Intrinsic.h b/make/stub_includes/x11/X11/Intrinsic.h
new file mode 100644
index 000000000..558d3791b
--- /dev/null
+++ b/make/stub_includes/x11/X11/Intrinsic.h
@@ -0,0 +1 @@
+#include <X11/X.h>
diff --git a/make/stub_includes/x11/X11/X.h b/make/stub_includes/x11/X11/X.h
new file mode 100644
index 000000000..239836ee4
--- /dev/null
+++ b/make/stub_includes/x11/X11/X.h
@@ -0,0 +1,35 @@
+#ifndef _X_H_
+#define _X_H_
+
+typedef struct {} * XID;
+typedef int Bool;
+typedef struct {} Display;
+typedef int Status;
+typedef struct {} Visual;
+typedef unsigned long VisualID;
+typedef XID Colormap;
+typedef XID Cursor;
+typedef XID Drawable;
+typedef XID Font;
+typedef XID GContext;
+typedef XID KeySym;
+typedef XID Pixmap;
+typedef XID Window;
+
+typedef struct __GLXcontextRec *GLXContext;
+//typedef void *GLXContext;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+/* GLX 1.3 and later */
+typedef struct __GLXFBConfigRec *GLXFBConfig;
+//typedef void *GLXFBConfig;
+typedef XID GLXFBConfigID;
+typedef XID GLXContextID;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+// Hacks for glXGetProcAddress
+typedef void (*__GLXextFuncPtr)(void);
+typedef unsigned char GLubyte; /* 1-byte unsigned */
+
+#endif /* defined _X_H_ */
diff --git a/make/stub_includes/x11/X11/Xlib.h b/make/stub_includes/x11/X11/Xlib.h
new file mode 100644
index 000000000..558d3791b
--- /dev/null
+++ b/make/stub_includes/x11/X11/Xlib.h
@@ -0,0 +1 @@
+#include <X11/X.h>
diff --git a/make/stub_includes/x11/X11/Xutil.h b/make/stub_includes/x11/X11/Xutil.h
new file mode 100644
index 000000000..32c8d5be5
--- /dev/null
+++ b/make/stub_includes/x11/X11/Xutil.h
@@ -0,0 +1,37 @@
+#ifndef _XUTIL_H_
+#define _XUTIL_H_
+
+#include <X11/X.h>
+#include <X11/Xlib.h>
+
+/*
+ * Information used by the visual utility routines to find desired visual
+ * type from the many visuals a display may support.
+ */
+
+typedef struct {
+ Visual *visual;
+ VisualID visualid;
+ int screen;
+ int depth;
+ int c_class; /* C++ */
+ unsigned long red_mask;
+ unsigned long green_mask;
+ unsigned long blue_mask;
+ int colormap_size;
+ int bits_per_rgb;
+} XVisualInfo;
+
+#define VisualNoMask 0x0
+#define VisualIDMask 0x1
+#define VisualScreenMask 0x2
+#define VisualDepthMask 0x4
+#define VisualClassMask 0x8
+#define VisualRedMaskMask 0x10
+#define VisualGreenMaskMask 0x20
+#define VisualBlueMaskMask 0x40
+#define VisualColormapSizeMask 0x80
+#define VisualBitsPerRGBMask 0x100
+#define VisualAllMask 0x1FF
+
+#endif /* #defined _XUTIL_H_ */
diff --git a/make/stub_includes/x11/glxext.c b/make/stub_includes/x11/glxext.c
new file mode 100644
index 000000000..67906a088
--- /dev/null
+++ b/make/stub_includes/x11/glxext.c
@@ -0,0 +1,14 @@
+#define GLAPI
+
+// Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in
+// "glext.h" are parsed.
+#define GL_GLEXT_PROTOTYPES
+
+#include <GL/gl.h>
+
+// Define GLX_GLXEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
+// "glxext.h" are parsed.
+#define GLX_GLXEXT_PROTOTYPES
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <GL/glxext.h>
diff --git a/make/stub_includes/x11/jni.h b/make/stub_includes/x11/jni.h
new file mode 100644
index 000000000..be01d0187
--- /dev/null
+++ b/make/stub_includes/x11/jni.h
@@ -0,0 +1,78 @@
+/* Stub header for JNI which provides needed declarations without more
+ complicated and unnecessary constructs */
+
+/*
+ * JNI Types
+ */
+
+#include "jni_md.h"
+
+typedef unsigned char jboolean;
+typedef unsigned short jchar;
+typedef short jshort;
+typedef float jfloat;
+typedef double jdouble;
+
+typedef jint jsize;
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+typedef jobject jweak;
+
+typedef union jvalue {
+ jboolean z;
+ jbyte b;
+ jchar c;
+ jshort s;
+ jint i;
+ jlong j;
+ jfloat f;
+ jdouble d;
+ jobject l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK 0 /* success */
+#define JNI_ERR (-1) /* unknown error */
+#define JNI_EDETACHED (-2) /* thread detached from the VM */
+#define JNI_EVERSION (-3) /* JNI version error */
+#define JNI_ENOMEM (-4) /* not enough memory */
+#define JNI_EEXIST (-5) /* VM already created */
+#define JNI_EINVAL (-6) /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
diff --git a/make/stub_includes/x11/jni_md.h b/make/stub_includes/x11/jni_md.h
new file mode 100644
index 000000000..449786272
--- /dev/null
+++ b/make/stub_includes/x11/jni_md.h
@@ -0,0 +1,15 @@
+#define _JNI_IMPORT_OR_EXPORT_
+#define JNIEXPORT
+#define JNIIMPORT
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit Solaris */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+
+typedef signed char jbyte;
+
+typedef long JNIEnv;
diff --git a/make/stub_includes/x11/window-lib.c b/make/stub_includes/x11/window-lib.c
new file mode 100644
index 000000000..17ddcb1c7
--- /dev/null
+++ b/make/stub_includes/x11/window-lib.c
@@ -0,0 +1,62 @@
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+// Routines needed from Xlib.h and Xutil.h (placed here to avoid having
+// XVisualInfo generated multiple times)
+#ifndef _Xconst
+#define _Xconst const
+#endif /* _Xconst */
+
+extern Display *XOpenDisplay(
+ _Xconst char* /* display_name */
+);
+
+extern XVisualInfo *XGetVisualInfo(
+ Display* /* display */,
+ long /* vinfo_mask */,
+ XVisualInfo* /* vinfo_template */,
+ int* /* nitems_return */
+);
+
+extern Pixmap XCreatePixmap(
+ Display* /* display */,
+ Drawable /* d */,
+ unsigned int /* width */,
+ unsigned int /* height */,
+ unsigned int /* depth */
+);
+
+extern int XFreePixmap(
+ Display* /* display */,
+ Pixmap /* pixmap */
+);
+
+extern int XFree(
+ void* /* data */
+);
+
+// Helper routine for querying whether Xinerama is enabled.
+Bool XineramaEnabled(Display* display);
+
+// Routines for changing gamma settings.
+// Note that these are not currently supported on Solaris.
+Bool XF86VidModeGetGammaRampSize(
+ Display *display,
+ int screen,
+ int* size);
+
+Bool XF86VidModeGetGammaRamp(
+ Display *display,
+ int screen,
+ int size,
+ unsigned short *red_array,
+ unsigned short *green_array,
+ unsigned short *blue_array);
+
+Bool XF86VidModeSetGammaRamp(
+ Display *display,
+ int screen,
+ int size,
+ unsigned short *red_array,
+ unsigned short *green_array,
+ unsigned short *blue_array);
diff --git a/make/stub_includes/x11/window-system.c b/make/stub_includes/x11/window-system.c
new file mode 100644
index 000000000..e718aee97
--- /dev/null
+++ b/make/stub_includes/x11/window-system.c
@@ -0,0 +1,14 @@
+// Define GLX_GLXEXT_PROTOTYPES so that the OpenGL GLX extension prototypes in
+// "glxext.h" are parsed.
+#define GLX_GLXEXT_PROTOTYPES
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <GL/glx.h>
+
+// Routines needed from Xlib.h and Xutil.h (placed here to avoid having
+// XVisualInfo generated multiple times)
+#ifndef _Xconst
+#define _Xconst const
+#endif /* _Xconst */
+
diff --git a/make/validate-properties.xml b/make/validate-properties.xml
new file mode 100644
index 000000000..3afb12bd5
--- /dev/null
+++ b/make/validate-properties.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ - A validator for all of the user-defined properties. It will be called
+ - from build.xml in the "init" task.
+ -->
+<project name="Configuration validator" default="validate">
+
+ <!-- ================================================================== -->
+ <!--
+ - Ensure that "antlr.jar" is set.
+ -->
+ <target name="antlr.jar.validate" unless="antlr.jar">
+ <fail>
+
+ *****************************************************************
+ ** The property "antlr.jar" was not set in the JOGL properties **
+ ** file **
+ ** "${user.properties.file}" **
+ ** (or this file was not found). **
+ ** **
+ ** Please set "antlr.jar" to to the full path of the ANTLR jar **
+ ** including the jar itself. **
+ *****************************************************************
+ </fail>
+ </target>
+
+ <!--
+ - Make sure that jogl.jar is not on the CLASSPATH; this can cause
+ - builds to fail since if this Java process has the jar file open
+ - we can not overwrite it.
+ -->
+ <target name="java.class.path.validate">
+ <available property="jogl.jar.on.class.path" classname="javax.media.opengl.GL" />
+ <fail if="jogl.jar.on.class.path">
+
+ ******************************************************************
+ ** Your CLASSPATH environment variable appears to be set (some **
+ ** JOGL classes are currently visible to the build.) This can **
+ ** cause the build to fail. Please unset your CLASSPATH **
+ ** variable and restart the build. **
+ ******************************************************************
+ </fail>
+ </target>
+
+ <!-- ================================================================== -->
+ <!--
+ - Validate the required properties
+ -->
+ <target name="validate" depends="antlr.jar.validate, java.class.path.validate"
+ description="Validate required properties" />
+
+</project>
diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java
new file mode 100755
index 000000000..8e4e97b0c
--- /dev/null
+++ b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Audio.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.javafx.audio.windows.waveout;
+
+import java.io.*;
+
+public class Audio {
+ private static Audio instance = null;
+ private Mixer mixer;
+
+ public synchronized static Audio getInstance() {
+ if (instance == null) {
+ instance = new Audio();
+ }
+ return instance;
+ }
+
+ private Audio() {
+ mixer = Mixer.getMixer();
+ }
+
+ public Mixer getMixer() {
+ return mixer;
+ }
+
+ public Track newTrack(File file) throws IOException
+ {
+ Track res = new Track(file);
+ mixer.add(res);
+ return res;
+ }
+
+ public void shutdown() {
+ mixer.shutdown();
+ }
+}
diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java
new file mode 100755
index 000000000..814a74a8c
--- /dev/null
+++ b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Mixer.java
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.javafx.audio.windows.waveout;
+
+import java.io.*;
+import java.nio.*;
+import java.util.*;
+
+// Needed only for NIO workarounds on CVM
+import java.lang.reflect.*;
+
+public class Mixer {
+ // This class is a singleton
+ private static Mixer mixer;
+
+ private volatile boolean shutdown;
+ private volatile Object shutdownLock = new Object();
+ private volatile boolean shutdownDone;
+
+ // Windows Event object
+ private long event;
+
+ private volatile ArrayList/*<Track>*/ tracks = new ArrayList();
+
+ private Vec3f leftSpeakerPosition = new Vec3f(-1, 0, 0);
+ private Vec3f rightSpeakerPosition = new Vec3f( 1, 0, 0);
+
+ private float falloffFactor = 1.0f;
+
+ static {
+ mixer = new Mixer();
+ }
+
+ private Mixer() {
+ event = CreateEvent();
+ new FillerThread().start();
+ MixerThread m = new MixerThread();
+ m.setPriority(Thread.MAX_PRIORITY - 1);
+ m.start();
+ }
+
+ public static Mixer getMixer() {
+ return mixer;
+ }
+
+ synchronized void add(Track track) {
+ ArrayList/*<Track>*/ newTracks = (ArrayList) tracks.clone();
+ newTracks.add(track);
+ tracks = newTracks;
+ }
+
+ synchronized void remove(Track track) {
+ ArrayList/*<Track>*/ newTracks = (ArrayList) tracks.clone();
+ newTracks.remove(track);
+ tracks = newTracks;
+ }
+
+ // NOTE: due to a bug on the APX device, we only have mono sounds,
+ // so we currently only pay attention to the position of the left
+ // speaker
+ public void setLeftSpeakerPosition(float x, float y, float z) {
+ leftSpeakerPosition.set(x, y, z);
+ }
+
+ // NOTE: due to a bug on the APX device, we only have mono sounds,
+ // so we currently only pay attention to the position of the left
+ // speaker
+ public void setRightSpeakerPosition(float x, float y, float z) {
+ rightSpeakerPosition.set(x, y, z);
+ }
+
+ /** This defines a scale factor of sorts -- the higher the number,
+ the larger an area the sound will affect. Default value is
+ 1.0f. Valid values are [1.0f, ...]. The formula for the gain
+ for each channel is
+<PRE>
+ falloffFactor
+ -------------------
+ falloffFactor + r^2
+</PRE>
+*/
+ public void setFalloffFactor(float factor) {
+ falloffFactor = factor;
+ }
+
+ public void shutdown() {
+ synchronized(shutdownLock) {
+ shutdown = true;
+ SetEvent(event);
+ try {
+ shutdownLock.wait();
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ class FillerThread extends Thread {
+ FillerThread() {
+ super("Mixer Thread");
+ }
+
+ public void run() {
+ while (!shutdown) {
+ List/*<Track>*/ curTracks = tracks;
+
+ for (Iterator iter = curTracks.iterator(); iter.hasNext(); ) {
+ Track track = (Track) iter.next();
+ try {
+ track.fill();
+ } catch (IOException e) {
+ e.printStackTrace();
+ remove(track);
+ }
+ }
+
+ try {
+ // Run ten times per second
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ class MixerThread extends Thread {
+ // Temporary mixing buffer
+ // Interleaved left and right channels
+ float[] mixingBuffer;
+ private Vec3f temp = new Vec3f();
+
+ MixerThread() {
+ super("Mixer Thread");
+ if (!initializeWaveOut(event)) {
+ throw new InternalError("Error initializing waveout device");
+ }
+ }
+
+ public void run() {
+ while (!shutdown) {
+ // Get the next buffer
+ long mixerBuffer = getNextMixerBuffer();
+ if (mixerBuffer != 0) {
+ ByteBuffer buf = getMixerBufferData(mixerBuffer);
+
+ if (buf == null) {
+ // This is happening on CVM because
+ // JNI_NewDirectByteBuffer isn't implemented
+ // by default and isn't compatible with the
+ // JSR-239 NIO implementation (apparently)
+ buf = newDirectByteBuffer(getMixerBufferDataAddress(mixerBuffer),
+ getMixerBufferDataCapacity(mixerBuffer));
+ }
+
+ if (buf == null) {
+ throw new InternalError("Couldn't wrap the native address with a direct byte buffer");
+ }
+
+ // System.out.println("Mixing buffer");
+
+ // If we don't have enough samples in our mixing buffer, expand it
+ // FIXME: knowledge of native output rendering format
+ if ((mixingBuffer == null) || (mixingBuffer.length < (buf.capacity() / 2 /* bytes / sample */))) {
+ mixingBuffer = new float[buf.capacity() / 2];
+ } else {
+ // Zap it
+ for (int i = 0; i < mixingBuffer.length; i++) {
+ mixingBuffer[i] = 0.0f;
+ }
+ }
+
+ // This assertion should be in place if we have stereo
+ if ((mixingBuffer.length % 2) != 0) {
+ String msg = "FATAL ERROR: odd number of samples in the mixing buffer";
+ System.out.println(msg);
+ throw new InternalError(msg);
+ }
+
+ // Run down all of the registered tracks mixing them in
+ List/*<Track>*/ curTracks = tracks;
+
+ for (Iterator iter = curTracks.iterator(); iter.hasNext(); ) {
+ Track track = (Track) iter.next();
+ // Consider only playing tracks
+ if (track.isPlaying()) {
+ // First recompute its gain
+ Vec3f pos = track.getPosition();
+ float leftGain = gain(pos, leftSpeakerPosition);
+ float rightGain = gain(pos, rightSpeakerPosition);
+ // Now mix it in
+ int i = 0;
+ while (i < mixingBuffer.length) {
+ if (track.hasNextSample()) {
+ float sample = track.nextSample();
+ mixingBuffer[i++] = sample * leftGain;
+ mixingBuffer[i++] = sample * rightGain;
+ } else {
+ // This allows tracks to stall without being abruptly cancelled
+ if (track.done()) {
+ remove(track);
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Now that we have our data, send it down to the card
+ int outPos = 0;
+ for (int i = 0; i < mixingBuffer.length; i++) {
+ short val = (short) mixingBuffer[i];
+ buf.put(outPos++, (byte) val);
+ buf.put(outPos++, (byte) (val >> 8));
+ }
+ if (!prepareMixerBuffer(mixerBuffer)) {
+ throw new RuntimeException("Error preparing mixer buffer");
+ }
+ if (!writeMixerBuffer(mixerBuffer)) {
+ throw new RuntimeException("Error writing mixer buffer to device");
+ }
+ } else {
+ // System.out.println("No mixer buffer available");
+
+ // Wait for a buffer to become available
+ if (!WaitForSingleObject(event)) {
+ throw new RuntimeException("Error while waiting for event object");
+ }
+
+ /*
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ }
+ */
+ }
+ }
+
+ // Need to shut down
+ shutdownWaveOut();
+ synchronized(shutdownLock) {
+ shutdownLock.notifyAll();
+ }
+ }
+
+ // This defines the 3D spatialization gain function.
+ // The function is defined as:
+ // falloffFactor
+ // -------------------
+ // falloffFactor + r^2
+ private float gain(Vec3f pos, Vec3f speakerPos) {
+ temp.sub(pos, speakerPos);
+ float dotp = temp.dot(temp);
+ return (falloffFactor / (falloffFactor + dotp));
+ }
+ }
+
+ // Initializes waveout device
+ private static native boolean initializeWaveOut(long eventObject);
+ // Shuts down waveout device
+ private static native void shutdownWaveOut();
+
+ // Gets the next (opaque) buffer of data to fill from the native
+ // code, or 0 if none was available yet (it should not happen that
+ // none is available the way the code is written).
+ private static native long getNextMixerBuffer();
+ // Gets the next ByteBuffer to fill out of the mixer buffer. It
+ // requires interleaved left and right channel samples, 16 signed
+ // bits per sample, little endian. Implicit 44.1 kHz sample rate.
+ private static native ByteBuffer getMixerBufferData(long mixerBuffer);
+ // We need these to work around the lack of
+ // JNI_NewDirectByteBuffer in CVM + the JSR 239 NIO classes
+ private static native long getMixerBufferDataAddress(long mixerBuffer);
+ private static native int getMixerBufferDataCapacity(long mixerBuffer);
+ // Prepares this mixer buffer for writing to the device.
+ private static native boolean prepareMixerBuffer(long mixerBuffer);
+ // Writes this mixer buffer to the device.
+ private static native boolean writeMixerBuffer(long mixerBuffer);
+
+ // Helpers to prevent mixer thread from busy waiting
+ private static native long CreateEvent();
+ private static native boolean WaitForSingleObject(long event);
+ private static native void SetEvent(long event);
+ private static native void CloseHandle(long handle);
+
+ // We need a reflective hack to wrap a direct ByteBuffer around
+ // the native memory because JNI_NewDirectByteBuffer doesn't work
+ // in CVM + JSR-239 NIO
+ private static Class directByteBufferClass;
+ private static Constructor directByteBufferConstructor;
+ private static Map createdBuffers = new HashMap(); // Map Long, ByteBuffer
+
+ private static ByteBuffer newDirectByteBuffer(long address, long capacity) {
+ Long key = new Long(address);
+ ByteBuffer buf = (ByteBuffer) createdBuffers.get(key);
+ if (buf == null) {
+ buf = newDirectByteBufferImpl(address, capacity);
+ if (buf != null) {
+ createdBuffers.put(key, buf);
+ }
+ }
+ return buf;
+ }
+ private static ByteBuffer newDirectByteBufferImpl(long address, long capacity) {
+ if (directByteBufferClass == null) {
+ try {
+ directByteBufferClass = Class.forName("java.nio.DirectByteBuffer");
+ byte[] tmp = new byte[0];
+ directByteBufferConstructor =
+ directByteBufferClass.getDeclaredConstructor(new Class[] { Integer.TYPE,
+ tmp.getClass(),
+ Integer.TYPE });
+ directByteBufferConstructor.setAccessible(true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (directByteBufferConstructor != null) {
+ try {
+ return (ByteBuffer)
+ directByteBufferConstructor.newInstance(new Object[] {
+ new Integer((int) capacity),
+ null,
+ new Integer((int) address)
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+}
diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java
new file mode 100755
index 000000000..b0404673e
--- /dev/null
+++ b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/SoundBuffer.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.javafx.audio.windows.waveout;
+
+import java.io.*;
+
+class SoundBuffer {
+ private byte[] data;
+ private boolean needsByteSwap;
+ private int numBytes;
+ private int bytesPerSample;
+ private int numSamples;
+ private boolean playing;
+ private boolean empty;
+
+ // Note: needsByteSwap argument makes assumptions about the format
+ SoundBuffer(int size, int bytesPerSample, boolean needsByteSwap) {
+ this.bytesPerSample = bytesPerSample;
+ this.needsByteSwap = needsByteSwap;
+ data = new byte[size * bytesPerSample];
+ empty = true;
+ }
+
+ boolean playing() {
+ return playing;
+ }
+
+ void playing(boolean playing) {
+ this.playing = playing;
+ }
+
+ boolean empty() {
+ return empty;
+ }
+
+ void empty(boolean empty) {
+ this.empty = empty;
+ }
+
+ void fill(InputStream input) throws IOException {
+ synchronized(this) {
+ if (playing) {
+ throw new IllegalStateException("Can not fill a buffer that is playing");
+ }
+ }
+
+ empty(true);
+ int num = input.read(data);
+ if (num > 0) {
+ numBytes = num;
+ numSamples = numBytes / bytesPerSample;
+ empty(false);
+ if ((numBytes % bytesPerSample) != 0) {
+ System.out.println("WARNING: needed integral multiple of " + bytesPerSample +
+ " bytes, but read " + numBytes + " bytes");
+ }
+ } else {
+ numBytes = 0;
+ }
+ }
+
+ int numSamples() {
+ return numSamples;
+ }
+
+ // This is called by the mixer and must be extremely fast
+ // FIXME: may want to reconsider use of floating point at this point
+ // FIXME: assumes all sounds are of the same format to avoid normalization
+ float getSample(int sample) {
+ int startByte = sample * bytesPerSample;
+ // FIXME: assumes no more than 4 bytes per sample
+ int res = 0;
+ if (needsByteSwap) {
+ for (int i = startByte + bytesPerSample - 1; i >= startByte; i--) {
+ res <<= 8;
+ res |= (data[i] & 0xff);
+ }
+ } else {
+ int endByte = startByte + bytesPerSample - 1;
+ for (int i = startByte; i <= endByte; i++) {
+ res <<= 8;
+ res |= (data[i] & 0xff);
+ }
+ }
+ // Sign extend
+ if (bytesPerSample == 2) {
+ res = (short) res;
+ } else if (bytesPerSample == 1) {
+ res = (byte) res;
+ }
+
+ return (float) res;
+ }
+}
diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java
new file mode 100755
index 000000000..4bf967a02
--- /dev/null
+++ b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/TestSpatialization.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.javafx.audio.windows.waveout;
+
+import java.io.*;
+import javax.media.opengl.GLDrawableFactory;
+
+public class TestSpatialization {
+ public static void main(String[] args) {
+ if (args.length != 1) {
+ System.out.println("Usage: TestSpatialization [file name]");
+ System.exit(1);
+ }
+
+ try {
+ // FIXME: this is a hack to get the native library loaded
+ try {
+ GLDrawableFactory.getFactory(NativeWindow.class);
+ } catch (Exception e) {}
+ // Initialize the audio subsystem
+ Audio audio = Audio.getInstance();
+ // Create a track
+ Track track = audio.newTrack(new File(args[0]));
+ track.setPosition(1, 0, 0);
+ // Run for ten seconds
+ long startTime = System.currentTimeMillis();
+ long duration = 10000;
+ long curTime = 0;
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ }
+ System.out.println("Playing...");
+ track.setLooping(true);
+ track.play();
+ while ((curTime = System.currentTimeMillis()) < startTime + duration) {
+ // Make one revolution every two seconds
+ float rads = (float) (((2 * Math.PI) * (((float) (curTime - startTime)) / 1000.0f)) / 2);
+ track.setPosition((float) Math.cos(rads), 0, (float) Math.sin(rads));
+ // Would like to make it go in a circle, but since
+ // stereo doesn't work now, make it move along a line
+ // track.setPosition(-1.0f, 0, 2.0f * (float) Math.sin(rads));
+ // Sleep a little between updates
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ }
+ }
+ System.out.println("Shutting down audio subsystem");
+ audio.shutdown();
+ System.out.println("Exiting.");
+ System.exit(0);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java
new file mode 100755
index 000000000..190396112
--- /dev/null
+++ b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Track.java
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.javafx.audio.windows.waveout;
+
+import java.io.*;
+import java.nio.*;
+
+public class Track {
+ // Default number of samples per buffer
+ private static final int BUFFER_SIZE = 32768;
+ // Number of bytes per sample (FIXME: dependence on audio format)
+ static final int BYTES_PER_SAMPLE = 2;
+ // Whether we need byte swapping (FIXME: dependence on audio format)
+ static final boolean NEEDS_BYTE_SWAP = true;
+
+ // This is the buffer this track is currently playing from
+ private SoundBuffer activeBuffer;
+ // This is the sample position in the active buffer
+ private int samplePosition;
+ // This is the total number of samples in the file
+ private int totalSamples;
+ // This is the total number of samples we have read
+ private int samplesRead;
+ // This is the buffer that the background filler thread may be filling
+ private SoundBuffer fillingBuffer;
+ // If we're playing the file, this is its input stream
+ private InputStream input;
+ // Keep around the file name
+ private File file;
+ // Whether we're playing this sound
+ private boolean playing;
+ // Whether we're looping this sound
+ private boolean looping;
+ // The position of this sound; defaults to being at the origin
+ private volatile Vec3f position = new Vec3f();
+
+ Track(File file) throws IOException {
+ if (!file.getName().endsWith(".rawsound")) {
+ throw new IOException("Unsupported file format (currently supports only raw sounds)");
+ }
+
+ this.file = file;
+ openInput();
+
+ // Allocate the buffers
+ activeBuffer = new SoundBuffer(BUFFER_SIZE, BYTES_PER_SAMPLE, NEEDS_BYTE_SWAP);
+ fillingBuffer = new SoundBuffer(BUFFER_SIZE, BYTES_PER_SAMPLE, NEEDS_BYTE_SWAP);
+
+ // Fill the first buffer immediately
+ fill();
+ swapBuffers();
+ }
+
+ private void openInput() throws IOException {
+ input = new BufferedInputStream(new FileInputStream(file));
+ totalSamples = (int) file.length() / BYTES_PER_SAMPLE;
+ }
+
+ public File getFile() {
+ return file;
+ }
+
+ public synchronized void play() {
+ if (input == null) {
+ try {
+ openInput();
+ // Fill it immediately
+ fill();
+ } catch (IOException e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+
+ playing = true;
+ }
+
+ public synchronized boolean isPlaying() {
+ return playing;
+ }
+
+ public synchronized void setLooping(boolean looping) {
+ this.looping = looping;
+ }
+
+ public synchronized boolean isLooping() {
+ return looping;
+ }
+
+ public void setPosition(float x, float y, float z) {
+ position = new Vec3f(x, y, z);
+ }
+
+ synchronized void fill() throws IOException {
+ if (input == null) {
+ return;
+ }
+ SoundBuffer curBuffer = fillingBuffer;
+ if (!curBuffer.empty()) {
+ return;
+ }
+ curBuffer.fill(input);
+ if (curBuffer.empty()) {
+ // End of file
+ InputStream tmp = null;
+ synchronized(this) {
+ tmp = input;
+ input = null;
+ }
+ tmp.close();
+
+ // If looping, re-open
+ if (isLooping()) {
+ openInput();
+ // and fill
+ fill();
+ }
+ }
+ }
+
+ // These are only for use by the Mixer
+ private float leftGain;
+ private float rightGain;
+
+ void setLeftGain(float leftGain) {
+ this.leftGain = leftGain;
+ }
+
+ float getLeftGain() {
+ return leftGain;
+ }
+
+ void setRightGain(float rightGain) {
+ this.rightGain = rightGain;
+ }
+
+ float getRightGain() {
+ return rightGain;
+ }
+
+ Vec3f getPosition() {
+ return position;
+ }
+
+ // This is called by the mixer and must be extremely fast
+ // Note this assumes mono sounds (FIXME)
+ boolean hasNextSample() {
+ return (!activeBuffer.empty() && samplePosition < activeBuffer.numSamples());
+ }
+
+ // This is called by the mixer and must be extremely fast
+ float nextSample() {
+ float res = activeBuffer.getSample(samplePosition++);
+ ++samplesRead;
+ if (!hasNextSample()) {
+ swapBuffers();
+ samplePosition = 0;
+ if (done()) {
+ playing = false;
+ }
+ }
+ return res;
+ }
+
+ synchronized void swapBuffers() {
+ SoundBuffer tmp = activeBuffer;
+ activeBuffer = fillingBuffer;
+ fillingBuffer = tmp;
+ fillingBuffer.empty(true);
+ }
+
+ // This provides a more robust termination condition
+ boolean done() {
+ return (samplesRead == totalSamples) && !looping;
+ }
+}
diff --git a/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java
new file mode 100755
index 000000000..9a3038e35
--- /dev/null
+++ b/src/jogl/classes/com/sun/javafx/audio/windows/waveout/Vec3f.java
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.javafx.audio.windows.waveout;
+
+/** 3-element single-precision vector */
+
+class Vec3f {
+ public static final Vec3f X_AXIS = new Vec3f( 1, 0, 0);
+ public static final Vec3f Y_AXIS = new Vec3f( 0, 1, 0);
+ public static final Vec3f Z_AXIS = new Vec3f( 0, 0, 1);
+ public static final Vec3f NEG_X_AXIS = new Vec3f(-1, 0, 0);
+ public static final Vec3f NEG_Y_AXIS = new Vec3f( 0, -1, 0);
+ public static final Vec3f NEG_Z_AXIS = new Vec3f( 0, 0, -1);
+
+ private float x;
+ private float y;
+ private float z;
+
+ public Vec3f() {}
+
+ public Vec3f(Vec3f arg) {
+ set(arg);
+ }
+
+ public Vec3f(float x, float y, float z) {
+ set(x, y, z);
+ }
+
+ public Vec3f copy() {
+ return new Vec3f(this);
+ }
+
+ public void set(Vec3f arg) {
+ set(arg.x, arg.y, arg.z);
+ }
+
+ public void set(float x, float y, float z) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ /** Sets the ith component, 0 <= i < 3 */
+ public void set(int i, float val) {
+ switch (i) {
+ case 0: x = val; break;
+ case 1: y = val; break;
+ case 2: z = val; break;
+ default: throw new IndexOutOfBoundsException();
+ }
+ }
+
+ /** Gets the ith component, 0 <= i < 3 */
+ public float get(int i) {
+ switch (i) {
+ case 0: return x;
+ case 1: return y;
+ case 2: return z;
+ default: throw new IndexOutOfBoundsException();
+ }
+ }
+
+ public float x() { return x; }
+ public float y() { return y; }
+ public float z() { return z; }
+
+ public void setX(float x) { this.x = x; }
+ public void setY(float y) { this.y = y; }
+ public void setZ(float z) { this.z = z; }
+
+ public float dot(Vec3f arg) {
+ return x * arg.x + y * arg.y + z * arg.z;
+ }
+
+ public float length() {
+ return (float) Math.sqrt(lengthSquared());
+ }
+
+ public float lengthSquared() {
+ return this.dot(this);
+ }
+
+ public void normalize() {
+ float len = length();
+ if (len == 0.0f) return;
+ scale(1.0f / len);
+ }
+
+ /** Returns this * val; creates new vector */
+ public Vec3f times(float val) {
+ Vec3f tmp = new Vec3f(this);
+ tmp.scale(val);
+ return tmp;
+ }
+
+ /** this = this * val */
+ public void scale(float val) {
+ x *= val;
+ y *= val;
+ z *= val;
+ }
+
+ /** Returns this + arg; creates new vector */
+ public Vec3f plus(Vec3f arg) {
+ Vec3f tmp = new Vec3f();
+ tmp.add(this, arg);
+ return tmp;
+ }
+
+ /** this = this + b */
+ public void add(Vec3f b) {
+ add(this, b);
+ }
+
+ /** this = a + b */
+ public void add(Vec3f a, Vec3f b) {
+ x = a.x + b.x;
+ y = a.y + b.y;
+ z = a.z + b.z;
+ }
+
+ /** Returns this + s * arg; creates new vector */
+ public Vec3f addScaled(float s, Vec3f arg) {
+ Vec3f tmp = new Vec3f();
+ tmp.addScaled(this, s, arg);
+ return tmp;
+ }
+
+ /** this = a + s * b */
+ public void addScaled(Vec3f a, float s, Vec3f b) {
+ x = a.x + s * b.x;
+ y = a.y + s * b.y;
+ z = a.z + s * b.z;
+ }
+
+ /** Returns this - arg; creates new vector */
+ public Vec3f minus(Vec3f arg) {
+ Vec3f tmp = new Vec3f();
+ tmp.sub(this, arg);
+ return tmp;
+ }
+
+ /** this = this - b */
+ public void sub(Vec3f b) {
+ sub(this, b);
+ }
+
+ /** this = a - b */
+ public void sub(Vec3f a, Vec3f b) {
+ x = a.x - b.x;
+ y = a.y - b.y;
+ z = a.z - b.z;
+ }
+
+ /** Returns this cross arg; creates new vector */
+ public Vec3f cross(Vec3f arg) {
+ Vec3f tmp = new Vec3f();
+ tmp.cross(this, arg);
+ return tmp;
+ }
+
+ /** this = a cross b. NOTE: "this" must be a different vector than
+ both a and b. */
+ public void cross(Vec3f a, Vec3f b) {
+ x = a.y * b.z - a.z * b.y;
+ y = a.z * b.x - a.x * b.z;
+ z = a.x * b.y - a.y * b.x;
+ }
+
+ /** Sets each component of this vector to the product of the
+ component with the corresponding component of the argument
+ vector. */
+ public void componentMul(Vec3f arg) {
+ x *= arg.x;
+ y *= arg.y;
+ z *= arg.z;
+ }
+
+ public String toString() {
+ return "(" + x + ", " + y + ", " + z + ")";
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/cg/CgException.java b/src/jogl/classes/com/sun/opengl/cg/CgException.java
new file mode 100644
index 000000000..3380bb540
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/cg/CgException.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.cg;
+
+/**
+ * A generic exception for errors that occur throughout the NVidia Cg
+ * binding, as a substitute for {@link RuntimeException}.
+ */
+public class CgException extends RuntimeException {
+ /** Constructs a CgException object. */
+ public CgException() {
+ super();
+ }
+
+ /** Constructs a CgException object with the specified detail message. */
+ public CgException(String message) {
+ super(message);
+ }
+
+ /** Constructs a CgException object with the specified detail message and
+ root cause. */
+ public CgException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /** Constructs a CgException object with the specified root cause. */
+ public CgException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/DRIHack.java b/src/jogl/classes/com/sun/opengl/impl/DRIHack.java
new file mode 100755
index 000000000..5478bd2f3
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/DRIHack.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.io.*;
+import java.security.*;
+import com.sun.gluegen.runtime.*;
+
+/**
+ * Helper class for working around problems with open-source DRI
+ * drivers. In the current DRI implementation it is required that the
+ * symbols in libGL.so.1.2 be globally visible to be accessible from
+ * other libraries that are dynamically loaded by the implementation.
+ * Applications may typically satisfy this need either by linking
+ * against libGL.so on the command line (-lGL) or by dlopen'ing
+ * libGL.so.1.2 with the RTLD_GLOBAL flag. The JOGL implementation
+ * links against libGL on all platforms rather than forcing all OpenGL
+ * entry points to be called through a function pointer. This allows
+ * the JOGL library to link directly to core 1.1 OpenGL entry points
+ * like glVertex3f, while calling through function pointers for entry
+ * points from later OpenGL versions as well as from
+ * extensions. However, because libjogl.so (which links against
+ * libGL.so) is loaded by the JVM, and because the JVM implicitly uses
+ * RTLD_LOCAL in the implementation of System.loadLibrary(), this
+ * means via transitivity that the symbols for libGL.so have only
+ * RTLD_LOCAL visibility to the rest of the application, so the DRI
+ * drivers can not find the symbols required. <P>
+ *
+ * There are at least two possible solutions. One would be to change
+ * the JOGL implementation to call through function pointers uniformly
+ * so that it does not need to link against libGL.so. This is
+ * possible, but requires changes to GlueGen and also is not really
+ * necessary in any other situation than with the DRI drivers. Another
+ * solution is to force the first load of libGL.so.1.2 to be done
+ * dynamically with RTLD_GLOBAL before libjogl.so is loaded and causes
+ * libGL.so.1.2 to be loaded again. The NativeLibrary class in the
+ * GlueGen runtime has this property, and we use it to implement this
+ * workaround.
+ */
+
+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 = System.getProperty("os.name").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 (System.getProperty("jogl.drihack.disable") != null) {
+ driHackNeeded = false;
+ }
+ return null;
+ }
+ });
+
+ if (driHackNeeded) {
+ if (DEBUG) {
+ System.err.println("Beginning DRI hack");
+ }
+
+ // 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 (oglLib == null) {
+ oglLib = NativeLibrary.open("/usr/lib/libGL.so.1", null);
+ if (DEBUG && oglLib != null) System.err.println(" Found /usr/lib/libGL.so.1");
+ }
+ }
+ }
+
+ public static void end() {
+ if (oglLib != null) {
+ if (DEBUG) {
+ System.err.println("Ending DRI hack");
+ }
+
+ oglLib.close();
+ oglLib = null;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/Debug.java b/src/jogl/classes/com/sun/opengl/impl/Debug.java
new file mode 100644
index 000000000..9faa04fa7
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/Debug.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.security.*;
+
+/** Helper routines for logging and debugging. */
+
+public class Debug {
+ // Some common properties
+ private static boolean verbose;
+ private static boolean debugAll;
+
+ static {
+ verbose = isPropertyDefined("jogl.verbose");
+ debugAll = isPropertyDefined("jogl.debug");
+ if (verbose) {
+ Package p = Package.getPackage("javax.media.opengl");
+ System.err.println("JOGL specification version " + p.getSpecificationVersion());
+ System.err.println("JOGL implementation version " + p.getImplementationVersion());
+ System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
+ }
+ }
+
+ public static boolean getBooleanProperty(final String property) {
+ Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ boolean val = Boolean.getBoolean(property);
+ return (val ? Boolean.TRUE : Boolean.FALSE);
+ }
+ });
+ return b.booleanValue();
+ }
+
+ public static boolean isPropertyDefined(final String property) {
+ Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String val = System.getProperty(property);
+ return (val != null ? Boolean.TRUE : Boolean.FALSE);
+ }
+ });
+ return b.booleanValue();
+ }
+
+ public static boolean verbose() {
+ return verbose;
+ }
+
+ public static boolean debugAll() {
+ return debugAll;
+ }
+
+ public static boolean debug(String subcomponent) {
+ return debugAll() || isPropertyDefined("jogl.debug." + subcomponent);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java b/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java
new file mode 100644
index 000000000..63dba3ff0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/ExtensionAvailabilityCache.java
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import javax.media.opengl.*;
+import java.util.*;
+// FIXME: refactor Java SE dependencies
+//import java.util.regex.*;
+import java.lang.reflect.*;
+
+/**
+ * A utility object intended to be used by implementations to act as a cache
+ * of which OpenGL extensions are currently available on both the host machine
+ * and display.
+ */
+public final class ExtensionAvailabilityCache {
+ private static final boolean DEBUG = Debug.debug("ExtensionAvailabilityCache");
+ private static final boolean DEBUG_AVAILABILITY = Debug.isPropertyDefined("ExtensionAvailabilityCache");
+
+ ExtensionAvailabilityCache(GLContextImpl context)
+ {
+ this.context = context;
+ }
+
+ /**
+ * Flush the cache. The cache will be rebuilt lazily as calls to {@link
+ * #isExtensionAvailable(String)} are received.
+ */
+ public void flush()
+ {
+ availableExtensionCache.clear();
+ }
+
+ public boolean isExtensionAvailable(String glExtensionName) {
+ initAvailableExtensions();
+ return availableExtensionCache.contains(mapGLExtensionName(glExtensionName));
+ }
+
+ protected void initAvailableExtensions() {
+ // 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()) {
+ GL gl = context.getGL();
+ if (DEBUG) {
+ System.err.println("!!! Pre-caching extension availability");
+ }
+ String allAvailableExtensions =
+ gl.glGetString(GL.GL_EXTENSIONS) + " " + context.getPlatformExtensionsString();
+ if (DEBUG) {
+ System.err.println("!!! Available extensions: " + allAvailableExtensions);
+ System.err.println("!!! GL vendor: " + gl.glGetString(GL.GL_VENDOR));
+ }
+ StringTokenizer tok = new StringTokenizer(allAvailableExtensions);
+ while (tok.hasMoreTokens()) {
+ String availableExt = tok.nextToken().trim();
+ availableExt = availableExt.intern();
+ availableExtensionCache.add(availableExt);
+ if (DEBUG_AVAILABILITY) {
+ System.err.println("!!! Available: " + availableExt);
+ }
+ }
+
+ // Put GL version strings in the table as well
+ Version version = new Version(gl.glGetString(GL.GL_VERSION));
+ if (version.isValid()) {
+ int major = version.getMajor();
+ int minor = version.getMinor();
+ // FIXME: this needs to be adjusted when the major rev changes
+ // beyond the known ones
+ while (major > 0) {
+ while (minor >= 0) {
+ availableExtensionCache.add("GL_VERSION_" + major + "_" + minor);
+ if (DEBUG) {
+ System.err.println("!!! Added GL_VERSION_" + major + "_" + minor + " to known extensions");
+ }
+ --minor;
+ }
+
+ switch (major) {
+ case 2:
+ // Restart loop at version 1.5
+ minor = 5;
+ break;
+ case 1:
+ break;
+ }
+
+ --major;
+ }
+ }
+
+ // put a dummy var in here so that the cache is no longer empty even if
+ // no extensions are in the GL_EXTENSIONS string
+ availableExtensionCache.add("<INTERNAL_DUMMY_PLACEHOLDER>");
+ }
+ }
+
+ // FIXME: hack to re-enable GL_NV_vertex_array_range extension after
+ // recent upgrade to new wglext.h and glxext.h headers
+ private static String mapGLExtensionName(String extensionName) {
+ if (extensionName != null &&
+ (extensionName.equals("WGL_NV_vertex_array_range") ||
+ extensionName.equals("GLX_NV_vertex_array_range")))
+ return "GL_NV_vertex_array_range";
+ return extensionName;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private 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("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/sun/opengl/impl/GLBufferSizeTracker.java
new file mode 100755
index 000000000..53fcc2de1
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLBufferSizeTracker.java
@@ -0,0 +1,188 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.util.*;
+import javax.media.opengl.*;
+
+/**
+ * Tracks as closely as possible the sizes of allocated OpenGL buffer
+ * objects. When glMapBuffer or glMapBufferARB is called, in order to
+ * turn the resulting base address into a java.nio.ByteBuffer, we need
+ * to know the size in bytes of the allocated OpenGL buffer object.
+ * Previously we would compute this size by using
+ * glGetBufferParameterivARB with a pname of GL_BUFFER_SIZE, but
+ * it appears doing so each time glMapBuffer is called is too costly
+ * on at least Apple's new multithreaded OpenGL implementation. <P>
+ *
+ * Instead we now try to track the sizes of allocated buffer objects.
+ * We watch calls to glBindBuffer to see which buffer is bound to
+ * which target and to glBufferData to see how large the buffer's
+ * allocated size is. When glMapBuffer is called, we consult our table
+ * of buffer sizes to see if we can return an answer without a glGet
+ * call. <P>
+ *
+ * We share the GLBufferSizeTracker objects among all GLContexts for
+ * which sharing is enabled, because the namespace for buffer objects
+ * is the same for these contexts. <P>
+ *
+ * Tracking the state of which buffer objects are bound is done in the
+ * GLBufferStateTracker and is not completely trivial. In the face of
+ * calls to glPushClientAttrib / glPopClientAttrib we currently punt
+ * and re-fetch the bound buffer object for the state in question;
+ * see, for example, glVertexPointer and the calls down to
+ * GLBufferStateTracker.getBoundBufferObject(). Note that we currently
+ * ignore new binding targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV;
+ * the fact that new binding targets may be added in the future makes
+ * it impossible to cache state for these new targets. <P>
+ *
+ * Ignoring new binding targets, the primary situation in which we may
+ * not be able to return a cached answer is in the case of an error,
+ * where glBindBuffer may not have been called before trying to call
+ * glBufferData. Also, if external native code modifies a buffer
+ * object, we may return an incorrect answer. (FIXME: this case
+ * requires more thought, and perhaps stochastic and
+ * exponential-fallback checking. However, note that it can only occur
+ * in the face of external native code which requires that the
+ * application be signed anyway, so there is no security risk in this
+ * area.)
+ */
+
+public class GLBufferSizeTracker {
+ // Map from buffer names to sizes.
+ // Note: should probably have some way of shrinking this map, but
+ // can't just make it a WeakHashMap because nobody holds on to the
+ // keys; would have to always track creation and deletion of buffer
+ // objects, which is probably sub-optimal. The expected usage
+ // pattern of buffer objects indicates that the fact that this map
+ // never shrinks is probably not that bad.
+ private Map/*<Integer,Integer>*/ bufferSizeMap =
+ Collections.synchronizedMap(new HashMap/*<Integer,Integer>*/());
+
+ private static final boolean DEBUG = Debug.debug("GLBufferSizeTracker");
+
+ public GLBufferSizeTracker() {
+ }
+
+ public void setBufferSize(GLBufferStateTracker bufferStateTracker,
+ int target,
+ GL caller,
+ int size) {
+ // Need to do some similar queries to getBufferSize below
+ int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
+ boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
+ if (valid) {
+ if (buffer == 0) {
+ // FIXME: this really should not happen if we know what's
+ // going on. Very likely there is an OpenGL error in the
+ // application if we get here. Could silently return 0, but it
+ // seems better to get an early warning that something is
+ // wrong.
+ throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
+ Integer.toHexString(target));
+ }
+ bufferSizeMap.put(new Integer(buffer), new Integer(size));
+ }
+ // We don't know the current buffer state. Note that the buffer
+ // state tracker will have made the appropriate OpenGL query if it
+ // didn't know what was going on, so at this point we have nothing
+ // left to do except drop this piece of information on the floor.
+ }
+
+ public int getBufferSize(GLBufferStateTracker bufferStateTracker,
+ int target,
+ GL caller) {
+ // See whether we know what buffer is currently bound to the given
+ // state
+ int buffer = bufferStateTracker.getBoundBufferObject(target, caller);
+ boolean valid = bufferStateTracker.isBoundBufferObjectKnown(target);
+ if (valid) {
+ if (buffer == 0) {
+ // FIXME: this really should not happen if we know what's
+ // going on. Very likely there is an OpenGL error in the
+ // application if we get here. Could silently return 0, but it
+ // seems better to get an early warning that something is
+ // wrong.
+ throw new GLException("Error: no OpenGL buffer object appears to be bound to target 0x" +
+ Integer.toHexString(target));
+ }
+ // See whether we know the size of this buffer object; at this
+ // point we almost certainly should if the application is
+ // written correctly
+ Integer key = new Integer(buffer);
+ Integer sz = (Integer) bufferSizeMap.get(key);
+ if (sz == null) {
+ // For robustness, try to query this value from the GL as we used to
+ int[] tmp = new int[1];
+ caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
+ if (tmp[0] == 0) {
+ // Assume something is wrong rather than silently going along
+ throw new GLException("Error: buffer size returned by glGetBufferParameteriv was zero; probably application error");
+ }
+ // Assume we just don't know what's happening
+ sz = new Integer(tmp[0]);
+ bufferSizeMap.put(key, sz);
+ if (DEBUG) {
+ System.err.println("GLBufferSizeTracker.getBufferSize(): made slow query to cache size " +
+ tmp[0] +
+ " for buffer " +
+ buffer);
+ }
+ }
+ return sz.intValue();
+ }
+ // We don't know what's going on in this case; query the GL for an answer
+ int[] tmp = new int[1];
+ caller.glGetBufferParameteriv(target, GL.GL_BUFFER_SIZE, tmp, 0);
+ if (DEBUG) {
+ System.err.println("GLBufferSizeTracker.getBufferSize(): no cached buffer information");
+ }
+ return tmp[0];
+ }
+
+ // This should be called on any major event where we might start
+ // producing wrong answers, such as OpenGL context creation and
+ // destruction if we don't know whether there are other currently-
+ // created contexts that might be keeping the buffer objects alive
+ // that we're dealing with
+ public void clearCachedBufferSizes() {
+ bufferSizeMap.clear();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java b/src/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java
new file mode 100755
index 000000000..ddc82eba2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLBufferStateTracker.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.util.*;
+import javax.media.opengl.*;
+
+/**
+ * Tracks as closely as possible which OpenGL buffer object is bound
+ * to which binding target in the current OpenGL context.
+ * GLBufferStateTracker objects are allocated on a per-GLImpl basis,
+ * which is basically identical to a per-OpenGL-context basis
+ * (assuming correct usage of the GLImpl objects, which is checked by
+ * the DebugGL). This class is used to verify that e.g. the vertex
+ * buffer object extension is in use when the glVertexPointer variant
+ * taking a long as argument is called. <P>
+ *
+ * Note that because the enumerated value used for the binding of a
+ * buffer object (e.g. GL_ARRAY_BUFFER) is different than that used to
+ * query the binding using glGetIntegerv (e.g.
+ * GL_ARRAY_BUFFER_BINDING), then in the face of new binding targets
+ * being added to the GL (e.g. GL_TRANSFORM_FEEDBACK_BUFFER_NV) it is
+ * impossible to set up a query of the buffer object currently bound
+ * to a particular state. It turns out that for some uses, such as
+ * finding the size of the currently bound buffer, this doesn't
+ * matter, though of course without knowing the buffer object we can't
+ * re-associate the queried size with the buffer object ID. <P>
+ *
+ * Because the namespace of buffer objects is the unsigned integers
+ * with 0 reserved by the GL, and because we have to be able to return
+ * both 0 and other integers as valid answers from
+ * getBoundBufferObject(), we need a second query, which is to ask
+ * whether we know the state of the binding for a given target. For
+ * "unknown" targets such as GL_TRANSFORM_FEEDBACK_BUFFER_NV we return
+ * false from this, but we also clear the valid bit and later refresh
+ * the binding state if glPushClientAttrib / glPopClientAttrib are
+ * called, since we don't want the complexity of tracking stacks of
+ * these attributes.
+ *
+ */
+
+public class GLBufferStateTracker {
+ private static final boolean DEBUG = Debug.debug("GLBufferStateTracker");
+
+ private static final Integer arrayBufferEnum = new Integer(GL.GL_ARRAY_BUFFER);
+ private static final Integer elementArrayBufferEnum = new Integer(GL.GL_ELEMENT_ARRAY_BUFFER);
+ private static final Integer pixelPackBufferEnum = new Integer(GL2.GL_PIXEL_PACK_BUFFER);
+ private static final Integer pixelUnpackBufferEnum = new Integer(GL2.GL_PIXEL_UNPACK_BUFFER);
+ private static final Integer zero = new Integer(0);
+
+ // Maps binding targets to buffer objects. A null value indicates
+ // that the binding is unknown. A zero value indicates that it is
+ // known that no buffer is bound to the target.
+ private Map/*<Integer,Integer>*/ bindingMap = new HashMap/*<Integer,Integer>*/();
+
+ private int[] bufTmp = new int[1];
+
+ public GLBufferStateTracker() {
+ // Start with known unbound targets for known keys
+ bindingMap.put(arrayBufferEnum, zero);
+ bindingMap.put(elementArrayBufferEnum, zero);
+ bindingMap.put(pixelPackBufferEnum, zero);
+ bindingMap.put(pixelUnpackBufferEnum, zero);
+ }
+
+ public void setBoundBufferObject(int target, int buffer) {
+ Integer key = box(target);
+ bindingMap.put(key, box(buffer));
+ }
+
+ /** Note: returns an unspecified value if the binding for the
+ specified target (e.g. GL_ARRAY_BUFFER) is currently unknown.
+ You must use isBoundBufferObjectKnown() to see whether the
+ return value is valid. */
+ public int getBoundBufferObject(int target, GL caller) {
+ Integer key = box(target);
+ Integer value = (Integer) bindingMap.get(key);
+ if (value == null) {
+ // User probably either called glPushClientAttrib /
+ // glPopClientAttrib or is querying an unknown target. See
+ // whether we know how to fetch this state.
+ boolean gotQueryTarget = true;
+ int queryTarget = 0;
+ switch (target) {
+ case GL.GL_ARRAY_BUFFER: queryTarget = GL.GL_ARRAY_BUFFER_BINDING; break;
+ case GL.GL_ELEMENT_ARRAY_BUFFER: queryTarget = GL.GL_ELEMENT_ARRAY_BUFFER_BINDING; break;
+ case GL2.GL_PIXEL_PACK_BUFFER: queryTarget = GL2.GL_PIXEL_PACK_BUFFER_BINDING; break;
+ case GL2.GL_PIXEL_UNPACK_BUFFER: queryTarget = GL2.GL_PIXEL_UNPACK_BUFFER_BINDING; break;
+ default: gotQueryTarget = false; break;
+ }
+ if (gotQueryTarget) {
+ caller.glGetIntegerv(queryTarget, bufTmp, 0);
+ if (DEBUG) {
+ System.err.println("GLBufferStateTracker.getBoundBufferObject(): queried bound buffer " +
+ bufTmp[0] +
+ " for query target 0x" + Integer.toHexString(queryTarget));
+ }
+ setBoundBufferObject(target, bufTmp[0]);
+ // Try once more
+ return getBoundBufferObject(target, caller);
+ }
+ return 0;
+ }
+ return value.intValue();
+ }
+
+ /** Indicates whether the binding state for the specified target is
+ currently known. Should be called after getBoundBufferObject()
+ because that method may change the answer for a given target. */
+ public boolean isBoundBufferObjectKnown(int target) {
+ return (bindingMap.get(box(target)) != null);
+ }
+
+ /** Clears out the known/unknown state of the various buffer object
+ binding states. These will be refreshed later on an as-needed
+ basis. This is called by the implementations of
+ glPushClientAttrib / glPopClientAttrib. Might want to call this
+ from GLContext.makeCurrent() in the future to possibly increase
+ the robustness of these caches in the face of external native
+ code manipulating OpenGL state. */
+ public void clearBufferObjectState() {
+ bindingMap.clear();
+ }
+
+ // FIXME: could largely remove this and use Integer.valueOf() in JDK 5
+ private static Integer box(int key) {
+ switch (key) {
+ case 0: return zero;
+ case GL.GL_ARRAY_BUFFER: return arrayBufferEnum;
+ case GL.GL_ELEMENT_ARRAY_BUFFER: return elementArrayBufferEnum;
+ case GL2.GL_PIXEL_PACK_BUFFER: return pixelPackBufferEnum;
+ case GL2.GL_PIXEL_UNPACK_BUFFER: return pixelUnpackBufferEnum;
+ default: return new Integer(key);
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
new file mode 100644
index 000000000..da0d96396
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -0,0 +1,521 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.nio.*;
+import java.lang.reflect.*;
+
+import javax.media.opengl.*;
+import com.sun.nativewindow.impl.NWReflection;
+import com.sun.gluegen.runtime.*;
+import com.sun.gluegen.runtime.opengl.*;
+
+public abstract class GLContextImpl extends GLContext {
+ protected GLContextLock lock = new GLContextLock();
+ protected static final boolean DEBUG = Debug.debug("GLContext");
+ protected static final boolean VERBOSE = Debug.verbose();
+ // NOTE: default sense of GLContext optimization disabled in JSR-231
+ // 1.0 beta 5 due to problems on X11 platforms (both Linux and
+ // Solaris) when moving and resizing windows. Apparently GLX tokens
+ // get sent to the X server under the hood (and out from under the
+ // cover of the AWT lock) in these situations. Users requiring
+ // multi-screen X11 applications can manually enable this flag. It
+ // basically had no tangible effect on the Windows or Mac OS X
+ // platforms anyway in particular with the disabling of the
+ // GLWorkerThread which we found to be necessary in 1.0 beta 4.
+ protected boolean optimizationEnabled = Debug.isPropertyDefined("jogl.GLContext.optimize");
+
+ // Cache of the functions that are available to be called at the current
+ // moment in time
+ protected ExtensionAvailabilityCache extensionAvailability;
+ // Table that holds the addresses of the native C-language entry points for
+ // OpenGL functions.
+ private ProcAddressTable glProcAddressTable;
+
+ // Tracks creation and initialization of buffer objects to avoid
+ // repeated glGet calls upon glMapBuffer operations
+ private GLBufferSizeTracker bufferSizeTracker;
+
+ protected GL gl;
+
+ public GLContextImpl(GLProfile glp, GLContext shareWith) {
+ extensionAvailability = new ExtensionAvailabilityCache(this);
+ if (shareWith != null) {
+ GLContextShareSet.registerSharing(this, shareWith);
+ }
+ GLContextShareSet.registerForBufferObjectSharing(shareWith, this);
+ // This must occur after the above calls into the
+ // GLContextShareSet, which set up state needed by the GL object
+ setGL(createGL(glp));
+ }
+
+ public GLDrawableImpl getDrawableImpl() {
+ 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();
+ }
+ }
+
+ 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;
+ }
+
+ protected abstract int makeCurrentImpl() throws GLException;
+
+ public void release() throws GLException {
+ if (!lock.isHeld()) {
+ throw new GLException("Context not current on current thread");
+ }
+ setCurrent(null);
+ try {
+ releaseImpl();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ protected abstract void releaseImpl() throws GLException;
+
+ public void destroy() {
+ if (lock.isHeld()) {
+ // release current context
+ release();
+ }
+
+ // Must hold the lock around the destroy operation to make sure we
+ // don't destroy the context out from under another thread rendering to it
+ lock.lock();
+ try {
+ /* FIXME: refactor dependence on Java 2D / JOGL bridge
+ if (tracker != null) {
+ // Don't need to do anything for contexts that haven't been
+ // created yet
+ if (isCreated()) {
+ // If we are tracking creation and destruction of server-side
+ // OpenGL objects, we must decrement the reference count of the
+ // GLObjectTracker upon context destruction.
+ //
+ // Note that we can only eagerly delete these server-side
+ // objects if there is another context currrent right now
+ // which shares textures and display lists with this one.
+ tracker.unref(deletedObjectTracker);
+ }
+ }
+ */
+
+ // Because we don't know how many other contexts we might be
+ // sharing with (and it seems too complicated to implement the
+ // GLObjectTracker's ref/unref scheme for the buffer-related
+ // optimizations), simply clear the cache of known buffers' sizes
+ // when we destroy contexts
+ if (bufferSizeTracker != null) {
+ bufferSizeTracker.clearCachedBufferSizes();
+ }
+
+ destroyImpl();
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ protected abstract void destroyImpl() throws GLException;
+
+ // This is only needed for Mac OS X on-screen contexts
+ protected void update() throws GLException {
+ }
+
+ public boolean isSynchronized() {
+ return !lock.getFailFastMode();
+ }
+
+ public void setSynchronized(boolean isSynchronized) {
+ lock.setFailFastMode(!isSynchronized);
+ }
+
+ public final GL getGL() {
+ return gl;
+ }
+
+ public void 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();
+ }
+ this.gl = gl;
+ }
+
+ public abstract Object getPlatformGLExtensions();
+
+ //----------------------------------------------------------------------
+ // Helpers for various context implementations
+ //
+
+ private Object createInstance(GLProfile glp, String suffix, Class[] cstrArgTypes, Object[] cstrArgs) {
+ return NWReflection.createInstance(glp.getGLImplBaseClassName()+suffix, cstrArgTypes, cstrArgs);
+ }
+
+ /** Create the GL for this context. */
+ protected GL createGL(GLProfile glp) {
+ GL gl = (GL) createInstance(glp, "Impl", new Class[] { GLProfile.class, GLContextImpl.class }, new Object[] { glp, this } );
+
+ /* FIXME: refactor dependence on Java 2D / JOGL bridge
+ if (tracker != null) {
+ gl.setObjectTracker(tracker);
+ }
+ */
+ return gl;
+ }
+
+ public final ProcAddressTable getGLProcAddressTable() {
+ return glProcAddressTable;
+ }
+
+ /**
+ * Shall return the platform extension ProcAddressTable,
+ * ie for GLXExt, EGLExt, ..
+ */
+ public abstract ProcAddressTable getPlatformExtProcAddressTable();
+
+ /**
+ * Pbuffer support; given that this is a GLContext associated with a
+ * pbuffer, binds this pbuffer to its texture target.
+ */
+ public abstract void bindPbufferToTexture();
+
+ /**
+ * Pbuffer support; given that this is a GLContext associated with a
+ * pbuffer, releases this pbuffer from its texture target.
+ */
+ public abstract void releasePbufferFromTexture();
+
+ public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3);
+
+ /*
+ * Sets the swap interval for onscreen OpenGL contexts. Has no
+ * effect for offscreen contexts.
+ */
+ public void setSwapInterval(final int interval) {
+ }
+
+ /** 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);
+
+ /** 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);
+
+ /** Helper routine which resets a ProcAddressTable generated by the
+ GLEmitter by looking up anew all of its function pointers. */
+ protected void resetProcAddressTable(Object table) {
+ GLProcAddressHelper.resetProcAddressTable(table, getDrawableImpl().getDynamicLookupHelper() );
+ }
+
+ /** Indicates whether the underlying OpenGL context has been
+ created. This is used to manage sharing of display lists and
+ textures between contexts. */
+ public abstract boolean isCreated();
+
+ /**
+ * Sets the OpenGL implementation class and
+ * the cache of which GL functions are available for calling through this
+ * context. See {@link #isFunctionAvailable(String)} for more information on
+ * the definition of "available".
+ *
+ * @param force force the setting, even if is already being set.
+ * This might be usefull if you change the OpenGL implementation.
+ */
+ protected void setGLFunctionAvailability(boolean force) {
+ if(null!=this.gl && null!=glProcAddressTable && !force) {
+ return; // already done and not forced
+ }
+ if(null==this.gl || force) {
+ setGL(createGL(getGLDrawable().getGLProfile()));
+ }
+
+ updateGLProcAddressTable();
+ }
+
+ /**
+ * 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".
+ */
+ protected void updateGLProcAddressTable() {
+ if(null==this.gl) {
+ throw new GLException("setGLFunctionAvailability not called yet");
+ }
+ extensionAvailability.flush();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Initializing OpenGL extension address table for " + this);
+ }
+ if (glProcAddressTable == null) {
+ glProcAddressTable = (ProcAddressTable) createInstance(gl.getGLProfile(), "ProcAddressTable", new Class[0], null);
+ // FIXME: cache ProcAddressTables by capability bits so we can
+ // share them among contexts with the same capabilities
+ }
+ resetProcAddressTable(getGLProcAddressTable());
+ }
+
+ /**
+ * Returns true if the specified OpenGL core- or extension-function can be
+ * successfully called using this GL context given the current host (OpenGL
+ * <i>client</i>) and display (OpenGL <i>server</i>) configuration.
+ *
+ * See {@link GL#isFunctionAvailable(String)} for more details.
+ *
+ * @param glFunctionName the name of the OpenGL function (e.g., use
+ * "glPolygonOffsetEXT" or "glPolygonOffset" to check if the {@link
+ * javax.media.opengl.GL#glPolygonOffset(float,float)} is available).
+ */
+ public boolean isFunctionAvailable(String glFunctionName) {
+ if(isCreated()) {
+ // Check GL 1st (cached)
+ ProcAddressTable pTable = getGLProcAddressTable();
+ try {
+ if(0!=pTable.getAddressFor(glFunctionName)) {
+ return true;
+ }
+ } catch (Exception e) {}
+
+ // Check platform extensions 2nd (cached)
+ pTable = getPlatformExtProcAddressTable();
+ try {
+ if(0!=pTable.getAddressFor(glFunctionName)) {
+ return true;
+ }
+ } catch (Exception e) {}
+ }
+ // dynamic function lookup at last incl name aliasing (not cached)
+ DynamicLookupHelper dynLookup = getDrawableImpl().getDynamicLookupHelper();
+ String tmpBase = GLExtensionNames.normalizeVEN(GLExtensionNames.normalizeARB(glFunctionName, true), true);
+ long addr = 0;
+ int variants = GLExtensionNames.getFuncNamePermutationNumber(tmpBase);
+ for(int i = 0; 0==addr && i < variants; i++) {
+ String tmp = GLExtensionNames.getFuncNamePermutation(tmpBase, i);
+ try {
+ addr = dynLookup.dynamicLookupFunction(tmp);
+ } catch (Exception e) { }
+ }
+ if(0!=addr) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns true if the specified OpenGL extension can be
+ * successfully called using this GL context given the current host (OpenGL
+ * <i>client</i>) and display (OpenGL <i>server</i>) configuration.
+ *
+ * See {@link GL#isExtensionAvailable(String)} for more details.
+ *
+ * @param glExtensionName the name of the OpenGL extension (e.g.,
+ * "GL_VERTEX_PROGRAM_ARB").
+ */
+ public boolean isExtensionAvailable(String glExtensionName) {
+ return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName));
+ }
+
+ /** Indicates which floating-point pbuffer implementation is in
+ use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT,
+ or GLPbuffer.NV_FLOAT. */
+ public int getFloatingPointMode() throws GLException {
+ throw new GLException("Not supported on non-pbuffer contexts");
+ }
+
+ /** On some platforms the mismatch between OpenGL's coordinate
+ system (origin at bottom left) and the window system's
+ coordinate system (origin at top left) necessitates a vertical
+ flip of pixels read from offscreen contexts. */
+ public abstract boolean offscreenImageNeedsVerticalFlip();
+
+ /** Only called for offscreen contexts; needed by glReadPixels */
+ public abstract int getOffscreenContextPixelDataType();
+
+ protected static String getThreadName() {
+ return Thread.currentThread().getName();
+ }
+
+ public static String toHexString(long hex) {
+ return "0x" + Long.toHexString(hex);
+ }
+
+ //----------------------------------------------------------------------
+ // Helpers for buffer object optimizations
+
+ public void setBufferSizeTracker(GLBufferSizeTracker bufferSizeTracker) {
+ this.bufferSizeTracker = bufferSizeTracker;
+ }
+
+ public GLBufferSizeTracker getBufferSizeTracker() {
+ return bufferSizeTracker;
+ }
+
+ //---------------------------------------------------------------------------
+ // Helpers for context optimization where the last context is left
+ // current on the OpenGL worker thread
+ //
+
+ public boolean isOptimizable() {
+ return optimizationEnabled;
+ }
+
+ public boolean hasWaiters() {
+ return lock.hasWaiters();
+ }
+
+ /* FIXME: needed only by the Java 2D / JOGL bridge; refactor
+
+ public GLContextImpl(GLContext shareWith) {
+ this(shareWith, false);
+ }
+
+ public GLContextImpl(GLContext shareWith, boolean dontShareWithJava2D) {
+ extensionAvailability = new ExtensionAvailabilityCache(this);
+ GLContext shareContext = shareWith;
+ if (!dontShareWithJava2D) {
+ shareContext = Java2D.filterShareContext(shareWith);
+ }
+ if (shareContext != null) {
+ GLContextShareSet.registerSharing(this, shareContext);
+ }
+ // Always indicate real behind-the-scenes sharing to track deleted objects
+ if (shareContext == null) {
+ shareContext = Java2D.filterShareContext(shareWith);
+ }
+ GLContextShareSet.registerForObjectTracking(shareWith, this, shareContext);
+ GLContextShareSet.registerForBufferObjectSharing(shareWith, this);
+ // This must occur after the above calls into the
+ // GLContextShareSet, which set up state needed by the GL object
+ setGL(createGL());
+ }
+
+ //---------------------------------------------------------------------------
+ // Helpers for integration with Java2D/OpenGL pipeline when FBOs are
+ // being used
+ //
+
+ public void setObjectTracker(GLObjectTracker tracker) {
+ this.tracker = tracker;
+ }
+
+ public GLObjectTracker getObjectTracker() {
+ return tracker;
+ }
+
+ public void setDeletedObjectTracker(GLObjectTracker deletedObjectTracker) {
+ this.deletedObjectTracker = deletedObjectTracker;
+ }
+
+ public GLObjectTracker getDeletedObjectTracker() {
+ return deletedObjectTracker;
+ }
+
+ // Tracks creation and deletion of server-side OpenGL objects when
+ // the Java2D/OpenGL pipeline is active and using FBOs to render
+ private GLObjectTracker tracker;
+ // Supports deletion of these objects when no other context is
+ // current which can support immediate deletion of them
+ private GLObjectTracker deletedObjectTracker;
+
+ */
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextLock.java b/src/jogl/classes/com/sun/opengl/impl/GLContextLock.java
new file mode 100644
index 000000000..753ef14f8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLContextLock.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import javax.media.opengl.*;
+
+/** Implements the makeCurrent / release locking behavior of the
+ GLContext class. When "fail fast mode" is enabled, attempts to
+ lock the same GLContextLock on more than one thread cause
+ GLException to be raised. This lock is not recursive. Attempts to
+ lock it more than once on a given thread will cause GLException to
+ be raised. */
+
+public class GLContextLock {
+ private Object lock = new Object();
+ private Thread owner;
+ private boolean failFastMode = true;
+ private volatile int waiters;
+
+ /** Locks this GLContextLock on the current thread. If fail fast
+ mode is enabled and the GLContextLock is already owned by
+ another thread, throws GLException. */
+ public void lock() throws GLException {
+ synchronized(lock) {
+ Thread current = Thread.currentThread();
+ if (owner == null) {
+ owner = current;
+ } else if (owner != current) {
+ while (owner != null) {
+ if (failFastMode) {
+ throw new GLException("Attempt to make context current on thread " + current +
+ " which is already current on thread " + owner);
+ } else {
+ try {
+ ++waiters;
+ lock.wait();
+ } catch (InterruptedException e) {
+ throw new GLException(e);
+ } finally {
+ --waiters;
+ }
+ }
+ }
+ owner = current;
+ } else {
+ throw new GLException("Attempt to make the same context current twice on thread " + current);
+ }
+ }
+ }
+
+ /** Unlocks this GLContextLock. */
+ public void unlock() throws GLException {
+ synchronized (lock) {
+ Thread current = Thread.currentThread();
+ if (owner == current) {
+ owner = null;
+ lock.notifyAll();
+ } else {
+ if (owner != null) {
+ throw new GLException("Attempt by thread " + current +
+ " to release context owned by thread " + owner);
+ } else {
+ throw new GLException("Attempt by thread " + current +
+ " to release unowned context");
+ }
+ }
+ }
+ }
+
+ /** Indicates whether this lock is held by the current thread. */
+ public boolean isHeld() {
+ synchronized(lock) {
+ Thread current = Thread.currentThread();
+ return (owner == current);
+ }
+ }
+
+ public void setFailFastMode(boolean onOrOff) {
+ failFastMode = onOrOff;
+ }
+
+ public boolean getFailFastMode() {
+ return failFastMode;
+ }
+
+ public boolean hasWaiters() {
+ return (waiters != 0);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java b/src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java
new file mode 100644
index 000000000..5f8fc1c84
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLContextShareSet.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+// FIXME: refactor Java SE dependencies
+// import java.awt.GraphicsConfiguration;
+// import java.awt.GraphicsDevice;
+// import java.awt.GraphicsEnvironment;
+import java.lang.ref.*;
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Provides a mechanism by which OpenGL contexts can share textures
+ and display lists in the face of multithreading and asynchronous
+ context creation as is inherent in the AWT and Swing. */
+
+public class GLContextShareSet {
+ // FIXME: refactor Java SE dependencies
+ // private static boolean forceTracking = Debug.isPropertyDefined("jogl.glcontext.forcetracking");
+ private static final boolean DEBUG = Debug.debug("GLContextShareSet");
+
+ // This class is implemented with a WeakHashMap that goes from the
+ // contexts as keys to a complex data structure as value that tracks
+ // context creation and deletion.
+
+ private static Map/*<GLContext, ShareSet>*/ shareMap = new WeakHashMap();
+ private static Object dummyValue = new Object();
+
+ private static class ShareSet {
+ private Map allShares = new WeakHashMap();
+ private Map createdShares = new WeakHashMap();
+ private Map destroyedShares = new WeakHashMap();
+
+ public void add(GLContext ctx) {
+ if (allShares.put(ctx, dummyValue) == null) {
+ // FIXME: downcast to GLContextImpl undesirable
+ if (((GLContextImpl) ctx).isCreated()) {
+ createdShares.put(ctx, dummyValue);
+ } else {
+ destroyedShares.put(ctx, dummyValue);
+ }
+ }
+ }
+
+ public GLContext getCreatedShare(GLContext ignore) {
+ for (Iterator iter = createdShares.keySet().iterator(); iter.hasNext(); ) {
+ GLContext ctx = (GLContext) iter.next();
+ if (ctx != ignore) {
+ return ctx;
+ }
+ }
+ return null;
+ }
+
+ public void contextCreated(GLContext ctx) {
+ Object res = destroyedShares.remove(ctx);
+ assert res != null : "State of ShareSet corrupted; thought context " +
+ ctx + " should have been in destroyed set but wasn't";
+ res = createdShares.put(ctx, dummyValue);
+ assert res == null : "State of ShareSet corrupted; thought context " +
+ ctx + " shouldn't have been in created set but was";
+ }
+
+ public void contextDestroyed(GLContext ctx) {
+ Object res = createdShares.remove(ctx);
+ assert res != null : "State of ShareSet corrupted; thought context " +
+ ctx + " should have been in created set but wasn't";
+ res = destroyedShares.put(ctx, dummyValue);
+ assert res == null : "State of ShareSet corrupted; thought context " +
+ ctx + " shouldn't have been in destroyed set but was";
+ }
+ }
+
+ /** Indicate that contexts <code>share1</code> and
+ <code>share2</code> will share textures and display lists. Both
+ must be non-null. */
+ public static synchronized void registerSharing(GLContext share1, GLContext share2) {
+ if (share1 == null || share2 == null) {
+ throw new IllegalArgumentException("Both share1 and share2 must be non-null");
+ }
+ ShareSet share = entryFor(share1);
+ if (share == null) {
+ share = entryFor(share2);
+ }
+ if (share == null) {
+ share = new ShareSet();
+ }
+ share.add(share1);
+ share.add(share2);
+ addEntry(share1, share);
+ addEntry(share2, share);
+ }
+
+ public static synchronized GLContext getShareContext(GLContext contextToCreate) {
+ ShareSet share = entryFor(contextToCreate);
+ if (share == null) {
+ return null;
+ }
+ return share.getCreatedShare(contextToCreate);
+ }
+
+ public static synchronized void contextCreated(GLContext context) {
+ ShareSet share = entryFor(context);
+ if (share != null) {
+ share.contextCreated(context);
+ }
+ }
+
+ public static synchronized void contextDestroyed(GLContext context) {
+ ShareSet share = entryFor(context);
+ if (share != null) {
+ share.contextDestroyed(context);
+ }
+ }
+
+ /** In order to avoid glGet calls for buffer object checks related
+ to glVertexPointer, etc. calls as well as glMapBuffer calls, we
+ need to share the same GLBufferSizeTracker object between
+ contexts sharing textures and display lists. For now we keep
+ this mechanism orthogonal to the GLObjectTracker to hopefully
+ keep things easier to understand. (The GLObjectTracker is
+ currently only needed in a fairly esoteric case, when the
+ Java2D/JOGL bridge is active, but the GLBufferSizeTracker
+ mechanism is now always required.) */
+ public static void registerForBufferObjectSharing(GLContext olderContextOrNull, GLContext newContext) {
+ // FIXME: downcasts to GLContextImpl undesirable
+ GLContextImpl older = (GLContextImpl) olderContextOrNull;
+ GLContextImpl newer = (GLContextImpl) newContext;
+ GLBufferSizeTracker tracker = null;
+ if (older != null) {
+ tracker = older.getBufferSizeTracker();
+ assert (tracker != null)
+ : "registerForBufferObjectSharing was not called properly for the older context, or has a bug in it";
+ }
+ if (tracker == null) {
+ tracker = new GLBufferSizeTracker();
+ }
+ newer.setBufferSizeTracker(tracker);
+ }
+
+ // FIXME: refactor Java SE dependencies
+ // /** Indicates that the two supplied contexts (which must be able to
+ // share textures and display lists) should be in the same
+ // namespace for tracking of server-side object creation and
+ // deletion. Because the sharing necessary behind the scenes is
+ // different than that requested at the user level, the two notions
+ // are different. This must be called immediately after the
+ // creation of the new context (which is the second argument)
+ // before any server-side OpenGL objects have been created in that
+ // context. */
+ // public static void registerForObjectTracking(GLContext olderContextOrNull,
+ // GLContext newContext,
+ // GLContext realShareContext) {
+ // if (isObjectTrackingEnabled() || isObjectTrackingDebuggingEnabled()) {
+ // GLContextImpl impl1 = null;
+ // GLContextImpl impl2 = null;
+ // GLObjectTracker tracker = null;
+ //
+ // synchronized (GLContextShareSet.class) {
+ // if (olderContextOrNull != null &&
+ // newContext != null) {
+ // if (entryFor(olderContextOrNull) != entryFor(newContext)) {
+ // throw new IllegalArgumentException("old and new contexts must be able to share textures and display lists");
+ // }
+ // }
+ //
+ // // FIXME: downcast to GLContextImpl undesirable
+ // impl1 = (GLContextImpl) olderContextOrNull;
+ // impl2 = (GLContextImpl) newContext;
+ //
+ // GLObjectTracker deletedObjectTracker = null;
+ // GLContextImpl shareImpl = (GLContextImpl) realShareContext;
+ // // Before we zap the "user-level" object trackers, make sure
+ // // that all contexts in the share set share the destroyed object
+ // // tracker
+ // if (shareImpl != null) {
+ // deletedObjectTracker = shareImpl.getDeletedObjectTracker();
+ // }
+ // if (deletedObjectTracker == null) {
+ // // Must create one and possibly set it up in the older context
+ // deletedObjectTracker = new GLObjectTracker();
+ // if (DEBUG) {
+ // System.err.println("Created deletedObjectTracker " + deletedObjectTracker + " because " +
+ // ((shareImpl == null) ? "shareImpl was null" : "shareImpl's (" + shareImpl + ") deletedObjectTracker was null"));
+ // }
+ //
+ // if (shareImpl != null) {
+ // // FIXME: think should really assert in this case
+ // shareImpl.setDeletedObjectTracker(deletedObjectTracker);
+ // if (DEBUG) {
+ // System.err.println("Set deletedObjectTracker " + deletedObjectTracker + " in shareImpl context " + shareImpl);
+ // }
+ // }
+ // }
+ // impl2.setDeletedObjectTracker(deletedObjectTracker);
+ // if (DEBUG) {
+ // System.err.println("Set deletedObjectTracker " + deletedObjectTracker + " in impl2 context " + impl2);
+ // }
+ // }
+ //
+ // // Must not hold lock around this operation
+ // // Don't share object trackers with the primordial share context from Java2D
+ // if (Java2D.isOGLPipelineActive()) {
+ // // FIXME: probably need to do something different here
+ // // Need to be able to figure out the GraphicsDevice for the
+ // // older context if it's on-screen
+ // GraphicsDevice device = GraphicsEnvironment.
+ // getLocalGraphicsEnvironment().
+ // getDefaultScreenDevice();
+ // GLContext j2dShareContext = Java2D.getShareContext(device);
+ // if (impl1 != null && impl1 == j2dShareContext) {
+ // impl1 = null;
+ // }
+ // }
+ //
+ // synchronized (GLContextShareSet.class) {
+ // if (impl1 != null) {
+ // tracker = impl1.getObjectTracker();
+ // assert (tracker != null)
+ // : "registerForObjectTracking was not called properly for the older context";
+ // }
+ // if (tracker == null) {
+ // tracker = new GLObjectTracker();
+ // }
+ // // Note that we don't assert that the tracker is non-null for
+ // // impl2 because the way we use this functionality we actually
+ // // overwrite the initially-set object tracker in the new context
+ // impl2.setObjectTracker(tracker);
+ // }
+ // }
+ // }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+
+
+ private static ShareSet entryFor(GLContext context) {
+ return (ShareSet) shareMap.get(context);
+ }
+
+ private static void addEntry(GLContext context, ShareSet share) {
+ if (shareMap.get(context) == null) {
+ shareMap.put(context, share);
+ }
+ }
+
+ // FIXME: refactor Java SE dependencies
+ // private static boolean isObjectTrackingEnabled() {
+ // return ((Java2D.isOGLPipelineActive() && Java2D.isFBOEnabled()) ||
+ // isObjectTrackingDebuggingEnabled());
+ // }
+ //
+ // private static boolean isObjectTrackingDebuggingEnabled() {
+ // return forceTracking;
+ // }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java
new file mode 100644
index 000000000..de911950a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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 java.lang.reflect.*;
+
+/** Extends GLDrawableFactory with a few methods for handling
+ typically software-accelerated offscreen rendering (Device
+ Independent Bitmaps on Windows, pixmaps on X11). Direct access to
+ these GLDrawables is not supplied directly to end users, though
+ they may be instantiated by the GLJPanel implementation. */
+public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
+ protected static final boolean DEBUG = Debug.debug("GLDrawableFactory");
+
+ /** Creates a (typically software-accelerated) offscreen GLDrawable
+ used to implement the fallback rendering path of the
+ GLJPanel. */
+ public abstract GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height);
+
+ protected GLDrawableFactoryImpl() {
+ super();
+ }
+
+ /**
+ * Returns the sole GLDrawableFactoryImpl instance.
+ *
+ * @arg glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
+ * or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
+ */
+ public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) {
+ return (GLDrawableFactoryImpl) getFactory(glp);
+ }
+
+ // Helper function for more lazily loading the GLU library;
+ // apparently can't use System.loadLibrary on UNIX because it uses
+ // RTLD_LOCAL and we need to call dlsym(RTLD_DEFAULT)
+ public abstract void loadGLULibrary();
+
+ //----------------------------------------------------------------------
+ // Support for locking and unlocking the toolkit -- needed only on X11 platforms
+ //
+
+ public void lockToolkit() {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ }
+
+ public void unlockToolkit() {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+
+ //---------------------------------------------------------------------------
+ // Support for Java2D/JOGL bridge on Mac OS X; the external
+ // GLDrawable mechanism in the public API is sufficient to
+ // implement this functionality on all other platforms
+ //
+
+ public abstract boolean canCreateContextOnJava2DSurface();
+
+ public abstract GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+ throws GLException;
+
+ //----------------------------------------------------------------------
+ // Gamma adjustment support
+ // Thanks to the LWJGL team for illustrating how to make these
+ // adjustments on various OSs.
+
+ /*
+ * Portions Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ /**
+ * Sets the gamma, brightness, and contrast of the current main
+ * display. Returns true if the settings were changed, false if
+ * not. If this method returns true, the display settings will
+ * automatically be reset upon JVM exit (assuming the JVM does not
+ * crash); if the user wishes to change the display settings back to
+ * normal ahead of time, use resetDisplayGamma(). Throws
+ * IllegalArgumentException if any of the parameters were
+ * out-of-bounds.
+ *
+ * @param gamma The gamma value, typically > 1.0 (default value is
+ * 1.0)
+ * @param brightness The brightness value between -1.0 and 1.0,
+ * inclusive (default value is 0)
+ * @param contrast The contrast, greater than 0.0 (default value is 1)
+ * @throws IllegalArgumentException if any of the parameters were
+ * out-of-bounds
+ */
+ public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException {
+ if ((brightness < -1.0f) || (brightness > 1.0f)) {
+ throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0");
+ }
+ if (contrast < 0) {
+ throw new IllegalArgumentException("Contrast must be greater than 0.0");
+ }
+ // FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
+ int rampLength = getGammaRampLength();
+ if (rampLength == 0) {
+ return false;
+ }
+ float[] gammaRamp = new float[rampLength];
+ for (int i = 0; i < rampLength; i++) {
+ float intensity = (float) i / (float) (rampLength - 1);
+ // apply gamma
+ float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
+ // apply brightness
+ rampEntry += brightness;
+ // apply contrast
+ rampEntry = (rampEntry - 0.5f) * contrast + 0.5f;
+ // Clamp entry to [0, 1]
+ if (rampEntry > 1.0f)
+ rampEntry = 1.0f;
+ else if (rampEntry < 0.0f)
+ rampEntry = 0.0f;
+ gammaRamp[i] = rampEntry;
+ }
+ registerGammaShutdownHook();
+ return setGammaRamp(gammaRamp);
+ }
+
+ public synchronized void resetDisplayGamma() {
+ if (gammaShutdownHook == null) {
+ throw new IllegalArgumentException("Should not call this unless setDisplayGamma called first");
+ }
+ resetGammaRamp(originalGammaRamp);
+ unregisterGammeShutdownHook();
+ }
+
+ //------------------------------------------------------
+ // Gamma-related methods to be implemented by subclasses
+ //
+
+ /** Returns the length of the computed gamma ramp for this OS and
+ hardware. Returns 0 if gamma changes are not supported. */
+ protected int getGammaRampLength() {
+ return 0;
+ }
+
+ /** Sets the gamma ramp for the main screen. Returns false if gamma
+ ramp changes were not supported. */
+ protected boolean setGammaRamp(float[] ramp) {
+ return false;
+ }
+
+ /** Gets the current gamma ramp. This is basically an opaque value
+ used only on some platforms to reset the gamma ramp to its
+ original settings. */
+ protected Buffer getGammaRamp() {
+ return null;
+ }
+
+ /** Resets the gamma ramp, potentially using the specified Buffer as
+ data to restore the original values. */
+ protected void resetGammaRamp(Buffer originalGammaRamp) {
+ }
+
+ // Shutdown hook mechanism for resetting gamma
+ private boolean gammaShutdownHookRegistered;
+ private Thread gammaShutdownHook;
+ private Buffer originalGammaRamp;
+ private synchronized void registerGammaShutdownHook() {
+ if (gammaShutdownHookRegistered)
+ return;
+ if (gammaShutdownHook == null) {
+ gammaShutdownHook = new Thread(new Runnable() {
+ public void run() {
+ synchronized (GLDrawableFactoryImpl.this) {
+ resetGammaRamp(originalGammaRamp);
+ }
+ }
+ });
+ originalGammaRamp = getGammaRamp();
+ }
+ Runtime.getRuntime().addShutdownHook(gammaShutdownHook);
+ gammaShutdownHookRegistered = true;
+ }
+
+ private synchronized void unregisterGammeShutdownHook() {
+ if (!gammaShutdownHookRegistered)
+ return;
+ if (gammaShutdownHook == null) {
+ throw new InternalError("Error in gamma shutdown hook logic");
+ }
+ Runtime.getRuntime().removeShutdownHook(gammaShutdownHook);
+ gammaShutdownHookRegistered = false;
+ // Leave the original gamma ramp data alone
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java
new file mode 100644
index 000000000..95c868d00
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableHelper.java
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Encapsulates the implementation of most of the GLAutoDrawable's
+ methods to be able to share it between GLCanvas and GLJPanel. */
+
+public class GLDrawableHelper {
+ private volatile List listeners = new ArrayList();
+ private static final boolean DEBUG = Debug.debug("GLDrawableHelper");
+ private static final boolean VERBOSE = Debug.verbose();
+ private static final boolean NVIDIA_CRASH_WORKAROUND = Debug.isPropertyDefined("jogl.nvidia.crash.workaround");
+ private boolean autoSwapBufferMode = true;
+
+ public GLDrawableHelper() {
+ }
+
+ public synchronized String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("GLEventListeners num "+listeners.size()+" [");
+ for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
+ sb.append(iter.next()+", ");
+ }
+ sb.append("]");
+ return sb.toString();
+ }
+
+ public synchronized void addGLEventListener(GLEventListener listener) {
+ List newListeners = (List) ((ArrayList) listeners).clone();
+ newListeners.add(listener);
+ listeners = newListeners;
+ }
+
+ public synchronized void removeGLEventListener(GLEventListener listener) {
+ List newListeners = (List) ((ArrayList) listeners).clone();
+ newListeners.remove(listener);
+ listeners = newListeners;
+ }
+
+ public synchronized void dispose(GLAutoDrawable drawable) {
+ for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
+ ((GLEventListener) iter.next()).dispose(drawable);
+ }
+ }
+
+ public void init(GLAutoDrawable drawable) {
+ for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
+ ((GLEventListener) iter.next()).init(drawable);
+ }
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
+ ((GLEventListener) iter.next()).display(drawable);
+ }
+ }
+
+ public void reshape(GLAutoDrawable drawable,
+ int x, int y, int width, int height) {
+ for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
+ ((GLEventListener) iter.next()).reshape(drawable, x, y, width, height);
+ }
+ }
+
+ public void setAutoSwapBufferMode(boolean onOrOff) {
+ autoSwapBufferMode = onOrOff;
+ }
+
+ public boolean getAutoSwapBufferMode() {
+ return autoSwapBufferMode;
+ }
+
+ private static final ThreadLocal perThreadInitAction = new ThreadLocal();
+ /** Principal helper method which runs a Runnable with the context
+ made current. This could have been made part of GLContext, but a
+ desired goal is to be able to implement the GLCanvas in terms of
+ the GLContext's public APIs, and putting it into a separate
+ class helps ensure that we don't inadvertently use private
+ methods of the GLContext or its implementing classes. */
+ public void invokeGL(GLDrawable drawable,
+ GLContext context,
+ Runnable runnable,
+ Runnable initAction) {
+ if(null==context) {
+ if (DEBUG) {
+ Exception e = new GLException(Thread.currentThread().getName()+" GLDrawableHelper " + this + ".invokeGL(): NULL GLContext");
+ e.printStackTrace();
+ }
+ return;
+ }
+ // Support for recursive makeCurrent() calls as well as calling
+ // other drawables' display() methods from within another one's
+ GLContext lastContext = GLContext.getCurrent();
+ Runnable lastInitAction = (Runnable) perThreadInitAction.get();
+ if (lastContext != null) {
+ lastContext.release();
+ }
+
+ int res = 0;
+ try {
+ res = context.makeCurrent();
+ if (res != GLContext.CONTEXT_NOT_CURRENT) {
+ if(null!=initAction) {
+ perThreadInitAction.set(initAction);
+ if (res == GLContext.CONTEXT_CURRENT_NEW) {
+ if (DEBUG) {
+ System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running initAction");
+ }
+ initAction.run();
+ }
+ }
+ if(null!=runnable) {
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running runnable");
+ }
+ runnable.run();
+ if (autoSwapBufferMode) {
+ if (drawable != null) {
+ drawable.swapBuffers();
+ }
+ }
+ }
+ }
+ } finally {
+ try {
+ if (res != GLContext.CONTEXT_NOT_CURRENT) {
+ context.release();
+ }
+ } catch (Exception e) {
+ }
+ if (lastContext != null) {
+ int res2 = lastContext.makeCurrent();
+ if (res2 == GLContext.CONTEXT_CURRENT_NEW) {
+ lastInitAction.run();
+ }
+ }
+ }
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java
new file mode 100644
index 000000000..c381f68f5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+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");
+
+ protected GLDrawableImpl(GLDrawableFactory factory,
+ NativeWindow comp,
+ boolean realized) {
+ this.factory = factory;
+ this.component = comp;
+ this.realized = realized;
+ this.requestedCapabilities = (GLCapabilities)component.getGraphicsConfiguration().getNativeGraphicsConfiguration().getRequestedCapabilities(); // a copy ..
+ }
+
+ /**
+ * Returns the DynamicLookupHelper
+ */
+ public abstract DynamicLookupHelper getDynamicLookupHelper();
+
+ public GLDrawableFactoryImpl getFactoryImpl() {
+ return (GLDrawableFactoryImpl) getFactory();
+ }
+
+ /** For offscreen GLDrawables (pbuffers and "pixmap" drawables),
+ indicates that native resources should be reclaimed. */
+ public void destroy() {
+ throw new GLException("Should not call this (should only be called for offscreen GLDrawables)");
+ }
+
+ public void swapBuffers() throws GLException {
+ }
+
+ public static String toHexString(long hex) {
+ return GLContextImpl.toHexString(hex);
+ }
+
+ public GLProfile getGLProfile() {
+ return requestedCapabilities.getGLProfile();
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ return (GLCapabilities)component.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); // a copy
+ }
+
+ public GLCapabilities getRequestedGLCapabilities() {
+ return requestedCapabilities;
+ }
+
+ public NativeWindow getNativeWindow() {
+ return component;
+ }
+
+ public GLDrawableFactory getFactory() {
+ return factory;
+ }
+
+ public void setRealized(boolean realized) {
+ this.realized = realized;
+ }
+
+ public boolean getRealized() {
+ return realized;
+ }
+
+ public int getWidth() {
+ return component.getWidth();
+ }
+
+ /** Returns the current height of this GLDrawable. */
+ public int getHeight() {
+ return component.getHeight();
+ }
+
+ public int lockSurface() throws GLException {
+ if (!realized) {
+ return NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+ return component.lockSurface();
+ }
+
+ public void unlockSurface() {
+ component.unlockSurface();
+ }
+
+ public boolean isSurfaceLocked() {
+ return component.isSurfaceLocked();
+ }
+
+ public String toString() {
+ return getClass().getName()+"[realized "+getRealized()+
+ ",\n\trequested "+getRequestedGLCapabilities()+
+ ",\n\tchosen "+getChosenGLCapabilities()+
+ ",\n\twindow "+getNativeWindow()+
+ ",\n\tfactory "+getFactory()+"]";
+ }
+
+ protected GLDrawableFactory factory;
+ protected NativeWindow component;
+ protected GLCapabilities requestedCapabilities;
+
+ // Indicates whether the component (if an onscreen context) has been
+ // realized. Plausibly, before the component is realized the JAWT
+ // should return an error or NULL object from some of its
+ // operations; this appears to be the case on Win32 but is not true
+ // at least with Sun's current X11 implementation (1.4.x), which
+ // crashes with no other error reported if the DrawingSurfaceInfo is
+ // fetched from a locked DrawingSurface during the validation as a
+ // result of calling show() on the main thread. To work around this
+ // we prevent any JAWT or OpenGL operations from being done until
+ // addNotify() is called on the component.
+ protected boolean realized;
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java
new file mode 100644
index 000000000..e414fbc8e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+/**
+import java.awt.Dimension;
+import java.awt.EventQueue;
+import java.awt.event.*;
+import java.beans.PropertyChangeListener;
+ */
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+
+/** Platform-independent class exposing pbuffer functionality to
+ applications. This class is not exposed in the public API as it
+ would probably add no value; however it implements the GLDrawable
+ interface so can be interacted with via its display() method. */
+
+public class GLPbufferImpl implements GLPbuffer {
+ private GLDrawableImpl pbufferDrawable;
+ private GLContextImpl context;
+ private GLDrawableHelper drawableHelper = new GLDrawableHelper();
+ private int floatMode;
+
+ public GLPbufferImpl(GLDrawableImpl pbufferDrawable,
+ GLContext parentContext) {
+ this.pbufferDrawable = pbufferDrawable;
+ context = (GLContextImpl) pbufferDrawable.createContext(parentContext);
+ context.setSynchronized(true);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return pbufferDrawable.createContext(shareWith);
+ }
+
+ public void setRealized(boolean realized) {
+ }
+
+ public void setSize(int width, int height) {
+ // FIXME
+ throw new GLException("Not yet implemented");
+ }
+
+ public NativeWindow getNativeWindow() {
+ return pbufferDrawable.getNativeWindow();
+ }
+
+ public GLDrawableFactory getFactory() {
+ return pbufferDrawable.getFactory();
+ }
+
+ public int getWidth() {
+ return pbufferDrawable.getWidth();
+ }
+
+ public int getHeight() {
+ return pbufferDrawable.getHeight();
+ }
+
+ public void display() {
+ maybeDoSingleThreadedWorkaround(displayOnEventDispatchThreadAction,
+ displayAction,
+ false);
+ }
+
+ public void repaint() {
+ display();
+ }
+
+ public void addGLEventListener(GLEventListener listener) {
+ drawableHelper.addGLEventListener(listener);
+ }
+
+ public void removeGLEventListener(GLEventListener listener) {
+ drawableHelper.removeGLEventListener(listener);
+ }
+
+ public void setContext(GLContext ctx) {
+ context=(GLContextImpl)ctx;
+ }
+
+ public GLContext getContext() {
+ return context;
+ }
+
+ public GLDrawable getDrawable() {
+ return pbufferDrawable;
+ }
+
+ public GL getGL() {
+ return getContext().getGL();
+ }
+
+ public void setGL(GL gl) {
+ getContext().setGL(gl);
+ }
+
+ public void setAutoSwapBufferMode(boolean onOrOff) {
+ drawableHelper.setAutoSwapBufferMode(onOrOff);
+ }
+
+ public boolean getAutoSwapBufferMode() {
+ return drawableHelper.getAutoSwapBufferMode();
+ }
+
+ public void swapBuffers() {
+ maybeDoSingleThreadedWorkaround(swapBuffersOnEventDispatchThreadAction, swapBuffersAction, false);
+ }
+
+ public void bindTexture() {
+ // Doesn't make much sense to try to do this on the event dispatch
+ // thread given that it has to be called while the context is current
+ context.bindPbufferToTexture();
+ }
+
+ public void releaseTexture() {
+ // Doesn't make much sense to try to do this on the event dispatch
+ // thread given that it has to be called while the context is current
+ context.releasePbufferFromTexture();
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ if (pbufferDrawable == null)
+ return null;
+
+ return pbufferDrawable.getChosenGLCapabilities();
+ }
+
+ public GLCapabilities getRequestedGLCapabilities() {
+ if (pbufferDrawable == null)
+ return null;
+
+ return pbufferDrawable.getRequestedGLCapabilities();
+ }
+
+ public GLProfile getGLProfile() {
+ if (pbufferDrawable == null)
+ return null;
+
+ return pbufferDrawable.getGLProfile();
+ }
+
+ private boolean surfaceLocked = false;
+
+ public int lockSurface() throws GLException {
+ surfaceLocked=true;
+ return NativeWindow.LOCK_SUCCESS;
+ }
+
+ public void unlockSurface() {
+ surfaceLocked=false;
+ }
+
+ public boolean isSurfaceLocked() {
+ return surfaceLocked;
+ }
+
+ //----------------------------------------------------------------------
+ // No-ops for ComponentEvents
+ //
+
+ /*
+ public void addComponentListener(ComponentListener l) {}
+ public void removeComponentListener(ComponentListener l) {}
+ public void addFocusListener(FocusListener l) {}
+ public void removeFocusListener(FocusListener l) {}
+ public void addHierarchyBoundsListener(HierarchyBoundsListener l) {}
+ public void removeHierarchyBoundsListener(HierarchyBoundsListener l) {}
+ public void addHierarchyListener(HierarchyListener l) {}
+ public void removeHierarchyListener(HierarchyListener l) {}
+ public void addInputMethodListener(InputMethodListener l) {}
+ public void removeInputMethodListener(InputMethodListener l) {}
+ public void addKeyListener(KeyListener l) {}
+ public void removeKeyListener(KeyListener l) {}
+ public void addMouseListener(MouseListener l) {}
+ public void removeMouseListener(MouseListener l) {}
+ public void addMouseMotionListener(MouseMotionListener l) {}
+ public void removeMouseMotionListener(MouseMotionListener l) {}
+ public void addMouseWheelListener(MouseWheelListener l) {}
+ public void removeMouseWheelListener(MouseWheelListener l) {}
+ public void addPropertyChangeListener(PropertyChangeListener listener) {}
+ public void removePropertyChangeListener(PropertyChangeListener listener) {}
+ public void addPropertyChangeListener(String propertyName,
+ PropertyChangeListener listener) {}
+ public void removePropertyChangeListener(String propertyName,
+ PropertyChangeListener listener) {}
+ */
+
+ public void destroy() {
+ // FIXME: not calling event listeners .. see GLAutoDrawable spec
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ Threading.invokeOnOpenGLThread(destroyAction);
+ } else {
+ destroyAction.run();
+ }
+ }
+
+ public int getFloatingPointMode() {
+ if (floatMode == 0) {
+ throw new GLException("Pbuffer not initialized, or floating-point support not requested");
+ }
+ return floatMode;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void maybeDoSingleThreadedWorkaround(Runnable eventDispatchThreadAction,
+ Runnable invokeGLAction,
+ boolean isReshape) {
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ Threading.invokeOnOpenGLThread(eventDispatchThreadAction);
+ } else {
+ drawableHelper.invokeGL(pbufferDrawable, context, invokeGLAction, initAction);
+ }
+ }
+
+ class InitAction implements Runnable {
+ public void run() {
+ floatMode = context.getFloatingPointMode();
+ drawableHelper.init(GLPbufferImpl.this);
+ }
+ }
+ private InitAction initAction = new InitAction();
+
+ class DisplayAction implements Runnable {
+ public void run() {
+ drawableHelper.display(GLPbufferImpl.this);
+ }
+ }
+ private DisplayAction displayAction = new DisplayAction();
+
+ class SwapBuffersAction implements Runnable {
+ // FIXME: currently a no-op
+ public void run() {
+ pbufferDrawable.swapBuffers();
+ }
+ }
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
+
+ // Workaround for ATI driver bugs related to multithreading issues
+ // like simultaneous rendering via Animators to canvases that are
+ // being resized on the AWT event dispatch thread
+ class DisplayOnEventDispatchThreadAction implements Runnable {
+ public void run() {
+ drawableHelper.invokeGL(pbufferDrawable, context, displayAction, initAction);
+ }
+ }
+ private DisplayOnEventDispatchThreadAction displayOnEventDispatchThreadAction =
+ new DisplayOnEventDispatchThreadAction();
+ class SwapBuffersOnEventDispatchThreadAction implements Runnable {
+ public void run() {
+ drawableHelper.invokeGL(pbufferDrawable, context, swapBuffersAction, initAction);
+ }
+ }
+ private SwapBuffersOnEventDispatchThreadAction swapBuffersOnEventDispatchThreadAction =
+ new SwapBuffersOnEventDispatchThreadAction();
+
+ class DestroyAction implements Runnable {
+ public void run() {
+ if (null != context) {
+ context.destroy();
+ }
+ pbufferDrawable.destroy();
+ }
+ }
+ private DestroyAction destroyAction = new DestroyAction();
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java b/src/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java
new file mode 100755
index 000000000..b110e4335
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/GLWorkerThread.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.security.*;
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Singleton thread upon which all OpenGL work is performed by
+ default. Unfortunately many vendors' OpenGL drivers are not really
+ thread-safe and stability is much improved by performing OpenGL
+ work on at most one thread. This is the default behavior of the
+ GLAutoDrawable implementations according to the {@link
+ javax.media.opengl.Threading Threading} class. The GLWorkerThread
+ replaces the original AWT event queue thread-based mechanism for
+ two reasons: first, more than one AWT event queue thread may be
+ spawned, for example if a dialog is being shown; second, it avoids
+ blocking the AWT event queue thread during OpenGL rendering. */
+
+public class GLWorkerThread {
+ private static volatile boolean started;
+ private static volatile Thread thread;
+ private static Object lock;
+ private static volatile boolean shouldTerminate;
+ private static volatile Throwable exception;
+
+ // The Runnable to execute immediately on the worker thread
+ private static volatile Runnable work;
+ // Queue of Runnables to be asynchronously invoked
+ private static List queue = new LinkedList();
+
+ /** Should only be called by Threading class if creation of the
+ GLWorkerThread was requested via the opengl.1thread system
+ property. */
+ public static void start() {
+ if (!started) {
+ synchronized (GLWorkerThread.class) {
+ if (!started) {
+ lock = new Object();
+ thread = new Thread(new WorkerRunnable(),
+ "JOGL GLWorkerThread");
+ thread.setDaemon(true);
+ started = true;
+ synchronized (lock) {
+ thread.start();
+ try {
+ lock.wait();
+ } catch (InterruptedException e) {
+ }
+ }
+
+ /*
+
+ // Note: it appears that there is a bug in NVidia's current
+ // drivers where if a context was ever made current on a
+ // given thread and that thread has exited before program
+ // exit, a crash occurs in the drivers. Releasing the
+ // context from the given thread does not work around the
+ // problem.
+ //
+ // For the time being, we're going to work around this
+ // problem by not terminating the GLWorkerThread. In theory,
+ // shutting down the GLWorkerThread cleanly could be a good
+ // general solution to the problem of needing to
+ // cooperatively terminate all Animators at program exit.
+ //
+ // It appears that this doesn't even work around all of the
+ // kinds of crashes. Causing the context to be unilaterally
+ // released from the GLWorkerThread after each invocation
+ // seems to work around all of the kinds of crashes seen.
+ //
+ // These appear to be similar to the kinds of crashes seen
+ // when the Java2D/OpenGL pipeline terminates, and those are
+ // a known issue being fixed, so presumably these will be
+ // fixed in NVidia's next driver set.
+
+ // Install shutdown hook to terminate daemon thread more or
+ // less cooperatively
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ Object lockTemp = lock;
+ if (lockTemp == null) {
+ // Already terminating (?)
+ return;
+ }
+ synchronized (lockTemp) {
+ shouldTerminate = true;
+ lockTemp.notifyAll();
+ try {
+ lockTemp.wait(500);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+ });
+ return null;
+ }
+ });
+
+ */
+
+ } else {
+ throw new RuntimeException("Should not start GLWorkerThread twice");
+ }
+ }
+ }
+ }
+
+ public static void invokeAndWait(Runnable runnable)
+ throws InvocationTargetException, InterruptedException {
+ if (!started) {
+ throw new RuntimeException("May not invokeAndWait on worker thread without starting it first");
+ }
+
+ Object lockTemp = lock;
+ if (lockTemp == null) {
+ return; // Terminating
+ }
+
+ synchronized (lockTemp) {
+ if (thread == null) {
+ // Terminating
+ return;
+ }
+
+ work = runnable;
+ lockTemp.notifyAll();
+ lockTemp.wait();
+ if (exception != null) {
+ Throwable localException = exception;
+ exception = null;
+ throw new InvocationTargetException(localException);
+ }
+ }
+ }
+
+ public static void invokeLater(Runnable runnable) {
+ if (!started) {
+ throw new RuntimeException("May not invokeLater on worker thread without starting it first");
+ }
+
+ Object lockTemp = lock;
+ if (lockTemp == null) {
+ return; // Terminating
+ }
+
+ synchronized (lockTemp) {
+ if (thread == null) {
+ // Terminating
+ return;
+ }
+
+ queue.add(runnable);
+ lockTemp.notifyAll();
+ }
+ }
+
+ /** Indicates whether the OpenGL worker thread was started, i.e.,
+ whether it is currently in use. */
+ public static boolean isStarted() {
+ return started;
+ }
+
+ /** Indicates whether the current thread is the OpenGL worker
+ thread. */
+ public static boolean isWorkerThread() {
+ return (Thread.currentThread() == thread);
+ }
+
+ static class WorkerRunnable implements Runnable {
+ public void run() {
+ // Notify starting thread that we're ready
+ synchronized (lock) {
+ lock.notifyAll();
+ }
+
+ while (!shouldTerminate) {
+ synchronized (lock) {
+ while (!shouldTerminate &&
+ (work == null) &&
+ queue.isEmpty()) {
+ try {
+ // Avoid race conditions with wanting to release contexts on this thread
+ lock.wait(1000);
+ } catch (InterruptedException e) {
+ }
+
+ if (GLContext.getCurrent() != null) {
+ // Test later to see whether we need to release this context
+ break;
+ }
+ }
+
+ if (shouldTerminate) {
+ lock.notifyAll();
+ thread = null;
+ lock = null;
+ return;
+ }
+
+ if (work != null) {
+ try {
+ work.run();
+ } catch (Throwable t) {
+ exception = t;
+ } finally {
+ work = null;
+ lock.notifyAll();
+ }
+ }
+
+ while (!queue.isEmpty()) {
+ try {
+ Runnable curAsync = (Runnable) queue.remove(0);
+ curAsync.run();
+ } catch (Throwable t) {
+ System.out.println("Exception occurred on JOGL OpenGL worker thread:");
+ t.printStackTrace();
+ }
+ }
+
+ // See about releasing current context
+ GLContext curContext = GLContext.getCurrent();
+ if (curContext != null &&
+ (curContext instanceof GLContextImpl)) {
+ GLContextImpl impl = (GLContextImpl) curContext;
+ if (impl.hasWaiters()) {
+ impl.release();
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp
new file mode 100644
index 000000000..2614e52d4
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javame_cdc_fp
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.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. */
+public class InternalBufferUtil {
+ 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;
+
+ //----------------------------------------------------------------------
+ // Allocation routines
+ //
+
+ /** 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;
+ }
+
+ /** 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();
+ }
+
+ //----------------------------------------------------------------------
+ // 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;
+ }
+
+ //----------------------------------------------------------------------
+ // Conversion routines
+ //
+
+ public 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;
+ }
+
+ //----------------------------------------------------------------------
+ // 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/impl/InternalBufferUtil.java.javase b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase
new file mode 100644
index 000000000..f9f443e13
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/InternalBufferUtil.java.javase
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.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. */
+public class InternalBufferUtil {
+ 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;
+
+ //----------------------------------------------------------------------
+ // Allocation routines
+ //
+
+ /** 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;
+ }
+
+ /** 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();
+ }
+
+ /** 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();
+ }
+
+ /** 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();
+ }
+
+ //----------------------------------------------------------------------
+ // 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;
+ }
+
+ //----------------------------------------------------------------------
+ // 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 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;
+ }
+
+ //----------------------------------------------------------------------
+ // 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/impl/NativeLibLoader.java b/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java
new file mode 100644
index 000000000..12dc8fc7d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/NativeLibLoader.java
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+// FIXME: refactor Java SE dependencies
+//import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import com.sun.nativewindow.impl.NativeLibLoaderBase;
+
+public class NativeLibLoader extends NativeLibLoaderBase {
+ protected static final boolean DEBUG = Debug.debug("NativeLibLoader");
+
+ public static void loadNEWT() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ loadLibrary("newt", nativeOSPreload, true);
+ return null;
+ }
+ });
+ }
+
+ public static void loadGLDesktop() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ loadLibrary("jogl_gl2", nativeOSPreload, true);
+ return null;
+ }
+ });
+ }
+
+ public static void loadGLDesktopES12() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ loadLibrary("jogl_gl2es12", nativeOSPreload, true);
+ return null;
+ }
+ });
+ }
+
+ public static void loadES2() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ loadLibrary("jogl_es2", nativeOSPreload, true);
+ return null;
+ }
+ });
+ }
+
+ public static void loadES1() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ loadLibrary("jogl_es1", nativeOSPreload, true);
+ return null;
+ }
+ });
+ }
+
+ public static void loadCgImpl() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String[] preload = { "nativewindow", "cg", "cgGL" };
+ loadLibrary("jogl_cg", preload, true);
+ return null;
+ }
+ });
+ }
+
+ //----------------------------------------------------------------------
+ // Support for the new JNLPAppletLauncher
+ //
+
+ private static class JOGLAction implements NativeLibLoaderBase.LoaderAction {
+ public void loadLibrary(String libname, String[] preload,
+ boolean preloadIgnoreError) {
+ if (null!=preload) {
+ for (int i=0; i<preload.length; i++) {
+ if(!isLoaded(preload[i])) {
+ try {
+ if(DEBUG) {
+ System.err.println("JOGL NativeLibLoader preload "+preload[i]);
+ }
+ loadLibraryInternal(preload[i]);
+ addLoaded(preload[i]);
+ }
+ catch (UnsatisfiedLinkError e) {
+ if(DEBUG) e.printStackTrace();
+ if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) {
+ throw e;
+ }
+ }
+ }
+ }
+ }
+
+ if(DEBUG) {
+ System.err.println("JOGL NativeLibLoader load "+libname);
+ }
+ loadLibraryInternal(libname);
+ addLoaded(libname);
+ }
+ }
+
+ private static final String[] nativeOSPreload = { "nativewindow_x11" };
+ private static boolean usingJNLPAppletLauncher;
+ private static Method jnlpLoadLibraryMethod;
+
+ static {
+ NativeLibLoaderBase.setLoadingAction(new JOGLAction());
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher");
+ usingJNLPAppletLauncher = Boolean.valueOf(sunAppletLauncher).booleanValue();
+ return null;
+ }
+ });
+ }
+
+ // I hate the amount of delegation currently in this class
+ private static void loadLibraryInternal(String libraryName) {
+ // Note: special-casing JAWT which is built in to the JDK
+ if (usingJNLPAppletLauncher && !libraryName.equals("jawt")) {
+ try {
+ if (jnlpLoadLibraryMethod == null) {
+ Class jnlpAppletLauncherClass = Class.forName("org.jdesktop.applet.util.JNLPAppletLauncher");
+ jnlpLoadLibraryMethod = jnlpAppletLauncherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class });
+ }
+ jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName });
+ } catch (Exception e) {
+ Throwable t = e;
+ if(DEBUG) t.printStackTrace();
+ if (t instanceof InvocationTargetException) {
+ t = ((InvocationTargetException) t).getTargetException();
+ }
+ if (t instanceof Error)
+ throw (Error) t;
+ if (t instanceof RuntimeException) {
+ throw (RuntimeException) t;
+ }
+ // Throw UnsatisfiedLinkError for best compatibility with System.loadLibrary()
+ throw (UnsatisfiedLinkError) new UnsatisfiedLinkError().initCause(e);
+ }
+ } else {
+ // FIXME: remove
+ // System.out.println("sun.boot.library.path=" + System.getProperty("sun.boot.library.path"));
+ System.loadLibrary(libraryName);
+ if(DEBUG) {
+ System.err.println("JOGL Loaded Native Library: "+libraryName);
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java b/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java
new file mode 100755
index 000000000..cc8ba639f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/ProjectFloat.java
@@ -0,0 +1,1057 @@
+/*
+** License Applicability. Except 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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** $Date: 2009-03-13 22:20:29 -0700 (Fri, 13 Mar 2009) $ $Revision: 1867 $
+** $Header$
+*/
+
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+package com.sun.opengl.impl;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
+/**
+ * ProjectFloat.java
+ * <p/>
+ * <p/>
+ * Created 11-jan-2004
+ *
+ * @author Erik Duijs
+ * @author Kenneth Russell
+ */
+public class ProjectFloat {
+ private static final float[] IDENTITY_MATRIX =
+ new float[] {
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 1.0f };
+
+ private static final float[] ZERO_MATRIX =
+ new float[] {
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 0.0f };
+
+ // Note that we have cloned parts of the implementation in order to
+ // support incoming Buffers. The reason for this is to avoid loading
+ // non-direct buffer subclasses unnecessarily, because doing so can
+ // cause performance decreases on direct buffer operations, at least
+ // on the current HotSpot JVM. It would be nicer (and make the code
+ // simpler) to simply have the array-based entry points delegate to
+ // the versions taking Buffers by wrapping the arrays.
+
+ // Array-based implementation
+ private final float[] matrix = new float[16];
+ private final float[][] tempInvertMatrix = new float[4][4];
+
+ private final float[] in = new float[4];
+ private final float[] out = new float[4];
+
+ private final float[] forward = new float[3];
+ private final float[] side = new float[3];
+ private final float[] up = new float[3];
+
+ // Buffer-based implementation
+ private FloatBuffer locbuf;
+ private final FloatBuffer matrixBuf;
+ private final FloatBuffer tempInvertMatrixBuf;
+
+ private final FloatBuffer inBuf;
+ private final FloatBuffer outBuf;
+
+ private final FloatBuffer forwardBuf;
+ private final FloatBuffer sideBuf;
+ private final FloatBuffer upBuf;
+
+ public ProjectFloat() {
+ // Use direct buffers to avoid loading indirect buffer
+ // implementations for applications trying to avoid doing so.
+ // Slice up one big buffer because some NIO implementations
+ // allocate a huge amount of memory to back even the smallest of
+ // buffers.
+ locbuf = InternalBufferUtil.newFloatBuffer(2*16+2*4+3*3);
+ int pos = 0;
+ int sz = 16;
+ matrixBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ tempInvertMatrixBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ sz = 4;
+ inBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ outBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ sz = 3;
+ forwardBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ sideBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ upBuf = slice(locbuf, pos, sz);
+ }
+
+ public void destroy() {
+ if(locbuf!=null) {
+ locbuf.clear();
+ locbuf=null;
+ }
+ }
+
+ private static FloatBuffer slice(FloatBuffer buf, int pos, int len) {
+ buf.position(pos);
+ buf.limit(pos + len);
+ return buf.slice();
+ }
+
+ /**
+ * Make matrix an identity matrix
+ */
+ public static void gluMakeIdentityf(FloatBuffer m) {
+ int oldPos = m.position();
+ m.put(IDENTITY_MATRIX);
+ m.position(oldPos);
+ }
+
+ /**
+ * Make matrix an zero matrix
+ */
+ public static void gluMakeZero(FloatBuffer m) {
+ int oldPos = m.position();
+ m.put(ZERO_MATRIX);
+ m.position(oldPos);
+ }
+
+ /**
+ * Make matrix an identity matrix
+ */
+ public static void gluMakeIdentityf(float[] m) {
+ for (int i = 0; i < 16; i++) {
+ m[i] = IDENTITY_MATRIX[i];
+ }
+ }
+
+ /**
+ * Method __gluMultMatrixVecf
+ *
+ * @param matrix
+ * @param in
+ * @param out
+ */
+ private void __gluMultMatrixVecf(float[] matrix, int matrix_offset, float[] in, float[] out) {
+ for (int i = 0; i < 4; i++) {
+ out[i] =
+ in[0] * matrix[0*4+i+matrix_offset] +
+ in[1] * matrix[1*4+i+matrix_offset] +
+ in[2] * matrix[2*4+i+matrix_offset] +
+ in[3] * matrix[3*4+i+matrix_offset];
+ }
+ }
+
+ /**
+ * Method __gluMultMatrixVecf
+ *
+ * @param matrix
+ * @param in
+ * @param out
+ */
+ private void __gluMultMatrixVecf(FloatBuffer matrix, FloatBuffer in, FloatBuffer out) {
+ int inPos = in.position();
+ int outPos = out.position();
+ int matrixPos = matrix.position();
+ for (int i = 0; i < 4; i++) {
+ out.put(i + outPos,
+ in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
+ in.get(1+inPos) * matrix.get(1*4+i+matrixPos) +
+ in.get(2+inPos) * matrix.get(2*4+i+matrixPos) +
+ in.get(3+inPos) * matrix.get(3*4+i+matrixPos));
+ }
+ }
+
+ /**
+ * @param src
+ * @param inverse
+ *
+ * @return
+ */
+ public boolean gluInvertMatrixf(float[] src, float[] inverse) {
+ int i, j, k, swap;
+ float t;
+ float[][] temp = tempInvertMatrix;
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ temp[i][j] = src[i*4+j];
+ }
+ }
+ gluMakeIdentityf(inverse);
+
+ for (i = 0; i < 4; i++) {
+ //
+ // Look for largest element in column
+ //
+ swap = i;
+ for (j = i + 1; j < 4; j++) {
+ if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
+ swap = j;
+ }
+ }
+
+ if (swap != i) {
+ //
+ // Swap rows.
+ //
+ for (k = 0; k < 4; k++) {
+ t = temp[i][k];
+ temp[i][k] = temp[swap][k];
+ temp[swap][k] = t;
+
+ t = inverse[i*4+k];
+ inverse[i*4+k] = inverse[swap*4+k];
+ inverse[swap*4+k] = t;
+ }
+ }
+
+ if (temp[i][i] == 0) {
+ //
+ // No non-zero pivot. The matrix is singular, which shouldn't
+ // happen. This means the user gave us a bad matrix.
+ //
+ return false;
+ }
+
+ t = temp[i][i];
+ for (k = 0; k < 4; k++) {
+ temp[i][k] /= t;
+ inverse[i*4+k] /= t;
+ }
+ for (j = 0; j < 4; j++) {
+ if (j != i) {
+ t = temp[j][i];
+ for (k = 0; k < 4; k++) {
+ temp[j][k] -= temp[i][k] * t;
+ inverse[j*4+k] -= inverse[i*4+k]*t;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @param src
+ * @param inverse
+ *
+ * @return
+ */
+ public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
+ int i, j, k, swap;
+ float t;
+
+ int srcPos = src.position();
+ int invPos = inverse.position();
+
+ FloatBuffer temp = tempInvertMatrixBuf;
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ temp.put(i*4+j, src.get(i*4+j + srcPos));
+ }
+ }
+ gluMakeIdentityf(inverse);
+
+ for (i = 0; i < 4; i++) {
+ //
+ // Look for largest element in column
+ //
+ swap = i;
+ for (j = i + 1; j < 4; j++) {
+ if (Math.abs(temp.get(j*4+i)) > Math.abs(temp.get(i*4+i))) {
+ swap = j;
+ }
+ }
+
+ if (swap != i) {
+ //
+ // Swap rows.
+ //
+ for (k = 0; k < 4; k++) {
+ t = temp.get(i*4+k);
+ temp.put(i*4+k, temp.get(swap*4+k));
+ temp.put(swap*4+k, t);
+
+ t = inverse.get(i*4+k + invPos);
+ inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
+ inverse.put(swap*4+k + invPos, t);
+ }
+ }
+
+ if (temp.get(i*4+i) == 0) {
+ //
+ // No non-zero pivot. The matrix is singular, which shouldn't
+ // happen. This means the user gave us a bad matrix.
+ //
+ return false;
+ }
+
+ t = temp.get(i*4+i);
+ for (k = 0; k < 4; k++) {
+ temp.put(i*4+k, temp.get(i*4+k) / t);
+ inverse.put(i*4+k + invPos, inverse.get(i*4+k + invPos) / t);
+ }
+ for (j = 0; j < 4; j++) {
+ if (j != i) {
+ t = temp.get(j*4+i);
+ for (k = 0; k < 4; k++) {
+ temp.put(j*4+k, temp.get(j*4+k) - temp.get(i*4+k) * t);
+ inverse.put(j*4+k + invPos, inverse.get(j*4+k + invPos) - inverse.get(i*4+k + invPos) * t);
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ * @param a
+ * @param b
+ * @param r
+ */
+ private void gluMultMatricesf(float[] a, int a_offset, float[] b, int b_offset, float[] r) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ r[i*4+j] =
+ a[i*4+0+a_offset]*b[0*4+j+b_offset] +
+ a[i*4+1+a_offset]*b[1*4+j+b_offset] +
+ a[i*4+2+a_offset]*b[2*4+j+b_offset] +
+ a[i*4+3+a_offset]*b[3*4+j+b_offset];
+ }
+ }
+ }
+
+
+ /**
+ * @param a
+ * @param b
+ * @param r
+ */
+ public static void gluMultMatricesf(FloatBuffer a, FloatBuffer b, FloatBuffer r) {
+ int aPos = a.position();
+ int bPos = b.position();
+ int rPos = r.position();
+
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ r.put(i*4+j + rPos,
+ a.get(i*4+0+aPos)*b.get(0*4+j+bPos) +
+ a.get(i*4+1+aPos)*b.get(1*4+j+bPos) +
+ a.get(i*4+2+aPos)*b.get(2*4+j+bPos) +
+ a.get(i*4+3+aPos)*b.get(3*4+j+bPos));
+ }
+ }
+ }
+
+ /**
+ * Normalize vector
+ *
+ * @param v
+ */
+ public static void normalize(float[] v) {
+ float r;
+
+ r = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+ if ( r == 0.0 || r == 1.0)
+ return;
+
+ r = 1.0f / r;
+
+ v[0] *= r;
+ v[1] *= r;
+ v[2] *= r;
+
+ return;
+ }
+
+ /**
+ * Normalize vector
+ *
+ * @param v
+ */
+ public static void normalize(FloatBuffer v) {
+ float r;
+
+ int vPos = v.position();
+
+ r = (float) Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
+ v.get(1+vPos) * v.get(1+vPos) +
+ v.get(2+vPos) * v.get(2+vPos));
+ if ( r == 0.0 || r == 1.0)
+ return;
+
+ r = 1.0f / r;
+
+ v.put(0+vPos, v.get(0+vPos) * r);
+ v.put(1+vPos, v.get(1+vPos) * r);
+ v.put(2+vPos, v.get(2+vPos) * r);
+
+ return;
+ }
+
+
+ /**
+ * Calculate cross-product
+ *
+ * @param v1
+ * @param v2
+ * @param result
+ */
+ private static void cross(float[] v1, float[] v2, float[] result) {
+ result[0] = v1[1] * v2[2] - v1[2] * v2[1];
+ result[1] = v1[2] * v2[0] - v1[0] * v2[2];
+ result[2] = v1[0] * v2[1] - v1[1] * v2[0];
+ }
+
+ /**
+ * Calculate cross-product
+ *
+ * @param v1
+ * @param v2
+ * @param result
+ */
+ private static void cross(FloatBuffer v1, FloatBuffer v2, FloatBuffer result) {
+ int v1Pos = v1.position();
+ int v2Pos = v2.position();
+ int rPos = result.position();
+
+ result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
+ result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
+ result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
+ }
+
+ /**
+ * Method gluOrtho2D.
+ *
+ * @param left
+ * @param right
+ * @param bottom
+ * @param top
+ */
+ public void gluOrtho2D(GLMatrixFunc gl, float left, float right, float bottom, float top) {
+ gl.glOrthof(left, right, bottom, top, -1, 1);
+ }
+
+ /**
+ * Method gluPerspective.
+ *
+ * @param fovy
+ * @param aspect
+ * @param zNear
+ * @param zFar
+ */
+ public void gluPerspective(GLMatrixFunc gl, float fovy, float aspect, float zNear, float zFar) {
+ float sine, cotangent, deltaZ;
+ float radians = fovy / 2 * (float) Math.PI / 180;
+
+ deltaZ = zFar - zNear;
+ sine = (float) Math.sin(radians);
+
+ if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
+ return;
+ }
+
+ cotangent = (float) Math.cos(radians) / sine;
+
+ gluMakeIdentityf(matrixBuf);
+
+ matrixBuf.put(0 * 4 + 0, cotangent / aspect);
+ matrixBuf.put(1 * 4 + 1, cotangent);
+ matrixBuf.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
+ matrixBuf.put(2 * 4 + 3, -1);
+ matrixBuf.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
+ matrixBuf.put(3 * 4 + 3, 0);
+
+ gl.glMultMatrixf(matrixBuf);
+ }
+
+ /**
+ * Method gluLookAt
+ *
+ * @param eyex
+ * @param eyey
+ * @param eyez
+ * @param centerx
+ * @param centery
+ * @param centerz
+ * @param upx
+ * @param upy
+ * @param upz
+ */
+ public void gluLookAt(GLMatrixFunc gl,
+ float eyex,
+ float eyey,
+ float eyez,
+ float centerx,
+ float centery,
+ float centerz,
+ float upx,
+ float upy,
+ float upz) {
+ FloatBuffer forward = this.forwardBuf;
+ FloatBuffer side = this.sideBuf;
+ FloatBuffer up = this.upBuf;
+
+ forward.put(0, centerx - eyex);
+ forward.put(1, centery - eyey);
+ forward.put(2, centerz - eyez);
+
+ up.put(0, upx);
+ up.put(1, upy);
+ up.put(2, upz);
+
+ normalize(forward);
+
+ /* Side = forward x up */
+ cross(forward, up, side);
+ normalize(side);
+
+ /* Recompute up as: up = side x forward */
+ cross(side, forward, up);
+
+ gluMakeIdentityf(matrixBuf);
+ matrixBuf.put(0 * 4 + 0, side.get(0));
+ matrixBuf.put(1 * 4 + 0, side.get(1));
+ matrixBuf.put(2 * 4 + 0, side.get(2));
+
+ matrixBuf.put(0 * 4 + 1, up.get(0));
+ matrixBuf.put(1 * 4 + 1, up.get(1));
+ matrixBuf.put(2 * 4 + 1, up.get(2));
+
+ matrixBuf.put(0 * 4 + 2, -forward.get(0));
+ matrixBuf.put(1 * 4 + 2, -forward.get(1));
+ matrixBuf.put(2 * 4 + 2, -forward.get(2));
+
+ gl.glMultMatrixf(matrixBuf);
+ gl.glTranslatef(-eyex, -eyey, -eyez);
+ }
+
+ /**
+ * Method gluProject
+ *
+ * @param objx
+ * @param objy
+ * @param objz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param win_pos
+ *
+ * @return
+ */
+ public boolean gluProject(float objx,
+ float objy,
+ float objz,
+ float[] modelMatrix,
+ int modelMatrix_offset,
+ float[] projMatrix,
+ int projMatrix_offset,
+ int[] viewport,
+ int viewport_offset,
+ float[] win_pos,
+ int win_pos_offset ) {
+
+ float[] in = this.in;
+ float[] out = this.out;
+
+ in[0] = objx;
+ in[1] = objy;
+ in[2] = objz;
+ in[3] = 1.0f;
+
+ __gluMultMatrixVecf(modelMatrix, modelMatrix_offset, in, out);
+ __gluMultMatrixVecf(projMatrix, projMatrix_offset, out, in);
+
+ if (in[3] == 0.0f)
+ return false;
+
+ in[3] = (1.0f / in[3]) * 0.5f;
+
+ // Map x, y and z to range 0-1
+ in[0] = in[0] * in[3] + 0.5f;
+ in[1] = in[1] * in[3] + 0.5f;
+ in[2] = in[2] * in[3] + 0.5f;
+
+ // Map x,y to viewport
+ win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
+ win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
+ win_pos[2+win_pos_offset] = in[2];
+
+ return true;
+ }
+
+ /**
+ * Method gluProject
+ *
+ * @param objx
+ * @param objy
+ * @param objz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param win_pos
+ *
+ * @return
+ */
+ public boolean gluProject(float objx,
+ float objy,
+ float objz,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ FloatBuffer win_pos) {
+
+ FloatBuffer in = this.inBuf;
+ FloatBuffer out = this.outBuf;
+
+ in.put(0, objx);
+ in.put(1, objy);
+ in.put(2, objz);
+ in.put(3, 1.0f);
+
+ __gluMultMatrixVecf(modelMatrix, in, out);
+ __gluMultMatrixVecf(projMatrix, out, in);
+
+ if (in.get(3) == 0.0f)
+ return false;
+
+ in.put(3, (1.0f / in.get(3)) * 0.5f);
+
+ // Map x, y and z to range 0-1
+ in.put(0, in.get(0) * in.get(3) + 0.5f);
+ in.put(1, in.get(1) * in.get(3) + 0.5f);
+ in.put(2, in.get(2) * in.get(3) + 0.5f);
+
+ // Map x,y to viewport
+ int vPos = viewport.position();
+ int wPos = win_pos.position();
+ win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
+ win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
+ win_pos.put(2+wPos, in.get(2));
+
+ return true;
+ }
+
+
+ /**
+ * Method gluUnproject
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject(float winx,
+ float winy,
+ float winz,
+ float[] modelMatrix,
+ int modelMatrix_offset,
+ float[] projMatrix,
+ int projMatrix_offset,
+ int[] viewport,
+ int viewport_offset,
+ float[] obj_pos,
+ int obj_pos_offset) {
+ float[] in = this.in;
+ float[] out = this.out;
+
+ gluMultMatricesf(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+ if (!gluInvertMatrixf(matrix, matrix))
+ return false;
+
+ in[0] = winx;
+ in[1] = winy;
+ in[2] = winz;
+ in[3] = 1.0f;
+
+ // Map x and y from window coordinates
+ in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+ in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+ // Map to range -1 to 1
+ in[0] = in[0] * 2 - 1;
+ in[1] = in[1] * 2 - 1;
+ in[2] = in[2] * 2 - 1;
+
+ __gluMultMatrixVecf(matrix, 0, in, out);
+
+ if (out[3] == 0.0)
+ return false;
+
+ out[3] = 1.0f / out[3];
+
+ obj_pos[0+obj_pos_offset] = out[0] * out[3];
+ obj_pos[1+obj_pos_offset] = out[1] * out[3];
+ obj_pos[2+obj_pos_offset] = out[2] * out[3];
+
+ return true;
+ }
+
+
+ /**
+ * Method gluUnproject
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject(float winx,
+ float winy,
+ float winz,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ FloatBuffer obj_pos) {
+ FloatBuffer in = this.inBuf;
+ FloatBuffer out = this.outBuf;
+
+ gluMultMatricesf(modelMatrix, projMatrix, matrixBuf);
+
+ if (!gluInvertMatrixf(matrixBuf, matrixBuf))
+ return false;
+
+ in.put(0, winx);
+ in.put(1, winy);
+ in.put(2, winz);
+ in.put(3, 1.0f);
+
+ // Map x and y from window coordinates
+ int vPos = viewport.position();
+ int oPos = obj_pos.position();
+ in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+ in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+
+ // Map to range -1 to 1
+ in.put(0, in.get(0) * 2 - 1);
+ in.put(1, in.get(1) * 2 - 1);
+ in.put(2, in.get(2) * 2 - 1);
+
+ __gluMultMatrixVecf(matrixBuf, in, out);
+
+ if (out.get(3) == 0.0f)
+ return false;
+
+ out.put(3, 1.0f / out.get(3));
+
+ obj_pos.put(0+oPos, out.get(0) * out.get(3));
+ obj_pos.put(1+oPos, out.get(1) * out.get(3));
+ obj_pos.put(2+oPos, out.get(2) * out.get(3));
+
+ return true;
+ }
+
+
+ /**
+ * Method gluUnproject4
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param clipw
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param near
+ * @param far
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject4(float winx,
+ float winy,
+ float winz,
+ float clipw,
+ float[] modelMatrix,
+ int modelMatrix_offset,
+ float[] projMatrix,
+ int projMatrix_offset,
+ int[] viewport,
+ int viewport_offset,
+ float near,
+ float far,
+ float[] obj_pos,
+ int obj_pos_offset ) {
+ float[] in = this.in;
+ float[] out = this.out;
+
+ gluMultMatricesf(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+ if (!gluInvertMatrixf(matrix, matrix))
+ return false;
+
+ in[0] = winx;
+ in[1] = winy;
+ in[2] = winz;
+ in[3] = clipw;
+
+ // Map x and y from window coordinates
+ in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+ in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+ in[2] = (in[2] - near) / (far - near);
+
+ // Map to range -1 to 1
+ in[0] = in[0] * 2 - 1;
+ in[1] = in[1] * 2 - 1;
+ in[2] = in[2] * 2 - 1;
+
+ __gluMultMatrixVecf(matrix, 0, in, out);
+
+ if (out[3] == 0.0f)
+ return false;
+
+ obj_pos[0+obj_pos_offset] = out[0];
+ obj_pos[1+obj_pos_offset] = out[1];
+ obj_pos[2+obj_pos_offset] = out[2];
+ obj_pos[3+obj_pos_offset] = out[3];
+ return true;
+ }
+
+ /**
+ * Method gluUnproject4
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param clipw
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param near
+ * @param far
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject4(float winx,
+ float winy,
+ float winz,
+ float clipw,
+ FloatBuffer modelMatrix,
+ FloatBuffer projMatrix,
+ IntBuffer viewport,
+ float near,
+ float far,
+ FloatBuffer obj_pos) {
+ FloatBuffer in = this.inBuf;
+ FloatBuffer out = this.outBuf;
+
+ gluMultMatricesf(modelMatrix, projMatrix, matrixBuf);
+
+ if (!gluInvertMatrixf(matrixBuf, matrixBuf))
+ return false;
+
+ in.put(0, winx);
+ in.put(1, winy);
+ in.put(2, winz);
+ in.put(3, clipw);
+
+ // Map x and y from window coordinates
+ int vPos = viewport.position();
+ in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+ in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+ in.put(2, (in.get(2) - near) / (far - near));
+
+ // Map to range -1 to 1
+ in.put(0, in.get(0) * 2 - 1);
+ in.put(1, in.get(1) * 2 - 1);
+ in.put(2, in.get(2) * 2 - 1);
+
+ __gluMultMatrixVecf(matrixBuf, in, out);
+
+ if (out.get(3) == 0.0f)
+ return false;
+
+ int oPos = obj_pos.position();
+ obj_pos.put(0+oPos, out.get(0));
+ obj_pos.put(1+oPos, out.get(1));
+ obj_pos.put(2+oPos, out.get(2));
+ obj_pos.put(3+oPos, out.get(3));
+ return true;
+ }
+
+
+ /**
+ * Method gluPickMatrix
+ *
+ * @param x
+ * @param y
+ * @param deltaX
+ * @param deltaY
+ * @param viewport
+ */
+ public void gluPickMatrix(GLMatrixFunc gl,
+ float x,
+ float y,
+ float deltaX,
+ float deltaY,
+ IntBuffer viewport) {
+ if (deltaX <= 0 || deltaY <= 0) {
+ return;
+ }
+
+ /* Translate and scale the picked region to the entire window */
+ int vPos = viewport.position();
+ gl.glTranslatef((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
+ (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
+ 0);
+ gl.glScalef(viewport.get(2) / deltaX, viewport.get(3) / deltaY, 1.0f);
+ }
+
+ /**
+ * Method gluPickMatrix
+ *
+ * @param x
+ * @param y
+ * @param deltaX
+ * @param deltaY
+ * @param viewport
+ * @param viewport_offset
+ */
+ public void gluPickMatrix(GLMatrixFunc gl,
+ float x,
+ float y,
+ float deltaX,
+ float deltaY,
+ int[] viewport,
+ int viewport_offset) {
+ if (deltaX <= 0 || deltaY <= 0) {
+ return;
+ }
+
+ /* Translate and scale the picked region to the entire window */
+ gl.glTranslatef((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
+ (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
+ 0);
+ gl.glScalef(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0f);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp
new file mode 100644
index 000000000..91723b505
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javame_cdc_fp
@@ -0,0 +1,10 @@
+package com.sun.opengl.impl;
+
+public class SystemUtil {
+
+ /** Wrapper for System.getenv(), which doesn't work on platforms
+ earlier than JDK 5 */
+ public static String getenv(String variableName) {
+ return null;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase b/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase
new file mode 100644
index 000000000..3f201c2b6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/SystemUtil.java.javase
@@ -0,0 +1,18 @@
+package com.sun.opengl.impl;
+
+public class SystemUtil {
+
+ private static volatile boolean getenvSupported = true;
+ /** Wrapper for System.getenv(), which doesn't work on platforms
+ earlier than JDK 5 */
+ public static String getenv(String variableName) {
+ if (getenvSupported) {
+ try {
+ return System.getenv(variableName);
+ } catch (Error e) {
+ getenvSupported = false;
+ }
+ }
+ return null;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java b/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java
new file mode 100644
index 000000000..6c8633c10
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/ThreadingImpl.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.opengl.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+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. */
+
+public class ThreadingImpl {
+ public static final int AWT = 1;
+ public static final int WORKER = 2;
+
+ protected static final boolean DEBUG = Debug.debug("Threading");
+
+ private static boolean singleThreaded = true;
+ private static int mode;
+ private static boolean hasAWT;
+ // We need to know whether we're running on X11 platforms to change
+ // our behavior when the Java2D/JOGL bridge is active
+ private static boolean _isX11;
+
+ private static final ThreadingPlugin threadingPlugin;
+
+ static {
+ Object threadingPluginTmp =
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String workaround = System.getProperty("opengl.1thread");
+ // Default to using the AWT thread on all platforms except
+ // Windows. On OS X there is instability apparently due to
+ // using the JAWT on non-AWT threads. On X11 platforms there
+ // are potential deadlocks which can be caused if the AWT
+ // EventQueue thread hands work off to the GLWorkerThread
+ // while holding the AWT lock. The optimization of
+ // makeCurrent / release calls isn't worth these stability
+ // problems.
+ hasAWT = NWReflection.isClassAvailable("java.awt.Canvas") &&
+ NWReflection.isClassAvailable("javax.media.opengl.awt.GLCanvas");
+
+ String osType = NativeWindowFactory.getNativeWindowType(false);
+ _isX11 = NativeWindowFactory.TYPE_X11.equals(osType);
+ // boolean isWindows = NativeWindowFactory.TYPE_WINDOWS.equals(osType);
+
+ // int defaultMode = (isWindows ? WORKER : ( hasAWT ? AWT : WORKER ) );
+ int defaultMode = ( hasAWT ? AWT : WORKER );
+
+ mode = defaultMode;
+ if (workaround != null) {
+ workaround = workaround.toLowerCase();
+ if (workaround.equals("true") ||
+ workaround.equals("auto")) {
+ // Nothing to do; singleThreaded and mode already set up
+ } else if (workaround.equals("worker")) {
+ singleThreaded = true;
+ mode = WORKER;
+ } else if (workaround.equals("awt")) {
+ singleThreaded = true;
+ mode = AWT;
+ } else {
+ singleThreaded = false;
+ }
+ }
+ printWorkaroundNotice();
+
+ Object threadingPluginObj=null;
+ // try to fetch the AWTThreadingPlugin
+ try {
+ threadingPluginObj = NWReflection.createInstance("com.sun.opengl.impl.awt.AWTThreadingPlugin");
+ } catch (Throwable t) { }
+ return threadingPluginObj;
+ }
+ });
+ threadingPlugin = (ThreadingPlugin) threadingPluginTmp;
+ if(DEBUG) {
+ System.err.println("Threading: hasAWT "+hasAWT+", mode "+((mode==AWT)?"AWT":"WORKER")+", plugin "+threadingPlugin);
+ }
+ }
+
+ /** No reason to ever instantiate this class */
+ private ThreadingImpl() {}
+
+ public static boolean isX11() { return _isX11; }
+ public static int getMode() { return mode; }
+
+ /** If an implementation of the javax.media.opengl APIs offers a
+ multithreading option but the default behavior is single-threading,
+ this API provides a mechanism for end users to disable single-threading
+ in this implementation. Users are strongly discouraged from
+ calling this method unless they are aware of all of the
+ consequences and are prepared to enforce some amount of
+ threading restrictions in their applications. Disabling
+ single-threading, for example, may have unintended consequences
+ on GLAutoDrawable implementations such as GLCanvas, GLJPanel and
+ GLPbuffer. Currently there is no supported way to re-enable it
+ once disabled, partly to discourage careless use of this
+ method. This method should be called as early as possible in an
+ application. */
+ public static void disableSingleThreading() {
+ singleThreaded = false;
+ if (Debug.verbose()) {
+ System.err.println("Application forced disabling of single-threading of javax.media.opengl implementation");
+ }
+ }
+
+ /** Indicates whether OpenGL work is being automatically forced to a
+ single thread in this implementation. */
+ public static boolean isSingleThreaded() {
+ return singleThreaded;
+ }
+
+ /** Indicates whether the current thread is the single thread on
+ which this implementation of the javax.media.opengl APIs
+ performs all of its OpenGL-related work. This method should only
+ be called if the single-thread model is in effect. */
+ public static boolean isOpenGLThread() throws GLException {
+ if (!isSingleThreaded()) {
+ throw new GLException("Should only call this in single-threaded mode");
+ }
+
+ if(null!=threadingPlugin) {
+ return threadingPlugin.isOpenGLThread();
+ }
+
+ switch (mode) {
+ case AWT:
+ return true;
+ case WORKER:
+ return GLWorkerThread.isWorkerThread();
+ default:
+ throw new InternalError("Illegal single-threading mode " + mode);
+ }
+ }
+
+ /** Executes the passed Runnable on the single thread used for all
+ OpenGL work in this javax.media.opengl API implementation. It is
+ not specified exactly which thread is used for this
+ purpose. This method should only be called if the single-thread
+ model is in use and if the current thread is not the OpenGL
+ thread (i.e., if <code>isOpenGLThread()</code> returns
+ false). It is up to the end user to check to see whether the
+ current thread is the OpenGL thread and either execute the
+ Runnable directly or perform the work inside it. */
+ public static void invokeOnOpenGLThread(Runnable r) throws GLException {
+ if (!isSingleThreaded()) {
+ throw new GLException ("Should only call this in single-threaded mode");
+ }
+
+ if (isOpenGLThread()) {
+ throw new GLException ("Should only call this from other threads than the OpenGL thread");
+ }
+
+ if(null!=threadingPlugin) {
+ threadingPlugin.invokeOnOpenGLThread(r);
+ return;
+ }
+
+ switch (mode) {
+ case AWT:
+ r.run();
+ break;
+
+ case WORKER:
+ if (!GLWorkerThread.isStarted()) {
+ synchronized (GLWorkerThread.class) {
+ if (!GLWorkerThread.isStarted()) {
+ GLWorkerThread.start();
+ }
+ }
+ }
+ try {
+ GLWorkerThread.invokeAndWait(r);
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (InterruptedException e) {
+ throw new GLException(e);
+ }
+ break;
+
+ default:
+ throw new InternalError("Illegal single-threading mode " + mode);
+ }
+ }
+
+ /** This is a workaround for AWT-related deadlocks which only seem
+ to show up in the context of applets */
+ public static boolean isAWTMode() {
+ return (mode == AWT);
+ }
+
+ private static void printWorkaroundNotice() {
+ if (singleThreaded && Debug.verbose()) {
+ System.err.println("Using " +
+ (mode == AWT ? "AWT" : "OpenGL worker") +
+ " thread for performing OpenGL work in javax.media.opengl implementation");
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java b/src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java
new file mode 100644
index 000000000..5c52f871e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/ThreadingPlugin.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl;
+
+import javax.media.opengl.*;
+
+public interface ThreadingPlugin {
+ /** Indicates whether the current thread is the single thread on
+ which this implementation of the javax.media.opengl APIs
+ performs all of its OpenGL-related work. This method should only
+ be called if the single-thread model is in effect. */
+ public boolean isOpenGLThread() throws GLException;
+
+ /** Executes the passed Runnable on the single thread used for all
+ OpenGL work in this javax.media.opengl API implementation. It is
+ not specified exactly which thread is used for this
+ purpose. This method should only be called if the single-thread
+ model is in use and if the current thread is not the OpenGL
+ thread (i.e., if <code>isOpenGLThread()</code> returns
+ false). It is up to the end user to check to see whether the
+ current thread is the OpenGL thread and either execute the
+ Runnable directly or perform the work inside it. */
+ public void invokeOnOpenGLThread(Runnable r) throws GLException;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java b/src/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java
new file mode 100755
index 000000000..c7dd9ea80
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/awt/AWTThreadingPlugin.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.awt;
+
+import javax.media.opengl.*;
+
+import java.awt.event.*;
+
+import java.awt.EventQueue;
+import java.lang.reflect.InvocationTargetException;
+
+import com.sun.opengl.impl.*;
+
+public class AWTThreadingPlugin implements ThreadingPlugin {
+
+ public AWTThreadingPlugin() {}
+
+ public boolean isOpenGLThread() throws GLException {
+ switch (ThreadingImpl.getMode()) {
+ case ThreadingImpl.AWT:
+ if (Java2D.isOGLPipelineActive()) {
+ // FIXME: ideally only the QFT would be considered to be the
+ // "OpenGL thread", but we can not currently run all of
+ // JOGL's OpenGL work on that thread. See the FIXME in
+ // invokeOnOpenGLThread.
+ return (Java2D.isQueueFlusherThread() ||
+ (ThreadingImpl.isX11() && EventQueue.isDispatchThread()));
+ } else {
+ return EventQueue.isDispatchThread();
+ }
+ case ThreadingImpl.WORKER:
+ if (Java2D.isOGLPipelineActive()) {
+ // FIXME: ideally only the QFT would be considered to be the
+ // "OpenGL thread", but we can not currently run all of
+ // JOGL's OpenGL work on that thread. See the FIXME in
+ // invokeOnOpenGLThread.
+ return (Java2D.isQueueFlusherThread() ||
+ (ThreadingImpl.isX11() && GLWorkerThread.isWorkerThread()));
+ } else {
+ return GLWorkerThread.isWorkerThread();
+ }
+ default:
+ throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
+ }
+ }
+
+ public void invokeOnOpenGLThread(Runnable r) throws GLException {
+ switch (ThreadingImpl.getMode()) {
+ case ThreadingImpl.AWT:
+ // FIXME: ideally should run all OpenGL work on the Java2D QFT
+ // thread when it's enabled, but unfortunately there are
+ // deadlock issues on X11 platforms when making our
+ // heavyweight OpenGL contexts current on the QFT because we
+ // perform the JAWT lock inside the makeCurrent()
+ // implementation, which attempts to grab the AWT lock on the
+ // QFT which is not allowed. For now, on X11 platforms,
+ // continue to perform this work on the EDT.
+ if (Java2D.isOGLPipelineActive() && !ThreadingImpl.isX11()) {
+ Java2D.invokeWithOGLContextCurrent(null, r);
+ } else {
+ try {
+ EventQueue.invokeAndWait(r);
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (InterruptedException e) {
+ throw new GLException(e);
+ }
+ }
+ break;
+
+ case ThreadingImpl.WORKER:
+ if (!GLWorkerThread.isStarted()) {
+ synchronized (GLWorkerThread.class) {
+ if (!GLWorkerThread.isStarted()) {
+ GLWorkerThread.start();
+ }
+ }
+ }
+ try {
+ GLWorkerThread.invokeAndWait(r);
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (InterruptedException e) {
+ throw new GLException(e);
+ }
+ break;
+
+ default:
+ throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java b/src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java
new file mode 100644
index 000000000..6170e4b29
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/awt/AWTUtil.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.impl.awt;
+
+import com.sun.nativewindow.impl.jawt.*;
+
+import com.sun.opengl.impl.*;
+
+import javax.media.opengl.*;
+
+import java.lang.reflect.*;
+import java.awt.GraphicsEnvironment;
+
+public class AWTUtil {
+ // See whether we're running in headless mode
+ private static boolean headlessMode;
+ private static Class j2dClazz = null;
+ private static Method isOGLPipelineActive = null;
+ private static Method isQueueFlusherThread = null;
+ private static boolean j2dOk = false;
+
+ static {
+ lockedToolkit = false;
+ headlessMode = GraphicsEnvironment.isHeadless();
+ try {
+ j2dClazz = Class.forName("com.sun.opengl.impl.awt.Java2D");
+ isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", null);
+ isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", null);
+ j2dOk = true;
+ } catch (Exception e) {}
+ }
+
+ private static boolean lockedToolkit;
+
+ public static synchronized void lockToolkit() throws GLException {
+ if (lockedToolkit) {
+ throw new GLException("Toolkit already locked");
+ }
+ lockedToolkit = true;
+
+ if (headlessMode) {
+ // Workaround for running (to some degree) in headless
+ // environments but still supporting rendering via pbuffers
+ // For full correctness, would need to implement a Lock class
+ return;
+ }
+
+ if(j2dOk) {
+ try {
+ if( !((Boolean)isOGLPipelineActive.invoke(null, null)).booleanValue() ||
+ !((Boolean)isQueueFlusherThread.invoke(null, null)).booleanValue() ) {
+ JAWT.getJAWT().Lock();
+ }
+ } catch (Exception e) { j2dOk=false; }
+ }
+ if(!j2dOk) {
+ JAWT.getJAWT().Lock();
+ }
+ }
+
+ public static synchronized void unlockToolkit() {
+ if (lockedToolkit) {
+ if (headlessMode) {
+ // Workaround for running (to some degree) in headless
+ // environments but still supporting rendering via pbuffers
+ // For full correctness, would need to implement a Lock class
+ return;
+ }
+
+ if(j2dOk) {
+ try {
+ if( !((Boolean)isOGLPipelineActive.invoke(null, null)).booleanValue() ||
+ !((Boolean)isQueueFlusherThread.invoke(null, null)).booleanValue() ) {
+ JAWT.getJAWT().Unlock();
+ }
+ } catch (Exception e) { j2dOk=false; }
+ }
+ if(!j2dOk) {
+ JAWT.getJAWT().Unlock();
+ }
+ lockedToolkit = false;
+ }
+ }
+
+ public static boolean isToolkitLocked() {
+ return lockedToolkit;
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/Java2D.java b/src/jogl/classes/com/sun/opengl/impl/awt/Java2D.java
new file mode 100755
index 000000000..328771a3b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/awt/Java2D.java
@@ -0,0 +1,570 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.awt;
+
+import com.sun.opengl.impl.*;
+
+import java.awt.*;
+import java.awt.image.*;
+import java.lang.reflect.*;
+import java.security.*;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+
+/** Defines integration with the Java2D OpenGL pipeline. This
+ integration is only supported in 1.6 and is highly experimental. */
+
+public class Java2D {
+ private static boolean DEBUG = Debug.debug("Java2D");
+ private static boolean VERBOSE = Debug.verbose();
+ private static boolean isHeadless;
+ private static boolean isOGLPipelineActive;
+ private static Method invokeWithOGLContextCurrentMethod;
+ private static Method isQueueFlusherThreadMethod;
+ private static Method getOGLViewportMethod;
+ private static Method getOGLScissorBoxMethod;
+ private static Method getOGLSurfaceIdentifierMethod;
+ // This one is currently optional and is only in very recent Mustang builds
+ private static Method getOGLTextureTypeMethod;
+
+ // The following methods and fields are needed for proper support of
+ // Frame Buffer Objects in the Java2D/OpenGL pipeline
+ // (-Dsun.java2d.opengl.fbobject=true)
+ private static boolean fbObjectSupportInitialized;
+ private static Method invokeWithOGLSharedContextCurrentMethod;
+ private static Method getOGLSurfaceTypeMethod;
+
+ // Publicly-visible constants for OpenGL surface types
+ public static final int UNDEFINED = getOGLUtilitiesIntField("UNDEFINED");
+ public static final int WINDOW = getOGLUtilitiesIntField("WINDOW");
+ public static final int PBUFFER = getOGLUtilitiesIntField("PBUFFER");
+ public static final int TEXTURE = getOGLUtilitiesIntField("TEXTURE");
+ public static final int FLIP_BACKBUFFER = getOGLUtilitiesIntField("FLIP_BACKBUFFER");
+ public static final int FBOBJECT = getOGLUtilitiesIntField("FBOBJECT");
+
+ // If FBOs are enabled in the Java2D/OpenGL pipeline, all contexts
+ // created by JOGL must share textures and display lists with the
+ // Java2D contexts in order to access the frame buffer object for
+ // potential rendering, and to simultaneously support sharing of
+ // textures and display lists with one another. Java2D has the
+ // notion of a single shared context with which all other contexts
+ // (on the same display device?) share textures and display lists;
+ // this is an approximation to that notion which will be refined
+ // later.
+ private static boolean initializedJ2DFBOShareContext;
+ private static GLContext j2dFBOShareContext;
+
+ // Accessors for new methods in sun.java2d.opengl.CGLSurfaceData
+ // class on OS X for enabling bridge
+ // public static long createOGLContextOnSurface(Graphics g, long ctx);
+ // public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx);
+ // public static void destroyOGLContext(long ctx);
+ private static Method createOGLContextOnSurfaceMethod;
+ private static Method makeOGLContextCurrentOnSurfaceMethod;
+ private static Method destroyOGLContextMethod;
+
+ static {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ if (DEBUG && VERBOSE) {
+ System.err.println("Checking for Java2D/OpenGL support");
+ }
+ try {
+ isHeadless = true;
+ // Figure out whether the default graphics configuration is an
+ // OpenGL graphics configuration
+ GraphicsConfiguration cfg =
+ GraphicsEnvironment.getLocalGraphicsEnvironment().
+ getDefaultScreenDevice().
+ getDefaultConfiguration();
+ // If we get here, we aren't running in headless mode
+ isHeadless = false;
+ String name = cfg.getClass().getName();
+ if (DEBUG && VERBOSE) {
+ System.err.println("Java2D support: default GraphicsConfiguration = " + name);
+ }
+ isOGLPipelineActive = (name.startsWith("sun.java2d.opengl"));
+
+ if (isOGLPipelineActive) {
+ try {
+ // Try to get methods we need to integrate
+ Class utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+ invokeWithOGLContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLContextCurrent",
+ new Class[] {
+ Graphics.class,
+ Runnable.class
+ });
+ invokeWithOGLContextCurrentMethod.setAccessible(true);
+
+ isQueueFlusherThreadMethod = utils.getDeclaredMethod("isQueueFlusherThread",
+ new Class[] {});
+ isQueueFlusherThreadMethod.setAccessible(true);
+
+ getOGLViewportMethod = utils.getDeclaredMethod("getOGLViewport",
+ new Class[] {
+ Graphics.class,
+ Integer.TYPE,
+ Integer.TYPE
+ });
+ getOGLViewportMethod.setAccessible(true);
+
+ getOGLScissorBoxMethod = utils.getDeclaredMethod("getOGLScissorBox",
+ new Class[] {
+ Graphics.class
+ });
+ getOGLScissorBoxMethod.setAccessible(true);
+
+ getOGLSurfaceIdentifierMethod = utils.getDeclaredMethod("getOGLSurfaceIdentifier",
+ new Class[] {
+ Graphics.class
+ });
+ getOGLSurfaceIdentifierMethod.setAccessible(true);
+
+ // Try to get additional methods required for proper FBO support
+ fbObjectSupportInitialized = true;
+ try {
+ invokeWithOGLSharedContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLSharedContextCurrent",
+ new Class[] {
+ GraphicsConfiguration.class,
+ Runnable.class
+ });
+ invokeWithOGLSharedContextCurrentMethod.setAccessible(true);
+
+ getOGLSurfaceTypeMethod = utils.getDeclaredMethod("getOGLSurfaceType",
+ new Class[] {
+ Graphics.class
+ });
+ getOGLSurfaceTypeMethod.setAccessible(true);
+ } catch (Exception e) {
+ fbObjectSupportInitialized = false;
+ if (DEBUG && VERBOSE) {
+ e.printStackTrace();
+ System.err.println("Disabling Java2D/JOGL FBO support");
+ }
+ }
+
+ // Try to get an additional method for FBO support in recent Mustang builds
+ try {
+ getOGLTextureTypeMethod = utils.getDeclaredMethod("getOGLTextureType",
+ new Class[] {
+ Graphics.class
+ });
+ getOGLTextureTypeMethod.setAccessible(true);
+ } catch (Exception e) {
+ if (DEBUG && VERBOSE) {
+ e.printStackTrace();
+ System.err.println("GL_ARB_texture_rectangle FBO support disabled");
+ }
+ }
+
+ // Try to set up APIs for enabling the bridge on OS X,
+ // where it isn't possible to create generalized
+ // external GLDrawables
+ Class cglSurfaceData = null;
+ try {
+ cglSurfaceData = Class.forName("sun.java2d.opengl.CGLSurfaceData");
+ } catch (Exception e) {
+ if (DEBUG && VERBOSE) {
+ e.printStackTrace();
+ System.err.println("Unable to find class sun.java2d.opengl.CGLSurfaceData for OS X");
+ }
+ }
+ if (cglSurfaceData != null) {
+ // FIXME: for now, assume that FBO support is not enabled on OS X
+ fbObjectSupportInitialized = false;
+
+ // We need to find these methods in order to make the bridge work on OS X
+ createOGLContextOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("createOGLContextOnSurface",
+ new Class[] {
+ Graphics.class,
+ Long.TYPE
+ });
+ createOGLContextOnSurfaceMethod.setAccessible(true);
+
+ makeOGLContextCurrentOnSurfaceMethod = cglSurfaceData.getDeclaredMethod("makeOGLContextCurrentOnSurface",
+ new Class[] {
+ Graphics.class,
+ Long.TYPE
+ });
+ makeOGLContextCurrentOnSurfaceMethod.setAccessible(true);
+
+ destroyOGLContextMethod = cglSurfaceData.getDeclaredMethod("destroyOGLContext",
+ new Class[] {
+ Long.TYPE
+ });
+ destroyOGLContextMethod.setAccessible(true);
+ }
+ } catch (Exception e) {
+ if (DEBUG && VERBOSE) {
+ e.printStackTrace();
+ System.err.println("Disabling Java2D/JOGL integration");
+ }
+ isOGLPipelineActive = false;
+ }
+ }
+ } catch (HeadlessException e) {
+ // The AWT is running in headless mode, so the Java 2D / JOGL bridge is clearly disabled
+ }
+
+ if (DEBUG) {
+ System.err.println("JOGL/Java2D integration " + (isOGLPipelineActive ? "enabled" : "disabled"));
+ }
+ return null;
+ }
+ });
+ }
+
+ public static boolean isOGLPipelineActive() {
+ return isOGLPipelineActive;
+ }
+
+ public static boolean isFBOEnabled() {
+ return fbObjectSupportInitialized;
+ }
+
+ public static boolean isQueueFlusherThread() {
+ checkActive();
+
+ try {
+ return ((Boolean) isQueueFlusherThreadMethod.invoke(null, new Object[] {})).booleanValue();
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Makes current the OpenGL context associated with the passed
+ Graphics object and runs the given Runnable on the Queue
+ Flushing Thread in one atomic action. */
+ public static void invokeWithOGLContextCurrent(Graphics g, Runnable r) throws GLException {
+ checkActive();
+
+ try {
+ // FIXME: this may need adjustment
+ // This seems to be needed in many applications which don't
+ // initialize an OpenGL context before this and which would
+ // otherwise cause initFBOShareContext to be called from the
+ // Queue Flusher Thread, which isn't allowed
+ initFBOShareContext(GraphicsEnvironment.
+ getLocalGraphicsEnvironment().
+ getDefaultScreenDevice());
+
+ AWTUtil.lockToolkit();
+ try {
+ invokeWithOGLContextCurrentMethod.invoke(null, new Object[] {g, r});
+ } finally {
+ AWTUtil.unlockToolkit();
+ }
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Makes current the "shared" OpenGL context associated with the
+ given GraphicsConfiguration object, allowing JOGL to share
+ server-side OpenGL objects like textures and display lists with
+ this context when necessary. This is needed when Java2D's FBO
+ support is enabled, because in order to render into that FBO,
+ JOGL must share textures and display lists with it. Returns
+ false if the passed GraphicsConfiguration was not an OpenGL
+ GraphicsConfiguration. */
+ public static boolean invokeWithOGLSharedContextCurrent(GraphicsConfiguration g, Runnable r) throws GLException {
+ checkActive();
+
+ try {
+ AWTUtil.lockToolkit();
+ try {
+ return ((Boolean) invokeWithOGLSharedContextCurrentMethod.invoke(null, new Object[] {g, r})).booleanValue();
+ } finally {
+ AWTUtil.unlockToolkit();
+ }
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Returns the OpenGL viewport associated with the given Graphics
+ object, assuming that the Graphics object is associated with a
+ component of the specified width and height. The user should
+ call glViewport() with the returned rectangle's bounds in order
+ to get correct rendering results. Should only be called from the
+ Queue Flusher Thread. */
+ public static Rectangle getOGLViewport(Graphics g,
+ int componentWidth,
+ int componentHeight) {
+ checkActive();
+
+ try {
+ return (Rectangle) getOGLViewportMethod.invoke(null, new Object[] {g,
+ new Integer(componentWidth),
+ new Integer(componentHeight)});
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Returns the OpenGL scissor region associated with the given
+ Graphics object, taking into account all clipping regions, etc.
+ To avoid destroying Java2D's previous rendering results, this
+ method should be called and the resulting rectangle's bounds
+ passed to a call to glScissor(). Should only be called from the
+ Queue Flusher Thread. */
+ public static Rectangle getOGLScissorBox(Graphics g) {
+ checkActive();
+
+ try {
+ return (Rectangle) getOGLScissorBoxMethod.invoke(null, new Object[] {g});
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Returns an opaque "surface identifier" associated with the given
+ Graphics object. If this changes from invocation to invocation,
+ the underlying OpenGL drawable for the Graphics object has
+ changed and a new external GLDrawable and GLContext should be
+ created (and the old ones destroyed). Should only be called from
+ the Queue Flusher Thread.*/
+ public static Object getOGLSurfaceIdentifier(Graphics g) {
+ checkActive();
+
+ try {
+ return getOGLSurfaceIdentifierMethod.invoke(null, new Object[] {g});
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Returns the underlying surface type for the given Graphics
+ object. This indicates, in particular, whether Java2D is
+ currently rendering into a pbuffer or FBO. */
+ public static int getOGLSurfaceType(Graphics g) {
+ checkActive();
+
+ try {
+ // FIXME: fallback path for pre-b73 (?) Mustang builds -- remove
+ // once fbobject support is in OGLUtilities
+ if (!fbObjectSupportInitialized) {
+ return 0;
+ }
+
+ return ((Integer) getOGLSurfaceTypeMethod.invoke(null, new Object[] { g })).intValue();
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Returns the underlying texture target of the given Graphics
+ object assuming it is rendering to an FBO. Returns either
+ GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. */
+ public static int getOGLTextureType(Graphics g) {
+ checkActive();
+
+ if (getOGLTextureTypeMethod == null) {
+ return GL.GL_TEXTURE_2D;
+ }
+
+ try {
+ return ((Integer) getOGLTextureTypeMethod.invoke(null, new Object[] { g })).intValue();
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** Returns either the given GLContext or a substitute one with
+ which clients should share textures and display lists. Needed
+ when the Java2D/OpenGL pipeline is active and FBOs are being
+ used for rendering. FIXME: may need to alter the API in the
+ future to indicate which GraphicsDevice the source context is
+ associated with. */
+ public static GLContext filterShareContext(GLContext shareContext) {
+ if (isHeadless)
+ return shareContext;
+
+ // FIXME: this may need adjustment
+ initFBOShareContext(GraphicsEnvironment.
+ getLocalGraphicsEnvironment().
+ getDefaultScreenDevice());
+ if (j2dFBOShareContext != null) {
+ return j2dFBOShareContext;
+ }
+ return shareContext;
+ }
+
+ /** Returns the GLContext associated with the Java2D "share
+ context", with which all contexts created by JOGL must share
+ textures and display lists when the FBO option is enabled for
+ the Java2D/OpenGL pipeline. */
+ public static GLContext getShareContext(GraphicsDevice device) {
+ initFBOShareContext(device);
+ // FIXME: for full generality probably need to have multiple of
+ // these, one per GraphicsConfiguration seen?
+ return j2dFBOShareContext;
+ }
+
+ //----------------------------------------------------------------------
+ // Mac OS X-specific methods
+ //
+
+ /** (Mac OS X-specific) Creates a new OpenGL context on the surface
+ associated with the given Graphics object, sharing textures and
+ display lists with the specified (CGLContextObj) share context. */
+ public static long createOGLContextOnSurface(Graphics g, long shareCtx) {
+ checkActive();
+
+ try {
+ return ((Long) createOGLContextOnSurfaceMethod.invoke(null, new Object[] { g, new Long(shareCtx) })).longValue();
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** (Mac OS X-specific) Makes the given OpenGL context current on
+ the surface associated with the given Graphics object. */
+ public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
+ checkActive();
+
+ try {
+ return ((Boolean) makeOGLContextCurrentOnSurfaceMethod.invoke(null, new Object[] { g, new Long(ctx) })).booleanValue();
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ /** (Mac OS X-specific) Destroys the given OpenGL context. */
+ public static void destroyOGLContext(long ctx) {
+ checkActive();
+
+ try {
+ destroyOGLContextMethod.invoke(null, new Object[] { new Long(ctx) });
+ } catch (InvocationTargetException e) {
+ throw new GLException(e.getTargetException());
+ } catch (Exception e) {
+ throw (InternalError) new InternalError().initCause(e);
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static void checkActive() {
+ if (!isOGLPipelineActive()) {
+ throw new GLException("Java2D OpenGL pipeline not active (or necessary support not present)");
+ }
+ }
+
+ private static int getOGLUtilitiesIntField(final String name) {
+ Integer i = (Integer) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+ Class utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+ Field f = utils.getField(name);
+ f.setAccessible(true);
+ return f.get(null);
+ } catch (Exception e) {
+ if (DEBUG && VERBOSE) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+ }
+ });
+ if (i == null)
+ return 0;
+ if (DEBUG && VERBOSE) {
+ System.err.println("OGLUtilities." + name + " = " + i.intValue());
+ }
+ return i.intValue();
+ }
+
+ private static void initFBOShareContext(final GraphicsDevice device) {
+ // Note 1: this must not be done in the static initalizer due to
+ // deadlock problems.
+
+ // Note 2: the first execution of this method must not be from the
+ // Java2D Queue Flusher Thread.
+
+ if (isOGLPipelineActive() &&
+ isFBOEnabled() &&
+ !initializedJ2DFBOShareContext) {
+
+ // FIXME: this technique is probably not adequate in multi-head
+ // situations. Ideally we would keep track of a given share
+ // context on a per-GraphicsConfiguration basis or something
+ // similar rather than keeping one share context in a global
+ // variable.
+ initializedJ2DFBOShareContext = true;
+ if (DEBUG) {
+ System.err.println("Starting initialization of J2D FBO share context");
+ }
+ invokeWithOGLSharedContextCurrent(device.getDefaultConfiguration(), new Runnable() {
+ public void run() {
+ // AbstractGraphicsScreen awtscreen = AWTGraphicsScreen.createScreenDevice(device);
+ j2dFBOShareContext = GLDrawableFactory.getFactory(GLProfile.getDefault()).createExternalGLContext(/*awtscreen*/);
+ }
+ });
+ if (DEBUG) {
+ System.err.println("Ending initialization of J2D FBO share context");
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java b/src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java
new file mode 100644
index 000000000..48461c116
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/awt/Java2DGLContext.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.awt;
+
+import com.sun.opengl.impl.*;
+import java.awt.Graphics;
+
+/** Provides a construct by which the shared GLJPanel code can
+ * interact with a few methods in the Mac OS X-specific Java2D/JOGL
+ * bridge implementation.
+ */
+
+public interface Java2DGLContext {
+ public void setGraphics(Graphics g);
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java
new file mode 100755
index 000000000..653bddb9d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLContext.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.egl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.gluegen.runtime.ProcAddressTable;
+import java.nio.*;
+import java.util.*;
+
+public abstract class EGLContext extends GLContextImpl {
+ protected EGLDrawable drawable;
+ private long eglContext;
+ private boolean eglQueryStringInitialized;
+ private boolean eglQueryStringAvailable;
+ private EGLExt eglExt;
+ // Table that holds the addresses of the native C-language entry points for
+ // EGL extension functions.
+ private EGLExtProcAddressTable eglExtProcAddressTable;
+
+ public EGLContext(EGLDrawable drawable, GLContext shareWith) {
+ super(drawable.getGLProfile(), shareWith);
+ this.drawable = drawable;
+ }
+
+ public Object getPlatformGLExtensions() {
+ return getEGLExt();
+ }
+
+ public EGLExt getEGLExt() {
+ if (eglExt == null) {
+ eglExt = new EGLExtImpl(this);
+ }
+ return eglExt;
+ }
+
+ public final ProcAddressTable getPlatformExtProcAddressTable() {
+ return eglExtProcAddressTable;
+ }
+
+ public final EGLExtProcAddressTable getEGLExtProcAddressTable() {
+ return eglExtProcAddressTable;
+ }
+
+ public GLDrawable getGLDrawable() {
+ return drawable;
+ }
+
+ protected String mapToRealGLFunctionName(String glFunctionName) {
+ return glFunctionName;
+ }
+
+ protected String mapToRealGLExtensionName(String glExtensionName) {
+ return glExtensionName;
+ }
+
+ public long getContext() {
+ return eglContext;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if(EGL.EGL_NO_DISPLAY==drawable.getDisplay() ) {
+ System.err.println("drawable not properly initialized");
+ return CONTEXT_NOT_CURRENT;
+ }
+ boolean created = false;
+ if (eglContext == 0) {
+ create();
+ 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(drawable.getDisplay(),
+ drawable.getSurface(),
+ drawable.getSurface(),
+ eglContext)) {
+ throw new GLException("Error making context 0x" +
+ Long.toHexString(eglContext) + " current: error code " + EGL.eglGetError());
+ }
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ if (!EGL.eglMakeCurrent(drawable.getDisplay(),
+ EGL.EGL_NO_SURFACE,
+ EGL.EGL_NO_SURFACE,
+ EGL.EGL_NO_CONTEXT)) {
+ throw new GLException("Error freeing OpenGL context 0x" +
+ Long.toHexString(eglContext) + ": error code " + EGL.eglGetError());
+ }
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void destroyImpl() throws GLException {
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ if (eglContext != 0) {
+ if (!EGL.eglDestroyContext(drawable.getDisplay(), eglContext)) {
+ throw new GLException("Error destroying OpenGL context 0x" +
+ Long.toHexString(eglContext) + ": error code " + EGL.eglGetError());
+ }
+ eglContext = 0;
+ GLContextShareSet.contextDestroyed(this);
+ }
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void create() throws GLException {
+ long eglDisplay = drawable.getDisplay();
+ EGLGraphicsConfiguration config = drawable.getGraphicsConfiguration();
+ GLProfile glProfile = drawable.getGLProfile();
+ _EGLConfig 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) {
+ throw new GLException("Error: attempted to create an OpenGL context without a graphics configuration");
+ }
+
+ if(!EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API)) {
+ throw new GLException("eglBindAPI to ES failed , error 0x"+Integer.toHexString(EGL.eglGetError()));
+ }
+
+ EGLContext other = (EGLContext) GLContextShareSet.getShareContext(this);
+ if (other != null) {
+ shareWith = other.getContext();
+ if (shareWith == 0) {
+ throw new GLException("GLContextShareSet returned an invalid OpenGL context");
+ }
+ }
+
+ int[] contextAttrs = new int[] {
+ EGL.EGL_CONTEXT_CLIENT_VERSION, -1,
+ EGL.EGL_NONE
+ };
+ if (glProfile.usesNativeGLES2()) {
+ contextAttrs[1] = 2;
+ } else if (glProfile.usesNativeGLES1()) {
+ contextAttrs[1] = 1;
+ } else {
+ throw new GLException("Error creating OpenGL context - invalid GLProfile: "+glProfile);
+ }
+ eglContext = EGL.eglCreateContext(eglDisplay, eglConfig, shareWith, contextAttrs, 0);
+ if (eglContext == 0) {
+ throw new GLException("Error creating OpenGL context: eglDisplay 0x"+Long.toHexString(eglDisplay)+
+ ", "+glProfile+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ }
+ GLContextShareSet.contextCreated(this);
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Created OpenGL context 0x" +
+ Long.toHexString(eglContext) + " for " + this +
+ ", surface 0x" + Long.toHexString(drawable.getSurface()) +
+ ", sharing with 0x" + Long.toHexString(shareWith));
+ }
+ if (!EGL.eglMakeCurrent(drawable.getDisplay(),
+ drawable.getSurface(),
+ drawable.getSurface(),
+ eglContext)) {
+ throw new GLException("Error making context 0x" +
+ Long.toHexString(eglContext) + " current: error code " + EGL.eglGetError());
+ }
+ setGLFunctionAvailability(true);
+ }
+
+ public boolean isCreated() {
+ return (eglContext != 0);
+ }
+
+ protected void updateGLProcAddressTable() {
+ super.updateGLProcAddressTable();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Initializing EGL extension address table");
+ }
+ if (eglExtProcAddressTable == null) {
+ // FIXME: cache ProcAddressTables by capability bits so we can
+ // share them among contexts with the same capabilities
+ eglExtProcAddressTable = new EGLExtProcAddressTable();
+ }
+ resetProcAddressTable(getEGLExtProcAddressTable());
+ }
+
+ public synchronized String getPlatformExtensionsString() {
+ if (!eglQueryStringInitialized) {
+ eglQueryStringAvailable =
+ getDrawableImpl().getDynamicLookupHelper().dynamicLookupFunction("eglQueryString") != 0;
+ eglQueryStringInitialized = true;
+ }
+ if (eglQueryStringAvailable) {
+ GLDrawableFactoryImpl factory = getDrawableImpl().getFactoryImpl();
+ factory.lockToolkit();
+ try {
+ String ret = EGL.eglQueryString(drawable.getDisplay(),
+ EGL.EGL_EXTENSIONS);
+ if (DEBUG) {
+ System.err.println("!!! EGL extensions: " + ret);
+ }
+ return ret;
+ } finally {
+ factory.unlockToolkit();
+ }
+ } else {
+ return "";
+ }
+ }
+
+ public abstract void bindPbufferToTexture();
+
+ public abstract void releasePbufferFromTexture();
+
+ //----------------------------------------------------------------------
+ // Currently unimplemented stuff
+ //
+
+ public void copy(GLContext source, int mask) throws GLException {
+ throw new GLException("Not yet implemented");
+ }
+
+
+ public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ throw new GLException("Should not call this");
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getOffscreenContextPixelDataType() {
+ throw new GLException("Should not call this");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java
new file mode 100755
index 000000000..a3d83ac36
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawable.java
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.egl;
+
+import com.sun.opengl.impl.GLDrawableImpl;
+import com.sun.nativewindow.impl.NWReflection;
+import com.sun.gluegen.runtime.DynamicLookupHelper;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+import javax.media.opengl.*;
+
+public abstract class EGLDrawable extends GLDrawableImpl {
+ protected boolean ownEGLDisplay = false;
+ private EGLGraphicsConfiguration eglConfig;
+ protected long eglDisplay;
+ protected long eglSurface;
+ private int[] tmp = new int[1];
+
+ protected EGLDrawable(EGLDrawableFactory factory,
+ NativeWindow component) throws GLException {
+ super(factory, component, false);
+ eglSurface=EGL.EGL_NO_SURFACE;
+ eglDisplay=0;
+ }
+
+ public long getDisplay() {
+ return eglDisplay;
+ }
+
+ public long getSurface() {
+ return eglSurface;
+ }
+
+ public EGLGraphicsConfiguration getGraphicsConfiguration() {
+ return eglConfig;
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ return (null==eglConfig)?super.getChosenGLCapabilities():(GLCapabilities)eglConfig.getChosenCapabilities();
+ }
+
+ public abstract GLContext createContext(GLContext shareWith);
+
+ protected abstract long createSurface(long eglDpy, _EGLConfig eglNativeCfg);
+
+ private void recreateSurface() {
+ if(EGL.EGL_NO_SURFACE!=eglSurface) {
+ EGL.eglDestroySurface(eglDisplay, eglSurface);
+ }
+ eglSurface = createSurface(eglDisplay, eglConfig.getNativeConfig());
+
+ if(DEBUG) {
+ System.err.println("setSurface using component: handle 0x"+Long.toHexString(component.getWindowHandle())+" -> 0x"+Long.toHexString(eglSurface));
+ }
+ }
+
+ public void setRealized(boolean realized) {
+ super.setRealized(realized);
+
+ if (realized) {
+ if ( NativeWindow.LOCK_SURFACE_NOT_READY == lockSurface() ) {
+ throw new GLException("Couldn't lock surface");
+ }
+ // lockSurface() also resolved the window/surface handles
+ try {
+ AbstractGraphicsConfiguration aConfig = component.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ AbstractGraphicsDevice aDevice = aConfig.getScreen().getDevice();
+ if(aDevice instanceof EGLGraphicsDevice) {
+ // just fetch the data .. trust but verify ..
+ eglDisplay = aDevice.getHandle();
+ if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+ throw new GLException("Invalid EGL display in EGLGraphicsDevice from "+aDevice);
+ }
+ if(aConfig instanceof EGLGraphicsConfiguration) {
+ eglConfig = (EGLGraphicsConfiguration) aConfig; // done ..
+ if (null == eglConfig) {
+ throw new GLException("Null EGLGraphicsConfiguration from "+aConfig);
+ }
+ eglConfig.updateGraphicsConfiguration();
+ } else {
+ throw new GLException("EGLGraphicsConfiguration doesn't carry a EGLGraphicsDevice: "+aConfig);
+ }
+ } else {
+ // create a new EGL config ..
+ ownEGLDisplay=true;
+ long nDisplay;
+ if( NativeWindowFactory.getNativeWindowType(false)==NativeWindowFactory.TYPE_WINDOWS ) {
+ nDisplay = component.getSurfaceHandle(); // don't even ask ..
+ } else {
+ nDisplay = aDevice.getHandle(); // 0 == EGL.EGL_DEFAULT_DISPLAY
+ }
+ eglDisplay = EGL.eglGetDisplay(nDisplay);
+ if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+ if(DEBUG) {
+ System.err.println("eglDisplay("+Long.toHexString(nDisplay)+" <surfaceHandle>): failed, using EGL_DEFAULT_DISPLAY");
+ }
+ nDisplay = EGL.EGL_DEFAULT_DISPLAY;
+ eglDisplay = EGL.eglGetDisplay(nDisplay);
+ }
+ if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+ throw new GLException("Failed to created EGL display: nhandle 0x"+Long.toHexString(nDisplay)+", "+aDevice+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ } else if(DEBUG) {
+ System.err.println("eglDisplay("+Long.toHexString(nDisplay)+"): 0x"+Long.toHexString(eglDisplay));
+ }
+ if (!EGL.eglInitialize(eglDisplay, null, null)) {
+ throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ }
+ EGLGraphicsDevice e = new EGLGraphicsDevice(eglDisplay);
+ DefaultGraphicsScreen s = new DefaultGraphicsScreen(e, aConfig.getScreen().getIndex());
+ GLCapabilities caps = (GLCapabilities) aConfig.getChosenCapabilities(); // yes, use the already choosen Capabilities (x11,win32,..)
+ eglConfig = (EGLGraphicsConfiguration) GraphicsConfigurationFactory.getFactory(e).chooseGraphicsConfiguration(caps, null, s);
+ if (null == eglConfig) {
+ throw new GLException("Couldn't create EGLGraphicsConfiguration from "+s);
+ } else if(DEBUG) {
+ System.err.println("Chosen eglConfig: "+eglConfig);
+ }
+ }
+ recreateSurface();
+ } finally {
+ unlockSurface();
+ }
+ } else if (eglSurface != EGL.EGL_NO_SURFACE) {
+ // Destroy the window surface
+ if (!EGL.eglDestroySurface(eglDisplay, eglSurface)) {
+ throw new GLException("Error destroying window surface (eglDestroySurface)");
+ }
+ eglSurface = EGL.EGL_NO_SURFACE;
+ if (ownEGLDisplay && EGL.EGL_NO_DISPLAY!=eglDisplay) {
+ EGL.eglTerminate(eglDisplay);
+ }
+ eglDisplay=EGL.EGL_NO_DISPLAY;
+ eglConfig=null;
+ }
+ }
+
+ public int getWidth() {
+ if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_WIDTH, tmp, 0)) {
+ throw new GLException("Error querying surface width");
+ }
+ return tmp[0];
+ }
+
+ public int getHeight() {
+ if (!EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_HEIGHT, tmp, 0)) {
+ throw new GLException("Error querying surface height");
+ }
+ return tmp[0];
+ }
+
+ public DynamicLookupHelper getDynamicLookupHelper() {
+ return EGLDynamicLookupHelper.getDynamicLookupHelper(getGLProfile());
+ }
+
+ public String toString() {
+ return "EGLDrawable[ realized "+getRealized()+
+ ", window "+getNativeWindow()+
+ ", egl surface " + eglSurface +
+ ", "+eglConfig+
+ ", factory "+getFactory()+"]";
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
new file mode 100755
index 000000000..396580c1d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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;
+
+public class EGLDrawableFactory extends GLDrawableFactoryImpl {
+
+ static {
+ // Register our GraphicsConfigurationFactory implementations
+ // The act of constructing them causes them to be registered
+ new EGLGraphicsConfigurationFactory();
+
+ // Check for other underlying stuff ..
+ if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) {
+ try {
+ NWReflection.createInstance("com.sun.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory");
+ } catch (Throwable t) {}
+ }
+ }
+
+ public EGLDrawableFactory() {
+ super();
+ }
+
+ public GLDrawable createGLDrawable(NativeWindow target) {
+ target = NativeWindowFactory.getNativeWindow(target, null);
+ return new EGLOnscreenDrawable(this, target);
+ }
+
+ public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ throw new GLException("Not yet implemented");
+ }
+
+ public boolean canCreateGLPbuffer() {
+ return true;
+ }
+ public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
+ final GLCapabilitiesChooser chooser,
+ final int initialWidth,
+ final int initialHeight,
+ final GLContext shareWith) {
+ if (!canCreateGLPbuffer()) {
+ throw new GLException("Pbuffer support not available with this EGL implementation");
+ }
+ EGLPbufferDrawable pbufferDrawable = new EGLPbufferDrawable(this, capabilities, chooser,
+ initialWidth,
+ initialHeight);
+ return new GLPbufferImpl(pbufferDrawable, shareWith);
+ }
+
+ public GLContext createExternalGLContext() {
+ AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createScreenDevice(0);
+ return new EGLExternalContext(absScreen);
+ }
+
+ public boolean canCreateExternalGLDrawable() {
+ return false;
+ }
+
+ public GLDrawable createExternalGLDrawable() {
+ throw new GLException("Not yet implemented");
+ }
+
+ public void loadGLULibrary() {
+ }
+
+ public boolean canCreateContextOnJava2DSurface() {
+ return false;
+ }
+
+ public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+ throws GLException {
+ throw new GLException("Unimplemented on this platform");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
new file mode 100755
index 000000000..97080b5f7
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.sun.gluegen.runtime.DynamicLookupHelper;
+
+/**
+ * Abstract implementation of the DynamicLookupHelper for EGL,
+ * which decouples it's dependencies to EGLDrawableFactory.
+ *
+ * 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");
+
+ private static final EGLDynamicLookupHelper eglES1DynamicLookupHelper;
+ private static final EGLDynamicLookupHelper eglES2DynamicLookupHelper;
+ private List/*<NativeLibrary>*/ glesLibraries;
+
+ static {
+ EGLDynamicLookupHelper tmp=null;
+ try {
+ tmp = new EGLES1DynamicLookupHelper();
+ } catch (Throwable t) {
+ if(DEBUG) {
+ t.printStackTrace();
+ }
+ }
+ eglES1DynamicLookupHelper = tmp;
+
+ tmp=null;
+ try {
+ tmp = new EGLES2DynamicLookupHelper();
+ } catch (Throwable t) {
+ if(DEBUG) {
+ t.printStackTrace();
+ }
+ }
+ eglES2DynamicLookupHelper = tmp;
+ }
+
+ public static EGLDynamicLookupHelper getDynamicLookupHelper(GLProfile glp) {
+ if (glp.usesNativeGLES2()) {
+ if(null==eglES2DynamicLookupHelper) {
+ throw new GLException("EGLDynamicLookupHelper for ES2 not available");
+ }
+ return eglES2DynamicLookupHelper;
+ } else if (glp.usesNativeGLES1()) {
+ if(null==eglES1DynamicLookupHelper) {
+ throw new GLException("EGLDynamicLookupHelper for ES1 not available");
+ }
+ return eglES1DynamicLookupHelper;
+ } else {
+ throw new GLException("Unsupported: "+glp);
+ }
+ }
+
+ public static EGLDynamicLookupHelper getDynamicLookupHelper(int esProfile) {
+ if (2==esProfile) {
+ if(null==eglES2DynamicLookupHelper) {
+ throw new GLException("EGLDynamicLookupHelper for ES2 not available");
+ }
+ return eglES2DynamicLookupHelper;
+ } else if (1==esProfile) {
+ if(null==eglES1DynamicLookupHelper) {
+ throw new GLException("EGLDynamicLookupHelper for ES1 not available");
+ }
+ return eglES1DynamicLookupHelper;
+ } else {
+ throw new GLException("Unsupported: ES"+esProfile);
+ }
+ }
+
+ protected EGLDynamicLookupHelper() {
+ loadGLESLibrary(getESProfile());
+ EGL.resetProcAddressTable(this);
+ }
+
+ /** Must return the proper ES profile number, 1 for ES1 and 2 for ES2 */
+ protected abstract int getESProfile();
+
+ /** Must return at least one OpenGL ES library name */
+ protected abstract List/*<String>*/ getGLESLibNames();
+
+ /** May return OpenGL ES library name(s) */
+ protected List/*<String>*/ getEGLLibNames() {
+ List/*<String>*/ eglLibNames = new ArrayList();
+
+ // EGL
+ eglLibNames.add("EGL");
+ // for windows distributions using the 'unlike' lib prefix,
+ // where our tool does not add it.
+ eglLibNames.add("libEGL");
+
+ return eglLibNames;
+ }
+
+ private NativeLibrary loadFirstAvailable(List/*<String>*/ libNames, ClassLoader loader) {
+ for (Iterator iter = libNames.iterator(); iter.hasNext(); ) {
+ NativeLibrary lib = NativeLibrary.open((String) iter.next(), loader, false /*global*/);
+ if (lib != null) {
+ return lib;
+ }
+ }
+ return null;
+ }
+
+ private void loadGLESLibrary(int esProfile) {
+ List/*<String>*/ glesLibNames = getGLESLibNames();
+ List/*<String>*/ eglLibNames = getEGLLibNames();
+
+ ClassLoader loader = getClass().getClassLoader();
+ NativeLibrary lib = null;
+
+ glesLibraries = new ArrayList();
+
+ // ES libraries ..
+ lib = loadFirstAvailable(glesLibNames, loader);
+ if (lib == null) {
+ throw new GLException("Unable to dynamically load OpenGL ES library for profile ES" + esProfile);
+ }
+ glesLibraries.add(lib);
+
+ if(null!=eglLibNames && eglLibNames.size()>0) {
+ // EGL libraries ..
+ lib = loadFirstAvailable(eglLibNames, loader);
+ if (lib == null) {
+ throw new GLException("Unable to dynamically load EGL library for profile ES" + esProfile);
+ }
+ glesLibraries.add(lib);
+ }
+
+ if (esProfile==2) {
+ NativeLibLoader.loadES2();
+ } else if (esProfile==1) {
+ NativeLibLoader.loadES1();
+ } else {
+ throw new GLException("Unsupported: ES"+esProfile);
+ }
+ }
+
+ private long dynamicLookupFunctionOnLibs(String glFuncName) {
+ String funcName=glFuncName;
+ long addr = dynamicLookupFunctionOnLibsImpl(funcName);
+ if( 0==addr && NativeWindowFactory.getNativeWindowType(false)==NativeWindowFactory.TYPE_WINDOWS ) {
+ // Hack: try some C++ decoration here for Imageon's emulation libraries ..
+ final int argAlignment=4; // 4 byte alignment of each argument
+ final int maxArguments=12; // experience ..
+ for(int arg=0; 0==addr && arg<=maxArguments; arg++) {
+ funcName = "_"+glFuncName+"@"+(arg*argAlignment);
+ addr = dynamicLookupFunctionOnLibsImpl(funcName);
+ }
+ }
+ if(DEBUG) {
+ if(0!=addr) {
+ System.err.println("Lookup-Native: "+glFuncName+" / "+funcName+" 0x"+Long.toHexString(addr));
+ } else {
+ System.err.println("Lookup-Native: "+glFuncName+" / "+funcName+" ** FAILED ** ");
+ }
+ }
+ return addr;
+ }
+
+ private long dynamicLookupFunctionOnLibsImpl(String glFuncName) {
+ // 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);
+ if (addr != 0) {
+ return addr;
+ }
+ }
+ return 0;
+ }
+
+ private long eglGetProcAddressHandle = 0;
+
+ public long dynamicLookupFunction(String glFuncName) {
+ if(null==glFuncName) {
+ return 0;
+ }
+
+ // bootstrap eglGetProcAddress
+ if(0==eglGetProcAddressHandle) {
+ eglGetProcAddressHandle = dynamicLookupFunctionOnLibs("eglGetProcAddress");
+ if(0==eglGetProcAddressHandle) {
+ GLException e = new GLException("Couldn't find eglGetProcAddress function entry");
+ if(DEBUG) {
+ e.printStackTrace();
+ }
+ throw e;
+ }
+ }
+
+ if(glFuncName.equals("eglGetProcAddress")) {
+ return eglGetProcAddressHandle;
+ }
+
+ long addr = EGL.eglGetProcAddress(eglGetProcAddressHandle, glFuncName);
+ if(DEBUG) {
+ if(0!=addr) {
+ System.err.println("Lookup-EGL: <"+glFuncName+"> 0x"+Long.toHexString(addr));
+ }
+ }
+ if(0==addr) {
+ addr = dynamicLookupFunctionOnLibs(glFuncName);
+ }
+ return addr;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java
new file mode 100755
index 000000000..7e60e25c0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.
+ */
+public class EGLES1DynamicLookupHelper extends EGLDynamicLookupHelper {
+
+ protected EGLES1DynamicLookupHelper() {
+ super();
+ }
+
+ protected int getESProfile() {
+ return 1;
+ }
+
+ protected List/*<String>*/ getGLESLibNames() {
+ List/*<String>*/ glesLibNames = new ArrayList();
+
+ glesLibNames.add("GLES_CM");
+ glesLibNames.add("GLES_CL");
+ glesLibNames.add("GLESv1_CM");
+ // for windows distributions using the 'unlike' lib prefix,
+ // where our tool does not add it.
+ glesLibNames.add("libGLES_CM");
+ glesLibNames.add("libGLES_CL");
+ glesLibNames.add("libGLESv1_CM");
+
+ return glesLibNames;
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java
new file mode 100755
index 000000000..cfd0558c9
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLES2DynamicLookupHelper.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.
+ */
+public class EGLES2DynamicLookupHelper extends EGLDynamicLookupHelper {
+
+ protected EGLES2DynamicLookupHelper() {
+ super();
+ }
+
+ protected int getESProfile() {
+ return 2;
+ }
+
+ protected List/*<String>*/ getGLESLibNames() {
+ List/*<String>*/ glesLibNames = new ArrayList();
+
+ glesLibNames.add("GLES20");
+ glesLibNames.add("GLESv2");
+ glesLibNames.add("GLESv2_CM");
+ // for windows distributions using the 'unlike' lib prefix
+ // where our tool does not add it.
+ glesLibNames.add("libGLES20");
+ glesLibNames.add("libGLESv2");
+ glesLibNames.add("libGLESv2_CM");
+
+ return glesLibNames;
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java
new file mode 100755
index 000000000..1635e8d63
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLExternalContext.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.egl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import javax.media.nativewindow.*;
+
+public class EGLExternalContext extends EGLContext {
+ private boolean firstMakeCurrent = true;
+ private boolean created = true;
+ private GLContext lastContext;
+
+ public EGLExternalContext(AbstractGraphicsScreen screen) {
+ super(null, null);
+ GLContextShareSet.contextCreated(this);
+ setGLFunctionAvailability(false);
+ }
+
+ public int makeCurrent() throws GLException {
+ // Save last context if necessary to allow external GLContexts to
+ // talk to other GLContexts created by this library
+ GLContext cur = getCurrent();
+ if (cur != null && cur != this) {
+ lastContext = cur;
+ setCurrent(null);
+ }
+ return super.makeCurrent();
+ }
+
+ public void release() throws GLException {
+ super.release();
+ setCurrent(lastContext);
+ lastContext = null;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (firstMakeCurrent) {
+ firstMakeCurrent = false;
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ }
+
+ protected void destroyImpl() throws GLException {
+ created = false;
+ GLContextShareSet.contextDestroyed(this);
+ }
+
+ public boolean isCreated() {
+ return created;
+ }
+
+ public void bindPbufferToTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ public void releasePbufferFromTexture() {
+ throw new GLException("Should not call this");
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java
new file mode 100644
index 000000000..4f04bb57a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfiguration.java
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.egl;
+
+import java.util.*;
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.gluegen.runtime.NativeLibrary;
+
+public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
+ protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+ public _EGLConfig getNativeConfig() {
+ return _config;
+ }
+
+ public int getNativeConfigID() {
+ return configID;
+ }
+
+ public EGLGraphicsConfiguration(AbstractGraphicsScreen screen,
+ GLCapabilities capsChosen, GLCapabilities capsRequested, GLCapabilitiesChooser chooser,
+ _EGLConfig cfg, int cfgID) {
+ super(screen, capsChosen, capsRequested);
+ this.chooser = chooser;
+ _config = cfg;
+ configID = cfgID;
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ protected void updateGraphicsConfiguration() {
+ EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(getScreen().getDevice()).chooseGraphicsConfiguration(getRequestedCapabilities(),
+ chooser,
+ getScreen());
+ if(null!=newConfig) {
+ // FIXME: setScreen( ... );
+ setChosenCapabilities(newConfig.getChosenCapabilities());
+ _config = newConfig.getNativeConfig();
+ configID = newConfig.getNativeConfigID();
+ if(DEBUG) {
+ System.err.println("!!! updateGraphicsConfiguration: "+this);
+ }
+ }
+ }
+
+ public static _EGLConfig EGLConfigId2EGLConfig(GLProfile glp, long display, int configID) {
+ int[] attrs = new int[] {
+ EGL.EGL_CONFIG_ID, configID,
+ EGL.EGL_NONE
+ };
+ _EGLConfig[] configs = new _EGLConfig[1];
+ int[] numConfigs = new int[1];
+ if (!EGL.eglChooseConfig(display,
+ attrs, 0,
+ configs, 1,
+ numConfigs, 0)) {
+ return null;
+ }
+ if (numConfigs[0] == 0) {
+ return null;
+ }
+ return configs[0];
+ }
+
+ public static GLCapabilities EGLConfig2Capabilities(GLProfile glp, long display, _EGLConfig _config) {
+ GLCapabilities caps = new GLCapabilities(glp);
+ int[] val = new int[1];
+
+ // Read the actual configuration into the choosen caps
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_RED_SIZE, val, 0)) {
+ caps.setRedBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_GREEN_SIZE, val, 0)) {
+ caps.setGreenBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_BLUE_SIZE, val, 0)) {
+ caps.setBlueBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_ALPHA_SIZE, val, 0)) {
+ caps.setAlphaBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_STENCIL_SIZE, val, 0)) {
+ caps.setStencilBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_DEPTH_SIZE, val, 0)) {
+ caps.setDepthBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_SAMPLES, val, 0)) {
+ caps.setSampleBuffers(val[0]>0?true:false);
+ caps.setNumSamples(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_TRANSPARENT_TYPE, val, 0)) {
+ caps.setBackgroundOpaque(val[0] != EGL.EGL_TRANSPARENT_RGB);
+ }
+ if(!caps.isBackgroundOpaque()) {
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_TRANSPARENT_RED_VALUE, val, 0)) {
+ caps.setTransparentRedValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_TRANSPARENT_GREEN_VALUE, val, 0)) {
+ caps.setTransparentGreenValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_TRANSPARENT_BLUE_VALUE, val, 0)) {
+ caps.setTransparentBlueValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+ }
+ /** Not defined in EGL
+ if(EGL.eglGetConfigAttrib(display, _config, EGL.EGL_TRANSPARENT_ALPHA_VALUE, val, 0)) {
+ caps.setTransparentAlphaValue(val[0]==EGL.EGL_DONT_CARE?-1:val[0]);
+ } */
+ }
+ return caps;
+ }
+
+ public static int[] GLCapabilities2AttribList(GLCapabilities caps, int eglSurfaceType) {
+ int[] attrs = new int[32];
+ int idx=0;
+
+ switch(eglSurfaceType) {
+ case EGL.EGL_WINDOW_BIT:
+ case EGL.EGL_PBUFFER_BIT:
+ case EGL.EGL_PIXMAP_BIT:
+ break;
+ default:
+ throw new GLException("Invalid EGL_SURFACE_TYPE 0x"+Integer.toHexString(eglSurfaceType));
+ }
+
+ attrs[idx++] = EGL.EGL_SURFACE_TYPE;
+ attrs[idx++] = eglSurfaceType;
+
+ attrs[idx++] = EGL.EGL_RED_SIZE;
+ attrs[idx++] = caps.getRedBits();
+
+ attrs[idx++] = EGL.EGL_GREEN_SIZE;
+ attrs[idx++] = caps.getGreenBits();
+
+ attrs[idx++] = EGL.EGL_BLUE_SIZE;
+ attrs[idx++] = caps.getBlueBits();
+
+ attrs[idx++] = EGL.EGL_ALPHA_SIZE;
+ attrs[idx++] = caps.getAlphaBits() > 0 ? caps.getAlphaBits() : EGL.EGL_DONT_CARE;
+
+ attrs[idx++] = EGL.EGL_STENCIL_SIZE;
+ attrs[idx++] = caps.getStencilBits() > 0 ? caps.getStencilBits() : EGL.EGL_DONT_CARE;
+
+ attrs[idx++] = EGL.EGL_DEPTH_SIZE;
+ attrs[idx++] = caps.getDepthBits();
+
+ attrs[idx++] = EGL.EGL_SAMPLES;
+ attrs[idx++] = caps.getSampleBuffers() ? caps.getNumSamples() : 1;
+
+ attrs[idx++] = EGL.EGL_TRANSPARENT_TYPE;
+ attrs[idx++] = caps.isBackgroundOpaque() ? EGL.EGL_NONE : EGL.EGL_TRANSPARENT_TYPE;
+
+ // 20
+
+ if(!caps.isBackgroundOpaque()) {
+ attrs[idx++] = EGL.EGL_TRANSPARENT_RED_VALUE;
+ attrs[idx++] = caps.getTransparentRedValue()>=0?caps.getTransparentRedValue():EGL.EGL_DONT_CARE;
+
+ attrs[idx++] = EGL.EGL_TRANSPARENT_GREEN_VALUE;
+ attrs[idx++] = caps.getTransparentGreenValue()>=0?caps.getTransparentGreenValue():EGL.EGL_DONT_CARE;
+
+ attrs[idx++] = EGL.EGL_TRANSPARENT_BLUE_VALUE;
+ attrs[idx++] = caps.getTransparentBlueValue()>=0?caps.getTransparentBlueValue():EGL.EGL_DONT_CARE;
+
+ /** Not define in EGL
+ attrs[idx++] = EGL.EGL_TRANSPARENT_ALPHA_VALUE;
+ attrs[idx++] = caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():EGL.EGL_DONT_CARE; */
+ }
+
+ // 26
+
+ attrs[idx++] = EGL.EGL_RENDERABLE_TYPE;
+ if(caps.getGLProfile().usesNativeGLES1()) {
+ attrs[idx++] = EGL.EGL_OPENGL_ES_BIT;
+ }
+ else if(caps.getGLProfile().usesNativeGLES2()) {
+ attrs[idx++] = EGL.EGL_OPENGL_ES2_BIT;
+ } else {
+ attrs[idx++] = EGL.EGL_OPENGL_BIT;
+ }
+
+ // 28
+
+ attrs[idx++] = EGL.EGL_NONE;
+
+ return attrs;
+ }
+
+ public static int[] CreatePBufferSurfaceAttribList(int width, int height, int texFormat) {
+ int[] attrs = new int[16];
+ int idx=0;
+
+ attrs[idx++] = EGL.EGL_WIDTH;
+ attrs[idx++] = width;
+
+ attrs[idx++] = EGL.EGL_HEIGHT;
+ attrs[idx++] = height;
+
+ attrs[idx++] = EGL.EGL_TEXTURE_FORMAT;
+ attrs[idx++] = texFormat;
+
+ attrs[idx++] = EGL.EGL_TEXTURE_TARGET;
+ attrs[idx++] = EGL.EGL_NO_TEXTURE==texFormat ? EGL.EGL_NO_TEXTURE : EGL.EGL_TEXTURE_2D;
+
+ attrs[idx++] = EGL.EGL_NONE;
+
+ return attrs;
+ }
+
+ public String toString() {
+ return getClass().toString()+"["+getScreen()+", eglConfigID "+configID+
+ ",\n\trequested " + getRequestedCapabilities()+
+ ",\n\tchosen " + getChosenCapabilities()+
+ "]";
+
+ }
+
+ private GLCapabilitiesChooser chooser;
+ private _EGLConfig _config;
+ private int configID;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..e0a025c4a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.egl;
+
+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
+ to this one to change the accepted and returned types of the
+ GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class EGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = GraphicsConfigurationFactory.DEBUG || com.sun.opengl.impl.Debug.debug("EGL");
+
+ public EGLGraphicsConfigurationFactory() {
+ // become the selector for KD/EGL ..
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.egl.EGLGraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ if (absScreen == null) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only AbstractGraphicsDevice objects");
+ }
+
+ if (capabilities != null &&
+ !(capabilities instanceof GLCapabilities)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ return chooseGraphicsConfigurationStatic((GLCapabilities) capabilities,
+ (GLCapabilitiesChooser) chooser,
+ absScreen, EGL.EGL_WINDOW_BIT);
+ }
+
+ public static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen, int eglSurfaceType) {
+ if (capabilities == null) {
+ capabilities = new GLCapabilities(null);
+ }
+ GLProfile glp = capabilities.getGLProfile();
+
+ if(null==absScreen) {
+ throw new GLException("Null AbstractGraphicsScreen");
+ }
+ AbstractGraphicsDevice absDevice = absScreen.getDevice();
+
+ if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
+ throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
+ }
+ long eglDisplay = absDevice.getHandle();
+
+ if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+ throw new GLException("Invalid EGL display: "+absDevice);
+ }
+
+ EGLGraphicsConfiguration res = eglChooseConfig(eglDisplay, capabilities, capabilities, chooser, absScreen, eglSurfaceType);
+ if(null!=res) {
+ return res;
+ }
+ if(DEBUG) {
+ System.err.println("eglChooseConfig failed with given capabilities surfaceType 0x"+Integer.toHexString(eglSurfaceType)+", "+capabilities);
+ }
+
+ if (chooser == null) {
+ chooser = new DefaultGLCapabilitiesChooser();
+ }
+
+ _EGLConfig[] configs = new _EGLConfig[10];
+ int[] numConfigs = new int[1];
+
+ if(!EGL.eglGetConfigs(eglDisplay, configs, configs.length, numConfigs, 0)) {
+ throw new GLException("Graphics configuration fetch (eglGetConfigs) failed");
+ }
+ if (numConfigs[0] == 0) {
+ throw new GLException("Graphics configuration fetch (eglGetConfigs) - no EGLConfig found");
+ }
+ GLCapabilities[] caps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0]);
+ if(DEBUG) {
+ printCaps("eglGetConfigs", caps, System.err);
+ }
+ int chosen = -1;
+ try {
+ chosen = chooser.chooseCapabilities(capabilities, caps, -1);
+ } catch (NativeWindowException e) { throw new GLException(e); }
+ if(chosen<0) {
+ throw new GLException("Graphics configuration chooser failed");
+ }
+ if(DEBUG) {
+ System.err.println("Choosen "+caps[chosen]);
+ }
+ res = eglChooseConfig(eglDisplay, caps[chosen], capabilities, chooser, absScreen, eglSurfaceType);
+ if(null!=res) {
+ return res;
+ }
+ if(DEBUG) {
+ System.err.println("eglChooseConfig failed with eglGetConfig/choosen capabilities surfaceType 0x"+Integer.toHexString(eglSurfaceType));
+ }
+
+ // Last try .. add a fixed embedded profile [ATI, Nokia, ..]
+ GLCapabilities fixedCaps = new GLCapabilities(glp);
+ fixedCaps.setRedBits(5);
+ fixedCaps.setGreenBits(6);
+ fixedCaps.setBlueBits(5);
+ fixedCaps.setDepthBits(16);
+ fixedCaps.setSampleBuffers(true);
+ fixedCaps.setNumSamples(4);
+ if(DEBUG) {
+ System.err.println("trying fixed caps: "+fixedCaps);
+ }
+
+ res = eglChooseConfig(eglDisplay, fixedCaps, capabilities, chooser, absScreen, eglSurfaceType);
+ if(null==res) {
+ throw new GLException("Graphics configuration failed [direct caps, eglGetConfig/chooser and fixed-caps]");
+ }
+ return res;
+ }
+
+ protected static EGLGraphicsConfiguration eglChooseConfig(long eglDisplay,
+ GLCapabilities capsChoosen0, GLCapabilities capsRequested, GLCapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen, int eglSurfaceType) {
+ GLProfile glp = capsChoosen0.getGLProfile();
+ int[] attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChoosen0, eglSurfaceType);
+ _EGLConfig[] configs = new _EGLConfig[10];
+ int[] numConfigs = new int[1];
+ if (!EGL.eglChooseConfig(eglDisplay,
+ attrs, 0,
+ configs, configs.length,
+ numConfigs, 0)) {
+ throw new GLException("Graphics configuration selection (eglChooseConfig) failed for surfaceType 0x"+Integer.toHexString(eglSurfaceType)+", "+capsChoosen0);
+ }
+ if (numConfigs[0] > 0) {
+ if(DEBUG) {
+ GLCapabilities[] caps = eglConfigs2GLCaps(glp, eglDisplay, configs, numConfigs[0]);
+ printCaps("eglChooseConfig", caps, System.err);
+ }
+ int[] val = new int[1];
+ // get the configID
+ if(!EGL.eglGetConfigAttrib(eglDisplay, configs[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 "+capsChoosen0+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ }
+ val[0]=0;
+ }
+ GLCapabilities capsChoosen1 = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs[0]);
+ if(DEBUG) {
+ System.err.println("eglChooseConfig found: surfaceType 0x"+Integer.toHexString(eglSurfaceType)+", "+capsChoosen0+" -> "+capsChoosen1);
+ }
+
+ return new EGLGraphicsConfiguration(absScreen, capsChoosen1, capsRequested, chooser, configs[0], val[0]);
+ }
+ return null;
+ }
+
+ protected static GLCapabilities[] eglConfigs2GLCaps(GLProfile glp, long eglDisplay, _EGLConfig[] configs, int num)
+ {
+ GLCapabilities[] caps = new GLCapabilities[num];
+ for(int i=0; i<num; i++) {
+ caps[i] = EGLGraphicsConfiguration.EGLConfig2Capabilities(glp, eglDisplay, configs[i]);
+ }
+ return caps;
+ }
+
+ protected static void printCaps(String prefix, GLCapabilities[] caps, PrintStream out) {
+ for(int i=0; i<caps.length; i++) {
+ out.println(prefix+"["+i+"] "+caps[i]);
+ }
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java
new file mode 100755
index 000000000..c1a5bd583
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenContext.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.egl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.gluegen.runtime.ProcAddressTable;
+import java.nio.*;
+import java.util.*;
+
+public class EGLOnscreenContext extends EGLContext {
+ public EGLOnscreenContext(EGLOnscreenDrawable drawable, GLContext shareWith) {
+ super(drawable, shareWith);
+ }
+
+ // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release]
+ protected int makeCurrentImpl() throws GLException {
+ int lockRes = drawable.lockSurface();
+ boolean exceptionOccurred = false;
+ try {
+ if (lockRes == NativeWindow.LOCK_SURFACE_NOT_READY) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ return super.makeCurrentImpl();
+ } catch (RuntimeException e) {
+ exceptionOccurred = true;
+ throw e;
+ } finally {
+ if (exceptionOccurred ||
+ (isOptimizable() && lockRes != NativeWindow.LOCK_SURFACE_NOT_READY) && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release]
+ protected void releaseImpl() throws GLException {
+ try {
+ super.releaseImpl();
+ } finally {
+ if (!isOptimizable() && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ public void bindPbufferToTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ public void releasePbufferFromTexture() {
+ throw new GLException("Should not call this");
+ }
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java
new file mode 100644
index 000000000..73dcf526c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLOnscreenDrawable.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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 java.nio.LongBuffer;
+
+public class EGLOnscreenDrawable extends EGLDrawable {
+ protected EGLOnscreenDrawable(EGLDrawableFactory factory, NativeWindow component) throws GLException {
+ super(factory, component);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new EGLOnscreenContext(this, shareWith);
+ }
+
+ protected long createSurface(long eglDpy, _EGLConfig eglNativeCfg) {
+ long surf = EGL.eglCreateWindowSurface(eglDpy, eglNativeCfg, component.getWindowHandle(), null);
+ if (EGL.EGL_NO_SURFACE==surf) {
+ throw new GLException("Creation of window surface (eglCreateWindowSurface) failed, component: "+component+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ } else if(DEBUG) {
+ System.err.println("setSurface result: eglSurface 0x"+Long.toHexString(surf));
+ }
+ return surf;
+ }
+
+ public void swapBuffers() throws GLException {
+ 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;
+ }
+
+ EGL.eglSwapBuffers(eglDisplay, eglSurface);
+
+ } finally {
+ if(didLock) {
+ unlockSurface();
+ }
+ }
+ }
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java
new file mode 100755
index 000000000..2a7a7705c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferContext.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.egl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.gluegen.runtime.ProcAddressTable;
+import java.nio.*;
+import java.util.*;
+
+public class EGLPbufferContext extends EGLContext {
+ public EGLPbufferContext(EGLPbufferDrawable drawable, GLContext shareWith) {
+ super(drawable, shareWith);
+ }
+
+ public int getFloatingPointMode() {
+ return 0; // FIXME ??
+ }
+
+ public void bindPbufferToTexture() {
+ throw new GLException("Not yet implemented");
+ }
+
+ public void releasePbufferFromTexture() {
+ throw new GLException("Not yet implemented");
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
new file mode 100644
index 000000000..0ab1838b2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLPbufferDrawable.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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 java.nio.LongBuffer;
+
+public class EGLPbufferDrawable extends EGLDrawable {
+ private int width, height;
+ private int texFormat;
+ protected static final boolean useTexture = false; // No yet ..
+
+ protected EGLPbufferDrawable(EGLDrawableFactory factory,
+ GLCapabilities caps,
+ GLCapabilitiesChooser chooser,
+ int width, int height) {
+ super(factory, new NullWindow(createEGLGraphicsConfiguration(caps, chooser)));
+ if (width <= 0 || height <= 0) {
+ throw new GLException("Width and height of pbuffer must be positive (were (" +
+ width + ", " + height + "))");
+ }
+
+ // get choosen ones ..
+ caps = (GLCapabilities) getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+
+ this.width=width;
+ this.height=height;
+ if(useTexture) {
+ this.texFormat = caps.getAlphaBits() > 0 ? EGL.EGL_TEXTURE_RGBA : EGL.EGL_TEXTURE_RGB ;
+ } else {
+ this.texFormat = EGL.EGL_NO_TEXTURE;
+ }
+
+ NullWindow nw = (NullWindow) getNativeWindow();
+ nw.setSize(width, height);
+
+ ownEGLDisplay = true;
+
+ if (DEBUG) {
+ System.out.println("Pbuffer config: " + getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration());
+ }
+ }
+
+ protected static EGLGraphicsConfiguration createEGLGraphicsConfiguration(GLCapabilities caps, GLCapabilitiesChooser chooser) {
+ long eglDisplay = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+ if (eglDisplay == EGL.EGL_NO_DISPLAY) {
+ throw new GLException("Failed to created EGL default display: error 0x"+Integer.toHexString(EGL.eglGetError()));
+ } else if(DEBUG) {
+ System.err.println("eglDisplay(EGL_DEFAULT_DISPLAY): 0x"+Long.toHexString(eglDisplay));
+ }
+ if (!EGL.eglInitialize(eglDisplay, null, null)) {
+ throw new GLException("eglInitialize failed"+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ }
+ EGLGraphicsDevice e = new EGLGraphicsDevice(eglDisplay);
+ DefaultGraphicsScreen s = new DefaultGraphicsScreen(e, 0);
+ EGLGraphicsConfiguration eglConfig = EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(caps, chooser, s, EGL.EGL_PBUFFER_BIT);
+ if (null == eglConfig) {
+ EGL.eglTerminate(eglDisplay);
+ throw new GLException("Couldn't create EGLGraphicsConfiguration from "+s);
+ } else if(DEBUG) {
+ System.err.println("Chosen eglConfig: "+eglConfig);
+ }
+ return eglConfig;
+ }
+
+ protected long createSurface(long eglDpy, _EGLConfig eglNativeCfg) {
+ int[] attrs = EGLGraphicsConfiguration.CreatePBufferSurfaceAttribList(width, height, texFormat);
+ long surf = EGL.eglCreatePbufferSurface(eglDpy, eglNativeCfg, attrs, 0);
+ if (EGL.EGL_NO_SURFACE==surf) {
+ throw new GLException("Creation of window surface (eglCreatePbufferSurface) failed, dim "+width+"x"+height+", error 0x"+Integer.toHexString(EGL.eglGetError()));
+ } else if(DEBUG) {
+ System.err.println("setSurface result: eglSurface 0x"+Long.toHexString(surf));
+ }
+ return surf;
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new EGLPbufferContext(this, shareWith);
+ }
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java b/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java
new file mode 100755
index 000000000..5b7b679ad
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/gl2/ProjectDouble.java
@@ -0,0 +1,1041 @@
+/*
+** License Applicability. Except 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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** $Date: 2009-03-13 22:20:29 -0700 (Fri, 13 Mar 2009) $ $Revision: 1867 $
+** $Header$
+*/
+
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+package com.sun.opengl.impl.gl2;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+/**
+ * Project.java
+ * <p/>
+ * <p/>
+ * Created 11-jan-2004
+ *
+ * @author Erik Duijs
+ * @author Kenneth Russell
+ */
+public class ProjectDouble {
+ private static final double[] IDENTITY_MATRIX =
+ new double[] {
+ 1.0, 0.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0 };
+
+ // Note that we have cloned parts of the implementation in order to
+ // support incoming Buffers. The reason for this is to avoid loading
+ // non-direct buffer subclasses unnecessarily, because doing so can
+ // cause performance decreases on direct buffer operations, at least
+ // on the current HotSpot JVM. It would be nicer (and make the code
+ // simpler) to simply have the array-based entry points delegate to
+ // the versions taking Buffers by wrapping the arrays.
+
+ // Array-based implementation
+ private final double[] matrix = new double[16];
+
+ private final double[][] tempMatrix = new double[4][4];
+ private final double[] in = new double[4];
+ private final double[] out = new double[4];
+
+ private final double[] forward = new double[3];
+ private final double[] side = new double[3];
+ private final double[] up = new double[3];
+
+ // Buffer-based implementation
+ private DoubleBuffer locbuf;
+ private final DoubleBuffer matrixBuf;
+
+ private final DoubleBuffer tempMatrixBuf;
+ private final DoubleBuffer inBuf;
+ private final DoubleBuffer outBuf;
+
+ private final DoubleBuffer forwardBuf;
+ private final DoubleBuffer sideBuf;
+ private final DoubleBuffer upBuf;
+
+ public ProjectDouble() {
+ // Use direct buffers to avoid loading indirect buffer
+ // implementations for applications trying to avoid doing so.
+ // Slice up one big buffer because some NIO implementations
+ // allocate a huge amount of memory to back even the smallest of
+ // buffers.
+ DoubleBuffer locbuf = InternalBufferUtil.newDoubleBuffer(128);
+ int pos = 0;
+ int sz = 16;
+ matrixBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ tempMatrixBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ sz = 4;
+ inBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ outBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ sz = 3;
+ forwardBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ sideBuf = slice(locbuf, pos, sz);
+ pos += sz;
+ upBuf = slice(locbuf, pos, sz);
+ }
+
+ public void destroy() {
+ if(locbuf!=null) {
+ locbuf.clear();
+ locbuf=null;
+ }
+ }
+
+ private static DoubleBuffer slice(DoubleBuffer buf, int pos, int len) {
+ buf.position(pos);
+ buf.limit(pos + len);
+ return buf.slice();
+ }
+
+ /**
+ * Make matrix an identity matrix
+ */
+ private void __gluMakeIdentityd(DoubleBuffer m) {
+ int oldPos = m.position();
+ m.put(IDENTITY_MATRIX);
+ m.position(oldPos);
+ }
+
+ /**
+ * Make matrix an identity matrix
+ */
+ private void __gluMakeIdentityd(double[] m) {
+ for (int i = 0; i < 16; i++) {
+ m[i] = IDENTITY_MATRIX[i];
+ }
+ }
+
+ /**
+ * Method __gluMultMatrixVecd
+ *
+ * @param matrix
+ * @param in
+ * @param out
+ */
+ private void __gluMultMatrixVecd(double[] matrix, int matrix_offset, double[] in, double[] out) {
+ for (int i = 0; i < 4; i++) {
+ out[i] =
+ in[0] * matrix[0*4+i+matrix_offset] +
+ in[1] * matrix[1*4+i+matrix_offset] +
+ in[2] * matrix[2*4+i+matrix_offset] +
+ in[3] * matrix[3*4+i+matrix_offset];
+ }
+ }
+
+ /**
+ * Method __gluMultMatrixVecd
+ *
+ * @param matrix
+ * @param in
+ * @param out
+ */
+ private void __gluMultMatrixVecd(DoubleBuffer matrix, DoubleBuffer in, DoubleBuffer out) {
+ int inPos = in.position();
+ int outPos = out.position();
+ int matrixPos = matrix.position();
+ for (int i = 0; i < 4; i++) {
+ out.put(i + outPos,
+ in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
+ in.get(1+inPos) * matrix.get(1*4+i+matrixPos) +
+ in.get(2+inPos) * matrix.get(2*4+i+matrixPos) +
+ in.get(3+inPos) * matrix.get(3*4+i+matrixPos));
+ }
+ }
+
+ /**
+ * @param src
+ * @param inverse
+ *
+ * @return
+ */
+ private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
+ int i, j, k, swap;
+ double t;
+ double[][] temp = tempMatrix;
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ temp[i][j] = src[i*4+j];
+ }
+ }
+ __gluMakeIdentityd(inverse);
+
+ for (i = 0; i < 4; i++) {
+ //
+ // Look for largest element in column
+ //
+ swap = i;
+ for (j = i + 1; j < 4; j++) {
+ if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
+ swap = j;
+ }
+ }
+
+ if (swap != i) {
+ //
+ // Swap rows.
+ //
+ for (k = 0; k < 4; k++) {
+ t = temp[i][k];
+ temp[i][k] = temp[swap][k];
+ temp[swap][k] = t;
+
+ t = inverse[i*4+k];
+ inverse[i*4+k] = inverse[swap*4+k];
+ inverse[swap*4+k] = t;
+ }
+ }
+
+ if (temp[i][i] == 0) {
+ //
+ // No non-zero pivot. The matrix is singular, which shouldn't
+ // happen. This means the user gave us a bad matrix.
+ //
+ return false;
+ }
+
+ t = temp[i][i];
+ for (k = 0; k < 4; k++) {
+ temp[i][k] /= t;
+ inverse[i*4+k] /= t;
+ }
+ for (j = 0; j < 4; j++) {
+ if (j != i) {
+ t = temp[j][i];
+ for (k = 0; k < 4; k++) {
+ temp[j][k] -= temp[i][k] * t;
+ inverse[j*4+k] -= inverse[i*4+k]*t;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @param src
+ * @param inverse
+ *
+ * @return
+ */
+ private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
+ int i, j, k, swap;
+ double t;
+
+ int srcPos = src.position();
+ int invPos = inverse.position();
+
+ DoubleBuffer temp = tempMatrixBuf;
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ temp.put(i*4+j, src.get(i*4+j + srcPos));
+ }
+ }
+ __gluMakeIdentityd(inverse);
+
+ for (i = 0; i < 4; i++) {
+ //
+ // Look for largest element in column
+ //
+ swap = i;
+ for (j = i + 1; j < 4; j++) {
+ if (Math.abs(temp.get(j*4+i)) > Math.abs(temp.get(i*4+i))) {
+ swap = j;
+ }
+ }
+
+ if (swap != i) {
+ //
+ // Swap rows.
+ //
+ for (k = 0; k < 4; k++) {
+ t = temp.get(i*4+k);
+ temp.put(i*4+k, temp.get(swap*4+k));
+ temp.put(swap*4+k, t);
+
+ t = inverse.get(i*4+k + invPos);
+ inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
+ inverse.put(swap*4+k + invPos, t);
+ }
+ }
+
+ if (temp.get(i*4+i) == 0) {
+ //
+ // No non-zero pivot. The matrix is singular, which shouldn't
+ // happen. This means the user gave us a bad matrix.
+ //
+ return false;
+ }
+
+ t = temp.get(i*4+i);
+ for (k = 0; k < 4; k++) {
+ temp.put(i*4+k, temp.get(i*4+k) / t);
+ inverse.put(i*4+k + invPos, inverse.get(i*4+k + invPos) / t);
+ }
+ for (j = 0; j < 4; j++) {
+ if (j != i) {
+ t = temp.get(j*4+i);
+ for (k = 0; k < 4; k++) {
+ temp.put(j*4+k, temp.get(j*4+k) - temp.get(i*4+k) * t);
+ inverse.put(j*4+k + invPos, inverse.get(j*4+k + invPos) - inverse.get(i*4+k + invPos) * t);
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ * @param a
+ * @param b
+ * @param r
+ */
+ private void __gluMultMatricesd(double[] a, int a_offset, double[] b, int b_offset, double[] r) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ r[i*4+j] =
+ a[i*4+0+a_offset]*b[0*4+j+b_offset] +
+ a[i*4+1+a_offset]*b[1*4+j+b_offset] +
+ a[i*4+2+a_offset]*b[2*4+j+b_offset] +
+ a[i*4+3+a_offset]*b[3*4+j+b_offset];
+ }
+ }
+ }
+
+
+ /**
+ * @param a
+ * @param b
+ * @param r
+ */
+ private void __gluMultMatricesd(DoubleBuffer a, DoubleBuffer b, DoubleBuffer r) {
+ int aPos = a.position();
+ int bPos = b.position();
+ int rPos = r.position();
+
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ r.put(i*4+j + rPos,
+ a.get(i*4+0+aPos)*b.get(0*4+j+bPos) +
+ a.get(i*4+1+aPos)*b.get(1*4+j+bPos) +
+ a.get(i*4+2+aPos)*b.get(2*4+j+bPos) +
+ a.get(i*4+3+aPos)*b.get(3*4+j+bPos));
+ }
+ }
+ }
+
+ /**
+ * Normalize vector
+ *
+ * @param v
+ */
+ private static void normalize(double[] v) {
+ double r;
+
+ r = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+ if ( r == 0.0 )
+ return;
+
+ r = 1.0 / r;
+
+ v[0] *= r;
+ v[1] *= r;
+ v[2] *= r;
+
+ return;
+ }
+
+ /**
+ * Normalize vector
+ *
+ * @param v
+ */
+ private static void normalize(DoubleBuffer v) {
+ double r;
+
+ int vPos = v.position();
+
+ r = Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
+ v.get(1+vPos) * v.get(1+vPos) +
+ v.get(2+vPos) * v.get(2+vPos));
+ if ( r == 0.0 )
+ return;
+
+ r = 1.0 / r;
+
+ v.put(0+vPos, v.get(0+vPos) * r);
+ v.put(1+vPos, v.get(1+vPos) * r);
+ v.put(2+vPos, v.get(2+vPos) * r);
+
+ return;
+ }
+
+
+ /**
+ * Calculate cross-product
+ *
+ * @param v1
+ * @param v2
+ * @param result
+ */
+ private static void cross(double[] v1, double[] v2, double[] result) {
+ result[0] = v1[1] * v2[2] - v1[2] * v2[1];
+ result[1] = v1[2] * v2[0] - v1[0] * v2[2];
+ result[2] = v1[0] * v2[1] - v1[1] * v2[0];
+ }
+
+ /**
+ * Calculate cross-product
+ *
+ * @param v1
+ * @param v2
+ * @param result
+ */
+ private static void cross(DoubleBuffer v1, DoubleBuffer v2, DoubleBuffer result) {
+ int v1Pos = v1.position();
+ int v2Pos = v2.position();
+ int rPos = result.position();
+
+ result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
+ result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
+ result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
+ }
+
+ /**
+ * Method gluOrtho2D.
+ *
+ * @param left
+ * @param right
+ * @param bottom
+ * @param top
+ */
+ public void gluOrtho2D(GL2 gl, double left, double right, double bottom, double top) {
+ gl.glOrtho(left, right, bottom, top, -1, 1);
+ }
+
+ /**
+ * Method gluPerspective.
+ *
+ * @param fovy
+ * @param aspect
+ * @param zNear
+ * @param zFar
+ */
+ public void gluPerspective(GL2 gl, double fovy, double aspect, double zNear, double zFar) {
+ double sine, cotangent, deltaZ;
+ double radians = fovy / 2 * Math.PI / 180;
+
+ deltaZ = zFar - zNear;
+ sine = Math.sin(radians);
+
+ if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
+ return;
+ }
+
+ cotangent = Math.cos(radians) / sine;
+
+ __gluMakeIdentityd(matrixBuf);
+
+ matrixBuf.put(0 * 4 + 0, cotangent / aspect);
+ matrixBuf.put(1 * 4 + 1, cotangent);
+ matrixBuf.put(2 * 4 + 2, - (zFar + zNear) / deltaZ);
+ matrixBuf.put(2 * 4 + 3, -1);
+ matrixBuf.put(3 * 4 + 2, -2 * zNear * zFar / deltaZ);
+ matrixBuf.put(3 * 4 + 3, 0);
+
+ gl.glMultMatrixd(matrixBuf);
+ }
+
+ /**
+ * Method gluLookAt
+ *
+ * @param eyex
+ * @param eyey
+ * @param eyez
+ * @param centerx
+ * @param centery
+ * @param centerz
+ * @param upx
+ * @param upy
+ * @param upz
+ */
+ public void gluLookAt(GL2 gl,
+ double eyex,
+ double eyey,
+ double eyez,
+ double centerx,
+ double centery,
+ double centerz,
+ double upx,
+ double upy,
+ double upz) {
+ DoubleBuffer forward = this.forwardBuf;
+ DoubleBuffer side = this.sideBuf;
+ DoubleBuffer up = this.upBuf;
+
+ forward.put(0, centerx - eyex);
+ forward.put(1, centery - eyey);
+ forward.put(2, centerz - eyez);
+
+ up.put(0, upx);
+ up.put(1, upy);
+ up.put(2, upz);
+
+ normalize(forward);
+
+ /* Side = forward x up */
+ cross(forward, up, side);
+ normalize(side);
+
+ /* Recompute up as: up = side x forward */
+ cross(side, forward, up);
+
+ __gluMakeIdentityd(matrixBuf);
+ matrixBuf.put(0 * 4 + 0, side.get(0));
+ matrixBuf.put(1 * 4 + 0, side.get(1));
+ matrixBuf.put(2 * 4 + 0, side.get(2));
+
+ matrixBuf.put(0 * 4 + 1, up.get(0));
+ matrixBuf.put(1 * 4 + 1, up.get(1));
+ matrixBuf.put(2 * 4 + 1, up.get(2));
+
+ matrixBuf.put(0 * 4 + 2, -forward.get(0));
+ matrixBuf.put(1 * 4 + 2, -forward.get(1));
+ matrixBuf.put(2 * 4 + 2, -forward.get(2));
+
+ gl.glMultMatrixd(matrixBuf);
+ gl.glTranslated(-eyex, -eyey, -eyez);
+ }
+
+ /**
+ * Method gluProject
+ *
+ * @param objx
+ * @param objy
+ * @param objz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param win_pos
+ *
+ * @return
+ */
+ public boolean gluProject(double objx,
+ double objy,
+ double objz,
+ double[] modelMatrix,
+ int modelMatrix_offset,
+ double[] projMatrix,
+ int projMatrix_offset,
+ int[] viewport,
+ int viewport_offset,
+ double[] win_pos,
+ int win_pos_offset ) {
+
+ double[] in = this.in;
+ double[] out = this.out;
+
+ in[0] = objx;
+ in[1] = objy;
+ in[2] = objz;
+ in[3] = 1.0;
+
+ __gluMultMatrixVecd(modelMatrix, modelMatrix_offset, in, out);
+ __gluMultMatrixVecd(projMatrix, projMatrix_offset, out, in);
+
+ if (in[3] == 0.0)
+ return false;
+
+ in[3] = (1.0 / in[3]) * 0.5;
+
+ // Map x, y and z to range 0-1
+ in[0] = in[0] * in[3] + 0.5f;
+ in[1] = in[1] * in[3] + 0.5f;
+ in[2] = in[2] * in[3] + 0.5f;
+
+ // Map x,y to viewport
+ win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
+ win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
+ win_pos[2+win_pos_offset] = in[2];
+
+ return true;
+ }
+
+ /**
+ * Method gluProject
+ *
+ * @param objx
+ * @param objy
+ * @param objz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param win_pos
+ *
+ * @return
+ */
+ public boolean gluProject(double objx,
+ double objy,
+ double objz,
+ DoubleBuffer modelMatrix,
+ DoubleBuffer projMatrix,
+ IntBuffer viewport,
+ DoubleBuffer win_pos) {
+
+ DoubleBuffer in = this.inBuf;
+ DoubleBuffer out = this.outBuf;
+
+ in.put(0, objx);
+ in.put(1, objy);
+ in.put(2, objz);
+ in.put(3, 1.0);
+
+ __gluMultMatrixVecd(modelMatrix, in, out);
+ __gluMultMatrixVecd(projMatrix, out, in);
+
+ if (in.get(3) == 0.0)
+ return false;
+
+ in.put(3, (1.0 / in.get(3)) * 0.5);
+
+ // Map x, y and z to range 0-1
+ in.put(0, in.get(0) * in.get(3) + 0.5f);
+ in.put(1, in.get(1) * in.get(3) + 0.5f);
+ in.put(2, in.get(2) * in.get(3) + 0.5f);
+
+ // Map x,y to viewport
+ int vPos = viewport.position();
+ int wPos = win_pos.position();
+ win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
+ win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
+ win_pos.put(2+wPos, in.get(2));
+
+ return true;
+ }
+
+
+ /**
+ * Method gluUnproject
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject(double winx,
+ double winy,
+ double winz,
+ double[] modelMatrix,
+ int modelMatrix_offset,
+ double[] projMatrix,
+ int projMatrix_offset,
+ int[] viewport,
+ int viewport_offset,
+ double[] obj_pos,
+ int obj_pos_offset) {
+ double[] in = this.in;
+ double[] out = this.out;
+
+ __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+ if (!__gluInvertMatrixd(matrix, matrix))
+ return false;
+
+ in[0] = winx;
+ in[1] = winy;
+ in[2] = winz;
+ in[3] = 1.0;
+
+ // Map x and y from window coordinates
+ in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+ in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+ // Map to range -1 to 1
+ in[0] = in[0] * 2 - 1;
+ in[1] = in[1] * 2 - 1;
+ in[2] = in[2] * 2 - 1;
+
+ __gluMultMatrixVecd(matrix, 0, in, out);
+
+ if (out[3] == 0.0)
+ return false;
+
+ out[3] = 1.0 / out[3];
+
+ obj_pos[0+obj_pos_offset] = out[0] * out[3];
+ obj_pos[1+obj_pos_offset] = out[1] * out[3];
+ obj_pos[2+obj_pos_offset] = out[2] * out[3];
+
+ return true;
+ }
+
+
+ /**
+ * Method gluUnproject
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject(double winx,
+ double winy,
+ double winz,
+ DoubleBuffer modelMatrix,
+ DoubleBuffer projMatrix,
+ IntBuffer viewport,
+ DoubleBuffer obj_pos) {
+ DoubleBuffer in = this.inBuf;
+ DoubleBuffer out = this.outBuf;
+
+ __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
+
+ if (!__gluInvertMatrixd(matrixBuf, matrixBuf))
+ return false;
+
+ in.put(0, winx);
+ in.put(1, winy);
+ in.put(2, winz);
+ in.put(3, 1.0);
+
+ // Map x and y from window coordinates
+ int vPos = viewport.position();
+ int oPos = obj_pos.position();
+ in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+ in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+
+ // Map to range -1 to 1
+ in.put(0, in.get(0) * 2 - 1);
+ in.put(1, in.get(1) * 2 - 1);
+ in.put(2, in.get(2) * 2 - 1);
+
+ __gluMultMatrixVecd(matrixBuf, in, out);
+
+ if (out.get(3) == 0.0)
+ return false;
+
+ out.put(3, 1.0 / out.get(3));
+
+ obj_pos.put(0+oPos, out.get(0) * out.get(3));
+ obj_pos.put(1+oPos, out.get(1) * out.get(3));
+ obj_pos.put(2+oPos, out.get(2) * out.get(3));
+
+ return true;
+ }
+
+
+ /**
+ * Method gluUnproject4
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param clipw
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param near
+ * @param far
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject4(double winx,
+ double winy,
+ double winz,
+ double clipw,
+ double[] modelMatrix,
+ int modelMatrix_offset,
+ double[] projMatrix,
+ int projMatrix_offset,
+ int[] viewport,
+ int viewport_offset,
+ double near,
+ double far,
+ double[] obj_pos,
+ int obj_pos_offset ) {
+ double[] in = this.in;
+ double[] out = this.out;
+
+ __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
+
+ if (!__gluInvertMatrixd(matrix, matrix))
+ return false;
+
+ in[0] = winx;
+ in[1] = winy;
+ in[2] = winz;
+ in[3] = clipw;
+
+ // Map x and y from window coordinates
+ in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+ in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+ in[2] = (in[2] - near) / (far - near);
+
+ // Map to range -1 to 1
+ in[0] = in[0] * 2 - 1;
+ in[1] = in[1] * 2 - 1;
+ in[2] = in[2] * 2 - 1;
+
+ __gluMultMatrixVecd(matrix, 0, in, out);
+
+ if (out[3] == 0.0)
+ return false;
+
+ obj_pos[0+obj_pos_offset] = out[0];
+ obj_pos[1+obj_pos_offset] = out[1];
+ obj_pos[2+obj_pos_offset] = out[2];
+ obj_pos[3+obj_pos_offset] = out[3];
+ return true;
+ }
+
+ /**
+ * Method gluUnproject4
+ *
+ * @param winx
+ * @param winy
+ * @param winz
+ * @param clipw
+ * @param modelMatrix
+ * @param projMatrix
+ * @param viewport
+ * @param near
+ * @param far
+ * @param obj_pos
+ *
+ * @return
+ */
+ public boolean gluUnProject4(double winx,
+ double winy,
+ double winz,
+ double clipw,
+ DoubleBuffer modelMatrix,
+ DoubleBuffer projMatrix,
+ IntBuffer viewport,
+ double near,
+ double far,
+ DoubleBuffer obj_pos) {
+ DoubleBuffer in = this.inBuf;
+ DoubleBuffer out = this.outBuf;
+
+ __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
+
+ if (!__gluInvertMatrixd(matrixBuf, matrixBuf))
+ return false;
+
+ in.put(0, winx);
+ in.put(1, winy);
+ in.put(2, winz);
+ in.put(3, clipw);
+
+ // Map x and y from window coordinates
+ int vPos = viewport.position();
+ in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
+ in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
+ in.put(2, (in.get(2) - near) / (far - near));
+
+ // Map to range -1 to 1
+ in.put(0, in.get(0) * 2 - 1);
+ in.put(1, in.get(1) * 2 - 1);
+ in.put(2, in.get(2) * 2 - 1);
+
+ __gluMultMatrixVecd(matrixBuf, in, out);
+
+ if (out.get(3) == 0.0)
+ return false;
+
+ int oPos = obj_pos.position();
+ obj_pos.put(0+oPos, out.get(0));
+ obj_pos.put(1+oPos, out.get(1));
+ obj_pos.put(2+oPos, out.get(2));
+ obj_pos.put(3+oPos, out.get(3));
+ return true;
+ }
+
+
+ /**
+ * Method gluPickMatrix
+ *
+ * @param x
+ * @param y
+ * @param deltaX
+ * @param deltaY
+ * @param viewport
+ */
+ public void gluPickMatrix(GL2 gl,
+ double x,
+ double y,
+ double deltaX,
+ double deltaY,
+ IntBuffer viewport) {
+ if (deltaX <= 0 || deltaY <= 0) {
+ return;
+ }
+
+ /* Translate and scale the picked region to the entire window */
+ int vPos = viewport.position();
+ gl.glTranslated((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
+ (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
+ 0);
+ gl.glScaled(viewport.get(2) / deltaX, viewport.get(3) / deltaY, 1.0);
+ }
+
+ /**
+ * Method gluPickMatrix
+ *
+ * @param x
+ * @param y
+ * @param deltaX
+ * @param deltaY
+ * @param viewport
+ * @param viewport_offset
+ */
+ public void gluPickMatrix(GL2 gl,
+ double x,
+ double y,
+ double deltaX,
+ double deltaY,
+ int[] viewport,
+ int viewport_offset) {
+ if (deltaX <= 0 || deltaY <= 0) {
+ return;
+ }
+
+ /* Translate and scale the picked region to the entire window */
+ gl.glTranslated((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
+ (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
+ 0);
+ gl.glScaled(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/Util.java b/src/jogl/classes/com/sun/opengl/impl/gl2/Util.java
new file mode 100644
index 000000000..0fc72daa9
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/gl2/Util.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.impl.gl2;
+
+import com.sun.opengl.impl.*;
+
+import java.nio.IntBuffer;
+import javax.media.opengl.*;
+
+/**
+ * Util.java
+ * <p/>
+ * <p/>
+ * Created 7-jan-2004
+ *
+ * @author Erik Duijs
+ */
+class Util {
+
+ /**
+ * temp int[] of one for getting an int from some GL functions
+ */
+ private int[] scratch = new int[1];
+
+ /**
+ * Return ceiling of integer division
+ *
+ * @param a
+ * @param b
+ *
+ * @return int
+ */
+ protected static int ceil(int a, int b) {
+ return (a % b == 0 ? a / b : a / b + 1);
+ }
+
+ /**
+ * Method compPerPix.
+ *
+ * @param format
+ *
+ * @return int
+ */
+ protected static int compPerPix(int format) {
+ /* Determine number of components per pixel */
+ switch ( format ) {
+ case GL2.GL_COLOR_INDEX:
+ case GL2.GL_STENCIL_INDEX:
+ case GL2.GL_DEPTH_COMPONENT:
+ case GL2.GL_RED:
+ case GL2.GL_GREEN:
+ case GL2.GL_BLUE:
+ case GL2.GL_ALPHA:
+ case GL2.GL_LUMINANCE:
+ return 1;
+ case GL2.GL_LUMINANCE_ALPHA:
+ return 2;
+ case GL2.GL_RGB:
+ case GL2.GL_BGR:
+ return 3;
+ case GL2.GL_RGBA:
+ case GL2.GL_BGRA:
+ return 4;
+ default :
+ return -1;
+ }
+ }
+
+ /**
+ * Method nearestPower.
+ * <p/>
+ * Compute the nearest power of 2 number. This algorithm is a little strange, but it works quite well.
+ *
+ * @param value
+ *
+ * @return int
+ */
+ protected static int nearestPower(int value) {
+ int i;
+
+ i = 1;
+
+ /* Error! */
+ if ( value == 0 )
+ return -1;
+
+ for ( ; ; ) {
+ if ( value == 1 ) {
+ return i;
+ } else if ( value == 3 ) {
+ return i << 2;
+ }
+ value >>= 1;
+ i <<= 1;
+ }
+ }
+
+ /**
+ * Method bytesPerPixel.
+ *
+ * @param format
+ * @param type
+ *
+ * @return int
+ */
+ protected static int bytesPerPixel(int format, int type) {
+ int n, m;
+
+ switch ( format ) {
+ case GL2.GL_COLOR_INDEX:
+ case GL2.GL_STENCIL_INDEX:
+ case GL2.GL_DEPTH_COMPONENT:
+ case GL2.GL_RED:
+ case GL2.GL_GREEN:
+ case GL2.GL_BLUE:
+ case GL2.GL_ALPHA:
+ case GL2.GL_LUMINANCE:
+ n = 1;
+ break;
+ case GL2.GL_LUMINANCE_ALPHA:
+ n = 2;
+ break;
+ case GL2.GL_RGB:
+ case GL2.GL_BGR:
+ n = 3;
+ break;
+ case GL2.GL_RGBA:
+ case GL2.GL_BGRA:
+ n = 4;
+ break;
+ default :
+ n = 0;
+ }
+
+ switch ( type ) {
+ case GL2.GL_UNSIGNED_BYTE:
+ m = 1;
+ break;
+ case GL2.GL_BYTE:
+ m = 1;
+ break;
+ case GL2.GL_BITMAP:
+ m = 1;
+ break;
+ case GL2.GL_UNSIGNED_SHORT:
+ m = 2;
+ break;
+ case GL2.GL_SHORT:
+ m = 2;
+ break;
+ case GL2.GL_UNSIGNED_INT:
+ m = 4;
+ break;
+ case GL2.GL_INT:
+ m = 4;
+ break;
+ case GL2.GL_FLOAT:
+ m = 4;
+ break;
+ default :
+ m = 0;
+ }
+
+ return n * m;
+ }
+
+ /**
+ * Convenience method for returning an int, rather than getting it out of a buffer yourself.
+ *
+ * @param what
+ *
+ * @return int
+ */
+ protected int glGetIntegerv(GL gl, int what) {
+ gl.glGetIntegerv(what, scratch, 0);
+ return scratch[0];
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java b/src/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java
new file mode 100755
index 000000000..885f3cb28
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/gl2/fixme/GLObjectTracker.java
@@ -0,0 +1,835 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.gl2;
+
+import com.sun.opengl.impl.*;
+
+import java.nio.*;
+import javax.media.opengl.*;
+
+/**
+ * Tracks the creation of server-side OpenGL objects which can be
+ * shared between contexts. Ordinarily, when an OpenGL context is
+ * deleted and no other contexts are sharing server-side objects with
+ * it, all of the server-side objects are automatically deleted by the
+ * OpenGL implementation. It is not necessary for the end user to
+ * explicitly delete these objects. However, when the Java2D/OpenGL
+ * pipeline is active and frame buffer objects are being used for
+ * rendering, it is necessary for all OpenGL contexts created by JOGL
+ * to share server-side objects with the Java2D OpenGL context. This
+ * means that these objects "leak" into the namespace used by Java2D.
+ * In order to prevent memory leaks and to present the same
+ * programming model to the end user, it is necessary to track the
+ * creation and destruction of all of these server-side OpenGL objects
+ * and to explicitly release them when all of the JOGL-created
+ * contexts which can see them have been released. <P>
+ *
+ * The {@link #ref ref} and {@link #unref unref} methods should be
+ * used during the creation and destruction of OpenGL contexts by JOGL
+ * in order to update the liveness of the objects being tracked. The
+ * various other methods should be called by the OpenGL binding in the
+ * various named methods.
+ */
+
+public class GLObjectTracker {
+ private static final boolean DEBUG = Debug.debug("GLObjectTracker");
+
+ //----------------------------------------------------------------------
+ // Adders
+ //
+
+ // glGenBuffers
+ public synchronized void addBuffers(int n, IntBuffer ids) {
+ add(getList(BUFFERS), n, ids);
+ }
+
+ // glGenBuffers
+ public synchronized void addBuffers(int n, int[] ids, int ids_offset) {
+ add(getList(BUFFERS), n, ids, ids_offset);
+ }
+
+ // glGenBuffersARB
+ public synchronized void addBuffersARB(int n, IntBuffer ids) {
+ add(getList(BUFFERS_ARB), n, ids);
+ }
+
+ // glGenBuffersARB
+ public synchronized void addBuffersARB(int n, int[] ids, int ids_offset) {
+ add(getList(BUFFERS_ARB), n, ids, ids_offset);
+ }
+
+ // glGenFencesAPPLE
+ public synchronized void addFencesAPPLE(int n, IntBuffer ids) {
+ add(getList(FENCES_APPLE), n, ids);
+ }
+
+ // glGenFencesAPPLE
+ public synchronized void addFencesAPPLE(int n, int[] ids, int ids_offset) {
+ add(getList(FENCES_APPLE), n, ids, ids_offset);
+ }
+
+ // glGenFencesNV
+ public synchronized void addFencesNV(int n, IntBuffer ids) {
+ add(getList(FENCES_NV), n, ids);
+ }
+
+ // glGenFencesNV
+ public synchronized void addFencesNV(int n, int[] ids, int ids_offset) {
+ add(getList(FENCES_NV), n, ids, ids_offset);
+ }
+
+ // glGenFragmentShadersATI
+ public synchronized void addFragmentShadersATI(int start, int n) {
+ add(getList(FRAGMENT_SHADERS_ATI), start, n);
+ }
+
+ // glGenFramebuffersEXT
+ public synchronized void addFramebuffersEXT(int n, IntBuffer ids) {
+ add(getList(FRAMEBUFFERS_EXT), n, ids);
+ }
+
+ // glGenFramebuffersEXT
+ public synchronized void addFramebuffersEXT(int n, int[] ids, int ids_offset) {
+ add(getList(FRAMEBUFFERS_EXT), n, ids, ids_offset);
+ }
+
+ // glGenLists
+ public synchronized void addLists(int start, int n) {
+ add(getList(LISTS), start, n);
+ }
+
+ // glGenOcclusionQueriesNV
+ public synchronized void addOcclusionQueriesNV(int n, IntBuffer ids) {
+ add(getList(OCCLUSION_QUERIES_NV), n, ids);
+ }
+
+ // glGenOcclusionQueriesNV
+ public synchronized void addOcclusionQueriesNV(int n, int[] ids, int ids_offset) {
+ add(getList(OCCLUSION_QUERIES_NV), n, ids, ids_offset);
+ }
+
+ // glCreateProgram
+ public synchronized void addProgramObject(int obj) {
+ add(getList(PROGRAM_OBJECTS), obj, 1);
+ }
+
+ // glCreateProgramObjectARB
+ public synchronized void addProgramObjectARB(int obj) {
+ add(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
+ }
+
+ // glGenProgramsARB
+ public synchronized void addProgramsARB(int n, IntBuffer ids) {
+ add(getList(PROGRAMS_ARB), n, ids);
+ }
+
+ // glGenProgramsARB
+ public synchronized void addProgramsARB(int n, int[] ids, int ids_offset) {
+ add(getList(PROGRAMS_ARB), n, ids, ids_offset);
+ }
+
+ // glGenProgramsNV
+ public synchronized void addProgramsNV(int n, IntBuffer ids) {
+ add(getList(PROGRAMS_NV), n, ids);
+ }
+
+ // glGenProgramsNV
+ public synchronized void addProgramsNV(int n, int[] ids, int ids_offset) {
+ add(getList(PROGRAMS_NV), n, ids, ids_offset);
+ }
+
+ // glGenQueries
+ public synchronized void addQueries(int n, IntBuffer ids) {
+ add(getList(QUERIES), n, ids);
+ }
+
+ // glGenQueries
+ public synchronized void addQueries(int n, int[] ids, int ids_offset) {
+ add(getList(QUERIES), n, ids, ids_offset);
+ }
+
+ // glGenQueriesARB
+ public synchronized void addQueriesARB(int n, IntBuffer ids) {
+ add(getList(QUERIES_ARB), n, ids);
+ }
+
+ // glGenQueriesARB
+ public synchronized void addQueriesARB(int n, int[] ids, int ids_offset) {
+ add(getList(QUERIES_ARB), n, ids, ids_offset);
+ }
+
+ // glGenRenderbuffersEXT
+ public synchronized void addRenderbuffersEXT(int n, IntBuffer ids) {
+ add(getList(RENDERBUFFERS_EXT), n, ids);
+ }
+
+ // glGenRenderbuffersEXT
+ public synchronized void addRenderbuffersEXT(int n, int[] ids, int ids_offset) {
+ add(getList(RENDERBUFFERS_EXT), n, ids, ids_offset);
+ }
+
+ // glCreateShader
+ public synchronized void addShaderObject(int obj) {
+ add(getList(SHADER_OBJECTS), obj, 1);
+ }
+
+ // glCreateShaderObjectARB
+ public synchronized void addShaderObjectARB(int obj) {
+ add(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
+ }
+
+ // glGenTextures
+ public synchronized void addTextures(int n, IntBuffer ids) {
+ add(getList(TEXTURES), n, ids);
+ }
+
+ // glGenTextures
+ public synchronized void addTextures(int n, int[] ids, int ids_offset) {
+ add(getList(TEXTURES), n, ids, ids_offset);
+ }
+
+ // glGenVertexArraysAPPLE
+ public synchronized void addVertexArraysAPPLE(int n, IntBuffer ids) {
+ add(getList(VERTEX_ARRAYS_APPLE), n, ids);
+ }
+
+ // glGenVertexArraysAPPLE
+ public synchronized void addVertexArraysAPPLE(int n, int[] ids, int ids_offset) {
+ add(getList(VERTEX_ARRAYS_APPLE), n, ids, ids_offset);
+ }
+
+ // glGenVertexShadersEXT
+ public synchronized void addVertexShadersEXT(int start, int n) {
+ add(getList(VERTEX_SHADERS_EXT), start, n);
+ }
+
+ //----------------------------------------------------------------------
+ // Removers
+ //
+
+ // glDeleteBuffers
+ public synchronized void removeBuffers(int n, IntBuffer ids) {
+ remove(getList(BUFFERS), n, ids);
+ }
+
+ // glDeleteBuffers
+ public synchronized void removeBuffers(int n, int[] ids, int ids_offset) {
+ remove(getList(BUFFERS), n, ids, ids_offset);
+ }
+
+ // glDeleteBuffersARB
+ public synchronized void removeBuffersARB(int n, IntBuffer ids) {
+ remove(getList(BUFFERS_ARB), n, ids);
+ }
+
+ // glDeleteBuffersARB
+ public synchronized void removeBuffersARB(int n, int[] ids, int ids_offset) {
+ remove(getList(BUFFERS_ARB), n, ids, ids_offset);
+ }
+
+ // glDeleteFencesAPPLE
+ public synchronized void removeFencesAPPLE(int n, IntBuffer ids) {
+ remove(getList(FENCES_APPLE), n, ids);
+ }
+
+ // glDeleteFencesAPPLE
+ public synchronized void removeFencesAPPLE(int n, int[] ids, int ids_offset) {
+ remove(getList(FENCES_APPLE), n, ids, ids_offset);
+ }
+
+ // glDeleteFencesNV
+ public synchronized void removeFencesNV(int n, IntBuffer ids) {
+ remove(getList(FENCES_NV), n, ids);
+ }
+
+ // glDeleteFencesNV
+ public synchronized void removeFencesNV(int n, int[] ids, int ids_offset) {
+ remove(getList(FENCES_NV), n, ids, ids_offset);
+ }
+
+ // glDeleteFragmentShaderATI
+ public synchronized void removeFragmentShaderATI(int obj) {
+ remove(getList(FRAGMENT_SHADERS_ATI), obj, 1);
+ }
+
+ // glDeleteFramebuffersEXT
+ public synchronized void removeFramebuffersEXT(int n, IntBuffer ids) {
+ remove(getList(FRAMEBUFFERS_EXT), n, ids);
+ }
+
+ // glDeleteFramebuffersEXT
+ public synchronized void removeFramebuffersEXT(int n, int[] ids, int ids_offset) {
+ remove(getList(FRAMEBUFFERS_EXT), n, ids, ids_offset);
+ }
+
+ // glDeleteLists
+ public synchronized void removeLists(int start, int n) {
+ remove(getList(LISTS), start, n);
+ }
+
+ // glDeleteOcclusionQueriesNV
+ public synchronized void removeOcclusionQueriesNV(int n, IntBuffer ids) {
+ remove(getList(OCCLUSION_QUERIES_NV), n, ids);
+ }
+
+ // glDeleteOcclusionQueriesNV
+ public synchronized void removeOcclusionQueriesNV(int n, int[] ids, int ids_offset) {
+ remove(getList(OCCLUSION_QUERIES_NV), n, ids, ids_offset);
+ }
+
+ // glDeleteProgram
+ public synchronized void removeProgramObject(int obj) {
+ remove(getList(PROGRAM_OBJECTS), obj, 1);
+ }
+
+ // glDeleteObjectARB
+ public synchronized void removeProgramOrShaderObjectARB(int obj) {
+ remove(getList(PROGRAM_AND_SHADER_OBJECTS_ARB), obj, 1);
+ }
+
+ // glDeleteProgramsARB
+ public synchronized void removeProgramsARB(int n, IntBuffer ids) {
+ remove(getList(PROGRAMS_ARB), n, ids);
+ }
+
+ // glDeleteProgramsARB
+ public synchronized void removeProgramsARB(int n, int[] ids, int ids_offset) {
+ remove(getList(PROGRAMS_ARB), n, ids, ids_offset);
+ }
+
+ // glDeleteProgramsNV
+ public synchronized void removeProgramsNV(int n, IntBuffer ids) {
+ remove(getList(PROGRAMS_NV), n, ids);
+ }
+
+ // glDeleteProgramsNV
+ public synchronized void removeProgramsNV(int n, int[] ids, int ids_offset) {
+ remove(getList(PROGRAMS_NV), n, ids, ids_offset);
+ }
+
+ // glDeleteQueries
+ public synchronized void removeQueries(int n, IntBuffer ids) {
+ remove(getList(QUERIES), n, ids);
+ }
+
+ // glDeleteQueries
+ public synchronized void removeQueries(int n, int[] ids, int ids_offset) {
+ remove(getList(QUERIES), n, ids, ids_offset);
+ }
+
+ // glDeleteQueriesARB
+ public synchronized void removeQueriesARB(int n, IntBuffer ids) {
+ remove(getList(QUERIES_ARB), n, ids);
+ }
+
+ // glDeleteQueriesARB
+ public synchronized void removeQueriesARB(int n, int[] ids, int ids_offset) {
+ remove(getList(QUERIES_ARB), n, ids, ids_offset);
+ }
+
+ // glDeleteRenderbuffersEXT
+ public synchronized void removeRenderbuffersEXT(int n, IntBuffer ids) {
+ remove(getList(RENDERBUFFERS_EXT), n, ids);
+ }
+
+ // glDeleteRenderbuffersEXT
+ public synchronized void removeRenderbuffersEXT(int n, int[] ids, int ids_offset) {
+ remove(getList(RENDERBUFFERS_EXT), n, ids, ids_offset);
+ }
+
+ // glDeleteShader
+ public synchronized void removeShaderObject(int obj) {
+ remove(getList(SHADER_OBJECTS), obj, 1);
+ }
+
+ // glDeleteTextures
+ public synchronized void removeTextures(int n, IntBuffer ids) {
+ remove(getList(TEXTURES), n, ids);
+ }
+
+ // glDeleteTextures
+ public synchronized void removeTextures(int n, int[] ids, int ids_offset) {
+ remove(getList(TEXTURES), n, ids, ids_offset);
+ }
+
+ // glDeleteVertexArraysAPPLE
+ public synchronized void removeVertexArraysAPPLE(int n, IntBuffer ids) {
+ remove(getList(VERTEX_ARRAYS_APPLE), n, ids);
+ }
+
+ // glDeleteVertexArraysAPPLE
+ public synchronized void removeVertexArraysAPPLE(int n, int[] ids, int ids_offset) {
+ remove(getList(VERTEX_ARRAYS_APPLE), n, ids, ids_offset);
+ }
+
+ // glDeleteVertexShaderEXT
+ public synchronized void removeVertexShaderEXT(int obj) {
+ remove(getList(VERTEX_SHADERS_EXT), obj, 1);
+ }
+
+ //----------------------------------------------------------------------
+ // Reference count maintenance and manual deletion
+ //
+
+ public synchronized void transferAll(GLObjectTracker other) {
+ for (int i = 0; i < lists.length; i++) {
+ getList(i).addAll(other.lists[i]);
+ if (other.lists[i] != null) {
+ other.lists[i].clear();
+ }
+ }
+ dirty = true;
+ }
+
+ public synchronized void ref() {
+ ++refCount;
+ }
+
+ public void unref(GLObjectTracker deletedObjectPool) {
+ boolean tryDelete = false;
+ synchronized (this) {
+ if (--refCount == 0) {
+ tryDelete = true;
+ }
+ }
+ if (tryDelete) {
+ // See whether we should try to do the work now or whether we
+ // have to postpone
+ GLContext cur = GLContext.getCurrent();
+ if ((cur != null) &&
+ (cur instanceof GLContextImpl)) {
+ GLContextImpl curImpl = (GLContextImpl) cur;
+ if (deletedObjectPool != null &&
+ deletedObjectPool == curImpl.getDeletedObjectTracker()) {
+ // Should be safe to delete these objects now
+ try {
+ delete((GL2)curImpl.getGL());
+ return;
+ } catch (GLException e) {
+ // Shouldn't happen, but if it does, transfer all objects
+ // to the deleted object pool hoping we can later clean
+ // them up
+ deletedObjectPool.transferAll(this);
+ throw(e);
+ }
+ }
+ }
+ // If we get here, we couldn't attempt to delete the objects
+ // right now; instead try to transfer them to the
+ // deletedObjectPool for later cleanup (FIXME: should consider
+ // throwing an exception if deletedObjectPool is null, since
+ // that shouldn't happen)
+ if (DEBUG) {
+ String s = null;
+ if (cur == null) {
+ s = "current context was null";
+ } else if (!(cur instanceof GLContextImpl)) {
+ s = "current context was not a GLContextImpl";
+ } else if (deletedObjectPool == null) {
+ s = "no current deletedObjectPool";
+ } else if (deletedObjectPool != ((GLContextImpl) cur).getDeletedObjectTracker()) {
+ s = "deletedObjectTracker didn't match";
+ if (((GLContextImpl) cur).getDeletedObjectTracker() == null) {
+ s += " (other was null)";
+ }
+ } else {
+ s = "unknown reason";
+ }
+ System.err.println("Deferred destruction of server-side OpenGL objects into " + deletedObjectPool + ": " + s);
+ }
+
+ if (deletedObjectPool != null) {
+ deletedObjectPool.transferAll(this);
+ }
+ }
+ }
+
+ public void clean(GL2 gl) {
+ if (dirty) {
+ try {
+ delete(gl);
+ dirty = false;
+ } catch (GLException e) {
+ // FIXME: not sure what to do here; probably a bad idea to be
+ // throwing exceptions during an otherwise-successful makeCurrent
+ }
+ }
+ }
+
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ // Kinds of sharable server-side OpenGL objects this class tracks
+ private static final int BUFFERS = 0;
+ private static final int BUFFERS_ARB = 1;
+ private static final int FENCES_APPLE = 2;
+ private static final int FENCES_NV = 3;
+ private static final int FRAGMENT_SHADERS_ATI = 4;
+ private static final int FRAMEBUFFERS_EXT = 5;
+ private static final int LISTS = 6;
+ private static final int OCCLUSION_QUERIES_NV = 7;
+ private static final int PROGRAM_AND_SHADER_OBJECTS_ARB = 8;
+ private static final int PROGRAM_OBJECTS = 9;
+ private static final int PROGRAMS_ARB = 10;
+ private static final int PROGRAMS_NV = 11;
+ private static final int QUERIES = 12;
+ private static final int QUERIES_ARB = 13;
+ private static final int RENDERBUFFERS_EXT = 14;
+ private static final int SHADER_OBJECTS = 15;
+ private static final int TEXTURES = 16;
+ private static final int VERTEX_ARRAYS_APPLE = 17;
+ private static final int VERTEX_SHADERS_EXT = 18;
+ private static final int NUM_OBJECT_TYPES = 19;
+
+ static abstract class Deleter {
+ public abstract void delete(GL2 gl, int obj);
+ }
+
+ static class ObjectList {
+ private static final int MIN_CAPACITY = 4;
+
+ private int size;
+ private int capacity;
+ private int[] data;
+ private Deleter deleter;
+ private String name;
+
+ public ObjectList(Deleter deleter) {
+ this.deleter = deleter;
+ clear();
+ }
+
+ public void add(int obj) {
+ if (size == capacity) {
+ int newCapacity = 2 * capacity;
+ int[] newData = new int[newCapacity];
+ System.arraycopy(data, 0, newData, 0, size);
+ data = newData;
+ capacity = newCapacity;
+ }
+
+ data[size++] = obj;
+ }
+
+ public void addAll(ObjectList other) {
+ if (other == null) {
+ return;
+ }
+ for (int i = 0; i < other.size; i++) {
+ add(other.data[i]);
+ }
+ }
+
+ public boolean remove(int value) {
+ for (int i = 0; i < size; i++) {
+ if (data[i] == value) {
+ if (i < size - 1) {
+ System.arraycopy(data, i+1, data, i, size - i - 1);
+ }
+ --size;
+ if ((size < capacity / 4) &&
+ (capacity > MIN_CAPACITY)) {
+ int newCapacity = capacity / 4;
+ if (newCapacity < MIN_CAPACITY) {
+ newCapacity = MIN_CAPACITY;
+ }
+ int[] newData = new int[newCapacity];
+ System.arraycopy(data, 0, newData, 0, size);
+ data = newData;
+ capacity = newCapacity;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void setName(String name) {
+ if (DEBUG) {
+ this.name = name;
+ }
+ }
+
+ public void delete(GL2 gl) {
+ // Just in case we start throwing exceptions during deletion,
+ // make sure we make progress rather than going into an infinite
+ // loop
+ while (size > 0) {
+ int obj = data[size - 1];
+ --size;
+ if (DEBUG) {
+ System.err.println("Deleting server-side OpenGL object " + obj +
+ ((name != null) ? (" (" + name + ")") : ""));
+ }
+ deleter.delete(gl, obj);
+ }
+ }
+
+ public void clear() {
+ size = 0;
+ capacity = MIN_CAPACITY;
+ data = new int[capacity];
+ }
+ }
+
+ private ObjectList[] lists = new ObjectList[NUM_OBJECT_TYPES];
+ private int refCount;
+ private boolean dirty;
+
+ private void add(ObjectList list, int n, IntBuffer ids) {
+ int pos = ids.position();
+ for (int i = 0; i < n; i++) {
+ list.add(ids.get(pos + i));
+ }
+ }
+
+ private void add(ObjectList list, int n, int[] ids, int ids_offset) {
+ for (int i = 0; i < n; i++) {
+ list.add(ids[i + ids_offset]);
+ }
+ }
+
+ private void add(ObjectList list, int start, int n) {
+ for (int i = 0; i < n; i++) {
+ list.add(start + i);
+ }
+ }
+
+ private void remove(ObjectList list, int n, IntBuffer ids) {
+ int pos = ids.position();
+ for (int i = 0; i < n; i++) {
+ list.remove(ids.get(pos + i));
+ }
+ }
+
+ private void remove(ObjectList list, int n, int[] ids, int ids_offset) {
+ for (int i = 0; i < n; i++) {
+ list.remove(ids[i + ids_offset]);
+ }
+ }
+
+ private void remove(ObjectList list, int start, int n) {
+ for (int i = 0; i < n; i++) {
+ list.remove(start + i);
+ }
+ }
+
+ private ObjectList getList(int which) {
+ ObjectList list = lists[which];
+ if (list == null) {
+ Deleter deleter = null;
+ String name = null;
+ // Figure out which deleter we need
+ switch (which) {
+ case BUFFERS:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteBuffers(1, new int[] { obj }, 0);
+ }
+ };
+ name = "buffer";
+ break;
+ case BUFFERS_ARB:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteBuffersARB(1, new int[] { obj }, 0);
+ }
+ };
+ name = "ARB buffer";
+ break;
+ case FENCES_APPLE:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteFencesAPPLE(1, new int[] { obj }, 0);
+ }
+ };
+ name = "APPLE fence";
+ break;
+ case FENCES_NV:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteFencesNV(1, new int[] { obj }, 0);
+ }
+ };
+ name = "NV fence";
+ break;
+ case FRAGMENT_SHADERS_ATI:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteFragmentShaderATI(obj);
+ }
+ };
+ name = "ATI fragment shader";
+ break;
+ case FRAMEBUFFERS_EXT:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteFramebuffersEXT(1, new int[] { obj }, 0);
+ }
+ };
+ name = "EXT framebuffer";
+ break;
+ case LISTS:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteLists(obj, 1);
+ }
+ };
+ name = "display list";
+ break;
+ case OCCLUSION_QUERIES_NV:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteOcclusionQueriesNV(1, new int[] { obj }, 0);
+ }
+ };
+ name = "NV occlusion query";
+ break;
+ case PROGRAM_AND_SHADER_OBJECTS_ARB:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteObjectARB(obj);
+ }
+ };
+ name = "ARB program or shader object";
+ break;
+ case PROGRAM_OBJECTS:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteProgram(obj);
+ }
+ };
+ name = "program object";
+ break;
+ case PROGRAMS_ARB:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteProgramsARB(1, new int[] { obj }, 0);
+ }
+ };
+ name = "ARB program object";
+ break;
+ case PROGRAMS_NV:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteProgramsNV(1, new int[] { obj }, 0);
+ }
+ };
+ name = "NV program";
+ break;
+ case QUERIES:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteQueries(1, new int[] { obj }, 0);
+ }
+ };
+ name = "query";
+ break;
+ case QUERIES_ARB:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteQueriesARB(1, new int[] { obj }, 0);
+ }
+ };
+ name = "ARB query";
+ break;
+ case RENDERBUFFERS_EXT:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteRenderbuffersEXT(1, new int[] { obj }, 0);
+ }
+ };
+ name = "EXT renderbuffer";
+ break;
+ case SHADER_OBJECTS:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteShader(obj);
+ }
+ };
+ name = "shader object";
+ break;
+ case TEXTURES:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteTextures(1, new int[] { obj }, 0);
+ }
+ };
+ name = "texture";
+ break;
+ case VERTEX_ARRAYS_APPLE:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteVertexArraysAPPLE(1, new int[] { obj }, 0);
+ }
+ };
+ name = "APPLE vertex array";
+ break;
+ case VERTEX_SHADERS_EXT:
+ deleter = new Deleter() {
+ public void delete(GL2 gl, int obj) {
+ gl.glDeleteVertexShaderEXT(obj);
+ }
+ };
+ name = "EXT vertex shader";
+ break;
+ default:
+ throw new InternalError("Unexpected OpenGL object type " + which);
+ }
+
+ list = new ObjectList(deleter);
+ list.setName(name);
+ lists[which] = list;
+ }
+ return list;
+ }
+
+ private void delete(GL2 gl) {
+ for (int i = 0; i < lists.length; i++) {
+ ObjectList list = lists[i];
+ if (list != null) {
+ list.delete(gl);
+ lists[i] = null;
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java b/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java
new file mode 100644
index 000000000..34b5ced6b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/GLUquadricImpl.java
@@ -0,0 +1,1212 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** $Date: 2009-03-04 17:23:34 -0800 (Wed, 04 Mar 2009) $ $Revision: 1856 $
+** $Header$
+*/
+
+/*
+ * Copyright (c) 2002-2004 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.impl.glu;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import com.sun.opengl.util.ImmModeSink;
+import java.nio.*;
+
+/**
+ * GLUquadricImpl.java
+ *
+ *
+ * Created 22-dec-2003 (originally Quadric.java)
+ * @author Erik Duijs
+ * @author Kenneth Russell, Sven Gothel
+ */
+
+public class GLUquadricImpl implements GLUquadric {
+ private boolean useGLSL;
+ private int drawStyle;
+ private int orientation;
+ private boolean textureFlag;
+ private int normals;
+ private boolean immModeSinkEnabled;
+ private boolean immModeSinkImmediate;
+ public int normalType;
+ public GL gl;
+
+ public static final boolean USE_NORM = true;
+ public static final boolean USE_TEXT = false;
+
+ private ImmModeSink immModeSink=null;
+
+ public GLUquadricImpl(GL gl, boolean useGLSL) {
+ this.gl=gl;
+ this.useGLSL = useGLSL;
+ drawStyle = GLU.GLU_FILL;
+ orientation = GLU.GLU_OUTSIDE;
+ textureFlag = false;
+ normals = GLU.GLU_SMOOTH;
+ normalType = gl.isGLES1()?GL.GL_BYTE:GL.GL_FLOAT;
+ immModeSinkImmediate=true;
+ immModeSinkEnabled=!gl.isGL2();
+ replaceImmModeSink();
+ }
+
+ public void enableImmModeSink(boolean val) {
+ if(gl.isGL2()) {
+ immModeSinkEnabled=val;
+ } else {
+ immModeSinkEnabled=true;
+ }
+ if(null==immModeSink && immModeSinkEnabled) {
+ replaceImmModeSink();
+ }
+ }
+
+ public boolean isImmModeSinkEnabled() {
+ return immModeSinkEnabled;
+ }
+
+ public void setImmMode(boolean val) {
+ if(immModeSinkEnabled) {
+ immModeSinkImmediate=val;
+ } else {
+ immModeSinkImmediate=true;
+ }
+ }
+
+ public boolean getImmMode() {
+ return immModeSinkImmediate;
+ }
+
+ public ImmModeSink replaceImmModeSink() {
+ if(!immModeSinkEnabled) return null;
+
+ ImmModeSink res = immModeSink;
+ if(useGLSL) {
+ immModeSink = ImmModeSink.createGLSL (gl, GL.GL_STATIC_DRAW, 32,
+ 3, GL.GL_FLOAT, // vertex
+ 0, GL.GL_FLOAT, // color
+ USE_NORM?3:0, normalType,// normal
+ USE_TEXT?2:0, GL.GL_FLOAT); // texture
+ } else {
+ immModeSink = ImmModeSink.createFixed(gl, GL.GL_STATIC_DRAW, 32,
+ 3, GL.GL_FLOAT, // vertex
+ 0, GL.GL_FLOAT, // color
+ USE_NORM?3:0, normalType,// normal
+ USE_TEXT?2:0, GL.GL_FLOAT); // texture
+ }
+ return res;
+ }
+
+ public void resetImmModeSink(GL gl) {
+ if(immModeSinkEnabled) {
+ immModeSink.reset(gl);
+ }
+ }
+
+ /**
+ * specifies the draw style for quadrics.
+ *
+ * The legal values are as follows:
+ *
+ * GLU.FILL: Quadrics are rendered with polygon primitives. The polygons
+ * are drawn in a counterclockwise fashion with respect to
+ * their normals (as defined with glu.quadricOrientation).
+ *
+ * GLU.LINE: Quadrics are rendered as a set of lines.
+ *
+ * GLU.SILHOUETTE: Quadrics are rendered as a set of lines, except that edges
+ * separating coplanar faces will not be drawn.
+ *
+ * GLU.POINT: Quadrics are rendered as a set of points.
+ *
+ * @param drawStyle The drawStyle to set
+ */
+ public void setDrawStyle(int drawStyle) {
+ this.drawStyle = drawStyle;
+ }
+
+ /**
+ * specifies what kind of normals are desired for quadrics.
+ * The legal values are as follows:
+ *
+ * GLU.NONE: No normals are generated.
+ *
+ * GLU.FLAT: One normal is generated for every facet of a quadric.
+ *
+ * GLU.SMOOTH: One normal is generated for every vertex of a quadric. This
+ * is the default.
+ *
+ * @param normals The normals to set
+ */
+ public void setNormals(int normals) {
+ this.normals = normals;
+ }
+
+ /**
+ * specifies what kind of orientation is desired for.
+ * The orientation values are as follows:
+ *
+ * GLU.OUTSIDE: Quadrics are drawn with normals pointing outward.
+ *
+ * GLU.INSIDE: Normals point inward. The default is GLU.OUTSIDE.
+ *
+ * Note that the interpretation of outward and inward depends on the quadric
+ * being drawn.
+ *
+ * @param orientation The orientation to set
+ */
+ public void setOrientation(int orientation) {
+ this.orientation = orientation;
+ }
+
+ /**
+ * specifies if texture coordinates should be generated for
+ * quadrics rendered with qobj. If the value of textureCoords is true,
+ * then texture coordinates are generated, and if textureCoords is false,
+ * they are not.. The default is false.
+ *
+ * The manner in which texture coordinates are generated depends upon the
+ * specific quadric rendered.
+ *
+ * @param textureFlag The textureFlag to set
+ */
+ public void setTextureFlag(boolean textureFlag) {
+ this.textureFlag = textureFlag;
+ }
+
+ /**
+ * Returns the drawStyle.
+ * @return int
+ */
+ public int getDrawStyle() {
+ return drawStyle;
+ }
+
+ /**
+ * Returns the normals.
+ * @return int
+ */
+ public int getNormals() {
+ return normals;
+ }
+
+ /**
+ * Returns the orientation.
+ * @return int
+ */
+ public int getOrientation() {
+ return orientation;
+ }
+
+ /**
+ * Returns the textureFlag.
+ * @return boolean
+ */
+ public boolean getTextureFlag() {
+ return textureFlag;
+ }
+
+
+ /**
+ * draws a cylinder oriented along the z axis. The base of the
+ * cylinder is placed at z = 0, and the top at z=height. Like a sphere, a
+ * cylinder is subdivided around the z axis into slices, and along the z axis
+ * into stacks.
+ *
+ * Note that if topRadius is set to zero, then this routine will generate a
+ * cone.
+ *
+ * If the orientation is set to GLU.OUTSIDE (with glu.quadricOrientation), then
+ * any generated normals point away from the z axis. Otherwise, they point
+ * toward the z axis.
+ *
+ * If texturing is turned on (with glu.quadricTexture), then texture
+ * coordinates are generated so that t ranges linearly from 0.0 at z = 0 to
+ * 1.0 at z = height, and s ranges from 0.0 at the +y axis, to 0.25 at the +x
+ * axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the
+ * +y axis.
+ *
+ * @param baseRadius Specifies the radius of the cylinder at z = 0.
+ * @param topRadius Specifies the radius of the cylinder at z = height.
+ * @param height Specifies the height of the cylinder.
+ * @param slices Specifies the number of subdivisions around the z axis.
+ * @param stacks Specifies the number of subdivisions along the z axis.
+ */
+ public void drawCylinder(GL gl, float baseRadius, float topRadius, float height, int slices, int stacks) {
+
+ float da, r, dr, dz;
+ float x, y, z, nz, nsign;
+ int i, j;
+
+ if (orientation == GLU.GLU_INSIDE) {
+ nsign = -1.0f;
+ } else {
+ nsign = 1.0f;
+ }
+
+ da = 2.0f * PI / slices;
+ dr = (topRadius - baseRadius) / stacks;
+ dz = height / stacks;
+ nz = (baseRadius - topRadius) / height;
+ // Z component of normal vectors
+
+ if (drawStyle == GLU.GLU_POINT) {
+ glBegin(gl, GL.GL_POINTS);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+
+ z = 0.0f;
+ r = baseRadius;
+ for (j = 0; j <= stacks; j++) {
+ glVertex3f(gl, (x * r), (y * r), z);
+ z += dz;
+ r += dr;
+ }
+ }
+ glEnd(gl);
+ } else if (drawStyle == GLU.GLU_LINE || drawStyle == GLU.GLU_SILHOUETTE) {
+ // Draw rings
+ if (drawStyle == GLU.GLU_LINE) {
+ z = 0.0f;
+ r = baseRadius;
+ for (j = 0; j <= stacks; j++) {
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+ glVertex3f(gl, (x * r), (y * r), z);
+ }
+ glEnd(gl);
+ z += dz;
+ r += dr;
+ }
+ } else {
+ // draw one ring at each end
+ if (baseRadius != 0.0) {
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+ glVertex3f(gl, (x * baseRadius), (y * baseRadius), 0.0f);
+ }
+ glEnd(gl);
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+ glVertex3f(gl, (x * topRadius), (y * topRadius), height);
+ }
+ glEnd(gl);
+ }
+ }
+ // draw length lines
+ glBegin(gl, GL.GL_LINES);
+ for (i = 0; i < slices; i++) {
+ x = cos((i * da));
+ y = sin((i * da));
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+ glVertex3f(gl, (x * baseRadius), (y * baseRadius), 0.0f);
+ glVertex3f(gl, (x * topRadius), (y * topRadius), (height));
+ }
+ glEnd(gl);
+ } else if (drawStyle == GLU.GLU_FILL) {
+ float ds = 1.0f / slices;
+ float dt = 1.0f / stacks;
+ float t = 0.0f;
+ z = 0.0f;
+ r = baseRadius;
+ for (j = 0; j < stacks; j++) {
+ float s = 0.0f;
+ glBegin(gl, immModeSink.GL_QUAD_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (i == slices) {
+ x = sin(0.0f);
+ y = cos(0.0f);
+ } else {
+ x = sin((i * da));
+ y = cos((i * da));
+ }
+ if (nsign == 1.0f) {
+ normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
+ TXTR_COORD(gl, s, t);
+ glVertex3f(gl, (x * r), (y * r), z);
+ normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
+ TXTR_COORD(gl, s, t + dt);
+ glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
+ } else {
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+ TXTR_COORD(gl, s, t);
+ glVertex3f(gl, (x * r), (y * r), z);
+ normal3f(gl, x * nsign, y * nsign, nz * nsign);
+ TXTR_COORD(gl, s, t + dt);
+ glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
+ }
+ s += ds;
+ } // for slices
+ glEnd(gl);
+ r += dr;
+ t += dt;
+ z += dz;
+ } // for stacks
+ }
+ }
+
+ /**
+ * renders a disk on the z = 0 plane. The disk has a radius of
+ * outerRadius, and contains a concentric circular hole with a radius of
+ * innerRadius. If innerRadius is 0, then no hole is generated. The disk is
+ * subdivided around the z axis into slices (like pizza slices), and also
+ * about the z axis into rings (as specified by slices and loops,
+ * respectively).
+ *
+ * With respect to orientation, the +z side of the disk is considered to be
+ * "outside" (see glu.quadricOrientation). This means that if the orientation
+ * is set to GLU.OUTSIDE, then any normals generated point along the +z axis.
+ * Otherwise, they point along the -z axis.
+ *
+ * If texturing is turned on (with glu.quadricTexture), texture coordinates are
+ * generated linearly such that where r=outerRadius, the value at (r, 0, 0) is
+ * (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at
+ * (0, -r, 0) it is (0.5, 0).
+ */
+ public void drawDisk(GL gl, float innerRadius, float outerRadius, int slices, int loops)
+ {
+ float da, dr;
+
+ /* Normal vectors */
+ if (normals != GLU.GLU_NONE) {
+ if (orientation == GLU.GLU_OUTSIDE) {
+ glNormal3f(gl, 0.0f, 0.0f, +1.0f);
+ }
+ else {
+ glNormal3f(gl, 0.0f, 0.0f, -1.0f);
+ }
+ }
+
+ da = 2.0f * PI / slices;
+ dr = (outerRadius - innerRadius) / loops;
+
+ switch (drawStyle) {
+ case GLU.GLU_FILL:
+ {
+ /* texture of a gluDisk is a cut out of the texture unit square
+ * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
+ * (linear mapping)
+ */
+ float dtc = 2.0f * outerRadius;
+ float sa, ca;
+ float r1 = innerRadius;
+ int l;
+ for (l = 0; l < loops; l++) {
+ float r2 = r1 + dr;
+ if (orientation == GLU.GLU_OUTSIDE) {
+ int s;
+ glBegin(gl, immModeSink.GL_QUAD_STRIP);
+ for (s = 0; s <= slices; s++) {
+ float a;
+ if (s == slices)
+ a = 0.0f;
+ else
+ a = s * da;
+ sa = sin(a);
+ ca = cos(a);
+ TXTR_COORD(gl, 0.5f + sa * r2 / dtc, 0.5f + ca * r2 / dtc);
+ glVertex2f(gl, r2 * sa, r2 * ca);
+ TXTR_COORD(gl, 0.5f + sa * r1 / dtc, 0.5f + ca * r1 / dtc);
+ glVertex2f(gl, r1 * sa, r1 * ca);
+ }
+ glEnd(gl);
+ }
+ else {
+ int s;
+ glBegin(gl, immModeSink.GL_QUAD_STRIP);
+ for (s = slices; s >= 0; s--) {
+ float a;
+ if (s == slices)
+ a = 0.0f;
+ else
+ a = s * da;
+ sa = sin(a);
+ ca = cos(a);
+ TXTR_COORD(gl, 0.5f - sa * r2 / dtc, 0.5f + ca * r2 / dtc);
+ glVertex2f(gl, r2 * sa, r2 * ca);
+ TXTR_COORD(gl, 0.5f - sa * r1 / dtc, 0.5f + ca * r1 / dtc);
+ glVertex2f(gl, r1 * sa, r1 * ca);
+ }
+ glEnd(gl);
+ }
+ r1 = r2;
+ }
+ break;
+ }
+ case GLU.GLU_LINE:
+ {
+ int l, s;
+ /* draw loops */
+ for (l = 0; l <= loops; l++) {
+ float r = innerRadius + l * dr;
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (s = 0; s < slices; s++) {
+ float a = s * da;
+ glVertex2f(gl, r * sin(a), r * cos(a));
+ }
+ glEnd(gl);
+ }
+ /* draw spokes */
+ for (s = 0; s < slices; s++) {
+ float a = s * da;
+ float x = sin(a);
+ float y = cos(a);
+ glBegin(gl, GL.GL_LINE_STRIP);
+ for (l = 0; l <= loops; l++) {
+ float r = innerRadius + l * dr;
+ glVertex2f(gl, r * x, r * y);
+ }
+ glEnd(gl);
+ }
+ break;
+ }
+ case GLU.GLU_POINT:
+ {
+ int s;
+ glBegin(gl, GL.GL_POINTS);
+ for (s = 0; s < slices; s++) {
+ float a = s * da;
+ float x = sin(a);
+ float y = cos(a);
+ int l;
+ for (l = 0; l <= loops; l++) {
+ float r = innerRadius * l * dr;
+ glVertex2f(gl, r * x, r * y);
+ }
+ }
+ glEnd(gl);
+ break;
+ }
+ case GLU.GLU_SILHOUETTE:
+ {
+ if (innerRadius != 0.0) {
+ float a;
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (a = 0.0f; a < 2.0 * PI; a += da) {
+ float x = innerRadius * sin(a);
+ float y = innerRadius * cos(a);
+ glVertex2f(gl, x, y);
+ }
+ glEnd(gl);
+ }
+ {
+ float a;
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (a = 0; a < 2.0f * PI; a += da) {
+ float x = outerRadius * sin(a);
+ float y = outerRadius * cos(a);
+ glVertex2f(gl, x, y);
+ }
+ glEnd(gl);
+ }
+ break;
+ }
+ default:
+ return;
+ }
+ }
+
+ /**
+ * renders a partial disk on the z=0 plane. A partial disk is similar to a
+ * full disk, except that only the subset of the disk from startAngle
+ * through startAngle + sweepAngle is included (where 0 degrees is along
+ * the +y axis, 90 degrees along the +x axis, 180 along the -y axis, and
+ * 270 along the -x axis).
+ *
+ * The partial disk has a radius of outerRadius, and contains a concentric
+ * circular hole with a radius of innerRadius. If innerRadius is zero, then
+ * no hole is generated. The partial disk is subdivided around the z axis
+ * into slices (like pizza slices), and also about the z axis into rings
+ * (as specified by slices and loops, respectively).
+ *
+ * With respect to orientation, the +z side of the partial disk is
+ * considered to be outside (see gluQuadricOrientation). This means that if
+ * the orientation is set to GLU.GLU_OUTSIDE, then any normals generated point
+ * along the +z axis. Otherwise, they point along the -z axis.
+ *
+ * If texturing is turned on (with gluQuadricTexture), texture coordinates
+ * are generated linearly such that where r=outerRadius, the value at (r, 0, 0)
+ * is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
+ * and at (0, -r, 0) it is (0.5, 0).
+ */
+ public void drawPartialDisk(GL gl,
+ float innerRadius,
+ float outerRadius,
+ int slices,
+ int loops,
+ float startAngle,
+ float sweepAngle) {
+ int i, j, max;
+ float[] sinCache = new float[CACHE_SIZE];
+ float[] cosCache = new float[CACHE_SIZE];
+ float angle;
+ float x, y;
+ float sintemp, costemp;
+ float deltaRadius;
+ float radiusLow, radiusHigh;
+ float texLow = 0, texHigh = 0;
+ float angleOffset;
+ int slices2;
+ int finish;
+
+ if (slices >= CACHE_SIZE)
+ slices = CACHE_SIZE - 1;
+ if (slices < 2
+ || loops < 1
+ || outerRadius <= 0.0f
+ || innerRadius < 0.0f
+ || innerRadius > outerRadius) {
+ //gluQuadricError(qobj, GLU.GLU_INVALID_VALUE);
+ System.err.println("PartialDisk: GLU_INVALID_VALUE");
+ return;
+ }
+
+ if (sweepAngle < -360.0f)
+ sweepAngle = 360.0f;
+ if (sweepAngle > 360.0f)
+ sweepAngle = 360.0f;
+ if (sweepAngle < 0) {
+ startAngle += sweepAngle;
+ sweepAngle = -sweepAngle;
+ }
+
+ if (sweepAngle == 360.0f) {
+ slices2 = slices;
+ } else {
+ slices2 = slices + 1;
+ }
+
+ /* Compute length (needed for normal calculations) */
+ deltaRadius = outerRadius - innerRadius;
+
+ /* Cache is the vertex locations cache */
+
+ angleOffset = startAngle / 180.0f * PI;
+ for (i = 0; i <= slices; i++) {
+ angle = angleOffset + ((PI * sweepAngle) / 180.0f) * i / slices;
+ sinCache[i] = sin(angle);
+ cosCache[i] = cos(angle);
+ }
+
+ if (sweepAngle == 360.0f) {
+ sinCache[slices] = sinCache[0];
+ cosCache[slices] = cosCache[0];
+ }
+
+ switch (normals) {
+ case GLU.GLU_FLAT :
+ case GLU.GLU_SMOOTH :
+ if (orientation == GLU.GLU_OUTSIDE) {
+ glNormal3f(gl, 0.0f, 0.0f, 1.0f);
+ } else {
+ glNormal3f(gl, 0.0f, 0.0f, -1.0f);
+ }
+ break;
+ default :
+ case GLU.GLU_NONE :
+ break;
+ }
+
+ switch (drawStyle) {
+ case GLU.GLU_FILL :
+ if (innerRadius == .0f) {
+ finish = loops - 1;
+ /* Triangle strip for inner polygons */
+ glBegin(gl, GL.GL_TRIANGLE_FAN);
+ if (textureFlag) {
+ glTexCoord2f(gl, 0.5f, 0.5f);
+ }
+ glVertex3f(gl, 0.0f, 0.0f, 0.0f);
+ radiusLow = outerRadius - deltaRadius * ((float) (loops - 1) / loops);
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ if (orientation == GLU.GLU_OUTSIDE) {
+ for (i = slices; i >= 0; i--) {
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ } else {
+ for (i = 0; i <= slices; i++) {
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ }
+ glEnd(gl);
+ } else {
+ finish = loops;
+ }
+ for (j = 0; j < finish; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ radiusHigh = outerRadius - deltaRadius * ((float) (j + 1) / loops);
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ texHigh = radiusHigh / outerRadius / 2;
+ }
+
+ glBegin(gl, immModeSink.GL_QUAD_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (orientation == GLU.GLU_OUTSIDE) {
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+
+ if (textureFlag) {
+ glTexCoord2f(gl, texHigh * sinCache[i] + 0.5f,
+ texHigh * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusHigh * sinCache[i],
+ radiusHigh * cosCache[i],
+ 0.0f);
+ } else {
+ if (textureFlag) {
+ glTexCoord2f(gl, texHigh * sinCache[i] + 0.5f,
+ texHigh * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusHigh * sinCache[i],
+ radiusHigh * cosCache[i],
+ 0.0f);
+
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ }
+ glEnd(gl);
+ }
+ break;
+ case GLU.GLU_POINT :
+ glBegin(gl, GL.GL_POINTS);
+ for (i = 0; i < slices2; i++) {
+ sintemp = sinCache[i];
+ costemp = cosCache[i];
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
+ }
+ }
+ glEnd(gl);
+ break;
+ case GLU.GLU_LINE :
+ if (innerRadius == outerRadius) {
+ glBegin(gl, GL.GL_LINE_STRIP);
+
+ for (i = 0; i <= slices; i++) {
+ if (textureFlag) {
+ glTexCoord2f(gl, sinCache[i] / 2 + 0.5f, cosCache[i] / 2 + 0.5f);
+ }
+ glVertex3f(gl, innerRadius * sinCache[i], innerRadius * cosCache[i], 0.0f);
+ }
+ glEnd(gl);
+ break;
+ }
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ glBegin(gl, GL.GL_LINE_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ glEnd(gl);
+ }
+ for (i = 0; i < slices2; i++) {
+ sintemp = sinCache[i];
+ costemp = cosCache[i];
+ glBegin(gl, GL.GL_LINE_STRIP);
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
+ }
+ glEnd(gl);
+ }
+ break;
+ case GLU.GLU_SILHOUETTE :
+ if (sweepAngle < 360.0f) {
+ for (i = 0; i <= slices; i += slices) {
+ sintemp = sinCache[i];
+ costemp = cosCache[i];
+ glBegin(gl, GL.GL_LINE_STRIP);
+ for (j = 0; j <= loops; j++) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sintemp, radiusLow * costemp, 0.0f);
+ }
+ glEnd(gl);
+ }
+ }
+ for (j = 0; j <= loops; j += loops) {
+ radiusLow = outerRadius - deltaRadius * ((float) j / loops);
+ if (textureFlag) {
+ texLow = radiusLow / outerRadius / 2;
+ }
+
+ glBegin(gl, GL.GL_LINE_STRIP);
+ for (i = 0; i <= slices; i++) {
+ if (textureFlag) {
+ glTexCoord2f(gl, texLow * sinCache[i] + 0.5f,
+ texLow * cosCache[i] + 0.5f);
+ }
+ glVertex3f(gl, radiusLow * sinCache[i], radiusLow * cosCache[i], 0.0f);
+ }
+ glEnd(gl);
+ if (innerRadius == outerRadius)
+ break;
+ }
+ break;
+ default :
+ break;
+ }
+ }
+
+ /**
+ * draws a sphere of the given radius centered around the origin.
+ * The sphere is subdivided around the z axis into slices and along the z axis
+ * into stacks (similar to lines of longitude and latitude).
+ *
+ * If the orientation is set to GLU.OUTSIDE (with glu.quadricOrientation), then
+ * any normals generated point away from the center of the sphere. Otherwise,
+ * they point toward the center of the sphere.
+
+ * If texturing is turned on (with glu.quadricTexture), then texture
+ * coordinates are generated so that t ranges from 0.0 at z=-radius to 1.0 at
+ * z=radius (t increases linearly along longitudinal lines), and s ranges from
+ * 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75
+ * at the -x axis, and back to 1.0 at the +y axis.
+ */
+ public void drawSphere(GL gl, float radius, int slices, int stacks) {
+ // TODO
+
+ float rho, drho, theta, dtheta;
+ float x, y, z;
+ float s, t, ds, dt;
+ int i, j, imin, imax;
+ boolean normals;
+ float nsign;
+
+ normals = (this.normals != GLU.GLU_NONE);
+
+ if (orientation == GLU.GLU_INSIDE) {
+ nsign = -1.0f;
+ } else {
+ nsign = 1.0f;
+ }
+
+ drho = PI / stacks;
+ dtheta = 2.0f * PI / slices;
+
+ if (drawStyle == GLU.GLU_FILL) {
+ if (!textureFlag) {
+ // draw +Z end as a triangle fan
+ glBegin(gl, GL.GL_TRIANGLE_FAN);
+ glNormal3f(gl, 0.0f, 0.0f, 1.0f);
+ glVertex3f(gl, 0.0f, 0.0f, nsign * radius);
+ for (j = 0; j <= slices; j++) {
+ theta = (j == slices) ? 0.0f : j * dtheta;
+ x = -sin(theta) * sin(drho);
+ y = cos(theta) * sin(drho);
+ z = nsign * cos(drho);
+ if (normals) {
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ }
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ }
+ glEnd(gl);
+ }
+
+ ds = 1.0f / slices;
+ dt = 1.0f / stacks;
+ t = 1.0f; // because loop now runs from 0
+ if (textureFlag) {
+ imin = 0;
+ imax = stacks;
+ } else {
+ imin = 1;
+ imax = stacks - 1;
+ }
+
+ // draw intermediate stacks as quad strips
+ for (i = imin; i < imax; i++) {
+ rho = i * drho;
+ glBegin(gl, immModeSink.GL_QUAD_STRIP);
+ s = 0.0f;
+ for (j = 0; j <= slices; j++) {
+ theta = (j == slices) ? 0.0f : j * dtheta;
+ x = -sin(theta) * sin(rho);
+ y = cos(theta) * sin(rho);
+ z = nsign * cos(rho);
+ if (normals) {
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ }
+ TXTR_COORD(gl, s, t);
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ x = -sin(theta) * sin(rho + drho);
+ y = cos(theta) * sin(rho + drho);
+ z = nsign * cos(rho + drho);
+ if (normals) {
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ }
+ TXTR_COORD(gl, s, t - dt);
+ s += ds;
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ }
+ glEnd(gl);
+ t -= dt;
+ }
+
+ if (!textureFlag) {
+ // draw -Z end as a triangle fan
+ glBegin(gl, GL.GL_TRIANGLE_FAN);
+ glNormal3f(gl, 0.0f, 0.0f, -1.0f);
+ glVertex3f(gl, 0.0f, 0.0f, -radius * nsign);
+ rho = PI - drho;
+ s = 1.0f;
+ for (j = slices; j >= 0; j--) {
+ theta = (j == slices) ? 0.0f : j * dtheta;
+ x = -sin(theta) * sin(rho);
+ y = cos(theta) * sin(rho);
+ z = nsign * cos(rho);
+ if (normals)
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ s -= ds;
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ }
+ glEnd(gl);
+ }
+ } else if (
+ drawStyle == GLU.GLU_LINE
+ || drawStyle == GLU.GLU_SILHOUETTE) {
+ // draw stack lines
+ for (i = 1;
+ i < stacks;
+ i++) { // stack line at i==stacks-1 was missing here
+ rho = i * drho;
+ glBegin(gl, GL.GL_LINE_LOOP);
+ for (j = 0; j < slices; j++) {
+ theta = j * dtheta;
+ x = cos(theta) * sin(rho);
+ y = sin(theta) * sin(rho);
+ z = cos(rho);
+ if (normals)
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ }
+ glEnd(gl);
+ }
+ // draw slice lines
+ for (j = 0; j < slices; j++) {
+ theta = j * dtheta;
+ glBegin(gl, GL.GL_LINE_STRIP);
+ for (i = 0; i <= stacks; i++) {
+ rho = i * drho;
+ x = cos(theta) * sin(rho);
+ y = sin(theta) * sin(rho);
+ z = cos(rho);
+ if (normals)
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ }
+ glEnd(gl);
+ }
+ } else if (drawStyle == GLU.GLU_POINT) {
+ // top and bottom-most points
+ glBegin(gl, GL.GL_POINTS);
+ if (normals)
+ glNormal3f(gl, 0.0f, 0.0f, nsign);
+ glVertex3f(gl, 0.0f, 0.0f, radius);
+ if (normals)
+ glNormal3f(gl, 0.0f, 0.0f, -nsign);
+ glVertex3f(gl, 0.0f, 0.0f, -radius);
+
+ // loop over stacks
+ for (i = 1; i < stacks - 1; i++) {
+ rho = i * drho;
+ for (j = 0; j < slices; j++) {
+ theta = j * dtheta;
+ x = cos(theta) * sin(rho);
+ y = sin(theta) * sin(rho);
+ z = cos(rho);
+ if (normals)
+ glNormal3f(gl, x * nsign, y * nsign, z * nsign);
+ glVertex3f(gl, x * radius, y * radius, z * radius);
+ }
+ }
+ glEnd(gl);
+ }
+ }
+
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static final float PI = (float)Math.PI;
+ private static final int CACHE_SIZE = 240;
+
+ private final void glBegin(GL gl, int mode) {
+ if(immModeSinkEnabled) {
+ immModeSink.glBegin(mode);
+ } else {
+ gl.getGL2().glBegin(mode);
+ }
+ }
+
+ private final void glEnd(GL gl) {
+ if(immModeSinkEnabled) {
+ immModeSink.glEnd(gl, immModeSinkImmediate);
+ } else {
+ gl.getGL2().glEnd();
+ }
+ }
+
+ private final void glVertex2f(GL gl, float x, float y) {
+ if(immModeSinkEnabled) {
+ immModeSink.glVertex2f(x, y);
+ } else {
+ gl.getGL2().glVertex2f(x, y);
+ }
+ }
+
+ private final void glVertex3f(GL gl, float x, float y, float z) {
+ if(immModeSinkEnabled) {
+ immModeSink.glVertex3f(x, y, z);
+ } else {
+ gl.getGL2().glVertex3f(x, y, z);
+ }
+ }
+
+ private final void glNormal3f_s(GL gl, float x, float y, float z) {
+ short a=(short)(x*0xFFFF);
+ short b=(short)(y*0xFFFF);
+ short c=(short)(z*0xFFFF);
+ if(immModeSinkEnabled) {
+ immModeSink.glNormal3s(a, b, c);
+ } else {
+ gl.getGL2().glNormal3s(a, b, c);
+ }
+ }
+
+ private final void glNormal3f_b(GL gl, float x, float y, float z) {
+ byte a=(byte)(x*0xFF);
+ byte b=(byte)(y*0xFF);
+ byte c=(byte)(z*0xFF);
+ if(immModeSinkEnabled) {
+ immModeSink.glNormal3b(a, b, c);
+ } else {
+ gl.getGL2().glNormal3b(a, b, c);
+ }
+ }
+
+ private final void glNormal3f(GL gl, float x, float y, float z) {
+ switch(normalType) {
+ case GL.GL_FLOAT:
+ if(immModeSinkEnabled) {
+ immModeSink.glNormal3f(x,y,z);
+ } else {
+ gl.getGL2().glNormal3f(x,y,z);
+ }
+ break;
+ case GL.GL_SHORT:
+ glNormal3f_s(gl, x, y, z);
+ break;
+ case GL.GL_BYTE:
+ glNormal3f_b(gl, x, y, z);
+ break;
+ }
+ }
+
+ private final void glTexCoord2f(GL gl, float x, float y) {
+ if(immModeSinkEnabled) {
+ immModeSink.glTexCoord2f(x, y);
+ } else {
+ gl.getGL2().glTexCoord2f(x, y);
+ }
+ }
+
+ /**
+ * Call glNormal3f after scaling normal to unit length.
+ *
+ * @param x
+ * @param y
+ * @param z
+ */
+ private void normal3f(GL gl, float x, float y, float z) {
+ float mag;
+
+ mag = (float)Math.sqrt(x * x + y * y + z * z);
+ if (mag > 0.00001F) {
+ x /= mag;
+ y /= mag;
+ z /= mag;
+ }
+ glNormal3f(gl, x, y, z);
+ }
+
+ private final void TXTR_COORD(GL gl, float x, float y) {
+ if (textureFlag) glTexCoord2f(gl, x,y);
+ }
+
+ private float sin(float r) {
+ return (float)Math.sin(r);
+ }
+
+ private float cos(float r) {
+ return (float)Math.cos(r);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/Glue.java b/src/jogl/classes/com/sun/opengl/impl/glu/Glue.java
new file mode 100755
index 000000000..ada5ab684
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/Glue.java
@@ -0,0 +1,114 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Glue {
+ private static String[] __gluNurbsErrors = {
+ " ",
+ "spline order un-supported",
+ "too few knots",
+ "valid knot range is empty",
+ "decreasing knot sequence knot",
+ "knot multiplicity greater than order of spline",
+ "gluEndCurve() must follow gluBeginCurve()",
+ "gluBeginCurve() must precede gluEndCurve()",
+ "missing or extra geometric data",
+ "can't draw piecewise linear trimming curves",
+ "missing or extra domain data",
+ "missing or extra domain data",
+ "gluEndTrim() must precede gluEndSurface()",
+ "gluBeginSurface() must precede gluEndSurface()",
+ "curve of improper type passed as trim curve",
+ "gluBeginSurface() must precede gluBeginTrim()",
+ "gluEndTrim() must follow gluBeginTrim()",
+ "gluBeginTrim() must follow gluEndTrim()",
+ "invalid or missing trim curve",
+ "gluBeginTrim() must precede gluPwlCurve()",
+ "piecewise linear trimming curve referenced twice",
+ "piecewise linear trimming curve and nurbs curve mixed",
+ "improper usage of trim data type",
+ "nurbs curve referenced twice",
+ "nurbs curve and piecewise linear trimming curve mixed",
+ "nurbs surface referenced twice",
+ "invalid property",
+ "gluEndSurface() must follow gluBeginSurface()",
+ "intersecting or misoriented trim curve",
+ "intersecting trim curves",
+ "UNUSED",
+ "inconnected trim curves",
+ "unknown knot error",
+ "negative vertex count encountered",
+ "negative byte-stride encountered",
+ "unknown type descriptor",
+ "null control point reference",
+ "duplicate point on piecewise linear trimming curve"
+ } ;
+
+ /** Creates a new instance of Glue */
+ public Glue() {
+ }
+
+ public static String __gluNURBSErrorString( int errno ) {
+ return( __gluNurbsErrors[ errno ] );
+ }
+
+ private static String[] __gluTessErrors = {
+ " ",
+ "gluTessBeginPolygon() must precede a gluTessEndPolygon",
+ "gluTessBeginContour() must precede a gluTessEndContour()",
+ "gluTessEndPolygon() must follow a gluTessBeginPolygon()",
+ "gluTessEndContour() must follow a gluTessBeginContour()",
+ "a coordinate is too large",
+ "need combine callback"
+ };
+
+ public static String __gluTessErrorString( int errno ) {
+ return( __gluTessErrors[ errno ] );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java b/src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java
new file mode 100644
index 000000000..d24a41f10
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/error/Error.java
@@ -0,0 +1,100 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.error;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.glu.GLU;
+import com.sun.opengl.impl.glu.Glue;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Error {
+
+ private static String[] glErrorStrings = {
+ "invalid enumerant",
+ "invalid value",
+ "invalid operation",
+ "stack overflow",
+ "stack underflow",
+ "out of memory",
+ "invalid framebuffer operation"
+ };
+
+ private static String[] gluErrorStrings = {
+ "invalid enumerant",
+ "invalid value",
+ "out of memory",
+ "",
+ "invalid operation"
+ };
+
+ /** Creates a new instance of Error */
+ public Error() {
+ }
+
+ public static String gluErrorString( int errorCode ) {
+ if( errorCode == 0 ) {
+ return( "no error" );
+ }
+ if( (errorCode >= GL.GL_INVALID_ENUM) && (errorCode <= GL.GL_INVALID_FRAMEBUFFER_OPERATION) ) {
+ return( glErrorStrings[ errorCode - GL.GL_INVALID_ENUM ] );
+ }
+ if( errorCode == 0x8031 /* GL.GL_TABLE_TOO_LARGE */ ) {
+ return( "table too large" );
+ }
+ if( (errorCode >= GLU.GLU_INVALID_ENUM) && (errorCode <= GLU.GLU_INVALID_OPERATION) ) {
+ return( gluErrorStrings[ errorCode - GLU.GLU_INVALID_ENUM ] );
+ }
+// if( (errorCode >= GLU.GLU_NURBS_ERROR1) && (errorCode <= GLU.GLU_NURBS_ERROR37) ) {
+// return( gluErrorStrings[ errorCode - (GLU.GLU_NURBS_ERROR1 - 1) ] );
+// }
+ if( (errorCode >= GLU.GLU_TESS_ERROR1) && (errorCode <= GLU.GLU_TESS_ERROR8) ) {
+ return( Glue.__gluTessErrorString(errorCode - (GLU.GLU_TESS_ERROR1 - 1)) );
+ }
+ return( "error ("+errorCode+")" );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java
new file mode 100755
index 000000000..d54f1c56f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2Backend.java
@@ -0,0 +1,49 @@
+package com.sun.opengl.impl.glu.gl2.nurbs;
+import com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class responsible for rendering
+ * @author Tomas Hrasky
+ *
+ */
+public class GL2Backend extends Backend {
+ public GL2Backend() {
+ super();
+ curveEvaluator = new GL2CurveEvaluator();
+ surfaceEvaluator = new GL2SurfaceEvaluator();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java
new file mode 100755
index 000000000..5be4f9049
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -0,0 +1,205 @@
+package com.sun.opengl.impl.glu.gl2.nurbs;
+import com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import javax.media.opengl.glu.gl2.GLUgl2;
+
+/**
+ * Class rendering curves with OpenGL
+ * @author Tomáš Hráský
+ *
+ */
+class GL2CurveEvaluator implements CurveEvaluator {
+
+ /**
+ * Output triangles (for callback) or render curve
+ */
+ private boolean output_triangles;
+
+ /**
+ * OpenGL object
+ */
+ private GL2 gl;
+
+ /**
+ * Not used
+ */
+ private int vertex_flag;
+
+ /**
+ * Not used
+ */
+ private int normal_flag;
+
+ /**
+ * Not used
+ */
+ private int color_flag;
+
+ /**
+ * Not used
+ */
+ private int texcoord_flag;
+
+ /**
+ * Number of bezier arc - used for color distinguishing of arcs forming NURBS curve
+ */
+ private int poradi;
+
+ /**
+ * Makes new Evaluator
+ */
+ public GL2CurveEvaluator() {
+ gl = GLUgl2.getCurrentGL2();
+ }
+
+ /**
+ * Pushes eval bit
+ */
+ public void bgnmap1f() {
+ // DONE
+ if (output_triangles) {
+ vertex_flag = 0;
+ normal_flag = 0;
+ color_flag = 0;
+ texcoord_flag = 0;
+ } else {
+ gl.glPushAttrib(GL2.GL_EVAL_BIT);
+ }
+
+ }
+
+ /**
+ * Pops all OpenGL attributes
+ */
+ public void endmap1f() {
+ // DONE
+ if (output_triangles) {
+
+ } else {
+ gl.glPopAttrib();
+ }
+
+ }
+
+ /**
+ * Initializes opengl evaluator
+ * @param type curve type
+ * @param ulo lowest u
+ * @param uhi highest u
+ * @param stride control point coords
+ * @param order curve order
+ * @param ps control points
+ */
+ public void map1f(int type, float ulo, float uhi, int stride, int order,
+ CArrayOfFloats ps) {
+ if (output_triangles) {
+ // TODO code for callback (output_triangles probably indicates callback)
+ // System.out.println("TODO curveevaluator.map1f-output_triangles");
+ } else {
+ gl.glMap1f(type, ulo, uhi, stride, order, ps.getArray(), ps
+ .getPointer());
+
+ // DEBUG - drawing bézier control points
+ // gl.glColor3d(.5,.5,.5);
+ // gl.glPointSize(5);
+ // gl.glBegin(GL2.GL_POINTS);
+ // float[] ctrlpoints=ps.getArray();
+ // for(int i=ps.getPointer();i<ps.getPointer()+order;i++){
+ // gl.glVertex3d(ctrlpoints[i * 4], ctrlpoints[i * 4 + 1],0);
+ // }
+ // gl.glEnd();
+ }
+
+ }
+
+ /**
+ * Calls opengl enable
+ * @param type what to enable
+ */
+ public void enable(int type) {
+ // DONE
+ gl.glEnable(type);
+ }
+
+ /**
+ * Calls glMapGrid1f
+ * @param nu steps
+ * @param u1 low u
+ * @param u2 high u
+ */
+ public void mapgrid1f(int nu, float u1, float u2) {
+ if (output_triangles) {
+ // System.out.println("TODO curveevaluator.mapgrid1f");
+ } else
+ gl.glMapGrid1f(nu, u1, u2);
+ // // System.out.println("upravit NU");
+ // gl.glMapGrid1f(50,u1,u2);
+ }
+
+ /**
+ * Evaluates a curve using glEvalMesh1f
+ * @param style Backend.N_MESHFILL/N_MESHLINE/N_MESHPOINT
+ * @param from lowest param
+ * @param to highest param
+ */
+ public void mapmesh1f(int style, int from, int to) {
+ /* //DEBUG drawing control points
+ this.poradi++;
+ if (poradi % 2 == 0)
+ gl.glColor3f(1, 0, 0);
+ else
+ gl.glColor3f(0, 1, 0);
+ */
+ if (output_triangles) {
+ // TODO code for callback
+ // System.out.println("TODO openglcurveevaluator.mapmesh1f output_triangles");
+ } else {
+ switch (style) {
+ case Backend.N_MESHFILL:
+ case Backend.N_MESHLINE:
+ gl.glEvalMesh1(GL2.GL_LINE, from, to);
+ break;
+ case Backend.N_MESHPOINT:
+ gl.glEvalMesh1(GL2.GL_POINT, from, to);
+ break;
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
new file mode 100755
index 000000000..c226b7db9
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -0,0 +1,217 @@
+package com.sun.opengl.impl.glu.gl2.nurbs;
+import com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import javax.media.opengl.glu.gl2.GLUgl2;
+
+/**
+ * Class rendering surfaces with OpenGL
+ * @author Tomas Hrasky
+ *
+ */
+class GL2SurfaceEvaluator implements SurfaceEvaluator {
+
+ /**
+ * JOGL OpenGL object
+ */
+ private GL2 gl;
+
+ /**
+ * Output triangles (callback)
+ */
+ private boolean output_triangles;
+
+ /**
+ * Number of patch - used for distinguishing bezier plates forming NURBS surface with different colors
+ */
+ private int poradi;
+
+ /**
+ * Creates new evaluator
+ */
+ public GL2SurfaceEvaluator() {
+ gl = GLUgl2.getCurrentGL2();
+ }
+
+ /**
+ * Pushes eval bit
+ */
+ public void bgnmap2f() {
+
+ if (output_triangles) {
+ // TODO outp triangles surfaceevaluator bgnmap2f
+ // System.out.println("TODO surfaceevaluator.bgnmap2f output triangles");
+ } else {
+ gl.glPushAttrib(GL2.GL_EVAL_BIT);
+ // System.out.println("TODO surfaceevaluator.bgnmap2f glgetintegerv");
+ }
+
+ }
+
+ /**
+ * Sets glPolygonMode
+ * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
+ */
+ public void polymode(int style) {
+ if (!output_triangles) {
+ switch (style) {
+ default:
+ case NurbsConsts.N_MESHFILL:
+ gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
+ break;
+ case NurbsConsts.N_MESHLINE:
+ gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+ break;
+ case NurbsConsts.N_MESHPOINT:
+ gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_POINT);
+ break;
+ }
+ }
+
+ }
+
+ /**
+ * Pops all attributes
+ */
+ public void endmap2f() {
+ // TODO Auto-generated method stub
+ if (output_triangles) {
+ // System.out.println("TODO surfaceevaluator.endmap2f output triangles");
+ } else {
+ gl.glPopAttrib();
+ // TODO use LOD
+ }
+ }
+
+ /**
+ * Empty method
+ * @param ulo
+ * @param uhi
+ * @param vlo
+ * @param vhi
+ */
+ public void domain2f(float ulo, float uhi, float vlo, float vhi) {
+ // DONE
+ }
+
+ /**
+ * Defines 2D mesh
+ * @param nu number of steps in u direction
+ * @param u0 lowest u
+ * @param u1 highest u
+ * @param nv number of steps in v direction
+ * @param v0 lowest v
+ * @param v1 highest v
+ */
+ public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
+
+ if (output_triangles) {
+ // System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
+ } else {
+ gl.glMapGrid2d(nu, u0, u1, nv, v0, v1);
+ }
+
+ }
+
+ /**
+ * Evaluates surface
+ * @param style surface style
+ * @param umin minimum U
+ * @param umax maximum U
+ * @param vmin minimum V
+ * @param vmax maximum V
+ */
+ public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
+ if (output_triangles) {
+ // System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
+ } else {
+ /* //DEBUG - draw control points
+ this.poradi++;
+ if (poradi % 2 == 0)
+ gl.glColor3f(1, 0, 0);
+ else if (poradi % 2 == 1)
+ gl.glColor3f(0, 1, 0);
+ */
+ switch (style) {
+ case NurbsConsts.N_MESHFILL:
+ gl.glEvalMesh2(GL2.GL_FILL, umin, umax, vmin, vmax);
+ break;
+ case NurbsConsts.N_MESHLINE:
+ gl.glEvalMesh2(GL2.GL_LINE, umin, umax, vmin, vmax);
+ break;
+ case NurbsConsts.N_MESHPOINT:
+ gl.glEvalMesh2(GL2.GL_POINT, umin, umax, vmin, vmax);
+ break;
+ }
+ }
+ }
+
+ /**
+ * Initializes evaluator
+ * @param type surface type
+ * @param ulo lowest u
+ * @param uhi highest u
+ * @param ustride number of objects between control points in u direction
+ * @param uorder surface order in u direction
+ * @param vlo lowest v
+ * @param vhi highest v
+ * @param vstride number of control points' coords
+ * @param vorder surface order in v direction
+ * @param pts control points
+ */
+ public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
+ float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
+ // TODO Auto-generated method stub
+ if (output_triangles) {
+ // System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
+ } else {
+ gl.glMap2f(type, ulo, uhi, ustride, uorder, vlo, vhi, vstride,
+ vorder, pts.getArray(), pts.getPointer());
+ }
+ }
+
+ /**
+ * Calls opengl enable
+ * @param type what to enable
+ */
+ public void enable(int type) {
+ //DONE
+ gl.glEnable(type);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
new file mode 100755
index 000000000..d6c653a73
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -0,0 +1,862 @@
+package com.sun.opengl.impl.glu.gl2.nurbs;
+import com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import java.lang.reflect.Method;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLUnurbs;
+
+/**
+ * Base object for working with NURBS curves and surfaces
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class GLUgl2nurbsImpl implements GLUnurbs {
+
+ /**
+ * Curve type - no type
+ */
+ public static final int CT_NONE = 0;
+
+ /**
+ * Curve type - NURBS curve
+ */
+ public static final int CT_NURBSCURVE = 1;
+
+ /**
+ * Curve type - picewise linear curve
+ */
+ public static final int CT_NPWLCURVE = 2;
+
+ /**
+ * Matrixes autoloading
+ */
+ private boolean autoloadmode;
+
+ /**
+ * Using callback
+ */
+ private int callBackFlag;
+
+ /**
+ * Object for error call backs
+ */
+ private Object errorCallback;
+
+ /**
+ * List of map definitions
+ */
+ Maplist maplist;
+
+ /**
+ * Indicates validity of data
+ */
+ private int isDataValid;
+
+ /**
+ * Are we in the middle of curve processing
+ */
+ private int inCurve;
+
+ /**
+ * Current curve
+ */
+ private O_curve currentCurve;
+
+ /**
+ * Are we in trim
+ */
+ private boolean inTrim;
+
+ /**
+ * Are we playbacking curve/surface rendering
+ */
+ private boolean playBack;
+
+ /**
+ * Next curve in linked list
+ */
+ private O_curve nextCurve;
+
+ /**
+ * Is curve modified
+ */
+ private int isCurveModified;
+
+ /**
+ * Object holding rendering settings
+ */
+ private Renderhints renderhints;
+
+ /**
+ * Display list
+ */
+ private DisplayList dl;
+
+ /**
+ * Object for subdividing curves and surfaces
+ */
+ private Subdivider subdivider;
+
+ /**
+ * Object responsible for rendering
+ */
+ private Backend backend;
+
+ /**
+ * Next picewise linear curve in linked list
+ */
+ private O_pwlcurve nextPwlcurve;
+
+ /**
+ * Next trimming NURBS curve in linked list
+ */
+ private O_nurbscurve nextNurbscurve;
+
+ /**
+ * Are we in the middle of surface processing
+ */
+ private int inSurface;
+
+ /**
+ * Are there any changes in trimming
+ */
+ private boolean isTrimModified;
+
+ /**
+ * Are there any changes in surface data
+ */
+ private boolean isDataSurfaceModified;
+
+ /**
+ * Nurber of trmims of processed surface
+ */
+ private int numTrims;
+
+ /**
+ * Current processed surface
+ */
+ private O_surface currentSurface;
+
+ /**
+ * Next trimming curve
+ */
+ private O_trim nextTrim;
+
+ /**
+ * Nextr surface in linked list
+ */
+ private O_nurbssurface nextNurbssurface;
+
+ /**
+ * Are there any changes in surface
+ */
+ private boolean isSurfaceModified;
+
+ /**
+ * Initializes default GLUgl2nurbs object
+ */
+ public GLUgl2nurbsImpl() {
+ // DONE
+ maplist = new Maplist(backend);
+ renderhints = new Renderhints();
+ subdivider = new Subdivider();
+ // original code
+
+ redefineMaps();
+
+ defineMap(GL2.GL_MAP2_NORMAL, 0, 3);
+ defineMap(GL2.GL_MAP1_NORMAL, 0, 3);
+ defineMap(GL2.GL_MAP2_TEXTURE_COORD_1, 0, 1);
+ defineMap(GL2.GL_MAP1_TEXTURE_COORD_1, 0, 1);
+ defineMap(GL2.GL_MAP2_TEXTURE_COORD_2, 0, 2);
+ defineMap(GL2.GL_MAP1_TEXTURE_COORD_2, 0, 2);
+ defineMap(GL2.GL_MAP2_TEXTURE_COORD_3, 0, 3);
+ defineMap(GL2.GL_MAP1_TEXTURE_COORD_3, 0, 3);
+ defineMap(GL2.GL_MAP2_TEXTURE_COORD_4, 1, 4);
+ defineMap(GL2.GL_MAP1_TEXTURE_COORD_4, 1, 4);
+ defineMap(GL2.GL_MAP2_VERTEX_4, 1, 4);
+ defineMap(GL2.GL_MAP1_VERTEX_4, 1, 4);
+ defineMap(GL2.GL_MAP2_VERTEX_3, 0, 3);
+ defineMap(GL2.GL_MAP1_VERTEX_3, 0, 3);
+ defineMap(GL2.GL_MAP2_COLOR_4, 0, 4);
+ defineMap(GL2.GL_MAP1_COLOR_4, 0, 4);
+ defineMap(GL2.GL_MAP2_INDEX, 0, 1);
+ defineMap(GL2.GL_MAP1_INDEX, 0, 1);
+
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
+ (float) NurbsConsts.N_PATHLENGTH);
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
+ (float) NurbsConsts.N_PATHLENGTH);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
+ (float) NurbsConsts.N_PATHLENGTH);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
+ (float) NurbsConsts.N_PATHLENGTH);
+
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
+ (float) 50.0);
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_PIXEL_TOLERANCE,
+ (float) 50.0);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
+ (float) 50.0);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_PIXEL_TOLERANCE,
+ (float) 50.0);
+
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_ERROR_TOLERANCE,
+ (float) 0.50);
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_ERROR_TOLERANCE,
+ (float) 0.50);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_ERROR_TOLERANCE,
+ (float) 0.50);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_ERROR_TOLERANCE,
+ (float) 0.50);
+
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_S_STEPS,
+ (float) 100.0);
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_S_STEPS,
+ (float) 100.0);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_S_STEPS,
+ (float) 100.0);
+ setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_S_STEPS,
+ (float) 100.0);
+
+ setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
+ NurbsConsts.N_PATHLENGTH);
+
+ set_domain_distance_u_rate(100.0);
+ set_domain_distance_v_rate(100.0);
+ set_is_domain_distance_sampling(0);
+
+ this.autoloadmode = true;
+
+ this.callBackFlag = 0;
+
+ this.errorCallback = null;
+ }
+
+ /**
+ * Sets domain distance for dom.dist. sampling in u direction
+ *
+ * @param d
+ * distance
+ */
+ private void set_domain_distance_u_rate(double d) {
+ // DONE
+ subdivider.set_domain_distance_u_rate(d);
+ }
+
+ /**
+ * Sets domain distance for dom.dist. sampling in v direction
+ *
+ * @param d
+ * distance
+ */
+ private void set_domain_distance_v_rate(double d) {
+ // DONE
+ subdivider.set_domain_distance_v_rate(d);
+ }
+
+ /**
+ * Begins new NURBS curve
+ */
+ public void bgncurve() {
+ // DONE
+ O_curve o_curve = new O_curve();
+ thread("do_bgncurve", o_curve);
+ }
+
+ /**
+ * Calls a method with given name and passes argumet
+ *
+ * @param name
+ * name of a method to be called
+ * @param arg
+ * parameter to be passed to called method
+ */
+ private void thread(String name, Object arg) {
+ // DONE
+ Class partype[] = new Class[1];
+ partype[0] = arg.getClass();
+ Method m;
+ try {
+ m = this.getClass().getMethod(name, partype);
+ if (dl != null) {
+ dl.append(this, m, arg);
+ } else {
+ m.invoke(this, new Object[] { arg });
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * Calls a method with given name
+ *
+ * @param name
+ * name of a method to be called
+ */
+ private void thread2(String name) {
+ // DONE
+ try {
+ Method m = this.getClass().getMethod(name, (Class[]) null);
+ if (dl != null) {
+ dl.append(this, m, null);
+ } else {
+ m.invoke(this, (Object[]) null);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Begins a NURBS curve
+ *
+ * @param o_curve
+ * curve object
+ */
+ public void do_bgncurve(O_curve o_curve) {
+ if (inCurve > 0) {
+ do_nurbserror(6);
+ endcurve();
+ }
+ inCurve = 1;
+ currentCurve = o_curve;
+
+ currentCurve.curvetype = CT_NONE;
+
+ if (inTrim) {
+ if (!nextCurve.equals(o_curve)) {
+ isCurveModified = 1;
+ nextCurve = o_curve;
+ }
+ } else {
+ if (!playBack)
+ bgnrender();
+ isDataValid = 1;
+ }
+ nextCurve = o_curve.next;
+ // kind of solution of union
+ nextPwlcurve = o_curve.o_pwlcurve;
+ nextNurbscurve = o_curve.o_nurbscurve;
+ }
+
+ /**
+ * Begins new surface
+ *
+ * @param o_surface
+ * surface object
+ */
+ public void do_bgnsurface(O_surface o_surface) {
+ // DONE
+ if (inSurface > 0) {
+ do_nurbserror(27);
+ endsurface();
+ }
+ inSurface = 1;
+ if (!playBack)
+ bgnrender();
+
+ isTrimModified = false;
+ isDataSurfaceModified = false;
+ isDataValid = 1;
+ numTrims = 0;
+ currentSurface = o_surface;
+ nextTrim = o_surface.o_trim;
+ nextNurbssurface = o_surface.o_nurbssurface;
+ }
+
+ /**
+ * End a curve
+ */
+ public void endcurve() {
+ // DONE
+ thread2("do_endcurve");
+ }
+
+ /**
+ * Ends surface
+ */
+ public void do_endsurface() {
+ // DONE
+ if (inTrim) {
+ do_nurbserror(12);
+ endtrim();
+ }
+
+ if (inSurface <= 0) {
+ do_nurbserror(13);
+ return;
+ }
+
+ inSurface = 0;
+
+ nextNurbssurface = null;
+
+ if (isDataValid <= 0) {
+ return;
+ }
+
+ if (nextTrim != null) {
+ isTrimModified = true;
+ nextTrim = null;
+ }
+
+ // TODO errval ??
+ if (numTrims > 0) {
+ // System.out.println("TODO glunurbs.do_endsurface - numtrims > 0");
+ }
+
+ subdivider.beginQuilts(new GL2Backend());
+ for (O_nurbssurface n = currentSurface.o_nurbssurface; n != null; n = n.next) {
+ subdivider.addQuilt(n.bezier_patches);
+ }
+ subdivider.endQuilts();
+ subdivider.drawSurfaces();
+ if (!playBack)
+ endrender();
+
+ }
+
+ /**
+ * Ends a curve
+ */
+ public void do_endcurve() {
+ // DONE
+ // // System.out.println("do_endcurve");
+ if (inCurve <= 0) {
+ do_nurbserror(7);
+ return;
+ }
+ inCurve = 0;
+
+ nextCurve = null;
+
+ if (currentCurve.curvetype == CT_NURBSCURVE) {
+ // nextNurbscurve = null;
+ // currentCurve.o_nurbscurve=null;
+ } else {
+ // nextPwlcurve = null;
+ // currentCurve.o_pwlcurve=null;
+ }
+ if (!inTrim) {
+ if (isDataValid <= 0) {
+ return;
+ }
+ // TODO errval?
+ if (currentCurve.curvetype == CT_NURBSCURVE) {
+ subdivider.beginQuilts(new GL2Backend());
+
+ for (O_nurbscurve n = currentCurve.o_nurbscurve; n != null; n = n.next)
+ subdivider.addQuilt(n.bezier_curves);
+
+ subdivider.endQuilts();
+ subdivider.drawCurves();
+ if (!playBack)
+ endrender();
+ } else {
+ if (!playBack)
+ endrender();
+ do_nurbserror(9);
+ }
+ }
+
+ }
+
+ /**
+ * Method for handling error codes
+ *
+ * @param i
+ * error code
+ */
+ private void do_nurbserror(int i) {
+ // TODO nurberror
+ // System.out.println("TODO nurbserror " + i);
+ }
+
+ /**
+ * Begin rendering
+ */
+ private void bgnrender() {
+ // DONE
+ if (autoloadmode) {
+ loadGLMatrices();
+ }
+ }
+
+ /**
+ * Load matrices from OpenGL state machine
+ */
+ private void loadGLMatrices() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO glunurbs.loadGLMatrices");
+ }
+
+ /**
+ * End rendering
+ */
+ private void endrender() {
+ // DONE
+ }
+
+ /**
+ * Make a NURBS curve
+ *
+ * @param nknots
+ * number of knots in knot vector
+ * @param knot
+ * knot vector
+ * @param stride
+ * number of control points coordinates
+ * @param ctlarray
+ * control points
+ * @param order
+ * order of the curve
+ * @param realType
+ * type of the curve
+ */
+ public void nurbscurve(int nknots, float[] knot, int stride,
+ float[] ctlarray, int order, int realType) {
+ // DONE
+ Mapdesc mapdesc = maplist.locate(realType);
+ if (mapdesc == null) {
+ do_nurbserror(35);
+ isDataValid = 0;
+ return;
+ }
+ if (ctlarray == null) {
+ do_nurbserror(36);
+ isDataValid = 0;
+ return;
+ }
+ if (stride < 0) {
+ do_nurbserror(34);
+ isDataValid = 0;
+ return;
+ }
+ Knotvector knots = new Knotvector(nknots, stride, order, knot);
+
+ if (!do_check_knots(knots, "curve"))
+ return;
+
+ O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
+ o_nurbscurve.bezier_curves = new Quilt(mapdesc);
+ CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
+ o_nurbscurve.bezier_curves.toBezier(knots, ctrlcarr, mapdesc
+ .getNCoords());
+ thread("do_nurbscurve", o_nurbscurve);
+ }
+
+ /**
+ * Check knot vector specification
+ *
+ * @param knots
+ * knot vector
+ * @param msg
+ * error message
+ * @return knot vector is / is not valid
+ */
+ public boolean do_check_knots(Knotvector knots, String msg) {
+ // DONE
+ int status = knots.validate();
+ if (status > 0) {
+ do_nurbserror(status);
+ if (renderhints.errorchecking != NurbsConsts.N_NOMSG)
+ knots.show(msg);
+ }
+ return (status > 0) ? false : true;
+ }
+
+ /**
+ * Draw a curve
+ *
+ * @param o_nurbscurve
+ * NURBS curve object
+ */
+ public void do_nurbscurve(O_nurbscurve o_nurbscurve) {
+ // DONE
+
+ if (inCurve <= 0) {
+ bgncurve();
+ inCurve = 2;
+ }
+
+ if (o_nurbscurve.used) {
+ do_nurbserror(23);
+ isDataValid = 0;
+ return;
+ } else
+ o_nurbscurve.used = true;
+
+ if (currentCurve.curvetype == CT_NONE) {
+ currentCurve.curvetype = CT_NURBSCURVE;
+ } else if (currentCurve.curvetype != CT_NURBSCURVE) {
+ do_nurbserror(24);
+ isDataValid = 0;
+ return;
+ }
+
+ // it was necessary to overcome problem with pointer to pointer here
+
+ // if(!o_nurbscurve.equals(nextNurbscurve)){
+ if (!o_nurbscurve.equals(currentCurve.o_nurbscurve)) {
+ isCurveModified = 1;
+ currentCurve.o_nurbscurve = o_nurbscurve;
+ // nextNurbscurve=o_nurbscurve;
+
+ }
+
+ nextNurbscurve = o_nurbscurve.next;
+
+ if (!currentCurve.equals(o_nurbscurve.owner)) {
+ isCurveModified = 1;
+ o_nurbscurve.owner = currentCurve;
+ }
+
+ if (o_nurbscurve.owner == null)
+ isCurveModified = 1;
+
+ if (inCurve == 2)
+ endcurve();
+ }
+
+ /**
+ * Draw NURBS surface
+ *
+ * @param o_nurbssurface
+ * NURBS surface object
+ */
+ public void do_nurbssurface(O_nurbssurface o_nurbssurface) {
+ // DONE
+ if (inSurface <= 0) {
+ bgnsurface();
+ inSurface = 2;
+ }
+ if (o_nurbssurface.used) {
+ do_nurbserror(25);
+ isDataValid = 0;
+ return;
+ } else
+ o_nurbssurface.used = true;
+
+ if (!o_nurbssurface.equals(nextNurbscurve)) {
+ isSurfaceModified = true;
+ // nextNurbssurface=o_nurbssurface;
+ currentSurface.o_nurbssurface = o_nurbssurface;
+ }
+
+ if (!currentSurface.equals(o_nurbssurface.owner)) {
+ isSurfaceModified = true;
+ o_nurbssurface.owner = currentSurface;
+ }
+
+ nextNurbssurface = o_nurbssurface.next;
+
+ if (inSurface == 2)
+ endsurface();
+ }
+
+ /**
+ * (Re)Inicialize maps
+ */
+ public void redefineMaps() {
+ // DONE
+ maplist.initialize();
+ }
+
+ /**
+ * Define a map of given properties
+ *
+ * @param type
+ * map type
+ * @param rational
+ * is rational
+ * @param ncoords
+ * number of control point coordinates
+ */
+ public void defineMap(int type, int rational, int ncoords) {
+ // DONE
+ maplist.define(type, rational, ncoords);
+ }
+
+ /**
+ * Set NURBS property
+ *
+ * @param type
+ * property type
+ * @param tag
+ * property tag
+ * @param value
+ * property value
+ */
+ public void setnurbsproperty(int type, int tag, float value) {
+ // DONE
+ Mapdesc mapdesc = maplist.locate(type);
+ if (mapdesc == null) {
+ do_nurbserror(35);
+ return;
+ }
+ if (!mapdesc.isProperty(tag)) {
+ do_nurbserror(26);
+ return;
+ }
+ Property prop = new Property(type, tag, value);
+ thread("do_setnurbsproperty2", prop);
+ }
+
+ /**
+ * Set parameters of existing property
+ *
+ * @param prop
+ * property
+ */
+ public void do_setnurbsproperty2(Property prop) {
+ Mapdesc mapdesc = maplist.find(prop.type);
+ mapdesc.setProperty(prop.tag, prop.value);
+ }
+
+ /**
+ * Set given property to rendering hints
+ *
+ * @param prop
+ * property to be set
+ */
+ public void do_setnurbsproperty(Property prop) {
+ // DONE
+ renderhints.setProperty(prop);
+ // TODO freeproperty?
+ }
+
+ /**
+ * Sets wheteher we use domain distance sampling
+ *
+ * @param i
+ * domain distance sampling flag
+ */
+ public void set_is_domain_distance_sampling(int i) {
+ // DONE
+ subdivider.set_is_domain_distance_sampling(i);
+ }
+
+ /**
+ * Begin new surface
+ */
+ public void bgnsurface() {
+ // DONE
+ O_surface o_surface = new O_surface();
+ // TODO nuid
+ // System.out.println("TODO glunurbs.bgnsurface nuid");
+ thread("do_bgnsurface", o_surface);
+ }
+
+ /**
+ * End current surface
+ */
+ public void endsurface() {
+ // DONE
+ thread2("do_endsurface");
+ }
+
+ /**
+ * End surface trimming
+ */
+ private void endtrim() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO glunurbs.endtrim");
+ }
+
+ /**
+ * Make NURBS surface
+ *
+ * @param sknot_count
+ * number of knots in s direction
+ * @param sknot
+ * knot vector in s direction
+ * @param tknot_count
+ * number of knots in t direction
+ * @param tknot
+ * knot vector in t direction
+ * @param s_stride
+ * number of coords of control points in s direction
+ * @param t_stride
+ * number of coords of control points in t direction
+ * @param ctlarray
+ * control points
+ * @param sorder
+ * order of curve in s direction
+ * @param torder
+ * order of curve in t direction
+ * @param type
+ * NURBS surface type (rational,...)
+ */
+ public void nurbssurface(int sknot_count, float[] sknot, int tknot_count,
+ float[] tknot, int s_stride, int t_stride, float[] ctlarray,
+ int sorder, int torder, int type) {
+ // DONE
+ Mapdesc mapdesc = maplist.locate(type);
+ if (mapdesc == null) {
+ do_nurbserror(35);
+ isDataValid = 0;
+ return;
+ }
+ if (s_stride < 0 || t_stride < 0) {
+ do_nurbserror(34);
+ isDataValid = 0;
+ return;
+ }
+ Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
+ sknot);
+ if (!do_check_knots(sknotvector, "surface"))
+ return;
+ Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
+ tknot);
+ if (!do_check_knots(tknotvector, "surface"))
+ return;
+
+ O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
+ o_nurbssurface.bezier_patches = new Quilt(mapdesc);
+
+ CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
+ o_nurbssurface.bezier_patches.toBezier(sknotvector, tknotvector,
+ ctrlarr, mapdesc.getNCoords());
+ thread("do_nurbssurface", o_nurbssurface);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java
new file mode 100644
index 000000000..f77f76fc8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/BuildMipmap.java
@@ -0,0 +1,1598 @@
+/*
+ * License Applicability. Except 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
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.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 java.nio.*;
+import java.io.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class BuildMipmap {
+
+ private static final boolean DEBUG = Debug.debug("BuildMipmap");
+ private static final boolean VERBOSE = Debug.verbose();
+
+ /** Creates a new instance of BuildMipmap */
+ public BuildMipmap() {
+ }
+
+ public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
+ int width, int widthPowerOf2, int format, int type, int userLevel,
+ int baseLevel, int maxLevel, ByteBuffer data ) {
+ int newwidth;
+ int level, levels;
+ ShortBuffer newImage = null;
+ int newImage_width;
+ ShortBuffer otherImage = null;
+ ShortBuffer imageTemp = null;
+ int memReq;
+ int maxsize;
+ int cmpts;
+ PixelStorageModes psm = new PixelStorageModes();
+
+ assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
+ assert( width >= 1 );
+
+ newwidth = widthPowerOf2;
+ levels = Mipmap.computeLog( newwidth );
+
+ levels += userLevel;
+
+ Mipmap.retrieveStoreModes( gl, psm );
+ try {
+ newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, 1, format,
+ GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ } catch( OutOfMemoryError ome ) {
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ newImage_width = width;
+
+ Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
+ cmpts = Mipmap.elements_per_group( format, type );
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+
+ // if swap_bytes was set, swapping occurred in fill_image
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+
+ for( level = userLevel; level <= levels; level++ ) {
+ if( newImage_width == newwidth ) {
+ // user newimage for this level
+ if( baseLevel <= level && level <= maxLevel ) {
+ gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, format,
+ GL2.GL_UNSIGNED_SHORT, newImage );
+ }
+ } else {
+ if( otherImage == null ) {
+ memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT );
+ try {
+ otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer();
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ }
+ ScaleInternal.scale_internal( cmpts, newImage_width, 1, newImage, newwidth, 1, otherImage );
+ // swap newImage and otherImage
+ imageTemp = otherImage;
+ otherImage = newImage;
+ newImage = imageTemp;
+
+ newImage_width = newwidth;
+ if( baseLevel <= level && level <= maxLevel ) {
+ gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
+ format, GL2.GL_UNSIGNED_SHORT, newImage );
+ }
+ }
+ if( newwidth > 1 ) {
+ newwidth /= 2;
+ }
+ }
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+
+ return( 0 );
+ }
+
+ public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
+ int width, int height, int format, int type, ByteBuffer data ) {
+ int newwidth[] = new int[1];
+ int newheight[] = new int[1];
+ int level, levels;
+ ShortBuffer newImage = null;
+ int newImage_width;
+ int newImage_height;
+ ShortBuffer otherImage = null;
+ ShortBuffer tempImage = null;
+ int memReq;
+ int maxsize;
+ int cmpts;
+ PixelStorageModes psm = new PixelStorageModes();
+
+ Mipmap.retrieveStoreModes( gl, psm );
+
+ Mipmap.closestFit( gl, target, width, height, internalFormat, format, type, newwidth, newheight );
+
+ levels = Mipmap.computeLog( newwidth[0] );
+ level = Mipmap.computeLog( newheight[0] );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ try {
+ newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size( width, height,
+ format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ } catch( OutOfMemoryError ome ) {
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ newImage_width = width;
+ newImage_height = height;
+
+ Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
+
+ cmpts = Mipmap.elements_per_group( format, type );
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+
+ // if swap_bytes is set, swapping occurred in fill_image
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+
+ for( level = 0; level < levels; level++ ) {
+ if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
+ newImage.rewind();
+ gl.glTexImage2D( target, level, internalFormat, newImage_width,
+ newImage_height, 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+ } else {
+ if( otherImage == null ) {
+ memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT );
+ try {
+ otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq )).asShortBuffer();
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ }
+ ScaleInternal.scale_internal( cmpts, newImage_width, newImage_height,
+ newImage, newwidth[0], newheight[0], otherImage );
+ // swap newImage and otherImage
+ tempImage = otherImage;
+ otherImage = newImage;
+ newImage = tempImage;
+
+ newImage_width = newwidth[0];
+ newImage_height = newheight[0];
+ newImage.rewind();
+ gl.glTexImage2D( target, level, internalFormat, newImage_width, newImage_height,
+ 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+ }
+ if( newheight[0] > 1 ) {
+ newwidth[0] /= 2;
+ }
+ if( newheight[0] > 1 ) {
+ newheight[0] /= 2;
+ }
+ }
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+
+ return( 0 );
+ }
+
+ public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
+ int width, int height, int widthPowerOf2, int heightPowerOf2,
+ int format, int type, int userLevel, int baseLevel, int maxLevel,
+ ByteBuffer data ) { // PointerWrapper data
+ int newwidth;
+ int newheight;
+ int level, levels;
+ int usersImage;
+ ByteBuffer srcImage = null;
+ ByteBuffer dstImage = null;
+ ByteBuffer tempImage = null;
+ int newImage_width;
+ int newImage_height;
+ short[] SWAP_IMAGE = null;
+ int memReq;
+ int maxsize;
+ int cmpts;
+ int mark=-1;
+
+ boolean myswap_bytes;
+ int groups_per_line, element_size, group_size;
+ int rowsize, padding;
+ PixelStorageModes psm = new PixelStorageModes();
+
+ assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
+ assert( width >= 1 && height >= 1 );
+
+ if( type == GL2.GL_BITMAP ) {
+ return( bitmapBuild2DMipmaps( gl, target, internalFormat, width, height, format, type, data ) );
+ }
+
+ newwidth = widthPowerOf2;
+ newheight = heightPowerOf2;
+ levels = Mipmap.computeLog( newwidth );
+ level = Mipmap.computeLog( newheight );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ levels += userLevel;
+
+ Mipmap.retrieveStoreModes( gl, psm );
+ myswap_bytes = psm.getUnpackSwapBytes();
+ cmpts = Mipmap.elements_per_group( format, type );
+ if( psm.getUnpackRowLength() > 0 ) {
+ groups_per_line = psm.getUnpackRowLength();
+ } else {
+ groups_per_line = width;
+ }
+
+ element_size = Mipmap.bytes_per_element( type );
+ group_size = element_size * cmpts;
+ if( element_size == 1 ) {
+ myswap_bytes = false;
+ }
+
+ rowsize = groups_per_line * group_size;
+ padding = ( rowsize % psm.getUnpackAlignment() );
+ if( padding != 0 ) {
+ rowsize += psm.getUnpackAlignment() - padding;
+ }
+
+ mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
+ data.position( mark );
+
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+
+ level = userLevel;
+
+ // already power of two square
+ if( width == newwidth && height == newheight ) {
+ // use usersImage for level userLevel
+ if( baseLevel <= level && level <= maxLevel ) {
+ data.rewind();
+ gl.glTexImage2D( target, level, internalFormat, width, height, 0, format, type, data );
+ }
+ if( levels == 0 ) { /* we're done. clean up and return */
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( 0 );
+ }
+ int nextWidth = newwidth / 2;
+ int nextHeight = newheight / 2;
+
+ // clamp to 1
+ if( nextWidth < 1 ) {
+ nextWidth = 1;
+ }
+ if( nextHeight < 1 ) {
+ nextHeight = 1;
+ }
+ memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
+
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ if( dstImage != null ) {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ HalveImage.halveImage_ubyte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
+ break;
+ case( GL2.GL_BYTE ):
+ HalveImage.halveImage_byte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ HalveImage.halveImage_ushort( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_SHORT ):
+ HalveImage.halveImage_short( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT ):
+ HalveImage.halveImage_uint( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_INT ):
+ HalveImage.halveImage_int( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_FLOAT ):
+ HalveImage.halveImage_float( cmpts, width, height, data, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ assert( format == GL2.GL_RGB );
+ HalveImage.halveImagePackedPixel( 3, new Extract332(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ assert( format == GL2.GL_RGB );
+ HalveImage.halveImagePackedPixel( 3, new Extract233rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ HalveImage.halveImagePackedPixel( 3, new Extract565(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ HalveImage.halveImagePackedPixel( 3, new Extract565rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract4444(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract5551(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract8888(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract1010102(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ default:
+ assert( false );
+ break;
+ }
+ }
+ newwidth = width / 2;
+ newheight = height / 2;
+ // clamp to 1
+ if( newwidth < 1 ) {
+ newwidth = 1;
+ }
+ if( newheight < 1 ) {
+ newheight = 1;
+ }
+
+ myswap_bytes = false;
+ rowsize = newwidth * group_size;
+ memReq = Mipmap.image_size( newwidth, newheight, format, type );
+ // swap srcImage and dstImage
+ tempImage = srcImage;
+ srcImage = dstImage;
+ dstImage = tempImage;
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ // level userLevel+1 is in srcImage; level userLevel already saved
+ level = userLevel + 1;
+ } else { // user's image is not nice powerof2 size square
+ memReq = Mipmap.image_size( newwidth, newheight, format, type );
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ data.position( mark );
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
+ newwidth, newheight, dstImage, element_size, rowsize, group_size );
+ break;
+ case( GL2.GL_BYTE ):
+ ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, group_size );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
+ newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_SHORT ):
+ ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
+ newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT ):
+ ScaleInternal.scale_internal_uint( cmpts, width, height, data, newwidth,
+ newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_INT ):
+ ScaleInternal.scale_internal_int( cmpts, width, height, data, newwidth,
+ newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_FLOAT ):
+ ScaleInternal.scale_internal_float( cmpts, width, height, data, newwidth,
+ newheight, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ ScaleInternal.scaleInternalPackedPixel( 3, new Extract332(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ ScaleInternal.scaleInternalPackedPixel( 3, new Extract233rev(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ ScaleInternal.scaleInternalPackedPixel( 3, new Extract565(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ ScaleInternal.scaleInternalPackedPixel( 3, new Extract565rev(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444rev(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract5551(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract1555rev(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888rev(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract1010102(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ ScaleInternal.scaleInternalPackedPixel( 4, new Extract2101010rev(), width, height, data, newwidth,
+ newheight, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ default:
+ assert( false );
+ break;
+ }
+ myswap_bytes = false;
+ rowsize = newwidth * group_size;
+ // swap dstImage and srcImage
+ tempImage = srcImage;
+ srcImage = dstImage;
+ dstImage = tempImage;
+
+ if( levels != 0 ) { // use as little memory as possible
+ int nextWidth = newwidth / 2;
+ int nextHeight = newheight / 2;
+ if( nextWidth < 1 ) {
+ nextWidth = 1;
+ }
+ if( nextHeight < 1 ) {
+ nextHeight = 1;
+ }
+
+ memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ }
+ // level userLevel is in srcImage; nothing saved yet
+ level = userLevel;
+ }
+
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ if( baseLevel <= level && level <= maxLevel ) {
+ srcImage.rewind();
+ gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
+ if (DEBUG) {
+ System.err.println("GL Error(" + level + "): " + gl.glGetError() );
+ if (VERBOSE) {
+ srcImage.limit( Mipmap.image_size( newwidth, newheight, format, type ) );
+ writeTargaFile("glu2DMipmapJ" + level + ".tga",
+ srcImage, newwidth, newheight);
+ srcImage.clear();
+ }
+ }
+ }
+
+ level++; // update current level for the loop
+ for( ; level <= levels; level++ ) {
+ srcImage.rewind();
+ dstImage.rewind();
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ HalveImage.halveImage_ubyte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
+ break;
+ case( GL2.GL_BYTE ):
+ HalveImage.halveImage_byte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ HalveImage.halveImage_ushort( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_SHORT ):
+ HalveImage.halveImage_short( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT ):
+ HalveImage.halveImage_uint( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_INT ):
+ HalveImage.halveImage_int( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_FLOAT ):
+ HalveImage.halveImage_float( cmpts, newwidth, newheight, srcImage, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ assert( format == GL2.GL_RGB );
+ HalveImage.halveImagePackedPixel( 3, new Extract332(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ assert( format == GL2.GL_RGB );
+ HalveImage.halveImagePackedPixel( 3, new Extract233rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ HalveImage.halveImagePackedPixel( 3, new Extract565(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ HalveImage.halveImagePackedPixel( 3, new Extract565rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract4444(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract5551(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract8888(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ HalveImage.halveImagePackedPixel( 4, new Extract1010102(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
+ break;
+ default:
+ assert( false );
+ break;
+ }
+
+ // swap dstImage and srcImage
+ tempImage = srcImage;
+ srcImage = dstImage;
+ dstImage = tempImage;
+
+ if( newwidth > 1 ) {
+ newwidth /= 2;
+ rowsize /= 2;
+ }
+ if( newheight > 1 ) {
+ newheight /= 2;
+ }
+ // compute amount to pad per row if any
+ int rowPad = rowsize % psm.getUnpackAlignment();
+
+ // should row be padded
+ if( rowPad == 0 ) {
+ // call teximage with srcImage untouched since its not padded
+ if( baseLevel <= level && level <= maxLevel ) {
+ srcImage.rewind();
+ gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
+ if (DEBUG) {
+ System.err.println("GL Error(" + level + "): " + gl.glGetError() );
+ if (VERBOSE) {
+ srcImage.limit( Mipmap.image_size( newwidth, newheight, format, type ) );
+ writeTargaFile("glu2DMipmapJ" + level + ".tga",
+ srcImage, newwidth, newheight);
+ srcImage.clear();
+ }
+ }
+ }
+ } else {
+ // compute length of new row in bytes, including padding
+ int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
+ int ii, jj;
+ int dstTrav;
+ int srcTrav;
+
+ // allocate new image for mipmap of size newRowLength x newheight
+ ByteBuffer newMipmapImage = null;
+ try {
+ newMipmapImage = ByteBuffer.allocateDirect( newRowLength * newheight );
+ } catch( OutOfMemoryError ome ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ srcImage.rewind();
+ // copy image from srcImage into newMipmapImage by rows
+ for( ii = 0; ii < newheight; ii++ ) {
+ newMipmapImage.position(newRowLength * ii);
+ for( jj = 0; jj < rowsize; jj++ ) {
+ newMipmapImage.put( srcImage.get() );
+ }
+ }
+
+ // and use this new image for mipmapping instead
+ if( baseLevel <= level && level <= maxLevel ) {
+ newMipmapImage.rewind();
+ gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, newMipmapImage );
+ if (DEBUG) {
+ System.err.println("GL Error(" + level + " padded): " + gl.glGetError() );
+ if (VERBOSE) {
+ writeTargaFile("glu2DMipmapJ" + level + ".tga",
+ newMipmapImage, newwidth, newheight);
+ }
+ }
+ }
+ }
+ }
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+
+ return( 0 );
+ }
+
+ public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
+ int components, int width, int height, int format, int type, ByteBuffer data ) {
+ int[] newwidth = new int[1];
+ int[] newheight = new int[1];
+ int level, levels;
+ ByteBuffer newImage;
+ int newImage_width;
+ int newImage_height;
+ ByteBuffer otherImage;
+ ByteBuffer imageTemp;
+ int memReq;
+ int maxsize;
+ int cmpts;
+
+ Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
+ newheight );
+
+ levels = Mipmap.computeLog( newwidth[0] );
+ level = Mipmap.computeLog( newheight[0] );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ cmpts = Mipmap.elements_per_group( format, type );
+
+ otherImage = null;
+ // No need to copy the user data if its packed correctly.
+ // Make sure that later routines don't change that data.
+
+ if( psm.getUnpackSkipRows() == 0 && psm.getUnpackSkipPixels() == 0 ) {
+ newImage = data;
+ newImage_width = width;
+ newImage_height = height;
+ } else {
+ int rowsize;
+ int group_per_line;
+ int elements_per_line;
+ int start;
+ int iter;
+ int iter2;
+ int i, j;
+
+ try {
+ newImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.image_size(
+ width, height, format, GL2.GL_UNSIGNED_BYTE ) ));
+ } catch( OutOfMemoryError err ) {
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ newImage_width = width;
+ newImage_height = height;
+
+ // Abbreviated version of fill_image for the restricted case.
+ if( psm.getUnpackRowLength() > 0 ) {
+ group_per_line = psm.getUnpackRowLength();
+ } else {
+ group_per_line = width;
+ }
+ rowsize = group_per_line * cmpts;
+ elements_per_line = width * cmpts;
+ start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * cmpts;
+
+ for( i = 0; i < height; i++ ) {
+ iter = start;
+ data.position( iter );
+ for( j = 0; j < elements_per_line; j++ ) {
+ newImage.put( data.get() );
+ }
+ start += rowsize;
+ }
+ }
+
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+
+ for( level = 0; level <= levels; level++ ) {
+ if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
+ // use newImage for this level
+ newImage.rewind();
+ gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
+ 0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+ } else {
+ if( otherImage == null ) {
+ memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE );
+ try {
+ otherImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ } catch( OutOfMemoryError err ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ }
+ // swap newImage and otherImage
+ imageTemp = otherImage;
+ otherImage = newImage;
+ newImage = imageTemp;
+
+ newImage_width = newwidth[0];
+ newImage_height = newheight[0];
+ newImage.rewind();
+ gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
+ 0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+ }
+ if( newwidth[0] > 1 ) {
+ newwidth[0] /= 2;
+ }
+ if( newheight[0] > 1 ) {
+ newheight[0] /= 2;
+ }
+ }
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+
+ return( 0 );
+ }
+
+ public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
+ int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
+ int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, ByteBuffer data ) {
+ int newWidth;
+ int newHeight;
+ int newDepth;
+ int level, levels;
+ ByteBuffer usersImage;
+ ByteBuffer srcImage, dstImage, tempImage;
+ int newImageWidth;
+ int newImageHeight;
+ int newImageDepth;
+ int memReq;
+ int maxSize;
+ int cmpts;
+ int mark=-1;
+
+ boolean myswapBytes;
+ int groupsPerLine, elementSize, groupSize;
+ int rowsPerImage, imageSize;
+ int rowSize, padding;
+ PixelStorageModes psm = new PixelStorageModes();
+
+ assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
+ assert( width >= 1 && height >= 1 && depth >= 1 );
+ assert( type != GL2.GL_BITMAP );
+
+ srcImage = dstImage = null;
+
+ newWidth = widthPowerOf2;
+ newHeight = heightPowerOf2;
+ newDepth = depthPowerOf2;
+ levels = Mipmap.computeLog( newWidth );
+ level = Mipmap.computeLog( newHeight );
+ if( level > levels ) {
+ levels = level;
+ }
+ level = Mipmap.computeLog( newDepth );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ levels += userLevel;
+
+ Mipmap.retrieveStoreModes3D( gl, psm );
+ myswapBytes = psm.getUnpackSwapBytes();
+ cmpts = Mipmap.elements_per_group( format, type );
+ if( psm.getUnpackRowLength() > 0 ) {
+ groupsPerLine = psm.getUnpackRowLength();
+ } else {
+ groupsPerLine = width;
+ }
+
+ elementSize = Mipmap.bytes_per_element( type );
+ groupSize = elementSize * cmpts;
+ if( elementSize == 1 ) {
+ myswapBytes = false;
+ }
+
+ // 3dstuff
+ if( psm.getUnpackImageHeight() > 0 ) {
+ rowsPerImage = psm.getUnpackImageHeight();
+ } else {
+ rowsPerImage = height;
+ }
+
+ rowSize = groupsPerLine * groupSize;
+ padding = ( rowSize % psm.getUnpackAlignment() );
+ if( padding != 0 ) {
+ rowSize += psm.getUnpackAlignment() - padding;
+ }
+
+ imageSize = rowsPerImage * rowSize;
+
+ usersImage = ByteBuffer.wrap(data.array());
+ mark = psm.getUnpackSkipRows() * rowSize +
+ psm.getUnpackSkipPixels() * groupSize +
+ psm.getUnpackSkipImages() * imageSize;
+ usersImage.position( mark );
+
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
+
+ level = userLevel;
+
+ if( width == newWidth && height == newHeight && depth == newDepth ) {
+ // use usersImage for level userlevel
+ if( baseLevel <= level && level <= maxLevel ) {
+ gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
+ 0, format, type, usersImage );
+ }
+ if( levels == 0 ) { /* we're done. clean up and return */
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ return( 0 );
+ }
+ int nextWidth = newWidth / 2;
+ int nextHeight = newHeight / 2;
+ int nextDepth = newDepth / 2;
+
+ // clamp to one
+ if( nextWidth < 1 ) {
+ nextWidth = 1;
+ }
+ if( nextHeight < 1 ) {
+ nextHeight = 1;
+ }
+ if( nextDepth < 1 ) {
+ nextDepth = 1;
+ }
+ memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError err ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+
+ if( dstImage != null ) {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
+ usersImage, dstImage, elementSize,
+ groupSize, rowSize, imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
+ dstImage, elementSize, rowSize, groupSize );
+ }
+ break;
+ case( GL2.GL_BYTE ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_byte( cmpts, width, height, usersImage,
+ dstImage, elementSize, rowSize, groupSize );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
+ dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_SHORT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_short( cmpts, width, height, usersImage,
+ dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_uint( cmpts, width, height, usersImage,
+ dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_INT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_int( cmpts, width, height, usersImage,
+ dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_FLOAT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_float( cmpts, width, height, usersImage,
+ dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ assert( format == GL2.GL_RGB );
+ HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ assert( format == GL2.GL_RGB );
+ HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ default:
+ assert( false );
+ break;
+ }
+ }
+ newWidth = width / 2;
+ newHeight = height / 2;
+ newDepth = depth / 2;
+ // clamp to 1
+ if( newWidth < 1 ) {
+ newWidth = 1;
+ }
+ if( newHeight < 1 ) {
+ newHeight = 1;
+ }
+ if( newDepth < 1 ) {
+ newDepth = 1;
+ }
+
+ myswapBytes = false;
+ rowSize = newWidth * groupSize;
+ imageSize = rowSize * newHeight;
+ memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
+ // swap srcImage and dstImage
+ tempImage = srcImage;
+ srcImage = dstImage;
+ dstImage = tempImage;
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError err ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+
+ // level userLevel + 1 is in srcImage; level userLevel already saved
+ level = userLevel + 1;
+ } else {
+ memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError err ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+
+ ScaleInternal.gluScaleImage3D( gl, format, width, height, depth, type,
+ usersImage, newWidth, newHeight, newDepth, type, dstImage );
+
+ myswapBytes = false;
+ rowSize = newWidth * groupSize;
+ imageSize = rowSize * newHeight;
+ // swap dstImage and srcImage
+ tempImage = srcImage;
+ srcImage = dstImage;
+ dstImage = tempImage;
+
+ if( levels != 0 ) {
+ int nextWidth = newWidth / 2;
+ int nextHeight = newHeight / 2;
+ int nextDepth = newDepth / 2;
+ if( nextWidth < 1 ) {
+ nextWidth = 1;
+ }
+ if( nextHeight < 1 ) {
+ nextHeight = 1;
+ }
+ if( nextDepth < 1 ) {
+ nextDepth = 1;
+ }
+ memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
+ try {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ case( GL2.GL_BYTE ):
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_INT ):
+ case( GL2.GL_FLOAT ):
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ dstImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( memReq ));
+ break;
+ default:
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ } catch( OutOfMemoryError err ) {
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ }
+ // level userLevel is in srcImage; nothing saved yet
+ level = userLevel;
+ }
+
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+ if( baseLevel <= level && level <= maxLevel ) {
+ usersImage.position( mark );
+ gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
+ 0, format, type, usersImage );
+ }
+ level++;
+ for( ; level <= levels; level++ ) {
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_ubyte( cmpts, width, height, usersImage,
+ dstImage, elementSize, rowSize, groupSize );
+ }
+ break;
+ case( GL2.GL_BYTE ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_byte( cmpts, width, height, usersImage,
+ dstImage, elementSize, rowSize, groupSize );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_ushort( cmpts, width, height, usersImage,
+ dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_SHORT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_short( cmpts, width, height, usersImage,
+ dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_uint( cmpts, width, height, usersImage,
+ dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_INT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_int( cmpts, width, height, usersImage,
+ dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_FLOAT ):
+ if( depth > 1 ) {
+ HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
+ usersImage, dstImage, elementSize, groupSize, rowSize,
+ imageSize, myswapBytes );
+ } else {
+ HalveImage.halveImage_float( cmpts, width, height, usersImage,
+ dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
+ dstImage, elementSize, rowSize, imageSize, myswapBytes );
+ break;
+ default:
+ assert( false );
+ break;
+ }
+
+ tempImage = srcImage;
+ srcImage = dstImage;
+ dstImage = tempImage;
+
+ if( newWidth > 1 ) {
+ newWidth /= 2;
+ rowSize /= 2;
+ }
+ if( newHeight > 1 ) {
+ newHeight /= 2;
+ imageSize = rowSize * newHeight;
+ }
+ if( newDepth > 1 ) {
+ newDepth /= 2;
+ }
+ if( baseLevel <= level && level <= maxLevel ) {
+ usersImage.position( mark );
+ gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
+ 0, format, type, usersImage );
+ }
+ }
+ gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+ gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+ gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+ gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+ gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+ return( 0 );
+ }
+
+ private static final int TARGA_HEADER_SIZE = 18;
+ private static void writeTargaFile(String filename, ByteBuffer data,
+ int width, int height) {
+ try {
+ FileOutputStream fos = new FileOutputStream(new File(filename));
+ ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
+ header.put(0, (byte) 0).put(1, (byte) 0);
+ header.put(2, (byte) 2); // uncompressed type
+ header.put(12, (byte) (width & 0xFF)); // width
+ header.put(13, (byte) (width >> 8)); // width
+ header.put(14, (byte) (height & 0xFF)); // height
+ header.put(15, (byte) (height >> 8)); // height
+ header.put(16, (byte) 24); // pixel size
+ fos.write(header.array());
+ fos.write(data.array());
+ data.clear();
+ fos.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java
new file mode 100644
index 000000000..d5224af74
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract.java
@@ -0,0 +1,56 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public interface Extract {
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents );
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel );
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java
new file mode 100644
index 000000000..fc29b299b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1010102.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract1010102 implements Extract {
+
+ /** Creates a new instance of Extract1010102 */
+ public Extract1010102() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ long uint = 0;
+
+ if( isSwap ) {
+ uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+ } else {
+ uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+ }
+
+ // 11111111,11000000,00000000,00000000 == 0xFFC00000
+ // 00000000,00111111,11110000,00000000 == 0x003F0000
+ // 00000000,00000000,00001111,11111100 == 0x00000FFC
+ // 00000000,00000000,00000000,00000011 == 0x00000003
+
+ extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
+ extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
+ extractComponents[2] = (float)( ( uint & 0x00000FFC ) >> 2 ) / 1023.0f;
+ extractComponents[3] = (float)( ( uint & 0x00000003 ) ) / 3.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) << 22) & 0xFFC00000 );
+ uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) << 12) & 0x003FF000 );
+ uint |= (((int)((shoveComponents[2] * 1023) + 0.5f) << 2) & 0x00000FFC );
+ uint |= (((int)((shoveComponents[3] * 3) + 0.5f) ) & 0x00000003 );
+ packedPixel.asIntBuffer().put( index, (int)uint );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java
new file mode 100644
index 000000000..e1c59041a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract1555rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract1555rev implements Extract {
+
+ /** Creates a new instance of Extract1555rev */
+ public Extract1555rev() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ int ushort = 0;
+
+ if( isSwap ) {
+ ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+ } else {
+ ushort = 0x0000FFFF & packedPixel.getShort();
+ }
+
+ // 00000000,00011111 == 0x001F
+ // 00000011,11100000 == 0x03E0
+ // 01111100,00000000 == 0x7C00
+ // 10000000,00000000 == 0x8000
+
+ extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+ extractComponents[1] = (float)( ( ushort & 0x003E ) >> 5 ) / 31.0f;
+ extractComponents[2] = (float)( ( ushort & 0x7C00 ) >> 10) / 31.0f;
+ extractComponents[3] = (float)( ( ushort & 0x8000 ) >> 15);
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 00000000,00011111 == 0x001F
+ // 00000011,11100000 == 0x03E0
+ // 01111100,00000000 == 0x7C00
+ // 10000000,00000000 == 0x8000
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
+ ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) << 5) & 0x000003E0 );
+ ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 10) & 0x00007C00 );
+ ushort |= (((int)((shoveComponents[3]) + 0.5f) << 15) & 0x00008000 );
+ packedPixel.asShortBuffer().put( index, (short)ushort );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java
new file mode 100644
index 000000000..e04d948d8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract2101010rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract2101010rev implements Extract {
+
+ /** Creates a new instance of Extract2101010 */
+ public Extract2101010rev() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ long uint = 0;
+
+ if( isSwap ) {
+ uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+ } else {
+ uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+ }
+
+ // 11111111,11000000,00000000,00000000 == 0xFFC00000
+ // 00000000,00111111,11110000,00000000 == 0x003F0000
+ // 00000000,00000000,00001111,11111100 == 0x00000FFC
+ // 00000000,00000000,00000000,00000011 == 0x00000003
+
+ extractComponents[0] = (float)( ( uint & 0x000003FF ) ) / 1023.0f;
+ extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
+ extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
+ extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ long uint = (((int)((shoveComponents[0] * 1023) + 0.5f) ) & 0x000003FF );
+ uint |= (((int)((shoveComponents[1] * 1023) + 0.5f) << 10) & 0x000FFC00 );
+ uint |= (((int)((shoveComponents[2] * 1023) + 0.5f) << 20) & 0x3FF00000 );
+ uint |= (((int)((shoveComponents[3] * 3) + 0.5f) << 30) & 0xC0000000 );
+ packedPixel.asIntBuffer().put( index, (int)uint );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java
new file mode 100644
index 000000000..a3d8ce2a8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract233rev.java
@@ -0,0 +1,85 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract233rev implements Extract {
+
+ /** Creates a new instance of Extract223rev */
+ public Extract233rev() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ // 11100000 == 0xe0
+ // 00011100 == 0x1c
+ // 00000011 == 0x03
+ byte ubyte = packedPixel.get();
+ extractComponents[0] = (float)((ubyte & 0x07) ) / 7.0f;
+ extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
+ extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11100000 == 0xE0
+ // 00011100 == 0x1C
+ // 00000011 == 0x03
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) ) & 0x07 );
+ b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 3 ) & 0x38 );
+ b |= (byte)( ( (int)( ( shoveComponents[2] * 3 ) + 0.5f ) << 6 ) & 0xC0 );
+ packedPixel.position( index );
+ packedPixel.put( b );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java
new file mode 100644
index 000000000..008911364
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract332.java
@@ -0,0 +1,84 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract332 implements Extract {
+
+ /** Creates a new instance of Extract332 */
+ public Extract332() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ // 11100000 == 0xe0
+ // 00011100 == 0x1c
+ // 00000011 == 0x03
+ byte ubyte = packedPixel.get();
+ extractComponents[0] = (float)((ubyte & 0xe0) >> 5) / 7.0f;
+ extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
+ extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11100000 == 0xE0
+ // 00011100 == 0x1C
+ // 00000011 == 0x03
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ byte b = (byte)( ( (int)( ( shoveComponents[0] * 7 ) + 0.5f ) << 5 ) & 0xE0 );
+ b |= (byte)( ( (int)( ( shoveComponents[1] * 7 ) + 0.5f ) << 2 ) & 0x1C );
+ b |= (byte)( ( (int)( ( shoveComponents[2] * 3 ) + 0.5f ) ) & 0x03 );
+ packedPixel.put( index, b );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java
new file mode 100644
index 000000000..b7414b184
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444.java
@@ -0,0 +1,96 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract4444 implements Extract {
+
+ /** Creates a new instance of Extract4444 */
+ public Extract4444() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ int ushort = 0;
+
+ if( isSwap ) {
+ ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+ } else {
+ ushort = 0x0000FFFF & packedPixel.getShort();
+ }
+
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+ extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
+ extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
+ extractComponents[3] = (float)( ( ushort & 0x000F ) ) / 15.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) << 12) & 0x0000F000 );
+ ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 8) & 0x00000F00 );
+ ushort |= (((int)((shoveComponents[2] * 15) + 0.5f) << 4) & 0x000000F0 );
+ ushort |= (((int)((shoveComponents[3] * 15) + 0.5f) ) & 0x0000000F );
+ packedPixel.asShortBuffer().put( index, (short)ushort );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java
new file mode 100644
index 000000000..30a2fa1ac
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract4444rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract4444rev implements Extract {
+
+ /** Creates a new instance of Extract4444rev */
+ public Extract4444rev() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ int ushort = 0;
+
+ if( isSwap ) {
+ ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+ } else {
+ ushort = 0x0000FFFF & packedPixel.getShort();
+ }
+
+ // 00000000,00001111 == 0x000F
+ // 00000000,11110000 == 0x00F0
+ // 00001111,00000000 == 0x0F00
+ // 11110000,00000000 == 0xF000
+
+ extractComponents[0] = (float)( ( ushort & 0x000F ) ) / 15.0f;
+ extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4 ) / 15.0f;
+ extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8 ) / 15.0f;
+ extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ int ushort = (((int)((shoveComponents[0] * 15) + 0.5f) ) & 0x0000000F );
+ ushort |= (((int)((shoveComponents[1] * 15) + 0.5f) << 4) & 0x000000F0 );
+ ushort |= (((int)((shoveComponents[2] * 15) + 0.5f) << 8) & 0x00000F00 );
+ ushort |= (((int)((shoveComponents[3] * 15) + 0.5f) << 12) & 0x0000F000 );
+ packedPixel.asShortBuffer().put( index, (short)ushort );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java
new file mode 100644
index 000000000..f9e692e98
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract5551.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract5551 implements Extract {
+
+ /** Creates a new instance of Extract5551 */
+ public Extract5551() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ int ushort = 0;
+
+ if( isSwap ) {
+ ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+ } else {
+ ushort = 0x0000FFFF & packedPixel.getShort();
+ }
+
+ // 11111000,00000000 == 0xF800
+ // 00000111,11000000 == 0x07C0
+ // 00000000,00111110 == 0x003E
+ // 00000000,00000001 == 0x0001
+
+ extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+ extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 6 ) / 31.0f;
+ extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 1 ) / 31.0f;
+ extractComponents[3] = (float)( ( ushort & 0xF000 ) );
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
+ ushort |= (((int)((shoveComponents[1] * 31) + 0.5f) << 6) & 0x000007C0 );
+ ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 1) & 0x0000003E );
+ ushort |= (((int)((shoveComponents[3]) + 0.5f)) & 0x00000001 );
+ packedPixel.asShortBuffer().put( index, (short)ushort );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java
new file mode 100644
index 000000000..5eff68d7e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565.java
@@ -0,0 +1,92 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract565 implements Extract {
+
+ /** Creates a new instance of Extract565 */
+ public Extract565() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ int ushort = 0;
+
+ if( isSwap ) {
+ ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+ } else {
+ ushort = 0x0000FFFF & packedPixel.getShort();
+ }
+
+ // 11111000,00000000 == 0xF800
+ // 00000111,11100000 == 0x07E0
+ // 00000000,00111111 == 0x001F
+
+ extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+ extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+ extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11111000,00000000 == 0xF800
+ // 00000111,11100000 == 0x07E0
+ // 00000000,00111111 == 0x001F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) << 11) & 0x0000F800 );
+ ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
+ ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) ) & 0x0000001F );
+ packedPixel.asShortBuffer().put( index, (short)ushort );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java
new file mode 100644
index 000000000..099f80be5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract565rev.java
@@ -0,0 +1,92 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract565rev implements Extract {
+
+ /** Creates a new instance of Extract565rev */
+ public Extract565rev() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ int ushort = 0;
+
+ if( isSwap ) {
+ ushort = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( packedPixel.getShort() );
+ } else {
+ ushort = 0x0000FFFF & packedPixel.getShort();
+ }
+
+ // 00000000,00011111 == 0x001F
+ // 00000111,11100000 == 0x07E0
+ // 11111000,00000000 == 0xF800
+
+ extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+ extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+ extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 00000000,00111111 == 0x001F
+ // 00000111,11100000 == 0x07E0
+ // 11111000,00000000 == 0xF800
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ int ushort = (((int)((shoveComponents[0] * 31) + 0.5f) ) & 0x0000001F );
+ ushort |= (((int)((shoveComponents[1] * 63) + 0.5f) << 5) & 0x000007E0 );
+ ushort |= (((int)((shoveComponents[2] * 31) + 0.5f) << 11) & 0x0000F800 );
+ packedPixel.asShortBuffer().put( index, (short)ushort );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java
new file mode 100644
index 000000000..f3da73952
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract8888 implements Extract {
+
+ /** Creates a new instance of Extract8888 */
+ public Extract8888() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ long uint = 0;
+
+ if( isSwap ) {
+ uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+ } else {
+ uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+ }
+
+ // 11111000,00000000 == 0xF800
+ // 00000111,11000000 == 0x07C0
+ // 00000000,00111110 == 0x003E
+ // 00000000,00000001 == 0x0001
+
+ extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+ extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+ extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
+ extractComponents[3] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ long uint = (((int)((shoveComponents[0] * 255) + 0.5f) << 24) & 0xFF000000 );
+ uint |= (((int)((shoveComponents[1] * 255) + 0.5f) << 16) & 0x00FF0000 );
+ uint |= (((int)((shoveComponents[2] * 255) + 0.5f) << 8) & 0x0000FF00 );
+ uint |= (((int)((shoveComponents[3] * 255) + 0.5f) ) & 0x000000FF );
+ packedPixel.asIntBuffer().put( index, (int)uint );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java
new file mode 100644
index 000000000..58dbe81f8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Extract8888rev.java
@@ -0,0 +1,97 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Extract8888rev implements Extract {
+
+ /** Creates a new instance of Extract8888rev */
+ public Extract8888rev() {
+ }
+
+ public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+ long uint = 0;
+
+ if( isSwap ) {
+ uint = 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( packedPixel.getInt() );
+ } else {
+ uint = 0x00000000FFFFFFFF & packedPixel.getInt();
+ }
+
+ // 11111000,00000000 == 0xF800
+ // 00000111,11000000 == 0x07C0
+ // 00000000,00111110 == 0x003E
+ // 00000000,00000001 == 0x0001
+
+ extractComponents[0] = (float)( ( uint & 0x000000FF ) ) / 255.0f;
+ extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >> 8 ) / 255.0f;
+ extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+ extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+ }
+
+ public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+ // 11110000,00000000 == 0xF000
+ // 00001111,00000000 == 0x0F00
+ // 00000000,11110000 == 0x00F0
+ // 00000000,00001111 == 0x000F
+
+ assert( 0.0f <= shoveComponents[0] && shoveComponents[0] <= 1.0f );
+ assert( 0.0f <= shoveComponents[1] && shoveComponents[1] <= 1.0f );
+ assert( 0.0f <= shoveComponents[2] && shoveComponents[2] <= 1.0f );
+ assert( 0.0f <= shoveComponents[3] && shoveComponents[3] <= 1.0f );
+
+ // due to limited precision, need to round before shoving
+ long uint = (((int)((shoveComponents[0] * 255) + 0.5f) ) & 0x000000FF );
+ uint |= (((int)((shoveComponents[1] * 255) + 0.5f) << 8) & 0x0000FF00 );
+ uint |= (((int)((shoveComponents[2] * 255) + 0.5f) << 16) & 0x00FF0000 );
+ uint |= (((int)((shoveComponents[3] * 255) + 0.5f) << 24) & 0xFF000000 );
+ packedPixel.asIntBuffer().put( index, (int)uint );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java
new file mode 100644
index 000000000..7d06dfa82
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractFloat.java
@@ -0,0 +1,74 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractFloat implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtractFloat */
+ public ExtractFloat() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer data ) {
+ float f = 0;
+ if( isSwap ) {
+ f = Mipmap.GLU_SWAP_4_BYTES( data.getInt() );
+ } else {
+ f = data.getInt();
+ }
+ assert( f <= 1.0f );
+ return( f );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ assert(0.0 <= value && value < 1.0);
+ data.asFloatBuffer().put( index, (float)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java
new file mode 100644
index 000000000..4cea1aa39
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractPrimitive.java
@@ -0,0 +1,56 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public interface ExtractPrimitive {
+ public double extract( boolean isSwap, ByteBuffer pointer );
+ public void shove( double value, int index, ByteBuffer pointer );
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java
new file mode 100644
index 000000000..a2cfeca94
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSByte.java
@@ -0,0 +1,69 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractSByte implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtractUByte */
+ public ExtractSByte() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer sbyte ) {
+ byte b = sbyte.get();
+ assert( b <= 127 );
+ return( b );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ data.position( index );
+ data.put( (byte)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java
new file mode 100644
index 000000000..48becdc18
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSInt.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractSInt implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtractSInt */
+ public ExtractSInt() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer uint ) {
+ int i = 0;
+ if( isSwap ) {
+ i = Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
+ } else {
+ i = uint.getInt();
+ }
+ assert( i <= 0x7FFFFFFF );
+ return( i );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ assert(0.0 <= value && value < Integer.MAX_VALUE);
+ IntBuffer ib = data.asIntBuffer();
+ ib.position( index );
+ ib.put( (int)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java
new file mode 100644
index 000000000..00ff15119
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractSShort.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractSShort implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtractSShort */
+ public ExtractSShort() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer ushort ) {
+ short s = 0;
+ if( isSwap ) {
+ s = Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
+ } else {
+ s = ushort.getShort();
+ }
+ assert( s <= 32767 );
+ return( s );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ assert(0.0 <= value && value < 32768.0);
+ ShortBuffer sb = data.asShortBuffer();
+ sb.position( index );
+ sb.put( (short)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java
new file mode 100644
index 000000000..4767d93c0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUByte.java
@@ -0,0 +1,70 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.ByteBuffer;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractUByte implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtractUByte */
+ public ExtractUByte() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer ubyte ) {
+ int i = 0x000000FF & ubyte.get();
+ assert( i <= 255 );
+ return( i );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ assert(0.0 <= value && value < 256.0);
+ data.position( index );
+ data.put( (byte)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java
new file mode 100644
index 000000000..e6cd6e183
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUInt.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractUInt implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtractUInt */
+ public ExtractUInt() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer uint ) {
+ long i = 0;
+ if( isSwap ) {
+ i = 0xFFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
+ } else {
+ i = 0xFFFFFFFF & uint.getInt();
+ }
+ assert( i <= 0xFFFFFFFF );
+ return( i );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ assert(0.0 <= value && value < 0xFFFFFFFF);
+ IntBuffer ib = data.asIntBuffer();
+ ib.position( index );
+ ib.put( (int)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java
new file mode 100644
index 000000000..89b42e41b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ExtractUShort.java
@@ -0,0 +1,76 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ExtractUShort implements ExtractPrimitive {
+
+ /** Creates a new instance of ExtracUShort */
+ public ExtractUShort() {
+ }
+
+ public double extract( boolean isSwap, ByteBuffer ushort ) {
+ int i = 0;
+ if( isSwap ) {
+ i = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
+ } else {
+ i = 0x0000FFFF & ushort.getShort();
+ }
+ assert( i <= 65535 );
+ return( i );
+ }
+
+ public void shove( double value, int index, ByteBuffer data ) {
+ assert(0.0 <= value && value < 65536.0);
+ ShortBuffer sb = data.asShortBuffer();
+ sb.position( index );
+ sb.put( (short)value );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java
new file mode 100644
index 000000000..7f2e87a63
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/HalveImage.java
@@ -0,0 +1,1533 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class HalveImage {
+
+ private static final int BOX2 = 2;
+ private static final int BOX4 = 4;
+ private static final int BOX8 = 8;
+
+ public static void halveImage( int components, int width, int height,
+ ShortBuffer datain, ShortBuffer dataout ) {
+ int i, j, k;
+ int newwidth, newheight;
+ int delta;
+ int t = 0;
+ short temp = 0;
+
+ newwidth = width / 2;
+ newheight = height /2;
+ delta = width * components;
+
+ // Piece of cake
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = datain.get();
+ datain.position( t + components );
+ temp += datain.get();
+ datain.position( t + delta );
+ temp += datain.get();
+ datain.position( t + delta + components );
+ temp +=datain.get();
+ temp += 2;
+ temp /= 4;
+ dataout.put( temp );
+ t++;
+ }
+ t += components;
+ }
+ t += delta;
+ }
+ }
+
+ public static void halveImage_ubyte( int components, int width, int height,
+ ByteBuffer datain, ByteBuffer dataout,
+ int element_size, int ysize, int group_size ) {
+ int i, j, k;
+ int newwidth, newheight;
+ int s;
+ int t;
+
+ // Handle case where there is only 1 column/row
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+ halve1Dimage_ubyte( components, width, height, datain, dataout, element_size, ysize, group_size );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+ s = 0;
+ t = 0;
+
+ int temp = 0;
+ // piece of cake
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = ( 0x000000FF & datain.get() );
+ datain.position( t + group_size );
+ temp += ( 0x000000FF & datain.get() );
+ datain.position( t + ysize );
+ temp += ( 0x000000FF & datain.get() );
+ datain.position( t + ysize + group_size );
+ temp += ( 0x000000FF & datain.get() ) + 2;
+ dataout.put( (byte)(temp / 4) );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+
+ public static void halve1Dimage_ubyte( int components, int width, int height,
+ ByteBuffer datain, ByteBuffer dataout,
+ int element_size, int ysize, int group_size ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+ int temp = 0;
+
+ assert( width == 1 || height == 1 ); // Must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // widthxheight can't be 1x1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ datain.position( src );
+ temp = ( 0x000000FF & datain.get() );
+ datain.position( src + group_size );
+ temp += ( 0x000000FF & datain.get() );
+ temp /= 2;
+ dataout.put( (byte)temp );
+ /*
+ dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
+ (0x000000FF & datain.setIndexInBytes( src + group_size ).getByte())) / 2 ) );
+ */
+ src += element_size;
+ //dataout.plusPlus();
+ dest++;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assertion only
+ } else if( width == 1 ) { // 1 column
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 );
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ datain.position( src );
+ temp = ( 0x000000FF & datain.get() );
+ datain.position( src + ysize );
+ temp += ( 0x000000FF & datain.get() );
+ temp /= 2;
+ dataout.put( (byte)temp );
+ /*
+ dataout.setByte( (byte)(((0x000000FF & datain.setIndexInBytes(src).getByte()) +
+ (0x000000FF & datain.setIndexInBytes(src + ysize).getByte()) ) / 2 ) );
+ */
+ src += element_size;
+ //dataout.plusPlus();
+ dest++;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ }
+ assert( src == ysize * height );
+ assert( dest == components * element_size * halfWidth * halfHeight );
+ }
+
+ public static void halveImage_byte( int components, int width, int height,
+ ByteBuffer datain, ByteBuffer dataout, int element_size,
+ int ysize, int group_size ) {
+ int i, j, k;
+ int newwidth, newheight;
+ int s = 0;
+ int t = 0;
+ byte temp = (byte)0;
+
+ // handle case where there is only 1 column
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) );
+ halve1Dimage_byte( components, width, height, datain, dataout, element_size,
+ ysize, group_size );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = datain.get();
+ datain.position( t + group_size );
+ temp += datain.get();
+ datain.position( t + ysize );
+ temp += datain.get();
+ datain.position( t + ysize + group_size );
+ temp += datain.get();
+ temp += 2;
+ temp /= 4;
+ dataout.put( temp );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+
+ public static void halve1Dimage_byte( int components, int width, int height,
+ ByteBuffer datain, ByteBuffer dataout,
+ int element_size, int ysize, int group_size ) {
+ int halfWidth = width / 2;
+ int halfHeight = width / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+ byte temp = (byte)0;
+
+ assert( width == 1 || height == 1 ); // must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // widthxheight can't be 1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ datain.position( src );
+ temp = datain.get();
+ datain.position( src + group_size );
+ temp += datain.get();
+ temp /= 2;
+ dataout.put( temp );
+ src += element_size;
+ dest++;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assert only
+ } else if( width == 1 ) { // 1 column
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 ); // widthxheight can't be 1
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ datain.position( src );
+ temp = datain.get();
+ datain.position( src + ysize );
+ temp += datain.get();
+ temp /= 2;
+ src += element_size;
+ dest++;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ assert( src == ysize * height );
+ }
+ assert( dest == components * element_size * halfWidth * halfHeight );
+ }
+
+ public static void halveImage_ushort( int components, int width, int height,
+ ByteBuffer datain, ShortBuffer dataout, int element_size,
+ int ysize, int group_size, boolean myswap_bytes ) {
+ int i, j, k, l;
+ int newwidth, newheight;
+ int s = 0;
+ int t = 0;
+ int temp = 0;
+ // handle case where there is only 1 column/row
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+ halve1Dimage_ushort( components, width, height, datain, dataout, element_size,
+ ysize, group_size, myswap_bytes );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+
+ // Piece of cake
+ if( !myswap_bytes ) {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = ( 0x0000FFFF & datain.getShort() );
+ datain.position( t + group_size );
+ temp += ( 0x0000FFFF & datain.getShort() );
+ datain.position( t + ysize );
+ temp += ( 0x0000FFFF & datain.getShort() );
+ datain.position( t + ysize + group_size );
+ temp += ( 0x0000FFFF & datain.getShort() );
+ dataout.put( (short)( ( temp + 2 ) / 4 ) );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ } else {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ datain.position( t + group_size );
+ temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ datain.position( t + ysize );
+ temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ datain.position( t + ysize + group_size );
+ temp += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ dataout.put( (short)( ( temp + 2 ) / 4 ) );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+ }
+
+ public static void halve1Dimage_ushort( int components, int width, int height,
+ ByteBuffer datain, ShortBuffer dataout, int element_size,
+ int ysize, int group_size, boolean myswap_bytes ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+
+ assert( width == 1 || height == 1 ); // must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // widthxheight can't be 1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < halfHeight; kk++ ) {
+ int[] ushort = new int[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ datain.position( src + group_size );
+ ushort[1] = (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ } else {
+ datain.position( src );
+ ushort[0] = (0x0000FFFF & datain.getShort() );
+ datain.position( src + group_size );
+ ushort[1] = (0x0000FFFF & datain.getShort() );
+ }
+ dataout.put( (short)( (ushort[0] + ushort[1]) / 2 ) );
+ src += element_size;
+ dest += 2;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assertion only
+ } else if( width == 1 ) { // 1 column
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 ); // widthxheight can't be 1
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ int[] ushort = new int[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ datain.position( src + ysize );
+ ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
+ } else {
+ datain.position( src );
+ ushort[0] = ( 0x0000FFFF & datain.getShort() );
+ datain.position( src + ysize );
+ ushort[1] = ( 0x0000FFFF & datain.getShort() );
+ }
+ dataout.put( (short)((ushort[0] + ushort[1]) / 2) );
+ src += element_size;
+ dest += 2;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ assert( src == ysize * height );
+ }
+ assert( dest == components * element_size * halfWidth * halfHeight );
+ }
+
+ public static void halveImage_short( int components, int width, int height,
+ ByteBuffer datain, ShortBuffer dataout, int element_size,
+ int ysize, int group_size, boolean myswap_bytes ) {
+ int i, j, k, l;
+ int newwidth, newheight;
+ int s = 0;
+ int t = 0;
+ short temp = (short)0;
+ // handle case where there is only 1 column/row
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+ halve1Dimage_short( components, width, height, datain, dataout, element_size,
+ ysize, group_size, myswap_bytes );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+
+ // Piece of cake
+ if( !myswap_bytes ) {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = datain.getShort();
+ datain.position( t + group_size );
+ temp += datain.getShort();
+ datain.position( t + ysize );
+ temp += datain.getShort();
+ datain.position( t + ysize + group_size );
+ temp += datain.getShort();
+ temp += 2;
+ temp /= 4;
+ dataout.put( (short)temp );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ } else {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ short b;
+ int buf;
+ datain.position( t );
+ temp = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ datain.position( t + group_size );
+ temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ datain.position( t + ysize );
+ temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ datain.position( t + ysize + group_size );
+ temp += Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ temp += 2;
+ temp /= 4;
+ dataout.put( temp );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+ }
+
+ public static void halve1Dimage_short( int components, int width, int height,
+ ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+
+ assert( width == 1 || height == 1 ); // must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // can't be 1x1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ short[] sshort = new short[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ datain.position( src + group_size );
+ sshort[1] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ } else {
+ datain.position( src );
+ sshort[0] = datain.getShort();
+ datain.position( src + group_size );
+ sshort[1] = datain.getShort();
+ }
+ dataout.put( (short)(( sshort[0] + sshort[1] ) / 2) );
+ src += element_size;
+ dest += 2;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assertion only
+ } else if( width == 1 ) {
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 );
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ short[] sshort = new short[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ datain.position( src + ysize );
+ sshort[1] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ } else {
+ datain.position( src );
+ sshort[0] = datain.getShort();
+ datain.position( src + ysize );
+ sshort[1] = datain.getShort();
+ }
+ dataout.put( (short)(( sshort[0] + sshort[1] ) / 2) );
+ src += element_size;
+ dest += 2;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ assert( src == ysize * height );
+ }
+ assert( dest == ( components * element_size * halfWidth * halfHeight ) );
+ }
+
+ public static void halveImage_uint( int components, int width, int height,
+ ByteBuffer datain, IntBuffer dataout, int element_size,
+ int ysize, int group_size, boolean myswap_bytes ) {
+ int i, j, k, l;
+ int newwidth, newheight;
+ int s = 0;
+ int t = 0;
+ double temp = 0;
+
+ // handle case where there is only 1 column/row
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+ halve1Dimage_uint( components, width, height, datain, dataout, element_size,
+ ysize, group_size, myswap_bytes );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+
+ // Piece of cake
+ if( !myswap_bytes ) {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = (0x000000007FFFFFFFL & datain.getInt() );
+ datain.position( t + group_size );
+ temp += (0x000000007FFFFFFFL & datain.getInt() );
+ datain.position( t + ysize );
+ temp += (0x000000007FFFFFFFL & datain.getInt() );
+ datain.position( t + ysize + group_size );
+ temp += (0x000000007FFFFFFFL & datain.getInt() );
+ dataout.put( (int)( ( temp / 4 ) + 0.5 ) );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ } else {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ // need to cast to double to hold large unsigned ints
+ double buf;
+ datain.position( t );
+ buf = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( t + group_size );
+ buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( t + ysize );
+ buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( t + ysize + group_size );
+ buf += ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ temp /= 4;
+ temp += 0.5;
+ dataout.put( (int)temp );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+ }
+
+ public static void halve1Dimage_uint( int components, int width, int height,
+ ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+
+ assert( width == 1 || height == 1 ); // must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // widthxheight can't be 1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < halfHeight; kk++ ) {
+ long[] uint = new long[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( src + group_size );
+ uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ } else {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ datain.position( src + group_size );
+ uint[1] = (0x00000000FFFFFFFF & datain.getInt() );
+ }
+ dataout.put( (int)( ( uint[0] + uint[1] ) / 2.0 ) );
+ src += element_size;
+ dest += 4;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assertion only
+ } else if( width == 1 ) { // 1 column
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 ); // widthxheight can't be 1
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ long[] uint = new long[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( src + group_size );
+ uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ } else {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ datain.position( src + ysize );
+ uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ }
+ dataout.put( (int)( ( uint[0] + uint[1] ) / 2.0 ) );
+ src += element_size;
+ dest += 4;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ assert( src == ysize * height );
+ }
+ assert( dest == components * element_size * halfWidth * halfHeight );
+ }
+
+ public static void halveImage_int( int components, int width, int height,
+ ByteBuffer datain, IntBuffer dataout, int element_size,
+ int ysize, int group_size, boolean myswap_bytes ) {
+ int i, j, k, l;
+ int newwidth, newheight;
+ int s = 0;
+ int t = 0;
+ int temp = 0;
+
+ // handle case where there is only 1 column/row
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+ halve1Dimage_int( components, width, height, datain, dataout, element_size,
+ ysize, group_size, myswap_bytes );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+
+ // Piece of cake
+ if( !myswap_bytes ) {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = datain.getInt();
+ datain.position( t + group_size );
+ temp += datain.getInt();
+ datain.position( t + ysize );
+ temp += datain.getInt();
+ datain.position( t + ysize + group_size );
+ temp += datain.getInt();
+ temp = (int)( ( temp / 4.0f ) + 0.5f );
+ dataout.put( temp );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ } else {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ long b;
+ float buf;
+ datain.position( t );
+ b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ buf = b;
+ datain.position( t + group_size );
+ b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ buf += b;
+ datain.position( t + ysize );
+ b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ buf += b;
+ datain.position( t + ysize + group_size );
+ b = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ buf += b;
+ dataout.put( (int)( ( buf / 4.0f ) + 0.5f ) );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+ }
+
+ public static void halve1Dimage_int( int components, int width, int height,
+ ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+
+ assert( width == 1 || height == 1 ); // must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // can't be 1x1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ long[] uint = new long[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( src + group_size );
+ uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ } else {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ datain.position( src + group_size );
+ uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ }
+ dataout.put( (int)( ( (float)uint[0] + (float)uint[1] ) / 2.0f) );
+ src += element_size;
+ dest += 4;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assertion only
+ } else if( width == 1 ) {
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 );
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ long[] uint = new long[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ datain.position( src + ysize );
+ uint[1] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
+ } else {
+ datain.position( src );
+ uint[0] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ datain.position( src + ysize );
+ uint[1] = ( 0x00000000FFFFFFFF & datain.getInt() );
+ }
+ dataout.put( (int)(( (float)uint[0] + (float)uint[1] ) / 2.0f) );
+ src += element_size;
+ dest += 4;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ assert( src == ysize * height );
+ }
+ assert( dest == ( components * element_size * halfWidth * halfHeight ) );
+ }
+
+ public static void halveImage_float( int components, int width, int height,
+ ByteBuffer datain, FloatBuffer dataout, int element_size,
+ int ysize, int group_size, boolean myswap_bytes ) {
+ int i, j, k, l;
+ int newwidth, newheight;
+ int s = 0;
+ int t = 0;
+ float temp = 0.0f;
+ // handle case where there is only 1 column/row
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) ); // can't be 1x1
+ halve1Dimage_float( components, width, height, datain, dataout, element_size,
+ ysize, group_size, myswap_bytes );
+ return;
+ }
+
+ newwidth = width / 2;
+ newheight = height / 2;
+
+ // Piece of cake
+ if( !myswap_bytes ) {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ datain.position( t );
+ temp = datain.getFloat();
+ datain.position( t + group_size );
+ temp += datain.getFloat();
+ datain.position( t + ysize );
+ temp += datain.getFloat();
+ datain.position( t + ysize + group_size );
+ temp /= 4.0f;
+ dataout.put( temp );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ } else {
+ for( i = 0; i < newheight; i++ ) {
+ for( j = 0; j < newwidth; j++ ) {
+ for( k = 0; k < components; k++ ) {
+ float buf;
+ datain.position( t );
+ buf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ datain.position( t + group_size );
+ buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ datain.position( t + ysize );
+ buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ datain.position( t + ysize + group_size );
+ buf += Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ dataout.put( buf / 4.0f );
+ t += element_size;
+ }
+ t += group_size;
+ }
+ t += ysize;
+ }
+ }
+ }
+
+ public static void halve1Dimage_float( int components, int width, int height,
+ ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int dest = 0;
+ int jj;
+
+ assert( width == 1 || height == 1 ); // must be 1D
+ assert( width != height ); // can't be square
+
+ if( height == 1 ) { // 1 row
+ assert( width != 1 ); // can't be 1x1
+ halfHeight = 1;
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ float[] sfloat = new float[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ datain.position( src + group_size );
+ sfloat[1] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ } else {
+ datain.position( src );
+ sfloat[0] = datain.getFloat();
+ datain.position( src + group_size );
+ sfloat[1] = datain.getFloat();
+ }
+ dataout.put( (sfloat[0] + sfloat[1]) / 2.0f );
+ src += element_size;
+ dest += 4;
+ }
+ src += group_size; // skip to next 2
+ }
+ int padBytes = ysize - ( width * group_size );
+ src += padBytes; // for assertion only
+ } else if( width == 1 ) {
+ int padBytes = ysize - ( width * group_size );
+ assert( height != 1 );
+ halfWidth = 1;
+ // one vertical column with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int kk;
+ for( kk = 0; kk < components; kk++ ) {
+ float[] sfloat = new float[BOX2];
+ if( myswap_bytes ) {
+ datain.position( src );
+ sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ datain.position( src + ysize );
+ sfloat[1] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ } else {
+ datain.position( src );
+ sfloat[0] = datain.getFloat();
+ datain.position( src + ysize );
+ sfloat[1] = datain.getFloat();
+ }
+ dataout.put( ( sfloat[0] + sfloat[1] ) / 2.0f );
+ src += element_size;
+ dest += 4;
+ }
+ src += padBytes; // add pad bytes, if any, to get to end of row
+ src += ysize;
+ }
+ assert( src == ysize * height );
+ }
+ assert( dest == ( components * element_size * halfWidth * halfHeight ) );
+ }
+
+ public static void halveImagePackedPixel( int components, Extract extract, int width,
+ int height, ByteBuffer datain, ByteBuffer dataout,
+ int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+ if( width == 1 || height == 1 ) {
+ assert( !( width == 1 && height == 1 ) );
+ halve1DimagePackedPixel( components, extract, width, height, datain, dataout,
+ pixelSizeInBytes, rowSizeInBytes, isSwap );
+ return;
+ }
+ int ii, jj;
+
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ int outIndex = 0;
+
+ for( ii = 0; ii < halfHeight; ii++ ) {
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ float totals[] = new float[4];
+ float extractTotals[][] = new float[BOX4][4];
+ int cc;
+
+ datain.position( src );
+ extract.extract( isSwap, datain, extractTotals[0] );
+ datain.position( src + pixelSizeInBytes );
+ extract.extract( isSwap, datain, extractTotals[1] );
+ datain.position( src + rowSizeInBytes );
+ extract.extract( isSwap, datain, extractTotals[2] );
+ datain.position( src + rowSizeInBytes + pixelSizeInBytes );
+ extract.extract( isSwap, datain, extractTotals[3] );
+ for( cc = 0; cc < components; cc++ ) {
+ int kk = 0;
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ for( kk = 0; kk < BOX4; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= BOX4;
+ }
+ extract.shove( totals, outIndex, dataout );
+ outIndex++;
+ src += pixelSizeInBytes + pixelSizeInBytes;
+ }
+ // skip past pad bytes, if any, to get to next row
+ src += padBytes;
+ src += rowSizeInBytes;
+ }
+ assert( src == rowSizeInBytes * height );
+ assert( outIndex == halfWidth * halfHeight );
+ }
+
+ public static void halve1DimagePackedPixel( int components, Extract extract, int width,
+ int height, ByteBuffer datain, ByteBuffer dataout,
+ int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int src = 0;
+ int jj;
+
+ assert( width == 1 || height == 1 );
+ assert( width != height );
+
+ if( height == 1 ) {
+ int outIndex = 0;
+
+ assert( width != 1 );
+ halfHeight = 1;
+
+ // one horizontal row with possible pad bytes
+
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ float[] totals = new float[4];
+ float[][] extractTotals = new float[BOX2][4];
+ int cc;
+
+ datain.position( src );
+ extract.extract( isSwap, datain, extractTotals[0] );
+ datain.position( src + pixelSizeInBytes );
+ extract.extract( isSwap, datain, extractTotals[1] );
+ for( cc = 0; cc < components; cc++ ) {
+ int kk = 0;
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ for( kk = 0; kk < BOX2; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= BOX2;
+ }
+ extract.shove( totals, outIndex, dataout );
+ outIndex++;
+ // skip over to next group of 2
+ src += pixelSizeInBytes + pixelSizeInBytes;
+ }
+ int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ src += padBytes;
+
+ assert( src == rowSizeInBytes );
+ assert( outIndex == halfWidth * halfHeight );
+ } else if( width == 1 ) {
+ int outIndex = 0;
+
+ assert( height != 1 );
+ halfWidth = 1;
+ // one vertical volumn with possible pad bytes per row
+ // average two at a time
+
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ float[] totals = new float[4];
+ float[][] extractTotals = new float[BOX2][4];
+ int cc;
+ // average two at a time, instead of four
+ datain.position( src );
+ extract.extract( isSwap, datain, extractTotals[0] );
+ datain.position( src + rowSizeInBytes );
+ extract.extract( isSwap, datain, extractTotals[1] );
+ for( cc = 0; cc < components; cc++ ) {
+ int kk = 0;
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ for( kk = 0; kk < BOX2; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= BOX2;
+ }
+ extract.shove( totals, outIndex, dataout );
+ outIndex++;
+ // skip over to next group of 2
+ src += rowSizeInBytes + rowSizeInBytes;
+ }
+ assert( src == rowSizeInBytes );
+ assert( outIndex == halfWidth * halfHeight );
+ }
+ }
+
+ public static void halveImagePackedPixelSlice( int components, Extract extract,
+ int width, int height, int depth, ByteBuffer dataIn,
+ ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
+ int imageSizeInBytes, boolean isSwap ) {
+ int ii, jj;
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int halfDepth = depth / 2;
+ int src = 0;
+ int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ int outIndex = 0;
+
+ assert( (width == 1 || height == 1) && depth >= 2 );
+
+ if( width == height ) {
+ assert( width == 1 && height == 1 );
+ assert( depth >= 2 );
+
+ for( ii = 0; ii < halfDepth; ii++ ) {
+ float totals[] = new float[4];
+ float extractTotals[][] = new float[BOX2][4];
+ int cc;
+
+ dataIn.position( src );
+ extract.extract( isSwap, dataIn, extractTotals[0] );
+ dataIn.position( src + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[1] );
+
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+
+ // average only 2 pixels since a column
+ totals[cc]= 0.0f;
+ for( kk = 0; kk < BOX2; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= BOX2;
+ } // for cc
+
+ extract.shove( totals, outIndex, dataOut );
+ outIndex++;
+ // skip over to next group of 2
+ src += imageSizeInBytes + imageSizeInBytes;
+ } // for ii
+ } else if( height == 1 ) {
+ assert( width != 1 );
+
+ for( ii = 0; ii < halfDepth; ii++ ) {
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ float totals[] = new float[4];
+ float extractTotals[][] = new float[BOX4][4];
+ int cc;
+
+ dataIn.position( src );
+ extract.extract( isSwap, dataIn, extractTotals[0] );
+ dataIn.position( src + pixelSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[1] );
+ dataIn.position( src + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[2] );
+ dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[3] );
+
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ for( kk = 0; kk < BOX4; kk++ ) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX4;
+ }
+ extract.shove( totals, outIndex, dataOut );
+ outIndex++;
+ // skip over to next horizontal square of 4
+ src += imageSizeInBytes + imageSizeInBytes;
+ }
+ }
+ } else if( width == 1 ) {
+ assert( height != 1 );
+
+ for( ii = 0; ii < halfDepth; ii++ ) {
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ float totals[] = new float[4];
+ float extractTotals[][] = new float[BOX4][4];
+ int cc;
+
+ dataIn.position( src );
+ extract.extract( isSwap, dataIn, extractTotals[0] );
+ dataIn.position( src + rowSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[1] );
+ dataIn.position( src + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[2] );
+ dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[3] );
+
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ for( kk = 0; kk < BOX4; kk++ ) {
+ totals[cc]+= extractTotals[kk][cc];
+ }
+ totals[cc]/= (float)BOX4;
+ }
+ extract.shove( totals, outIndex, dataOut );
+ outIndex++;
+ // skip over to next horizontal square of 4
+ src += imageSizeInBytes + imageSizeInBytes;
+ }
+ }
+ }
+ }
+
+ public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
+ int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
+ int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
+ int imageSizeInBytes, boolean isSwap ) {
+ int ii, jj;
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int halfDepth = depth / 2;
+ int src = 0;
+ int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+ int outIndex = 0;
+
+ assert( (width == 1 || height == 1) && depth >= 2 );
+
+ if( width == height ) {
+ assert( width == 1 && height == 1 );
+ assert( depth >= 2 );
+
+ for( ii = 0; ii < halfDepth; ii++ ) {
+ int cc;
+ for( cc = 0; cc < components; cc++ ) {
+ double[] totals = new double[4];
+ double[][] extractTotals = new double[BOX2][4];
+ int kk;
+
+ dataIn.position( src );
+ extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + imageSizeInBytes );
+ extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+
+ // average 2 pixels since only a column
+ totals[cc] = 0.0f;
+ // totals[red] = extractTotals[0][red] + extractTotals[1][red];
+ // totals[red] = red / 2;
+ for( kk = 0; kk < BOX2; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= (double)BOX2;
+
+ extract.shove( totals[cc], outIndex, dataOut );
+ outIndex++;
+ src += elementSizeInBytes;
+ } // for cc
+ // skip over next group of 2
+ src += rowSizeInBytes;
+ } // for ii
+
+ assert( src == rowSizeInBytes * height * depth );
+ assert( outIndex == halfDepth * components );
+ } else if( height == 1 ) {
+ assert( width != 1 );
+
+ for( ii = 0; ii < halfDepth; ii++ ) {
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int cc;
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+ double totals[] = new double[4];
+ double extractTotals[][] = new double[BOX4][4];
+
+ dataIn.position( src );
+ extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + groupSizeInBytes );
+ extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + imageSizeInBytes );
+ extractTotals[2][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
+ extractTotals[3][cc] = extract.extract( isSwap, dataIn );
+
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
+ // extractTotals[2][red] + extractTotals[3][red];
+ // totals[red] /= (double)BOX4;
+ for( kk = 0; kk < BOX4; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= (double)BOX4;
+
+ extract.shove( totals[cc], outIndex, dataOut );
+ outIndex++;
+ src += elementSizeInBytes;
+ } // for cc
+ // skip over to next horizontal square of 4
+ src += elementSizeInBytes;
+ } // for jj
+ src += padBytes;
+ src += rowSizeInBytes;
+ } // for ii
+ assert( src == rowSizeInBytes * height * depth );
+ assert( outIndex == halfWidth * halfDepth * components );
+ } else if( width == 1 ) {
+ assert( height != 1 );
+
+ for( ii = 0; ii < halfDepth; ii++ ) {
+ for( jj = 0; jj < halfHeight; jj++ ) {
+ int cc;
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+ double totals[] = new double[4];
+ double extractTotals[][] = new double[BOX4][4];
+
+ dataIn.position( src );
+ extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + rowSizeInBytes );
+ extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + imageSizeInBytes );
+ extractTotals[2][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + imageSizeInBytes + groupSizeInBytes );
+ extractTotals[3][cc] = extract.extract( isSwap, dataIn );
+
+
+ // grab 4 pixels to average
+ totals[cc] = 0.0f;
+ // totals[red] = extractTotals[0][red] + extractTotals[1][red] +
+ // extractTotals[2][red] + extractTotals[3][red];
+ // totals[red] /= (double)BOX4;
+ for( kk = 0; kk < BOX4; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= (double)BOX4;
+
+ extract.shove( totals[cc], outIndex, dataOut );
+ outIndex++;
+ src += elementSizeInBytes;
+ } // for cc
+ // skip over to next horizontal square of 4
+ src += padBytes;
+ src += rowSizeInBytes;
+ } // for jj
+ src += imageSizeInBytes;
+ } // for ii
+ assert( src == rowSizeInBytes * height * depth );
+ assert( outIndex == halfWidth * halfDepth * components );
+ }
+ }
+
+ public static void halveImage3D( int components, ExtractPrimitive extract,
+ int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
+ int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
+ int imageSizeInBytes, boolean isSwap ) {
+ assert( depth > 1 );
+
+ // horizontal/vertical/onecolumn slice viewed from top
+ if( width == 1 || height == 1 ) {
+ assert( 1 <= depth );
+
+ halveImageSlice( components, extract, width, height, depth, dataIn, dataOut,
+ elementSizeInBytes, groupSizeInBytes, rowSizeInBytes, imageSizeInBytes,
+ isSwap );
+ return;
+ }
+
+ int ii, jj, dd;
+
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int halfDepth = depth / 2;
+ int src = 0;
+ int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+ int outIndex = 0;
+
+ for( dd = 0; dd < halfDepth; dd++ ) {
+ for( ii = 0; ii < halfHeight; ii++ ) {
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ int cc;
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+ double totals[] = new double[4];
+ double extractTotals[][] = new double[BOX8][4];
+
+ dataIn.position( src );
+ extractTotals[0][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + groupSizeInBytes );
+ extractTotals[1][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + rowSizeInBytes );
+ extractTotals[2][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + rowSizeInBytes + groupSizeInBytes );
+ extractTotals[3][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + imageSizeInBytes );
+ extractTotals[4][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + groupSizeInBytes + imageSizeInBytes );
+ extractTotals[5][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
+ extractTotals[6][cc] = extract.extract( isSwap, dataIn );
+ dataIn.position( src + rowSizeInBytes + imageSizeInBytes + groupSizeInBytes );
+ extractTotals[7][cc] = extract.extract( isSwap, dataIn );
+
+ totals[cc] = 0.0f;
+
+ for( kk = 0; kk < BOX8; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= (double)BOX8;
+
+ extract.shove( totals[cc], outIndex, dataOut );
+ outIndex++;
+
+ src += elementSizeInBytes;
+ } // for cc
+ // skip over to next square of 4
+ src += groupSizeInBytes;
+ } // for jj
+ // skip past pad bytes, if any, to get to next row
+ src += padBytes;
+ src += rowSizeInBytes;
+ } // for ii
+ src += imageSizeInBytes;
+ } // for dd
+ assert( src == rowSizeInBytes * height * depth );
+ assert( outIndex == halfWidth * halfHeight * halfDepth * components );
+ }
+
+ public static void halveImagePackedPixel3D( int components, Extract extract,
+ int width, int height, int depth, ByteBuffer dataIn,
+ ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
+ int imageSizeInBytes, boolean isSwap ) {
+ if( depth == 1 ) {
+ assert( 1 <= width && 1 <= height );
+
+ halveImagePackedPixel( components, extract, width, height, dataIn, dataOut,
+ pixelSizeInBytes, rowSizeInBytes, isSwap );
+ return;
+ } else if( width == 1 || height == 1 ) { // a horizontal or vertical slice viewed from top
+ assert( 1 <= depth );
+
+ halveImagePackedPixelSlice( components, extract, width, height, depth, dataIn,
+ dataOut, pixelSizeInBytes, rowSizeInBytes, imageSizeInBytes, isSwap );
+ return;
+ }
+ int ii, jj, dd;
+
+ int halfWidth = width / 2;
+ int halfHeight = height / 2;
+ int halfDepth = depth / 2;
+ int src = 0;
+ int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+ int outIndex = 0;
+
+ for( dd = 0; dd < halfDepth; dd++ ) {
+ for( ii = 0; ii < halfHeight; ii++ ) {
+ for( jj = 0; jj < halfWidth; jj++ ) {
+ float totals[] = new float[4]; // 4 is max components
+ float extractTotals[][] = new float[BOX8][4];
+ int cc;
+
+ dataIn.position( src );
+ extract.extract( isSwap, dataIn, extractTotals[0] );
+ dataIn.position( src + pixelSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[1] );
+ dataIn.position( src + rowSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[2] );
+ dataIn.position( src + rowSizeInBytes + pixelSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[3] );
+ dataIn.position( src + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[4] );
+ dataIn.position( src + pixelSizeInBytes + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[5] );
+ dataIn.position( src + rowSizeInBytes + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[6] );
+ dataIn.position( src + rowSizeInBytes + pixelSizeInBytes + imageSizeInBytes );
+ extract.extract( isSwap, dataIn, extractTotals[7] );
+
+ for( cc = 0; cc < components; cc++ ) {
+ int kk;
+ // grab 8 pixels to average
+ totals[cc] = 0.0f;
+ for( kk = 0; kk < BOX8; kk++ ) {
+ totals[cc] += extractTotals[kk][cc];
+ }
+ totals[cc] /= (float)BOX8;
+ }
+ extract.shove( totals, outIndex, dataOut );
+ outIndex++;
+ // skip over to next square of 4
+ src += pixelSizeInBytes + pixelSizeInBytes;
+ }
+ // skip past pad bytes, if any, to get to next row
+ src += padBytes;
+ src += rowSizeInBytes;
+ }
+ src += imageSizeInBytes;
+ }
+ assert( src == rowSizeInBytes * height * depth );
+ assert( outIndex == halfWidth * halfHeight * halfDepth );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java
new file mode 100644
index 000000000..605d5547b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Image.java
@@ -0,0 +1,1413 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Image {
+
+ /** Creates a new instance of Image */
+ public Image() {
+ }
+
+ public static short getShortFromByteArray( byte[] array, int index ) {
+ short s;
+ s = (short)(array[index] << 8 );
+ s |= (short)(0x00FF & array[index+1]);
+ return( s );
+ }
+
+ public static int getIntFromByteArray( byte[] array, int index ) {
+ int i;
+ i = ( array[index] << 24 ) & 0xFF000000;
+ i |= ( array[index+1] << 16 ) & 0x00FF0000;
+ i |= ( array[index+2] << 8 ) & 0x0000FF00;
+ i |= ( array[index+3] ) & 0x000000FF;
+ return( i );
+ }
+
+ public static float getFloatFromByteArray( byte[] array, int index ) {
+ int i = getIntFromByteArray( array, index );
+ return( Float.intBitsToFloat(i) );
+ }
+
+ /*
+ * Extract array from user's data applying all pixel store modes.
+ * The internal format used is an array of unsigned shorts.
+ */
+ public static void fill_image( PixelStorageModes psm, int width, int height,
+ int format, int type, boolean index_format, ByteBuffer userdata,
+ ShortBuffer newimage ) {
+ int components;
+ int element_size;
+ int rowsize;
+ int padding;
+ int groups_per_line;
+ int group_size;
+ int elements_per_line;
+ int start;
+ int iter = 0;
+ int iter2;
+ int i, j, k;
+ boolean myswap_bytes;
+
+ // Create a Extract interface object
+ Extract extract = null;
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ extract = new Extract332();
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ extract = new Extract233rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ extract = new Extract565();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ extract = new Extract565rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ extract = new Extract4444();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ extract = new Extract4444rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ extract = new Extract5551();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ extract = new Extract1555rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ extract = new Extract8888();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ extract = new Extract8888rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ extract = new Extract1010102();
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ extract = new Extract2101010rev();
+ break;
+ }
+
+ myswap_bytes = psm.getUnpackSwapBytes();
+ components = Mipmap.elements_per_group( format, type );
+ if( psm.getUnpackRowLength() > 0 ) {
+ groups_per_line = psm.getUnpackRowLength();
+ } else {
+ groups_per_line = width;
+ }
+
+ // All formats except GL_BITMAP fall out trivially
+ if( type == GL2.GL_BITMAP ) {
+ int bit_offset;
+ int current_bit;
+
+ rowsize = ( groups_per_line * components + 7 ) / 8;
+ padding = ( rowsize % psm.getUnpackAlignment() );
+ if( padding != 0 ) {
+ rowsize += psm.getUnpackAlignment() - padding;
+ }
+ start = psm.getUnpackSkipRows() * rowsize + ( psm.getUnpackSkipPixels() * components / 8 );
+ elements_per_line = width * components;
+ iter2 = 0;
+ for( i = 0; i < height; i++ ) {
+ iter = start;
+ userdata.position( iter ); // ****************************************
+ bit_offset = (psm.getUnpackSkipPixels() * components) % 8;
+ for( j = 0; j < elements_per_line; j++ ) {
+ // retrieve bit
+ if( psm.getUnpackLsbFirst() ) {
+ userdata.position( iter );
+ current_bit = ( userdata.get() & 0x000000FF ) & ( 1 << bit_offset );//userdata[iter] & ( 1 << bit_offset );
+ } else {
+ current_bit = ( userdata.get() & 0x000000FF ) & ( 1 << ( 7 - bit_offset ) );
+ }
+ if( current_bit != 0 ) {
+ if( index_format ) {
+ newimage.position( iter2 );
+ newimage.put( (short)1 );
+ } else {
+ newimage.position( iter2 );
+ newimage.put( (short)65535 );
+ }
+ } else {
+ newimage.position( iter2 );
+ newimage.put( (short)0 );
+ }
+ bit_offset++;
+ if( bit_offset == 8 ) {
+ bit_offset = 0;
+ iter++;
+ }
+ iter2++;
+ }
+ start += rowsize;
+ }
+ } else {
+ element_size = Mipmap.bytes_per_element( type );
+ group_size = element_size * components;
+ if( element_size == 1 ) {
+ myswap_bytes = false;
+ }
+
+ rowsize = groups_per_line * group_size;
+ padding = ( rowsize % psm.getUnpackAlignment() );
+ if( padding != 0 ) {
+ rowsize += psm.getUnpackAlignment() - padding;
+ }
+ start = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
+ elements_per_line = width * components;
+
+ iter2 = 0;
+ for( i = 0; i < height; i++ ) {
+ iter = start;
+ userdata.position( iter ); //***************************************
+ for( j = 0; j < elements_per_line; j++ ) {
+ Type_Widget widget = new Type_Widget();
+ float[] extractComponents = new float[4];
+ userdata.position( iter );
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
+ for( k = 0; k < 3; k++ ) {
+ newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
+ for( k = 0; k < 3; k++ ) {
+ newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE ):
+ if( index_format ) {
+ newimage.put( iter2++, (short)( 0x000000FF & userdata.get() ) );//userdata[iter];
+ } else {
+ newimage.put( iter2++, (short)( 0x000000FF & userdata.get()/*userdata[iter]*/ * 257 ) );
+ }
+ break;
+ case( GL2.GL_BYTE ):
+ if( index_format ) {
+ newimage.put( iter2++, userdata.get() ); //userdata[iter];
+ } else {
+ newimage.put( iter2++, (short)(userdata.get()/*userdata[iter]*/ * 516 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ extract.extract( myswap_bytes, userdata/*userdata[iter]*/, extractComponents );
+ for( k = 0; k < 3; k++ ) {
+ newimage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 3; k++ ) {
+ newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ if( myswap_bytes ) {
+ widget.setUB1( userdata.get() );
+ widget.setUB0( userdata.get() );
+ } else {
+ widget.setUB0( userdata.get() );
+ widget.setUB1( userdata.get() );
+ }
+ if( type == GL2.GL_SHORT ) {
+ if( index_format ) {
+ newimage.put( iter2++, widget.getS0() );
+ } else {
+ newimage.put( iter2++, (short)(widget.getS0() * 2) );
+ }
+ } else {
+ newimage.put( iter2++, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ extract.extract( myswap_bytes, userdata, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_INT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_FLOAT ):
+ if( myswap_bytes ) {
+ widget.setUB3( userdata.get() );
+ widget.setUB2( userdata.get() );
+ widget.setUB1( userdata.get() );
+ widget.setUB0( userdata.get() );
+ } else {
+ widget.setUB0( userdata.get() );
+ widget.setUB1( userdata.get() );
+ widget.setUB2( userdata.get() );
+ widget.setUB3( userdata.get() );
+ }
+ if( type == GL2.GL_FLOAT ) {
+ if( index_format ) {
+ newimage.put( iter2++, (short)widget.getF() );
+ } else {
+ newimage.put( iter2++, (short)(widget.getF() * 65535 ) );
+ }
+ } else if( type == GL2.GL_UNSIGNED_INT ) {
+ if( index_format ) {
+ newimage.put( iter2++, (short)( widget.getUI() ) );
+ } else {
+ newimage.put( iter2++, (short)( widget.getUI() >> 16 ) );
+ }
+ } else {
+ if( index_format ) {
+ newimage.put( iter2++, (short)( widget.getI() ) );
+ } else {
+ newimage.put( iter2++, (short)( widget.getI() >> 15 ) );
+ }
+ }
+ break;
+ }
+ iter += element_size;
+ } // for j
+ start += rowsize;
+ // want iter pointing at start, not within, row for assertion purposes
+ iter = start;
+ } // for i
+
+ // iterators should be one byte past end
+ if( !Mipmap.isTypePackedPixel( type ) ) {
+ assert( iter2 == ( width * height * components ) );
+ } else {
+ assert( iter2 == ( width * height * Mipmap.elements_per_group( format, 0 ) ) );
+ }
+ assert( iter == ( rowsize * height + psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size ) );
+ }
+ }
+
+ /*
+ * Insert array into user's data applying all pixel store modes.
+ * Theinternal format is an array of unsigned shorts.
+ * empty_image() because it is the opposet of fill_image().
+ */
+ public static void empty_image( PixelStorageModes psm, int width, int height,
+ int format, int type, boolean index_format,
+ ShortBuffer oldimage, ByteBuffer userdata ) {
+
+ int components;
+ int element_size;
+ int rowsize;
+ int padding;
+ int groups_per_line;
+ int group_size;
+ int elements_per_line;
+ int start;
+ int iter = 0;
+ int iter2;
+ int i, j, k;
+ boolean myswap_bytes;
+
+ // Create a Extract interface object
+ Extract extract = null;
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ extract = new Extract332();
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ extract = new Extract233rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ extract = new Extract565();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ extract = new Extract565rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ extract = new Extract4444();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ extract = new Extract4444rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ extract = new Extract5551();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ extract = new Extract1555rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ extract = new Extract8888();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ extract = new Extract8888rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ extract = new Extract1010102();
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ extract = new Extract2101010rev();
+ break;
+ }
+
+ myswap_bytes = psm.getPackSwapBytes();
+ components = Mipmap.elements_per_group( format, type );
+ if( psm.getPackRowLength() > 0 ) {
+ groups_per_line = psm.getPackRowLength();
+ } else {
+ groups_per_line = width;
+ }
+
+ // all formats except GL_BITMAP fall out trivially
+ if( type == GL2.GL_BITMAP ) {
+ int bit_offset;
+ int current_bit;
+
+ rowsize = ( groups_per_line * components + 7 ) / 8;
+ padding = ( rowsize % psm.getPackAlignment() );
+ if( padding != 0 ) {
+ rowsize += psm.getPackAlignment() - padding;
+ }
+ start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * components / 8;
+ elements_per_line = width * components;
+ iter2 = 0;
+ for( i = 0; i < height; i++ ) {
+ iter = start;
+ bit_offset = ( psm.getPackSkipPixels() * components ) % 8;
+ for( j = 0; j < elements_per_line; j++ ) {
+ if( index_format ) {
+ current_bit = oldimage.get( iter2 ) & 1;
+ } else {
+ if( oldimage.get( iter2 ) < 0 ) { // must check for negative rather than 32767
+ current_bit = 1;
+ } else {
+ current_bit = 0;
+ }
+ }
+
+ if( current_bit != 0 ) {
+ if( psm.getPackLsbFirst() ) {
+ userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 1 << bit_offset ) ) ) );
+ } else {
+ userdata.put( iter, (byte)( ( userdata.get( iter ) | ( 7 - bit_offset ) ) ) );
+ }
+ } else {
+ if( psm.getPackLsbFirst() ) {
+ //userdata[iter] &= ~( 1 << bit_offset );
+ userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 1 << bit_offset ) ) ) );
+ } else {
+ //userdata[iter] &= ~( 1 << ( 7 - bit_offset ) );
+ userdata.put( iter, (byte)( ( userdata.get( iter ) & ~( 7 - bit_offset ) ) ) );
+ }
+ }
+
+ bit_offset++;
+ if( bit_offset == 8 ) {
+ bit_offset = 0;
+ iter++;
+ }
+ iter2++;
+ }
+ start += rowsize;
+ }
+ } else {
+ float shoveComponents[] = new float[4];
+
+ element_size = Mipmap.bytes_per_element( type );
+ group_size = element_size * components;
+ if( element_size == 1 ) {
+ myswap_bytes = false;
+ }
+
+ rowsize = groups_per_line * group_size;
+ padding = ( rowsize % psm.getPackAlignment() );
+ if( padding != 0 ) {
+ rowsize += psm.getPackAlignment() - padding;
+ }
+ start = psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size;
+ elements_per_line = width * components;
+
+ iter2 = 0;
+ for( i = 0; i < height; i++ ) {
+ iter = start;
+ for( j = 0; j < elements_per_line; j++ ) {
+ Type_Widget widget = new Type_Widget();
+
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ for( k = 0; k < 3; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, userdata );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ for( k = 0; k < 3; k++ ) {
+ shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, userdata );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE ):
+ if( index_format ) {
+ //userdata[iter] = (byte)oldimage[iter2++];
+ userdata.put( iter, (byte)oldimage.get(iter2++) );
+ } else {
+ //userdata[iter] = (byte)( oldimage[iter2++] >> 8 );
+ userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
+ }
+ break;
+ case( GL2.GL_BYTE ):
+ if( index_format ) {
+ //userdata[iter] = (byte)oldimage[iter2++];
+ userdata.put( iter, (byte)oldimage.get(iter2++) );
+ } else {
+ //userdata[iter] = (byte)( oldimage[iter2++] >> 9 );
+ userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ for( k = 0; k < 3; k++ ) {
+ shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1,widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter+1] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ for( k = 0; k < 3; k++ ) {
+ shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter+1] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter+1] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter+1] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter+1] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter+1] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ if( type == GL2.GL_SHORT ) {
+ if( index_format ) {
+ widget.setS0( oldimage.get( iter2++ ) );
+ } else {
+ widget.setS0( (short)(oldimage.get( iter2++ ) >> 1) );
+ }
+ } else {
+ widget.setUS0( oldimage.get( iter2++ ) );
+ }
+ if( myswap_bytes ) {
+ //userdata[iter] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB0();
+ userdata.put( iter, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB0() );
+ } else {
+ //userdata[iter] = widget.getUB0();
+ //userdata[iter] = widget.getUB1();
+ userdata.put( iter, widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter+3] = widget.getUB0();
+ //userdata[iter+2] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB2();
+ //userdata[iter ] = widget.getUB3();
+ userdata.put( iter + 3, widget.getUB0() );
+ userdata.put( iter + 2, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB2() );
+ userdata.put( iter , widget.getUB3() );
+ } else {
+ userdata.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter+3] = widget.getUB0();
+ //userdata[iter+2] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB2();
+ //userdata[iter ] = widget.getUB3();
+ userdata.put( iter + 3, widget.getUB0() );
+ userdata.put( iter + 2, widget.getUB1() );
+ userdata.put( iter + 2, widget.getUB2() );
+ userdata.put( iter , widget.getUB3() );
+ } else {
+ userdata.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter+3] = widget.getUB0();
+ //userdata[iter+2] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB2();
+ //userdata[iter ] = widget.getUB3();
+ userdata.put( iter + 3, widget.getUB0() );
+ userdata.put( iter + 2, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB2() );
+ userdata.put( iter , widget.getUB3() );
+ } else {
+ userdata.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswap_bytes ) {
+ //userdata[iter+3] = widget.getUB0();
+ //userdata[iter+2] = widget.getUB1();
+ //userdata[iter+1] = widget.getUB2();
+ //userdata[iter ] = widget.getUB3();
+ userdata.put( iter + 3, widget.getUB0() );
+ userdata.put( iter + 2, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB2() );
+ userdata.put( iter , widget.getUB3() );
+ } else {
+ userdata.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_INT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_FLOAT ):
+ if( type == GL2.GL_FLOAT ) {
+ if( index_format ) {
+ widget.setF( oldimage.get( iter2++ ) );
+ } else {
+ widget.setF( oldimage.get( iter2++ ) / 65535.0f );
+ }
+ } else if( type == GL2.GL_UNSIGNED_INT ) {
+ if( index_format ) {
+ widget.setUI( oldimage.get( iter2++ ) );
+ } else {
+ widget.setUI( oldimage.get( iter2++ ) * 65537 );
+ }
+ } else {
+ if( index_format ) {
+ widget.setI( oldimage.get( iter2++ ) );
+ } else {
+ widget.setI( (oldimage.get( iter2++ ) * 65537) / 2 );
+ }
+ }
+ if( myswap_bytes ) {
+ userdata.put( iter + 3, widget.getUB0() );
+ userdata.put( iter + 2, widget.getUB1() );
+ userdata.put( iter + 1, widget.getUB2() );
+ userdata.put( iter , widget.getUB3() );
+ } else {
+ userdata.put( iter , widget.getUB0() );
+ userdata.put( iter + 1, widget.getUB1() );
+ userdata.put( iter + 2, widget.getUB2() );
+ userdata.put( iter + 3, widget.getUB3() );
+ }
+ break;
+ }
+ iter += element_size;
+ } // for j
+ start += rowsize;
+ // want iter pointing at start, not within, row for assertion purposes
+ iter = start;
+ } // for i
+ // iterators should be one byte past end
+ if( !Mipmap.isTypePackedPixel( type ) ) {
+ assert( iter2 == width * height * components );
+ } else {
+ assert( iter2 == width * height * Mipmap.elements_per_group( format, 0 ) );
+ }
+ assert( iter == rowsize * height + psm.getPackSkipRows() * rowsize + psm.getPackSkipPixels() * group_size );
+ }
+ }
+
+ public static void fillImage3D( PixelStorageModes psm, int width, int height,
+ int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
+ ShortBuffer newImage ) {
+ boolean myswapBytes;
+ int components;
+ int groupsPerLine;
+ int elementSize;
+ int groupSize;
+ int rowSize;
+ int padding;
+ int elementsPerLine;
+ int rowsPerImage;
+ int imageSize;
+ int start, rowStart;
+ int iter = 0;
+ int iter2 = 0;
+ int ww, hh, dd, k;
+ Type_Widget widget = new Type_Widget();
+ float extractComponents[] = new float[4];
+
+ // Create a Extract interface object
+ Extract extract = null;
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ extract = new Extract332();
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ extract = new Extract233rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ extract = new Extract565();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ extract = new Extract565rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ extract = new Extract4444();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ extract = new Extract4444rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ extract = new Extract5551();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ extract = new Extract1555rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ extract = new Extract8888();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ extract = new Extract8888rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ extract = new Extract1010102();
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ extract = new Extract2101010rev();
+ break;
+ }
+
+ myswapBytes = psm.getUnpackSwapBytes();
+ components = Mipmap.elements_per_group( format, type );
+ if( psm.getUnpackRowLength() > 0 ) {
+ groupsPerLine = psm.getUnpackRowLength();
+ } else {
+ groupsPerLine = width;
+ }
+ elementSize = Mipmap.bytes_per_element( type );
+ groupSize = elementSize * components;
+ if( elementSize == 1 ) {
+ myswapBytes = false;
+ }
+
+ // 3dstuff begin
+ if( psm.getUnpackImageHeight() > 0 ) {
+ rowsPerImage = psm.getUnpackImageHeight();
+ } else {
+ rowsPerImage = height;
+ }
+ // 3dstuff end
+
+ rowSize = groupsPerLine * groupSize;
+ padding = rowSize % psm.getUnpackAlignment();
+ if( padding != 0 ) {
+ rowSize += psm.getUnpackAlignment() - padding;
+ }
+
+ imageSize = rowsPerImage * rowSize; // 3dstuff
+
+ start = psm.getUnpackSkipRows() * rowSize +
+ psm.getUnpackSkipPixels() * groupSize +
+ psm.getUnpackSkipImages() * imageSize;
+ elementsPerLine = width * components;
+
+ iter2 = 0;
+ for( dd = 0; dd < depth; dd++ ) {
+ rowStart = start;
+ for( hh = 0; hh < height; hh++ ) {
+ iter = rowStart;
+ for( ww = 0; ww < elementsPerLine; ww++ ) {
+
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ if( indexFormat ) {
+ newImage.put( iter2++, (short)(0x000000FF & userImage.get( iter ) ) );
+ } else {
+ newImage.put( iter2++, (short)((0x000000FF & userImage.get( iter ) ) * 257 ) );
+ }
+ break;
+ case( GL2.GL_BYTE ):
+ if( indexFormat ) {
+ newImage.put( iter2++, userImage.get( iter ) );
+ } else {
+ newImage.put( iter2++, (short)(userImage.get( iter ) * 516 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ userImage.position( iter );
+ extract.extract( false, userImage, extractComponents );
+ for( k = 0; k < 3; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ userImage.position( iter );
+ extract.extract( false, userImage, extractComponents );
+ for( k = 0; k < 3; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ if( myswapBytes ) {
+ widget.setUB0( userImage.get( iter + 1 ) );
+ widget.setUB1( userImage.get( iter ) );
+ } else {
+ widget.setUB0( userImage.get( iter ) );
+ widget.setUB1( userImage.get( iter + 1 ) );
+ }
+ if( type == GL2.GL_SHORT ) {
+ if( indexFormat ) {
+ newImage.put( iter2++, widget.getUS0() );
+ } else {
+ newImage.put( iter2++, (short)(widget.getUS0() * 2) );
+ }
+ } else {
+ newImage.put( iter2++, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ userImage.position( iter );
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ extract.extract( myswapBytes, userImage, extractComponents );
+ for( k = 0; k < 4; k++ ) {
+ newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
+ }
+ break;
+ case( GL2.GL_INT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_FLOAT ):
+ if( myswapBytes ) {
+ widget.setUB0( userImage.get( iter + 3 ) );
+ widget.setUB1( userImage.get( iter + 2 ) );
+ widget.setUB2( userImage.get( iter + 1 ) );
+ widget.setUB3( userImage.get( iter ) );
+ } else {
+ widget.setUB0( userImage.get( iter ) );
+ widget.setUB1( userImage.get( iter + 1 ) );
+ widget.setUB2( userImage.get( iter + 2 ) );
+ widget.setUB3( userImage.get( iter + 3 ) );
+ }
+ if( type == GL2.GL_FLOAT ) {
+ if( indexFormat ) {
+ newImage.put( iter2++, (short)widget.getF() );
+ } else {
+ newImage.put( iter2++, (short)( widget.getF() * 65535.0f ) );
+ }
+ } else if( type == GL2.GL_UNSIGNED_INT ) {
+ if( indexFormat ) {
+ newImage.put( iter2++, (short)widget.getUI() );
+ } else {
+ newImage.put( iter2++, (short)(widget.getUI() >> 16) );
+ }
+ } else {
+ if( indexFormat ) {
+ newImage.put( iter2++, (short)widget.getI() );
+ } else {
+ newImage.put( iter2++, (short)(widget.getI() >> 15) );
+ }
+ }
+ break;
+ default:
+ assert( false );
+ }
+ iter += elementSize;
+ } // for ww
+ rowStart += rowSize;
+ iter = rowStart; // for assert
+ } // for hh
+ start += imageSize;
+ }// for dd
+
+ // iterators should be one byte past end
+ if( !Mipmap.isTypePackedPixel( type ) ) {
+ assert( iter2 == width * height * depth * components );
+ } else {
+ assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
+ }
+ assert( iter == rowSize * height * depth + psm.getUnpackSkipRows() * rowSize +
+ psm.getUnpackSkipPixels() * groupSize +
+ psm.getUnpackSkipImages() * imageSize );
+ }
+
+ public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
+ int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
+ boolean myswapBytes;
+ int components;
+ int groupsPerLine;
+ int elementSize;
+ int groupSize;
+ int rowSize;
+ int padding;
+ int start, rowStart, iter;
+ int elementsPerLine;
+ int iter2;
+ int ii, jj, dd, k;
+ int rowsPerImage;
+ int imageSize;
+ Type_Widget widget = new Type_Widget();
+ float[] shoveComponents = new float[4];
+
+ // Create a Extract interface object
+ Extract extract = null;
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ extract = new Extract332();
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ extract = new Extract233rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ extract = new Extract565();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ extract = new Extract565rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ extract = new Extract4444();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ extract = new Extract4444rev();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ extract = new Extract5551();
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ extract = new Extract1555rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ extract = new Extract8888();
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ extract = new Extract8888rev();
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ extract = new Extract1010102();
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ extract = new Extract2101010rev();
+ break;
+ }
+
+ iter = 0;
+
+ myswapBytes = psm.getPackSwapBytes();
+ components = Mipmap.elements_per_group( format, type );
+ if( psm.getPackRowLength() > 0 ) {
+ groupsPerLine = psm.getPackRowLength();
+ } else {
+ groupsPerLine = width;
+ }
+
+ elementSize = Mipmap.bytes_per_element( type );
+ groupSize = elementSize * components;
+ if( elementSize == 1 ) {
+ myswapBytes = false;
+ }
+
+ // 3dstuff begin
+ if( psm.getPackImageHeight() > 0 ) {
+ rowsPerImage = psm.getPackImageHeight();
+ } else {
+ rowsPerImage = height;
+ }
+
+ // 3dstuff end
+
+ rowSize = groupsPerLine * groupSize;
+ padding = rowSize % psm.getPackAlignment();
+ if( padding != 0 ) {
+ rowSize += psm.getPackAlignment() - padding;
+ }
+
+ imageSize = rowsPerImage * rowSize;
+
+ start = psm.getPackSkipRows() * rowSize +
+ psm.getPackSkipPixels() * groupSize +
+ psm.getPackSkipImages() * imageSize;
+ elementsPerLine = width * components;
+
+ iter2 = 0;
+ for( dd = 0; dd < depth; dd++ ) {
+ rowStart = start;
+
+ for( ii = 0; ii < height; ii++ ) {
+ iter = rowStart;
+
+ for( jj = 0; jj < elementsPerLine; jj++ ) {
+
+ switch( type ) {
+ case( GL2.GL_UNSIGNED_BYTE ):
+ if( indexFormat ) {
+ userImage.put( iter, (byte)(oldImage.get( iter2++ ) ) );
+ } else {
+ userImage.put( iter, (byte)(oldImage.get( iter2++ ) >> 8 ) );
+ }
+ break;
+ case( GL2.GL_BYTE ):
+ if( indexFormat ) {
+ userImage.put( iter, (byte)(oldImage.get(iter2++) ) );
+ } else {
+ userImage.put( iter, (byte)(oldImage.get(iter2++) >> 9) );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+ for( k = 0; k < 3; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, userImage );
+ break;
+ case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+ for( k = 0; k < 3; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, userImage );
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.putShort( iter, widget.getUB1() );
+ userImage.putShort( iter + 1, widget.getUB0() );
+ } else {
+ userImage.putShort( iter, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB0() );
+ } else {
+ userImage.putShort( iter, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB0() );
+ } else {
+ userImage.putShort( iter, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB0() );
+ } else {
+ userImage.putShort( iter, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB0() );
+ } else {
+ userImage.putShort( iter, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB0() );
+ } else {
+ userImage.putShort( iter, widget.getUS0() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_SHORT ):
+ case( GL2.GL_SHORT ):
+ if( type == GL2.GL_SHORT ) {
+ if( indexFormat ) {
+ widget.setS0( (short)oldImage.get( iter2++ ) );
+ } else {
+ widget.setS0( (short)(oldImage.get( iter2++ ) >> 1) );
+ }
+ } else {
+ widget.setUS0( (short)oldImage.get( iter2++ ) );
+ }
+ if( myswapBytes ) {
+ userImage.put( iter, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB0() );
+ } else {
+ userImage.put( iter, widget.getUB0() );
+ userImage.put( iter + 1, widget.getUB1() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter + 3, widget.getUB0() );
+ userImage.put( iter + 2, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB2() );
+ userImage.put( iter , widget.getUB3() );
+ } else {
+ userImage.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter + 3, widget.getUB0() );
+ userImage.put( iter + 2, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB2() );
+ userImage.put( iter , widget.getUB3() );
+ } else {
+ userImage.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter + 3, widget.getUB0() );
+ userImage.put( iter + 2, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB2() );
+ userImage.put( iter ,widget.getUB3() );
+ } else {
+ userImage.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+ for( k = 0; k < 4; k++ ) {
+ shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
+ }
+ extract.shove( shoveComponents, 0, widget.getBuffer() );
+ if( myswapBytes ) {
+ userImage.put( iter + 3, widget.getUB0() );
+ userImage.put( iter + 2, widget.getUB2() );
+ userImage.put( iter + 1, widget.getUB1() );
+ userImage.put( iter , widget.getUB0() );
+ } else {
+ userImage.putInt( iter, widget.getUI() );
+ }
+ break;
+ case( GL2.GL_INT ):
+ case( GL2.GL_UNSIGNED_INT ):
+ case( GL2.GL_FLOAT ):
+ if( type == GL2.GL_FLOAT ) {
+ if( indexFormat ) {
+ widget.setF( oldImage.get( iter2++ ) );
+ } else {
+ widget.setF( oldImage.get( iter2++ ) / 65535.0f );
+ }
+ } else if( type == GL2.GL_UNSIGNED_INT ) {
+ if( indexFormat ) {
+ widget.setUI( oldImage.get( iter2++ ) );
+ } else {
+ widget.setUI( oldImage.get( iter2++ ) * 65537 );
+ }
+ } else {
+ if( indexFormat ) {
+ widget.setI( oldImage.get( iter2++ ) );
+ } else {
+ widget.setI( ( oldImage.get( iter2++ ) * 65535 ) / 2 );
+ }
+ }
+ if( myswapBytes ) {
+ userImage.put( iter + 3, widget.getUB0() );
+ userImage.put( iter + 2, widget.getUB1() );
+ userImage.put( iter + 1, widget.getUB2() );
+ userImage.put( iter , widget.getUB3() );
+ } else {
+ userImage.put( iter , widget.getUB0() );
+ userImage.put( iter + 1, widget.getUB1() );
+ userImage.put( iter + 2, widget.getUB2() );
+ userImage.put( iter + 3, widget.getUB3() );
+ }
+ break;
+ default:
+ assert( false );
+ }
+
+ iter += elementSize;
+ } // for jj
+ rowStart += rowSize;
+ } // for ii
+ start += imageSize;
+ } // for dd
+
+ if( !Mipmap.isTypePackedPixel( type ) ) {
+ assert( iter2 == width * height * depth * components );
+ } else {
+ assert( iter2 == width * height * depth * Mipmap.elements_per_group( format, 0 ) );
+ }
+ assert( iter == rowSize * height * depth +
+ psm.getUnpackSkipRows() * rowSize +
+ psm.getUnpackSkipPixels() * groupSize +
+ psm.getUnpackSkipImages() * imageSize );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java
new file mode 100644
index 000000000..aa33550ca
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Mipmap.java
@@ -0,0 +1,867 @@
+/*
+ * License Applicability. Except 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
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2;
+import javax.media.opengl.glu.GLU;
+import javax.media.opengl.GLException;
+import java.nio.*;
+import com.sun.opengl.impl.InternalBufferUtil;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Mipmap {
+
+ /** Creates a new instance of Mipmap */
+ public Mipmap() {
+ }
+
+ public static int computeLog( int value ) {
+ int i = 0;
+ // Error
+ if( value == 0 ) {
+ return( -1 );
+ }
+ for( ;; ) {
+ if( (value & 1) >= 1 ) {
+ if( value != 1 ) {
+ return( -1 );
+ }
+ return( i );
+ }
+ value = value >> 1;
+ i++;
+ }
+ }
+
+ /* Compute the nearest power of 2 number. This algorithm is a little strange
+ * but it works quite well.
+ */
+ public static int nearestPower( int value ) {
+ int i = 1;
+ // Error!
+ if( value == 0 ) {
+ return( -1 );
+ }
+ for( ;; ) {
+ if( value == 1 ) {
+ return( i );
+ } else if( value == 3 ) {
+ return( i * 4 );
+ }
+ value = value >> 1;
+ i *= 2;
+ }
+ }
+
+ public static short GLU_SWAP_2_BYTES( short s ) {
+ byte b = 0;
+ b = (byte)( s >>> 8 );
+ s = (short)( s << 8 );
+ s = (short)( s | (0x00FF & b) );
+ return( s );
+ }
+
+ public static int GLU_SWAP_4_BYTES( int i ) {
+ int t = i << 24;
+ t |= 0x00FF0000 & ( i << 8 );
+ t |= 0x0000FF00 & ( i >>> 8 );
+ t |= 0x000000FF & ( i >>> 24 );
+ return( t );
+ }
+
+ public static float GLU_SWAP_4_BYTES( float f ) {
+ int i = Float.floatToRawIntBits( f );
+ float temp = Float.intBitsToFloat( i );
+ return( temp );
+ }
+
+ public static int checkMipmapArgs( int internalFormat, int format, int type ) {
+ if( !legalFormat( format ) || !legalType( type ) ) {
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ if( format == GL2.GL_STENCIL_INDEX ) {
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ if( !isLegalFormatForPackedPixelType( format, type ) ) {
+ return( GLU.GLU_INVALID_OPERATION );
+ }
+ return( 0 );
+ }
+
+ public static boolean legalFormat( int format ) {
+ switch( format ) {
+ case( GL2.GL_COLOR_INDEX ):
+ case( 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 ):
+ return( true );
+ default:
+ return( false );
+ }
+ }
+
+ 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 ):
+ return( true );
+ default:
+ return( false );
+ }
+ }
+
+ 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 ) {
+ return( true );
+ }
+ return( false );
+ }
+
+ public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
+ // if not a packed pixel type then return true
+ if( isTypePackedPixel( type ) ) {
+ return( true );
+ }
+
+ // 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
+ if( (type == 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 ) {
+ 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) ) {
+ return( false );
+ }
+ return( true );
+ }
+
+ public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
+ int totalLevels ) {
+ if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
+ (totalLevels < maxLevel) ) {
+ return( false );
+ }
+ return( true );
+ }
+
+ /* Given user requested textures size, determine if it fits. If it doesn't then
+ * halve both sides and make the determination again until it does fit ( for
+ * IR only ).
+ * Note that proxy textures are not implemented in RE* even though they
+ * advertise the texture extension.
+ * Note that proxy textures are implemented but not according to spec in IMPACT*
+ */
+ public static void closestFit( GL gl, int target, int width, int height, int internalFormat,
+ int format, int type, int[] newWidth, int[] newHeight ) {
+ // Use proxy textures if OpenGL version >= 1.1
+ if( Double.parseDouble( gl.glGetString( GL.GL_VERSION ).trim().substring( 0, 3 ) ) >= 1.1 ) {
+ int widthPowerOf2 = nearestPower( width );
+ int heightPowerOf2 = nearestPower( height );
+ int[] proxyWidth = new int[1];
+ boolean noProxyTextures = false;
+
+ // Some drivers (in particular, ATI's) seem to set a GL error
+ // when proxy textures are used even though this is in violation
+ // of the spec. Guard against this and interactions with the
+ // DebugGL by watching for GLException.
+ try {
+ do {
+ // compute level 1 width & height, clamping each at 1
+ int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
+ int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
+ int proxyTarget;
+
+ assert( widthAtLevelOne > 0 );
+ assert( heightAtLevelOne > 0 );
+
+ // does width x height at level 1 & all their mipmaps fit?
+ if( target == GL2.GL_TEXTURE_2D || target == GL2.GL_PROXY_TEXTURE_2D ) {
+ proxyTarget = GL2.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;
+ 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,
+ 0, format, type, null );
+ }
+ if(gl.isGL2()) {
+ gl.getGL2().glGetTexLevelParameteriv( proxyTarget, 1, GL2.GL_TEXTURE_WIDTH, proxyWidth, 0 );
+ } else {
+ proxyWidth[0] = 0;
+ }
+ // does it fit?
+ if( proxyWidth[0] == 0 ) { // nope, so try again with theses sizes
+ if( widthPowerOf2 == 1 && heightPowerOf2 == 1 ) {
+ /* A 1x1 texture couldn't fit for some reason so break out. This
+ * should never happen. But things happen. The disadvantage with
+ * this if-statement is that we will never be aware of when this
+ * happens since it will silently branch out.
+ */
+ noProxyTextures = true;
+ break;
+ }
+ widthPowerOf2 = widthAtLevelOne;
+ heightPowerOf2 = heightAtLevelOne;
+ }
+ // else it does fit
+ } while( proxyWidth[0] == 0 );
+ } catch (GLException e) {
+ noProxyTextures = true;
+ }
+ // loop must terminate
+ // return the width & height at level 0 that fits
+ if( !noProxyTextures ) {
+ newWidth[0] = widthPowerOf2;
+ newHeight[0] = heightPowerOf2;
+ return;
+ }
+ }
+ int[] maxsize = new int[1];
+ gl.glGetIntegerv( GL2.GL_MAX_TEXTURE_SIZE, maxsize , 0);
+ // clamp user's texture sizes to maximum sizes, if necessary
+ newWidth[0] = nearestPower( width );
+ if( newWidth[0] > maxsize[0] ) {
+ newWidth[0] = maxsize[0];
+ }
+ newHeight[0] = nearestPower( height );
+ if( newHeight[0] > maxsize[0] ) {
+ newHeight[0] = maxsize[0];
+ }
+ }
+
+ public static void closestFit3D( GL gl, int target, int width, int height, int depth,
+ int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
+ int[] newDepth ) {
+ int widthPowerOf2 = nearestPower( width );
+ int heightPowerOf2 = nearestPower( height );
+ int depthPowerOf2 = nearestPower( depth );
+ int[] proxyWidth = new int[1];
+
+ do {
+ // compute level 1 width & height & depth, clamping each at 1
+ int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
+ int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
+ int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
+ int proxyTarget = 0;
+ assert( widthAtLevelOne > 0 );
+ assert( heightAtLevelOne > 0 );
+ assert( depthAtLevelOne > 0 );
+
+ // does width x height x depth at level 1 & all their mipmaps fit?
+ if( target == GL2.GL_TEXTURE_3D || target == GL2.GL_PROXY_TEXTURE_3D ) {
+ proxyTarget = GL2.GL_PROXY_TEXTURE_3D;
+ gl.getGL2().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 );
+ } else {
+ proxyWidth[0] = 0;
+ }
+ // does it fit
+ if( proxyWidth[0] == 0 ) {
+ if( widthPowerOf2 == 1 && heightPowerOf2 == 1 && depthPowerOf2 == 1 ) {
+ newWidth[0] = newHeight[0] = newDepth[0] = 1;
+ return;
+ }
+ widthPowerOf2 = widthAtLevelOne;
+ heightPowerOf2 = heightAtLevelOne;
+ depthPowerOf2 = depthAtLevelOne;
+ }
+ } while( proxyWidth[0] == 0 );
+ // loop must terminate
+
+ // return the width & height at level 0 that fits
+ newWidth[0] = widthPowerOf2;
+ newHeight[0] = heightPowerOf2;
+ newDepth[0] = depthPowerOf2;
+ }
+
+ public static int elements_per_group( int format, int type ) {
+ // Return the number of elements per grtoup of a specified gromat
+
+ // If the type is packedpixels then answer is 1
+ if( type == 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 ) {
+ return( 1 );
+ }
+
+ // Types are not packed pixels so get elements per group
+ switch( format ) {
+ case( GL2.GL_RGB ):
+ case( GL2.GL_BGR ):
+ return( 3 );
+ case( GL2.GL_LUMINANCE_ALPHA ):
+ return( 2 );
+ case( GL2.GL_RGBA ):
+ case( GL2.GL_BGRA ):
+ return( 4 );
+ default:
+ return( 1 );
+ }
+ }
+
+ public static int bytes_per_element( int type ) {
+ // return the number of bytes per element, based on the element type
+
+ switch( type ) {
+ case( GL2.GL_BITMAP ):
+ case( 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 ):
+ 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 ):
+ 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 ):
+ return( 4 );
+ default:
+ return( 4 );
+ }
+ }
+
+ public static boolean is_index( int format ) {
+ return( format == GL2.GL_COLOR_INDEX || format == GL2.GL_STENCIL_INDEX );
+ }
+
+ /* Compute memory required for internal packed array of data of given type and format. */
+
+ public static int image_size( int width, int height, int format, int type ) {
+ int bytes_per_row;
+ int components;
+
+ assert( width > 0 );
+ assert( height > 0 );
+ components = elements_per_group( format, type );
+ if( type == GL2.GL_BITMAP ) {
+ bytes_per_row = (width + 7) / 8;
+ } else {
+ bytes_per_row = bytes_per_element( type ) * width;
+ }
+ return( bytes_per_row * height * components );
+ }
+
+ public static int imageSize3D( int width, int height, int depth, int format, int type ) {
+ int components = elements_per_group( format, type );
+ int bytes_per_row = bytes_per_element( type ) * width;
+
+ assert( width > 0 && height > 0 && depth > 0 );
+ assert( type != GL2.GL_BITMAP );
+
+ return( bytes_per_row * height * depth * components );
+ }
+
+ public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
+ int[] a = new int[1];
+ gl.glGetIntegerv( GL2.GL_UNPACK_ALIGNMENT, a, 0);
+ psm.setUnpackAlignment( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_ROW_LENGTH, a, 0);
+ psm.setUnpackRowLength( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_ROWS, a, 0);
+ psm.setUnpackSkipRows( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_PIXELS, a, 0);
+ psm.setUnpackSkipPixels( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_LSB_FIRST, a, 0);
+ psm.setUnpackLsbFirst( ( a[0] == 1 ) );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SWAP_BYTES, a, 0);
+ psm.setUnpackSwapBytes( ( a[0] == 1 ) );
+
+ gl.glGetIntegerv( GL2.GL_PACK_ALIGNMENT, a, 0);
+ psm.setPackAlignment( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_ROW_LENGTH, a, 0);
+ psm.setPackRowLength( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_ROWS, a, 0);
+ psm.setPackSkipRows( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_PIXELS, a, 0);
+ psm.setPackSkipPixels( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_LSB_FIRST, a, 0);
+ psm.setPackLsbFirst( ( a[0] == 1 ) );
+ gl.glGetIntegerv( GL2.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);
+ psm.setUnpackAlignment( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_ROW_LENGTH, a, 0);
+ psm.setUnpackRowLength( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_ROWS, a, 0);
+ psm.setUnpackSkipRows( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_PIXELS, a, 0);
+ psm.setUnpackSkipPixels( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_LSB_FIRST, a, 0);
+ psm.setUnpackLsbFirst( ( a[0] == 1 ) );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SWAP_BYTES, a, 0);
+ psm.setUnpackSwapBytes( ( a[0] == 1 ) );
+ gl.glGetIntegerv( GL2.GL_UNPACK_SKIP_IMAGES, a, 0);
+ psm.setUnpackSkipImages( a[0] );
+ gl.glGetIntegerv( GL2.GL_UNPACK_IMAGE_HEIGHT, a, 0);
+ psm.setUnpackImageHeight( a[0] );
+
+ gl.glGetIntegerv( GL2.GL_PACK_ALIGNMENT, a, 0);
+ psm.setPackAlignment( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_ROW_LENGTH, a, 0);
+ psm.setPackRowLength( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_ROWS, a, 0);
+ psm.setPackSkipRows( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_PIXELS, a, 0 );
+ psm.setPackSkipPixels( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_LSB_FIRST, a, 0 );
+ psm.setPackLsbFirst( ( a[0] == 1 ) );
+ gl.glGetIntegerv( GL2.GL_PACK_SWAP_BYTES, a, 0 );
+ psm.setPackSwapBytes( ( a[0] == 1 ) );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_IMAGES, a, 0 );
+ psm.setPackSkipImages( a[0] );
+ gl.glGetIntegerv( GL2.GL_PACK_IMAGE_HEIGHT, a, 0 );
+ psm.setPackImageHeight( a[0] );
+ }
+
+ public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
+ int typein, ByteBuffer datain, int widthout, int heightout,
+ int typeout, ByteBuffer dataout ) {
+ int datainPos = datain.position();
+ int dataoutPos = dataout.position();
+ try {
+
+ int components;
+ ByteBuffer beforeimage;
+ ByteBuffer afterimage;
+ PixelStorageModes psm = new PixelStorageModes();
+
+ if( (widthin == 0) || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
+ return( 0 );
+ }
+ if( (widthin < 0) || (heightin < 0) || (widthout < 0) || (heightout < 0) ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+ if( !legalFormat( format ) || !legalType( typein ) || !legalType( typeout ) ) {
+ return( GLU.GLU_INVALID_ENUM );
+ }
+ if( !isLegalFormatForPackedPixelType( format, typein ) ) {
+ return( GLU.GLU_INVALID_OPERATION );
+ }
+ if( !isLegalFormatForPackedPixelType( format, typeout ) ) {
+ return( GLU.GLU_INVALID_OPERATION );
+ }
+ beforeimage = 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 ) ));
+ if( beforeimage == null || afterimage == null ) {
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+
+ retrieveStoreModes( gl, psm );
+ Image.fill_image( psm, widthin, heightin, format, typein, is_index( format ), datain, beforeimage.asShortBuffer() );
+ components = elements_per_group( format, 0 );
+ ScaleInternal.scale_internal( components, widthin, heightin, beforeimage.asShortBuffer(), widthout, heightout, afterimage.asShortBuffer() );
+ Image.empty_image( psm, widthout, heightout, format, typeout, is_index( format ), afterimage.asShortBuffer(), dataout );
+
+ return( 0 );
+ } finally {
+ datain.position(datainPos);
+ dataout.position(dataoutPos);
+ }
+ }
+
+ public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
+ int width, int format, int type, int userLevel, int baseLevel,
+ int maxLevel, ByteBuffer data ) {
+ int dataPos = data.position();
+ try {
+
+ int levels;
+
+ int rc = checkMipmapArgs( internalFormat, format, type );
+ if( rc != 0 ) {
+ return( rc );
+ }
+
+ if( width < 1 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ levels = computeLog( width );
+
+ levels += userLevel;
+ if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat, width,
+ width, format, type, userLevel, baseLevel, maxLevel, data ) );
+ } finally {
+ data.position(dataPos);
+ }
+ }
+
+ public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
+ int format, int type, ByteBuffer data ) {
+ int dataPos = data.position();
+
+ try {
+ int[] widthPowerOf2 = new int[1];
+ int levels;
+ int[] dummy = new int[1];
+
+ int rc = checkMipmapArgs( internalFormat, format, type );
+ if( rc != 0 ) {
+ return( rc );
+ }
+
+ if( width < 1 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ closestFit( gl, target, width, 1, internalFormat, format, type, widthPowerOf2, dummy );
+ levels = computeLog( widthPowerOf2[0] );
+
+ return( BuildMipmap.gluBuild1DMipmapLevelsCore( gl, target, internalFormat,
+ width, widthPowerOf2[0], format, type, 0, 0, levels, data ) );
+ } finally {
+ data.position(dataPos);
+ }
+ }
+
+
+ public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
+ int width, int height, int format, int type, int userLevel,
+ int baseLevel, int maxLevel, Object data ) {
+ int dataPos = 0;
+
+ int level, levels;
+
+ int rc = checkMipmapArgs( internalFormat, format, type );
+ if( rc != 0 ) {
+ return( rc );
+ }
+
+ if( width < 1 || height < 1 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ levels = computeLog( width );
+ level = computeLog( height );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ levels += userLevel;
+ if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
+ ByteBuffer buffer = null;
+ if( data instanceof ByteBuffer ) {
+ buffer = (ByteBuffer)data;
+ dataPos = buffer.position();
+ } else if( data instanceof byte[] ) {
+ byte[] array = (byte[])data;
+ buffer = ByteBuffer.allocateDirect(array.length);
+ buffer.put(array);
+ } else if( data instanceof short[] ) {
+ short[] array = (short[])data;
+ buffer = ByteBuffer.allocateDirect( array.length * 2 );
+ ShortBuffer sb = buffer.asShortBuffer();
+ sb.put( array );
+ } else if( data instanceof int[] ) {
+ int[] array = (int[])data;
+ buffer = ByteBuffer.allocateDirect( array.length * 4 );
+ IntBuffer ib = buffer.asIntBuffer();
+ ib.put( array );
+ } else if( data instanceof float[] ) {
+ float[] array = (float[])data;
+ buffer = ByteBuffer.allocateDirect( array.length * 4 );
+ FloatBuffer fb = buffer.asFloatBuffer();
+ fb.put( array );
+ }
+
+ try {
+ return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
+ width, height, width, height, format, type, userLevel, baseLevel,
+ maxLevel, buffer ) );
+ } finally {
+ buffer.position(dataPos);
+ }
+ }
+
+
+ public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
+ int width, int height, int format, int type, Object data ) {
+ int dataPos = 0;
+
+ int[] widthPowerOf2 = new int[1];
+ int[] heightPowerOf2 = new int[1];
+ int level, levels;
+
+ int rc = checkMipmapArgs( internalFormat, format, type );
+ if( rc != 0 ) {
+ return( rc );
+ }
+
+ if( width < 1 || height < 1 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ closestFit( gl, target, width, height, internalFormat, format, type,
+ widthPowerOf2, heightPowerOf2 );
+
+ levels = computeLog( widthPowerOf2[0] );
+ level = computeLog( heightPowerOf2[0] );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
+ ByteBuffer buffer = null;
+ if( data instanceof ByteBuffer ) {
+ buffer = (ByteBuffer)data;
+ dataPos = buffer.position();
+ } else if( data instanceof byte[] ) {
+ byte[] array = (byte[])data;
+ buffer = ByteBuffer.allocateDirect(array.length);
+ buffer.put(array);
+ } else if( data instanceof short[] ) {
+ short[] array = (short[])data;
+ buffer = ByteBuffer.allocateDirect( array.length * 2 );
+ ShortBuffer sb = buffer.asShortBuffer();
+ sb.put( array );
+ } else if( data instanceof int[] ) {
+ int[] array = (int[])data;
+ buffer = ByteBuffer.allocateDirect( array.length * 4 );
+ IntBuffer ib = buffer.asIntBuffer();
+ ib.put( array );
+ } else if( data instanceof float[] ) {
+ float[] array = (float[])data;
+ buffer = ByteBuffer.allocateDirect( array.length * 4 );
+ FloatBuffer fb = buffer.asFloatBuffer();
+ fb.put( array );
+ }
+
+ try {
+ return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
+ width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
+ 0, levels, buffer ) );
+ } finally {
+ buffer.position(dataPos);
+ }
+ }
+
+
+ public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
+ int width, int height, int depth, int format, int type, ByteBuffer data ) {
+ int dataPos = data.position();
+ try {
+
+ int[] widthPowerOf2 = new int[1];
+ int[] heightPowerOf2 = new int[1];
+ int[] depthPowerOf2 = new int[1];
+ int level, levels;
+
+ int rc = checkMipmapArgs( internalFormat, format, type );
+ if( rc != 0 ) {
+ return( rc );
+ }
+
+ if( width < 1 || height < 1 || depth < 1 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ if( type == GL2.GL_BITMAP ) {
+ return( GLU.GLU_INVALID_ENUM );
+ }
+
+ closestFit3D( gl, target, width, height, depth, internalFormat, format,
+ type, widthPowerOf2, heightPowerOf2, depthPowerOf2 );
+
+ levels = computeLog( widthPowerOf2[0] );
+ level = computeLog( heightPowerOf2[0] );
+ if( level > levels ) {
+ levels = level;
+ }
+ level = computeLog( depthPowerOf2[0] );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
+ height, depth, widthPowerOf2[0], heightPowerOf2[0], depthPowerOf2[0],
+ format, type, 0, 0, levels, data ) );
+ } finally {
+ data.position(dataPos);
+ }
+ }
+
+ public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
+ int width, int height, int depth, int format, int type, int userLevel,
+ int baseLevel, int maxLevel, ByteBuffer data ) {
+ int dataPos = data.position();
+ try {
+ int level, levels;
+
+ int rc = checkMipmapArgs( internalFormat, format, type );
+ if( rc != 0 ) {
+ return( rc );
+ }
+
+ if( width < 1 || height < 1 || depth < 1 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ if( type == GL2.GL_BITMAP ) {
+ return( GLU.GLU_INVALID_ENUM );
+ }
+
+ levels = computeLog( width );
+ level = computeLog( height );
+ if( level > levels ) {
+ levels = level;
+ }
+ level = computeLog( depth );
+ if( level > levels ) {
+ levels = level;
+ }
+
+ levels += userLevel;
+ if( !isLegalLevels( userLevel, baseLevel, maxLevel, levels ) ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ return( BuildMipmap.gluBuild3DMipmapLevelsCore( gl, target, internalFormat, width,
+ height, depth, width, height, depth, format, type, userLevel,
+ baseLevel, maxLevel, data ) );
+ } finally {
+ data.position(dataPos);
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java
new file mode 100644
index 000000000..82324f1b0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/PixelStorageModes.java
@@ -0,0 +1,426 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+/**
+ *
+ * @author Administrator
+ */
+public class PixelStorageModes {
+
+ /**
+ * Holds value of property packAlignment.
+ */
+ private int packAlignment;
+
+ /**
+ * Holds value of property packRowLength.
+ */
+ private int packRowLength;
+
+ /**
+ * Holds value of property packSkipRows.
+ */
+ private int packSkipRows;
+
+ /**
+ * Holds value of property packSkipPixels.
+ */
+ private int packSkipPixels;
+
+ /**
+ * Holds value of property packLsbFirst.
+ */
+ private boolean packLsbFirst;
+
+ /**
+ * Holds value of property packSwapBytes.
+ */
+ private boolean packSwapBytes;
+
+ /**
+ * Holds value of property packSkipImages.
+ */
+ private int packSkipImages;
+
+ /**
+ * Holds value of property packImageHeight.
+ */
+ private int packImageHeight;
+
+ /**
+ * Holds value of property unpackAlignment.
+ */
+ private int unpackAlignment;
+
+ /**
+ * Holds value of property unpackRowLength.
+ */
+ private int unpackRowLength;
+
+ /**
+ * Holds value of property unpackSkipRows.
+ */
+ private int unpackSkipRows;
+
+ /**
+ * Holds value of property unpackSkipPixels.
+ */
+ private int unpackSkipPixels;
+
+ /**
+ * Holds value of property unpackLsbFirst.
+ */
+ private boolean unpackLsbFirst;
+
+ /**
+ * Holds value of property unpackSwapBytes.
+ */
+ private boolean unpackSwapBytes;
+
+ /**
+ * Holds value of property unpackSkipImages.
+ */
+ private int unpackSkipImages;
+
+ /**
+ * Holds value of property unpackImageHeight.
+ */
+ private int unpackImageHeight;
+
+ /** Creates a new instance of PixelStorageModes */
+ public PixelStorageModes() {
+ }
+
+ /**
+ * Getter for property packAlignment.
+ * @return Value of property packAlignment.
+ */
+ public int getPackAlignment() {
+
+ return this.packAlignment;
+ }
+
+ /**
+ * Setter for property packAlignment.
+ * @param packAlignment New value of property packAlignment.
+ */
+ public void setPackAlignment(int packAlignment) {
+
+ this.packAlignment = packAlignment;
+ }
+
+ /**
+ * Getter for property packRowLength.
+ * @return Value of property packRowLength.
+ */
+ public int getPackRowLength() {
+
+ return this.packRowLength;
+ }
+
+ /**
+ * Setter for property packRowLength.
+ * @param packRowLength New value of property packRowLength.
+ */
+ public void setPackRowLength(int packRowLength) {
+
+ this.packRowLength = packRowLength;
+ }
+
+ /**
+ * Getter for property packSkipRows.
+ * @return Value of property packSkipRows.
+ */
+ public int getPackSkipRows() {
+
+ return this.packSkipRows;
+ }
+
+ /**
+ * Setter for property packSkipRows.
+ * @param packSkipRows New value of property packSkipRows.
+ */
+ public void setPackSkipRows(int packSkipRows) {
+
+ this.packSkipRows = packSkipRows;
+ }
+
+ /**
+ * Getter for property packSkipPixels.
+ * @return Value of property packSkipPixels.
+ */
+ public int getPackSkipPixels() {
+
+ return this.packSkipPixels;
+ }
+
+ /**
+ * Setter for property packSkipPixels.
+ * @param packSkipPixels New value of property packSkipPixels.
+ */
+ public void setPackSkipPixels(int packSkipPixels) {
+
+ this.packSkipPixels = packSkipPixels;
+ }
+
+ /**
+ * Getter for property packLsbFirst.
+ * @return Value of property packLsbFirst.
+ */
+ public boolean getPackLsbFirst() {
+
+ return this.packLsbFirst;
+ }
+
+ /**
+ * Setter for property packLsbFirst.
+ * @param packLsbFirst New value of property packLsbFirst.
+ */
+ public void setPackLsbFirst(boolean packLsbFirst) {
+
+ this.packLsbFirst = packLsbFirst;
+ }
+
+ /**
+ * Getter for property packSwapBytes.
+ * @return Value of property packSwapBytes.
+ */
+ public boolean getPackSwapBytes() {
+
+ return this.packSwapBytes;
+ }
+
+ /**
+ * Setter for property packSwapBytes.
+ * @param packSwapBytes New value of property packSwapBytes.
+ */
+ public void setPackSwapBytes(boolean packSwapBytes) {
+
+ this.packSwapBytes = packSwapBytes;
+ }
+
+ /**
+ * Getter for property packSkipImages.
+ * @return Value of property packSkipImages.
+ */
+ public int getPackSkipImages() {
+
+ return this.packSkipImages;
+ }
+
+ /**
+ * Setter for property packSkipImages.
+ * @param packSkipImages New value of property packSkipImages.
+ */
+ public void setPackSkipImages(int packSkipImages) {
+
+ this.packSkipImages = packSkipImages;
+ }
+
+ /**
+ * Getter for property packImageHeight.
+ * @return Value of property packImageHeight.
+ */
+ public int getPackImageHeight() {
+
+ return this.packImageHeight;
+ }
+
+ /**
+ * Setter for property packImageHeight.
+ * @param packImageHeight New value of property packImageHeight.
+ */
+ public void setPackImageHeight(int packImageHeight) {
+
+ this.packImageHeight = packImageHeight;
+ }
+
+ /**
+ * Getter for property unpackAlignment.
+ * @return Value of property unpackAlignment.
+ */
+ public int getUnpackAlignment() {
+
+ return this.unpackAlignment;
+ }
+
+ /**
+ * Setter for property unpackAlignment.
+ * @param unpackAlignment New value of property unpackAlignment.
+ */
+ public void setUnpackAlignment(int unpackAlignment) {
+
+ this.unpackAlignment = unpackAlignment;
+ }
+
+ /**
+ * Getter for property unpackRowLength.
+ * @return Value of property unpackRowLength.
+ */
+ public int getUnpackRowLength() {
+
+ return this.unpackRowLength;
+ }
+
+ /**
+ * Setter for property unpackRowLength.
+ * @param unpackRowLength New value of property unpackRowLength.
+ */
+ public void setUnpackRowLength(int unpackRowLength) {
+
+ this.unpackRowLength = unpackRowLength;
+ }
+
+ /**
+ * Getter for property unpackSkipRows.
+ * @return Value of property unpackSkipRows.
+ */
+ public int getUnpackSkipRows() {
+
+ return this.unpackSkipRows;
+ }
+
+ /**
+ * Setter for property unpackSkipRows.
+ * @param unpackSkipRows New value of property unpackSkipRows.
+ */
+ public void setUnpackSkipRows(int unpackSkipRows) {
+
+ this.unpackSkipRows = unpackSkipRows;
+ }
+
+ /**
+ * Getter for property unpackSkipPixels.
+ * @return Value of property unpackSkipPixels.
+ */
+ public int getUnpackSkipPixels() {
+
+ return this.unpackSkipPixels;
+ }
+
+ /**
+ * Setter for property unpackSkipPixels.
+ * @param unpackSkipPixels New value of property unpackSkipPixels.
+ */
+ public void setUnpackSkipPixels(int unpackSkipPixels) {
+
+ this.unpackSkipPixels = unpackSkipPixels;
+ }
+
+ /**
+ * Getter for property unpackLsbFirst.
+ * @return Value of property unpackLsbFirst.
+ */
+ public boolean getUnpackLsbFirst() {
+
+ return this.unpackLsbFirst;
+ }
+
+ /**
+ * Setter for property unpackLsbFirst.
+ * @param unpackLsbFirst New value of property unpackLsbFirst.
+ */
+ public void setUnpackLsbFirst(boolean unpackLsbFirst) {
+
+ this.unpackLsbFirst = unpackLsbFirst;
+ }
+
+ /**
+ * Getter for property unpackSwapBytes.
+ * @return Value of property unpackSwapBytes.
+ */
+ public boolean getUnpackSwapBytes() {
+
+ return this.unpackSwapBytes;
+ }
+
+ /**
+ * Setter for property unpackSwapBytes.
+ * @param unpackSwapBytes New value of property unpackSwapBytes.
+ */
+ public void setUnpackSwapBytes(boolean unpackSwapBytes) {
+
+ this.unpackSwapBytes = unpackSwapBytes;
+ }
+
+ /**
+ * Getter for property unpackSkipImages.
+ * @return Value of property unpackSkipImages.
+ */
+ public int getUnpackSkipImages() {
+
+ return this.unpackSkipImages;
+ }
+
+ /**
+ * Setter for property unpackSkipImages.
+ * @param unpackSkipImages New value of property unpackSkipImages.
+ */
+ public void setUnpackSkipImages(int unpackSkipImages) {
+
+ this.unpackSkipImages = unpackSkipImages;
+ }
+
+ /**
+ * Getter for property unpackImageHeight.
+ * @return Value of property unpackImageHeight.
+ */
+ public int getUnpackImageHeight() {
+
+ return this.unpackImageHeight;
+ }
+
+ /**
+ * Setter for property unpackImageHeight.
+ * @param unpackImageHeight New value of property unpackImageHeight.
+ */
+ public void setUnpackImageHeight(int unpackImageHeight) {
+
+ this.unpackImageHeight = unpackImageHeight;
+ }
+
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java
new file mode 100644
index 000000000..f51c72ea6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/ScaleInternal.java
@@ -0,0 +1,2447 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.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;
+
+/**
+ *
+ * @author Administrator
+ */
+public class ScaleInternal {
+
+ public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
+
+ public static void scale_internal( int components, int widthin, int heightin,
+ ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
+ float x, lowx, highx, convx, halfconvx;
+ float y, lowy, highy, convy, halfconvy;
+ float xpercent, ypercent;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, yint, xint, xindex, yindex;
+ int temp;
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage( components, widthin, heightin, datain, dataout );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ halfconvx = convx / 2;
+ halfconvy = convy / 2;
+ for( i = 0; i < heightout; i++ ) {
+ y = convy * ( i + 0.5f );
+ if( heightin > heightout ) {
+ highy = y + halfconvy;
+ lowy = y - halfconvy;
+ } else {
+ highy = y + 0.5f;
+ lowy = y - 0.5f;
+ }
+ for( j = 0; j < widthout; j++ ) {
+ x = convx * ( j + 0.5f );
+ if( widthin > widthout ) {
+ highx = x + halfconvx;
+ lowx = x - halfconvx;
+ } else {
+ highx = x + 0.5f;
+ lowx = x - 0.5f;
+ }
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+ area = 0.0f;
+
+ y = lowy;
+ yint = (int)Math.floor( y );
+ while( y < highy ) {
+ yindex = ( yint + heightin ) % heightin;
+ if( highy < yint + 1 ) {
+ ypercent = highy - y;
+ } else {
+ ypercent = yint + 1 - y;
+ }
+
+ x = lowx;
+ xint = (int)Math.floor( x );
+
+ while( x < highx ) {
+ xindex = ( xint + widthin ) % widthin;
+ if( highx < xint + 1 ) {
+ xpercent = highx -x;
+ } else {
+ xpercent = xint + 1 - x;
+ }
+
+ percent = xpercent * ypercent;
+ area += percent;
+ temp = ( xindex + ( yindex * widthin) ) * components;
+ for( k = 0; k < components; k++ ) {
+ totals[k] += datain.get( temp + k ) * percent;
+ }
+
+ xint++;
+ x = xint;
+ }
+ yint++;
+ y = yint;
+ }
+
+ temp = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ // totals[] should be rounded in the case of enlarging an RGB
+ // ramp when the type is 332 or 4444
+ dataout.put( temp + k, (short)((totals[k] + 0.5f) / area) );
+ }
+ }
+ }
+ }
+
+ public static void scale_internal_ubyte( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ ByteBuffer dataout, int element_size, int ysize, int group_size ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_ubyte( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ float f = 0.0f;
+ datain.position( left );
+ f = ( 0x000000FF & datain.get() ) * ( 1.0f - lowx_float );
+ datain.position( right );
+ f += ( 0x000000FF & datain.get() ) * highx_float;
+ totals[k] += f;
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * x_percent;
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() ) * percent;
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += ( 0x000000FF & datain.get() );
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ dataout.position( outindex + k );
+ dataout.put( (byte)(totals[k] / area) );
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scale_internal_byte( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ ByteBuffer dataout, int element_size, int ysize,
+ int group_size ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_byte( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * y_percent;
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ float f = 0.0f;
+ datain.position( left );
+ f = datain.get() * ( 1 - lowx_float );
+ datain.position( right );
+ f += datain.get() * highx_float;
+ totals[k] += f;
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * x_percent;
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * y_percent;
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get() * percent;
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ totals[k] += datain.get();
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ dataout.position( outindex + k );
+ dataout.put( (byte)(totals[k] / area) );
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scale_internal_ushort( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ ShortBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_ushort( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size, myswap_bytes );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
+ } else {
+ totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
+ }
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
+ } else {
+ totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
+ } else {
+ totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+ } else {
+ totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * y_percent;
+ } else {
+ totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+ } else {
+ totals[k] += ( 0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ if( myswap_bytes ) {
+ datain.position( left );
+ float f = (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES(datain.getShort())) * ( 1 - lowx_float );
+ datain.position( right );
+ f += ((0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES(datain.getShort())) * highx_float);
+ totals[k] += f;
+ } else {
+ datain.position( left );
+ float f = ((0x0000FFFF & datain.getShort()) * ( 1 - lowx_float ));
+ datain.position( right );
+ f += ((0x0000FFFF & datain.getShort()) * highx_float);
+ totals[k] += f;
+ }
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() )) * percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * x_percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() )) * percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * y_percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()) ) * percent;
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort()) * percent;
+ }
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort()));
+ } else {
+ totals[k] += (0x0000FFFF & datain.getShort());
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ dataout.position( outindex + k );
+ dataout.put( (short)(totals[k] / area) );
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scale_internal_short( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ ShortBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ int swapbuf; // unsigned buffer
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_short( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size, myswap_bytes );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getShort() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getShort() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ if( myswap_bytes ) {
+ datain.position( left );
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * ( 1 - lowx_float );
+ datain.position( right );
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * highx_float;
+ } else {
+ datain.position( left );
+ totals[k] += datain.getShort() * ( 1 - lowx_float );
+ datain.position( right );
+ totals[k] += datain.getShort() * highx_float;
+ }
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort());
+ totals[k] += swapbuf * x_percent;
+ } else {
+ totals[k] += datain.getShort() * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getShort() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getShort() * percent;
+ }
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
+ totals[k] += swapbuf;
+ } else {
+ totals[k] += datain.getShort();
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ dataout.position( outindex + k );
+ dataout.put( (short)(totals[k] / area) );
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scale_internal_uint( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ IntBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_uint( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size, myswap_bytes );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * y_percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * y_percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()) ) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ if( myswap_bytes ) {
+ datain.position( left );
+ totals[k] += ((0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES(datain.getInt())) * ( 1 - lowx_float ));
+ datain.position( right );
+ totals[k] += ((0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES(datain.getInt())) * highx_float);
+ } else {
+ datain.position( left );
+ totals[k] += ((0x00000000FFFFFFFF & datain.getInt()) * ( 1 - lowx_float ));
+ datain.position( right );
+ totals[k] += ((0x00000000FFFFFFFF & datain.getInt()) * highx_float);
+ }
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * x_percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * y_percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
+ datain.position( temp_index );
+ long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt()) * percent;
+ }
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt()));
+ } else {
+ totals[k] += (0x00000000FFFFFFFF & datain.getInt());
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ float value = 0.0f;
+ for( k = 0; k < components; k++ ) {
+ value = totals[k] / area;
+ dataout.position( outindex + k );
+ if( value >= UINT_MAX ) {
+ dataout.put( (int)value );
+ } else {
+ dataout.put( (int)(totals[k] / area) );
+ }
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scale_internal_int( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ IntBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ long swapbuf; // unsigned buffer
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_int( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size, myswap_bytes );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getInt() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getInt() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ if( myswap_bytes ) {
+ datain.position( left );
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * ( 1 - lowx_float );
+ datain.position( right );
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * highx_float;
+ } else {
+ datain.position( left );
+ totals[k] += (datain.getInt() * ( 1 - lowx_float ));
+ datain.position( right );
+ totals[k] += (datain.getInt() * highx_float);
+ }
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * x_percent;
+ } else {
+ totals[k] += datain.getInt() * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getInt() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getInt() * percent;
+ }
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getInt() );
+ totals[k] += swapbuf;
+ } else {
+ totals[k] += datain.getInt();
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ dataout.position( outindex + k );
+ dataout.put( (int)(totals[k] / area) );
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scale_internal_float( int components, int widthin, int heightin,
+ ByteBuffer datain, int widthout, int heightout,
+ FloatBuffer dataout, int element_size, int ysize,
+ int group_size, boolean myswap_bytes ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+ // Max components in a format is 4, so...
+ float[] totals = new float[4];
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outindex;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ float swapbuf; // unsigned buffer
+
+ if( (widthin == (widthout * 2)) && (heightin == (heightout * 2)) ) {
+ HalveImage.halveImage_float( components, widthin, heightin, datain, dataout,
+ element_size, ysize, group_size, myswap_bytes );
+ return;
+ }
+ convy = (float)heightin / heightout;
+ convx = (float)widthin / widthout;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convy_float;
+
+ for( i = 0; i < heightout; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightin)
+ highy_int = heightin - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthout; j++ ) {
+
+ // Ok, now apply box filter to box that goes from (lowx, lowy)
+ // to (highx, highy) on input data into this pixel on output
+ // data.
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // caulate the value for pixels in the 1st row
+ xindex = lowx_int * group_size;
+ if( ( highy_int > lowy_int ) && ( highx_int > lowx_int ) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * ysize;
+ percent = y_percent * ( 1 - lowx_float );
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getFloat() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ right = temp;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+
+ // calculate the value for pixels in the last row
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getFloat() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+
+ // calculate the value for the pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += ysize;
+ right += ysize;
+ for( k = 0; k < components; k++, left += element_size, right += element_size ) {
+ if( myswap_bytes ) {
+ datain.position( left );
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * ( 1 - lowx_float );
+ datain.position( right );
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * highx_float;
+ } else {
+ datain.position( left );
+ totals[k] += (datain.getFloat() * ( 1 - lowx_float ));
+ datain.position( right );
+ totals[k] += (datain.getFloat() * highx_float);
+ }
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float) * x_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * x_percent;
+ } else {
+ totals[k] += datain.getFloat() * x_percent;
+ }
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += ysize;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += group_size;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * y_percent;
+ } else {
+ totals[k] += datain.getFloat() * y_percent;
+ }
+ }
+ }
+ temp += group_size;
+ percent = y_percent * highx_float;
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + (lowy_int * ysize);
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf * percent;
+ } else {
+ totals[k] += datain.getFloat() * percent;
+ }
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + group_size + ( lowy_int + 1 ) * ysize;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
+ datain.position( temp_index );
+ if( myswap_bytes ) {
+ swapbuf = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
+ totals[k] += swapbuf;
+ } else {
+ totals[k] += datain.getFloat();
+ }
+ }
+ temp += group_size;
+ }
+ temp0 += ysize;
+ }
+
+ outindex = ( j + ( i * widthout ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ dataout.position( outindex + k );
+ dataout.put( (totals[k] / area) );
+ }
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthin - 1) {
+ int delta = (highx_int - widthin + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ }
+
+ public static void scaleInternalPackedPixel( int components, Extract extract,
+ int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
+ int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
+ int rowSizeInBytes, boolean isSwap ) {
+ float x, convx;
+ float y, convy;
+ float percent;
+
+ // max components in a format is 4, so
+ float[] totals = new float[4];
+ float[] extractTotals = new float[4];
+ float[] extractMoreTotals = new float[4];
+ float[] shoveTotals = new float[4];
+
+ float area;
+ int i, j, k, xindex;
+
+ int temp, temp0;
+ int temp_index;
+ int outIndex = 0;
+
+ int lowx_int, highx_int, lowy_int, highy_int;
+ float x_percent, y_percent;
+ float lowx_float, highx_float, lowy_float, highy_float;
+ float convy_float, convx_float;
+ int convy_int, convx_int;
+ int l, m;
+ int left, right;
+
+ if( widthIn == widthOut * 2 && heightIn == heightOut * 2 ) {
+ HalveImage.halveImagePackedPixel( components, extract, widthIn, heightIn, dataIn, dataOut,
+ pixelSizeInBytes, rowSizeInBytes, isSwap );
+ return;
+ }
+ convy = (float)heightIn / (float)heightOut;
+ convx = (float)widthIn / (float)widthOut;
+ convy_int = (int)Math.floor( convy );
+ convy_float = convy - convy_int;
+ convx_int = (int)Math.floor( convx );
+ convx_float = convx - convx_int;
+
+ area = convx * convy;
+
+ lowy_int = 0;
+ lowy_float = 0.0f;
+ highy_int = convy_int;
+ highy_float = convx_float;
+
+ for( i = 0; i < heightOut; i++ ) {
+ // Clamp here to be sure we don't read beyond input buffer.
+ if (highy_int >= heightIn)
+ highy_int = heightIn - 1;
+ lowx_int = 0;
+ lowx_float = 0.0f;
+ highx_int = convx_int;
+ highx_float = convx_float;
+
+ for( j = 0; j < widthOut; j++ ) {
+ // ok now apply box filter to box that goes from( lowx, lowy )
+ // to ( highx, highy ) on input data into this pixel on output data
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+
+ // calculate that value for pixels in the 1st row
+ xindex = lowx_int * pixelSizeInBytes;
+ if( (highy_int > lowy_int) && (highx_int > lowx_int) ) {
+
+ y_percent = 1 - lowy_float;
+ temp = xindex + lowy_int * rowSizeInBytes;
+ percent = y_percent * ( 1 - lowx_float );
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ left = temp;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += pixelSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * y_percent;
+ }
+ }
+ temp += pixelSizeInBytes;
+ right = temp;
+ percent = y_percent * highx_float;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ // calculate the value for pixels in the last row
+
+ y_percent = highy_float;
+ percent = y_percent * ( 1 - lowx_float );
+ temp = xindex + highy_int * rowSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += pixelSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * y_percent;
+ }
+ }
+ temp += pixelSizeInBytes;
+ percent = y_percent * highx_float;
+ dataIn.position( temp );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+
+ // calculate the value for pixels in the 1st and last column
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ left += rowSizeInBytes;
+ right += rowSizeInBytes;
+ dataIn.position( left );
+ extract.extract( isSwap, dataIn, extractTotals );
+ dataIn.position( right );
+ extract.extract( isSwap, dataIn, extractMoreTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += ( extractTotals[k] * ( 1 - lowx_float ) + extractMoreTotals[k] * highx_float );
+ }
+ }
+ } else if( highy_int > lowy_int ) {
+ x_percent = highx_float - lowx_float;
+ percent = ( 1 - lowy_float ) * x_percent;
+ temp = xindex + lowy_int * rowSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp += rowSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * x_percent;
+ }
+ }
+ percent = x_percent * highy_float;
+ temp += rowSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ } else if( highx_int > lowx_int ) {
+ y_percent = highy_float - lowy_float;
+ percent = ( 1 - lowx_float ) * y_percent;
+ temp = xindex + lowy_int * rowSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ temp += pixelSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * y_percent;
+ }
+ }
+ temp += pixelSizeInBytes;
+ percent = y_percent * highx_float;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ } else {
+ percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
+ temp = xindex + lowy_int * rowSizeInBytes;
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ }
+
+ // this is for the pixels in the body
+ temp0 = xindex + pixelSizeInBytes + ( lowy_int + 1 ) * rowSizeInBytes;
+ for( m = lowy_int + 1; m < highy_int; m++ ) {
+ temp = temp0;
+ for( l = lowx_int + 1; l < highx_int; l++ ) {
+ dataIn.position( temp );
+ extract.extract( isSwap, dataIn, extractTotals );
+ for( k = 0; k < components; k++ ) {
+ totals[k] += extractTotals[k] * percent;
+ }
+ temp += pixelSizeInBytes;
+ }
+ temp0 += rowSizeInBytes;
+ }
+
+ outIndex = ( j + ( i * widthOut ) );
+ for( k = 0; k < components; k++ ) {
+ shoveTotals[k] = totals[k] / area;
+ }
+ extract.shove( shoveTotals, outIndex, dataOut );
+ lowx_int = highx_int;
+ lowx_float = highx_float;
+ highx_int += convx_int;
+ highx_float += convx_float;
+ if( highx_float > 1.0f ) {
+ highx_float -= 1.0f;
+ highx_int++;
+ }
+
+ // Clamp to make sure we don't run off the right edge
+ if (highx_int > widthIn - 1) {
+ int delta = (highx_int - widthIn + 1);
+ lowx_int -= delta;
+ highx_int -= delta;
+ }
+ }
+ lowy_int = highy_int;
+ lowy_float = highy_float;
+ highy_int += convy_int;
+ highy_float += convy_float;
+ if( highy_float > 1.0f ) {
+ highy_float -= 1.0f;
+ highy_int++;
+ }
+ }
+ assert( outIndex == ( widthOut * heightOut - 1) );
+ }
+
+ public static void scaleInternal3D( int components, int widthIn, int heightIn,
+ int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
+ int depthOut, ShortBuffer dataOut ) {
+ float x, lowx, highx, convx, halfconvx;
+ float y, lowy, highy, convy, halfconvy;
+ float z, lowz, highz, convz, halfconvz;
+ float xpercent, ypercent, zpercent;
+ float percent;
+ // max compnents in a format is 4
+ float[] totals = new float[4];
+ float volume;
+ int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
+ int temp;
+
+ lowy = highy = lowx = highx = 0.0f;
+
+ convz = (float)depthIn / depthOut;
+ convy = (float)heightIn / heightOut;
+ convx = (float)widthIn / widthOut;
+ halfconvz = convz / 2.0f;
+ halfconvy = convy / 2.0f;
+ halfconvx = convx / 2.0f;
+ for( d = 0; d < depthOut; d++ ) {
+ z = convz * ( d + 0.5f );
+ if( depthIn > depthOut ) {
+ highz = z + halfconvz;
+ lowz = z - halfconvz;
+ } else {
+ highz = z + 0.5f;
+ lowz = z - 0.5f;
+ }
+ for( i = 0; i < heightOut; i++ ) {
+ y = convy * ( i + 0.5f );
+ if( heightIn > heightOut ) {
+ highz = y + halfconvy;
+ lowz = y - halfconvy;
+ } else {
+ highz = y + 0.5f;
+ lowz = y - 0.5f;
+ }
+ for( j = 0; j < widthOut; j++ ) {
+ x = convx * ( j + 0.5f );
+ if( depthIn > depthOut ) {
+ highz = x + halfconvx;
+ lowz = x - halfconvx;
+ } else {
+ highz = x + 0.5f;
+ lowz = x - 0.5f;
+ }
+
+ // Ok, now apply box filter to box that goes from ( lowx, lowy, lowz )
+ // to ( highx, highy, highz ) on input data into this pixel on output data
+
+ totals[0] = totals[1] = totals[2] = totals[3] = 0.0f;
+ volume = 0.0f;
+
+ z = lowz;
+ zint = (int)(Math.floor( z ) );
+ while( z < highz ) {
+ zindex = ( zint + depthIn ) % depthIn;
+ if( highz < zint + 1 ) {
+ zpercent = highz - z;
+ } else {
+ zpercent = zint + 1 - z;
+ }
+
+ y = lowy;
+ yint = (int)(Math.floor( y ) );
+ while( y < highy ) {
+ yindex = ( yint + heightIn ) % heightIn;
+ if( highy < yint + 1 ) {
+ ypercent = highy - y;
+ } else {
+ ypercent = yint + 1 - y;
+ }
+
+ x = lowx;
+ xint = (int)(Math.floor( x ) );
+
+ while( x < highx ) {
+ xindex = (xint + widthIn ) % widthIn;
+ if( highx < xint + 1 ) {
+ xpercent = highx - x;
+ } else {
+ xpercent = xint + 1 - x;
+ }
+
+ percent = xpercent * ypercent * zpercent;
+ volume += percent;
+
+ temp = (xindex + ( yindex *widthIn) + (zindex * widthIn *heightIn)) * components;
+ for( k = 0; k < components; k++ ) {
+ assert( 0 <= (temp+k) && (temp+k) < (widthIn * heightIn * depthIn * components) );
+ totals[k] += dataIn.get( temp + k ) * percent;
+ }
+ xint++;
+ x = xint;
+ } // while x
+ yint++;
+ y = yint;
+ } // while y
+ zint++;
+ z = zint;
+ } // while z
+
+ temp = ( j + ( i * widthOut ) + (d * widthOut * heightOut ) ) * components;
+ for( k = 0; k < components; k++ ) {
+ // totals should be rounded in the case of enlarging an rgb ramp when the type is 332 or 4444
+ assert( 0 <= ( temp + k ) && ( temp + k ) < (widthOut * heightOut* depthOut * components) );
+ dataOut.put( temp + k, (short)((totals[k] + 0.5f) / volume ) );
+ }
+ }
+ }
+ }
+ }
+
+ public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
+ int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
+ int depthOut, int typeOut, ByteBuffer dataOut ) {
+ int components;
+ ShortBuffer beforeImage, afterImage;
+ PixelStorageModes psm = new PixelStorageModes();
+
+ if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
+ widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
+ return( 0 );
+ }
+
+ if( widthIn < 0 || heightIn < 0 || depthIn < 0 ||
+ widthOut < 0 || heightOut < 0 || depthOut < 0 ) {
+ return( GLU.GLU_INVALID_VALUE );
+ }
+
+ if( !Mipmap.legalFormat(format) || !Mipmap.legalType(typeIn) ||
+ !Mipmap.legalType(typeOut) || typeIn == GL2.GL_BITMAP ||
+ typeOut == GL2.GL_BITMAP ) {
+ return( GLU.GLU_INVALID_ENUM );
+ }
+
+ if( !Mipmap.isLegalFormatForPackedPixelType( format, typeIn ) ) {
+ return( GLU.GLU_INVALID_OPERATION );
+ }
+
+ if( !Mipmap.isLegalFormatForPackedPixelType( format, typeOut ) ) {
+ return( GLU.GLU_INVALID_OPERATION );
+ }
+
+ try {
+ beforeImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn,
+ heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ afterImage = InternalBufferUtil.nativeOrder(ByteBuffer.allocateDirect( Mipmap.imageSize3D( widthIn,
+ heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) )).asShortBuffer();
+ } catch( OutOfMemoryError err ) {
+ return( GLU.GLU_OUT_OF_MEMORY );
+ }
+ Mipmap.retrieveStoreModes3D( gl, psm );
+
+ Image.fillImage3D( psm, widthIn, heightIn, depthIn, format, typeIn,
+ Mipmap.is_index( format ), dataIn, beforeImage );
+ components = Mipmap.elements_per_group( format, 0 );
+ ScaleInternal.scaleInternal3D( components, widthIn, heightIn, depthIn,
+ beforeImage, widthOut, heightOut, depthOut, afterImage );
+ Image.emptyImage3D( psm, widthOut, heightOut, depthOut, format, typeOut,
+ Mipmap.is_index( format ), afterImage, dataOut );
+
+ return( 0 );
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java
new file mode 100644
index 000000000..d5c6768b3
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/mipmap/Type_Widget.java
@@ -0,0 +1,224 @@
+/*
+ * License Applicability. Except 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
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.mipmap;
+
+import java.nio.*;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Type_Widget {
+
+ ByteBuffer buffer;
+
+ /** Creates a new instance of Type_Widget */
+ public Type_Widget() {
+ buffer = ByteBuffer.allocateDirect( 4 );
+ }
+
+ public void setUB0( byte b ) {
+ buffer.position( 0 );
+ buffer.put( b );
+ }
+
+ public byte getUB0() {
+ buffer.position( 0 );
+ return( buffer.get() );
+ }
+
+ public void setUB1( byte b ) {
+ buffer.position( 1 );
+ buffer.put( b );
+ }
+
+ public byte getUB1() {
+ buffer.position( 1 );
+ return( buffer.get() );
+ }
+
+ public void setUB2( byte b ) {
+ buffer.position( 2 );
+ buffer.put( b );
+ }
+
+ public byte getUB2() {
+ buffer.position( 2 );
+ return( buffer.get() );
+ }
+
+ public void setUB3( byte b ) {
+ buffer.position( 3 );
+ buffer.put( b );
+ }
+
+ public byte getUB3() {
+ buffer.position( 3 );
+ return( buffer.get() );
+ }
+
+ public void setUS0( short s ) {
+ buffer.position( 0 );
+ buffer.putShort( s );
+ }
+
+ public short getUS0() {
+ buffer.position( 0 );
+ return( buffer.getShort() );
+ }
+
+ public void setUS1( short s ) {
+ buffer.position( 2 );
+ buffer.putShort( s );
+ }
+
+ public short getUS1() {
+ buffer.position( 2 );
+ return( buffer.getShort() );
+ }
+
+ public void setUI( int i ) {
+ buffer.position( 0 );
+ buffer.putInt( i );
+ }
+
+ public int getUI() {
+ buffer.position( 0 );
+ return( buffer.getInt() );
+ }
+
+ public void setB0( byte b ) {
+ buffer.position( 0 );
+ buffer.put( b );
+ }
+
+ public byte getB0() {
+ buffer.position( 0 );
+ return( buffer.get() );
+ }
+
+ public void setB1( byte b ) {
+ buffer.position( 1 );
+ buffer.put( b );
+ }
+
+ public byte getB1() {
+ buffer.position( 1 );
+ return( buffer.get() );
+ }
+
+ public void setB2( byte b ) {
+ buffer.position( 2 );
+ buffer.put( b );
+ }
+
+ public byte getB2() {
+ buffer.position( 2 );
+ return( buffer.get() );
+ }
+
+ public void setB3( byte b ) {
+ buffer.position( 3 );
+ buffer.put( b );
+ }
+
+ public byte getB3() {
+ buffer.position( 3 );
+ return( buffer.get() );
+ }
+
+ public void setS0( short s ) {
+ buffer.position( 0 );
+ buffer.putShort( s );
+ }
+
+ public short getS0() {
+ buffer.position( 0 );
+ return( buffer.getShort() );
+ }
+
+ public void setS1( short s ) {
+ buffer.position( 2 );
+ buffer.putShort( s );
+ }
+
+ public short getS1() {
+ buffer.position( 2 );
+ return( buffer.getShort() );
+ }
+
+ public void setI( int i ) {
+ buffer.position( 0 );
+ buffer.putInt( i );
+ }
+
+ public int getI() {
+ buffer.position( 0 );
+ return( buffer.getInt() );
+ }
+
+ public void setF( float f ) {
+ buffer.position( 0 );
+ buffer.putFloat( f );
+ }
+
+ public float getF() {
+ buffer.position( 0 );
+ return( buffer.getFloat() );
+ }
+
+ public ByteBuffer getBuffer() {
+ buffer.rewind();
+ return( buffer );
+ }
+
+ public static void main( String args[] ) {
+ Type_Widget t = new Type_Widget();
+ t.setI( 1000000 );
+
+ System.out.println("int: " + Integer.toHexString( t.getI() ) );
+
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java
new file mode 100755
index 000000000..e96aa83f8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Arc.java
@@ -0,0 +1,258 @@
+package com.sun.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
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+*/
+
+/**
+ * Trimming arc
+ * @author Tomas Hrasky
+ *
+ */
+public class Arc {
+ /**
+ * Corresponding picewise-linear arc
+ */
+ public PwlArc pwlArc;
+
+ /**
+ * Arc type
+ */
+ private long type;
+
+ /**
+ * Arc link in linked list
+ */
+ public Arc link;
+
+ /**
+ * Previous arc
+ */
+ Arc prev;
+
+ /**
+ * Next arc
+ */
+ Arc next;
+
+ /**
+ * Corresponding berizer type arc
+ */
+ private BezierArc bezierArc;
+
+ /**
+ * Makes new arc at specified side
+ *
+ * @param side
+ * which side doeas this arc form
+ */
+ public Arc(int side) {
+ bezierArc = null;
+ pwlArc = null;
+ type = 0;
+ setside(side);
+ // nuid=_nuid
+ }
+
+ /**
+ * Sets side the arc is at
+ *
+ * @param side
+ * arc side
+ */
+ private void setside(int side) {
+ // DONE
+ clearside();
+ type |= side << 8;
+ }
+
+ /**
+ * Unsets side
+ */
+ private void clearside() {
+ // DONE
+ type &= ~(0x7 << 8);
+ }
+
+ // this one replaces enum arc_side
+ /**
+ * Side not specified
+ */
+ public static final int ARC_NONE = 0;
+
+ /**
+ * Arc on right
+ */
+ public static final int ARC_RIGHT = 1;
+
+ /**
+ * Arc on top
+ */
+ public static final int ARC_TOP = 2;
+
+ /**
+ * Arc on left
+ */
+ public static final int ARC_LEFT = 3;
+
+ /**
+ * Arc on bottom
+ */
+ public static final int ARC_BOTTOM = 4;
+
+ /**
+ * Bezier type flag
+ */
+ private static final long BEZIER_TAG = 1 << 13;
+
+ /**
+ * Arc type flag
+ */
+ private static final long ARC_TAG = 1 << 3;
+
+ /**
+ * Tail type tag
+ */
+ private static final long TAIL_TAG = 1 << 6;
+
+ /**
+ * Appends arc to the list
+ *
+ * @param jarc
+ * arc to be append
+ * @return this
+ */
+ public Arc append(Arc jarc) {
+ // DONE
+ if (jarc != null) {
+ next = jarc.next;
+ prev = jarc;
+ next.prev = this;
+ prev.next = this;
+ } else {
+ next = this;
+ prev = this;
+ }
+
+ return this;
+ }
+
+ /**
+ * Unused
+ *
+ * @return true
+ */
+ public boolean check() {
+ return true;
+ }
+
+ /**
+ * Sets bezier type flag
+ */
+ public void setbezier() {
+ // DONE
+ type |= BEZIER_TAG;
+
+ }
+
+ /**
+ * Returns tail of linked list coords
+ *
+ * @return tail coords
+ */
+ public float[] tail() {
+ // DONE
+ return pwlArc.pts[0].param;
+ }
+
+ /**
+ * Returns head of linked list coords
+ *
+ * @return head coords
+ */
+ public float[] head() {
+ // DONE
+ return next.pwlArc.pts[0].param;
+ }
+
+ /**
+ * Returns whether arc is marked with arc_tag
+ *
+ * @return is arc marked with arc_tag
+ */
+ public boolean ismarked() {
+ // DONE
+ return ((type & ARC_TAG) > 0) ? true : false;
+ }
+
+ /**
+ * Cleans arc_tag flag
+ */
+ public void clearmark() {
+ // DONE
+ type &= (~ARC_TAG);
+ }
+
+ /**
+ * Sets arc_tag flag
+ */
+ public void setmark() {
+ // DONE
+ type |= ARC_TAG;
+ }
+
+ /**
+ * sets tail tag
+ */
+ public void setitail() {
+ // DONE
+ type |= TAIL_TAG;
+ }
+
+ /**
+ * Returns whether arc is marked tail
+ *
+ * @return is tail
+ */
+ public boolean getitail() {
+ return false;
+ }
+
+ /**
+ * Unsets tail tag
+ */
+ public void clearitail() {
+ // DONE
+ type &= (~TAIL_TAG);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java
new file mode 100755
index 000000000..f8fbe2930
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcSdirSorter.java
@@ -0,0 +1,63 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for sorting list of Arcs
+ * @author Tomas Hrasky
+ *
+ */
+public class ArcSdirSorter {
+
+ /**
+ * Makes new ArcSdirSorter with Subdivider
+ * @param subdivider subdivider
+ */
+ public ArcSdirSorter(Subdivider subdivider) {
+ //TODO
+ // System.out.println("TODO arcsdirsorter.constructor");
+ }
+
+ /**
+ * Sorts list of arcs
+ * @param list arc list to be sorted
+ * @param count size of list
+ */
+ public void qsort(CArrayOfArcs list, int count) {
+ // TODO
+ // System.out.println("TODO arcsdirsorter.qsort");
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java
new file mode 100755
index 000000000..9e9a10b42
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTdirSorter.java
@@ -0,0 +1,60 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for sorting list of Arcs
+ * @author Tomas Hrasky
+ *
+ */
+public class ArcTdirSorter {
+ /**
+ * Makes new ArcSdirSorter with Subdivider
+ * @param subdivider subdivider
+ */
+ public ArcTdirSorter(Subdivider subdivider) {
+ // TODO Auto-generated constructor stub
+ // System.out.println("TODO arcTsorter.konstruktor");
+ }
+ /**
+ * Sorts list of arcs
+ * @param list arc list to be sorted
+ * @param count size of list
+ */
+ public void qsort(CArrayOfArcs list, int count) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO arcTsorter.qsort");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java
new file mode 100755
index 000000000..496e8b7d6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/ArcTesselator.java
@@ -0,0 +1,90 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for arc tesselation
+ * @author Tomas Hrasky
+ *
+ */
+public class ArcTesselator {
+
+ /**
+ * Makes given arc an bezier arc
+ * @param arc arc to work with
+ * @param s1 minimum s param
+ * @param s2 maximum s param
+ * @param t1 minimum t param
+ * @param t2 maximum s param
+ */
+ public void bezier(Arc arc, float s1, float s2, float t1, float t2) {
+ // DONE
+ TrimVertex[] p = new TrimVertex[2];
+ p[0] = new TrimVertex();
+ p[1] = new TrimVertex();
+ arc.pwlArc = new PwlArc(2, p);
+ p[0].param[0] = s1;
+ p[0].param[1] = s2;
+ p[1].param[0] = t1;
+ p[1].param[1] = t2;
+ arc.setbezier();
+ }
+
+ /**
+ * Empty method
+ * @param newright arc to work with
+ * @param s first tail
+ * @param t2 second tail
+ * @param t1 third tail
+ * @param f stepsize
+ */
+ public void pwl_right(Arc newright, float s, float t1, float t2, float f) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO arctesselator.pwl_right");
+ }
+
+ /**
+ * Empty method
+ * @param newright arc to work with
+ * @param s first tail
+ * @param t2 second tail
+ * @param t1 third tail
+ * @param f stepsize
+ */
+ public void pwl_left(Arc newright, float s, float t2, float t1, float f) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO arctesselator.pwl_left");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java
new file mode 100755
index 000000000..9467104f5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Backend.java
@@ -0,0 +1,217 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class responsible for rendering
+ * @author Tomas Hrasky
+ *
+ */
+public abstract class Backend {
+
+ /**
+ * Fill surface
+ */
+ public static final int N_MESHFILL = 0;
+
+ /**
+ * Draw surface as wire model
+ */
+ public static final int N_MESHLINE = 1;
+
+ /**
+ * Draw surface with points
+ */
+ public static final int N_MESHPOINT = 2;
+
+ /**
+ * Object rendering curves
+ */
+ protected CurveEvaluator curveEvaluator;
+
+ /**
+ * Object rendering surfaces
+ */
+ protected SurfaceEvaluator surfaceEvaluator;
+
+ /**
+ * Makes new backend
+ */
+ public Backend() {
+ // curveEvaluator = new OpenGLCurveEvaluator();
+ // surfaceEvaluator = new OpenGLSurfaceEvaluator();
+ }
+
+ /**
+ * Begin a curve
+ */
+ public void bgncurv() {
+ // DONE
+ curveEvaluator.bgnmap1f();
+
+ }
+
+ /**
+ * End a curve
+ */
+ public void endcurv() {
+ // DONE
+ curveEvaluator.endmap1f();
+
+ }
+
+ /**
+ * Make cuve with given parameters
+ * @param type curve type
+ * @param ps control points
+ * @param stride control points coordinates number
+ * @param order order of curve
+ * @param ulo smallest u
+ * @param uhi highest u
+ */
+ public void curvpts(int type, CArrayOfFloats ps, int stride, int order,
+ float ulo, float uhi) {
+ // DONE
+ curveEvaluator.map1f(type, ulo, uhi, stride, order, ps);
+ curveEvaluator.enable(type);
+ }
+
+ /**
+ * Draw curve
+ * @param u1 smallest u
+ * @param u2 highest u
+ * @param nu number of pieces
+ */
+ public void curvgrid(float u1, float u2, int nu) {
+ // DONE
+ curveEvaluator.mapgrid1f(nu, u1, u2);
+
+ }
+
+ /**
+ * Evaluates curve mesh
+ * @param from low param
+ * @param n step
+ */
+ public void curvmesh(int from, int n) {
+ // DONE
+ curveEvaluator.mapmesh1f(N_MESHFILL, from, from + n);
+ }
+
+ /**
+ * Begin surface
+ * @param wiretris use triangles
+ * @param wirequads use quads
+ */
+ public void bgnsurf(int wiretris, int wirequads) {
+ // DONE
+ surfaceEvaluator.bgnmap2f();
+
+ if (wiretris > 0)
+ surfaceEvaluator.polymode(NurbsConsts.N_MESHLINE);
+ else
+ surfaceEvaluator.polymode(NurbsConsts.N_MESHFILL);
+ }
+
+ /**
+ * End surface
+ */
+ public void endsurf() {
+ // DONE
+ surfaceEvaluator.endmap2f();
+ }
+
+ /**
+ * Empty method
+ * @param ulo low u param
+ * @param uhi hig u param
+ * @param vlo low v param
+ * @param vhi high v param
+ */
+ public void patch(float ulo, float uhi, float vlo, float vhi) {
+ // DONE
+ surfaceEvaluator.domain2f(ulo, uhi, vlo, vhi);
+ }
+
+ /**
+ * Draw surface
+ * @param u0 lowest u
+ * @param u1 highest u
+ * @param nu number of pieces in u direction
+ * @param v0 lowest v
+ * @param v1 highest v
+ * @param nv number of pieces in v direction
+ */
+ public void surfgrid(float u0, float u1, int nu, float v0, float v1, int nv) {
+ // DONE
+ surfaceEvaluator.mapgrid2f(nu, u0, u1, nv, v0, v1);
+
+ }
+
+ /**
+ * Evaluates surface mesh
+ * @param u u param
+ * @param v v param
+ * @param n step in u direction
+ * @param m step in v direction
+ */
+ public void surfmesh(int u, int v, int n, int m) {
+ // System.out.println("TODO backend.surfmesh wireframequads");
+ // TODO wireframequads
+ surfaceEvaluator.mapmesh2f(NurbsConsts.N_MESHFILL, u, u + n, v, v + m);
+ }
+
+ /**
+ * Make surface
+ * @param type surface type
+ * @param pts control points
+ * @param ustride control points coordinates in u direction
+ * @param vstride control points coordinates in v direction
+ * @param uorder surface order in u direction
+ * @param vorder surface order in v direction
+ * @param ulo lowest u
+ * @param uhi hightest u
+ * @param vlo lowest v
+ * @param vhi hightest v
+ */
+ public void surfpts(int type, CArrayOfFloats pts, int ustride, int vstride,
+ int uorder, int vorder, float ulo, float uhi, float vlo, float vhi) {
+ // DONE
+ surfaceEvaluator.map2f(type, ulo, uhi, ustride, uorder, vlo, vhi,
+ vstride, vorder, pts);
+ surfaceEvaluator.enable(type);
+
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java
new file mode 100755
index 000000000..ef4cf0684
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/BezierArc.java
@@ -0,0 +1,44 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomas Hrasky
+ *
+ */
+public class BezierArc {
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java
new file mode 100755
index 000000000..0f0806d96
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Bin.java
@@ -0,0 +1,155 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding trimming arcs
+ * @author Tomas Hrasky
+ *
+ */
+public class Bin {
+
+ /**
+ * Head of linked list of arcs
+ */
+ private Arc head;
+
+ /**
+ * Current arc
+ */
+ private Arc current;
+
+ /**
+ * Indicates whether there are any Arcs in linked list
+ * @return true if there are any Arcs in linked list
+ */
+ public boolean isnonempty() {
+ // DONE
+ return this.head != null ? true : false;
+ }
+
+ /**
+ * Adds and arc to linked list
+ * @param jarc added arc
+ */
+ public void addarc(Arc jarc) {
+ // DONE
+ // if (head == null)
+ // head = jarc;
+ // else {
+ jarc.link = head;
+ head = jarc;
+ // }
+
+ }
+
+ /**
+ * Returns number of arcs in linked list
+ * @return number of arcs
+ */
+ public int numarcs() {
+ // DONE
+ int count = 0;
+ for (Arc jarc = firstarc(); jarc != null; jarc = nextarc())
+ count++;
+ return count;
+ }
+
+ /**
+ * Removes first arc in list
+ * @return new linked list head
+ */
+ public Arc removearc() {
+ // DONE
+ Arc jarc = head;
+ if (jarc != null)
+ head = jarc.link;
+ return jarc;
+
+ }
+
+ /**
+ * Consolidates linked list
+ */
+ public void adopt() {
+ // DONE
+ markall();
+
+ Arc orphan;
+ while ((orphan = removearc()) != null) {
+ for (Arc parent = orphan.next; !parent.equals(orphan); parent = parent.next) {
+ if (!parent.ismarked()) {
+ orphan.link = parent.link;
+ parent.link = orphan;
+ orphan.clearmark();
+ break;
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Marks all arc in linked list
+ */
+ private void markall() {
+ // DONE
+ for (Arc jarc = firstarc(); jarc != null; jarc = nextarc())
+ jarc.setmark();
+ }
+
+ /**
+ * Returns first arc in linked list
+ * @return first arc in linked list
+ */
+ private Arc firstarc() {
+ // DONE
+ current = head;
+ return nextarc();
+ }
+
+ /**
+ * Returns next arc in linked list
+ * @return next arc
+ *
+ */
+ private Arc nextarc() {
+ // DONE
+ Arc jarc = current;
+ if (jarc != null)
+ current = jarc.link;
+ return jarc;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java
new file mode 100755
index 000000000..9cccc5102
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Breakpt.java
@@ -0,0 +1,59 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding break point parameters
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class Breakpt {
+
+ /**
+ * Breakpoint multiplicity
+ */
+ public int multi;
+
+ /**
+ * Breakpint value
+ */
+ public float value;
+
+ /**
+ * Breakpoint deficit (how many times it has to be added)
+ */
+ public int def;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java
new file mode 100755
index 000000000..3d6e1d47f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfArcs.java
@@ -0,0 +1,194 @@
+package com.sun.opengl.impl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class CArrayOfArcs {
+ /**
+ * Underlaying array
+ */
+ private Arc[] array;
+
+ /**
+ * Pointer to array member
+ */
+ private int pointer;
+
+ /**
+ * Don't check for array borders?
+ */
+ private boolean noCheck = true;
+
+ /**
+ * Makes new CArray
+ *
+ * @param array
+ * underlaying array
+ * @param pointer
+ * pointer (index) to array
+ */
+ public CArrayOfArcs(Arc[] array, int pointer) {
+ this.array = array;
+ // this.pointer=pointer;
+ setPointer(pointer);
+ }
+
+ /**
+ * Makes new CArray from other CArray
+ *
+ * @param carray
+ * reference array
+ */
+ public CArrayOfArcs(CArrayOfArcs carray) {
+ this.array = carray.array;
+ // this.pointer=carray.pointer;
+ setPointer(carray.pointer);
+ }
+
+ /**
+ * Makes new CArray with pointer set to 0
+ *
+ * @param ctlarray
+ * underlaying array
+ */
+ public CArrayOfArcs(Arc[] ctlarray) {
+ this.array = ctlarray;
+ this.pointer = 0;
+ }
+
+ /**
+ * Returns element at pointer
+ *
+ * @return element at pointer
+ */
+ public Arc get() {
+ return array[pointer];
+ }
+
+ /**
+ * Increases pointer by one (++)
+ */
+ public void pp() {
+ // pointer++;
+ setPointer(pointer + 1);
+ }
+
+ /**
+ * Sets element at pointer
+ *
+ * @param f
+ * desired value
+ */
+ public void set(Arc f) {
+ array[pointer] = f;
+
+ }
+
+ /**
+ * Returns array element at specified index
+ *
+ * @param i
+ * array index
+ * @return element at index
+ */
+ public Arc get(int i) {
+ return array[i];
+ }
+
+ /**
+ * Returns array element at specified index relatively to pointer
+ *
+ * @param i
+ * relative index
+ * @return element at relative index
+ */
+ public Arc getRelative(int i) {
+ return array[pointer + i];
+ }
+
+ /**
+ * Sets value of element at specified index relatively to pointer
+ *
+ * @param i
+ * relative index
+ * @param value
+ * value to be set
+ */
+ public void setRelative(int i, Arc value) {
+ array[pointer + i] = value;
+ }
+
+ /**
+ * Lessens pointer by value
+ *
+ * @param i
+ * lessen by
+ */
+ public void lessenPointerBy(int i) {
+ // pointer-=i;
+ setPointer(pointer - i);
+ }
+
+ /**
+ * Returns pointer value
+ *
+ * @return pointer value
+ */
+ public int getPointer() {
+ return pointer;
+ }
+
+ /**
+ * Sets ponter value
+ *
+ * @param pointer
+ * pointer value to be set
+ */
+ public void setPointer(int pointer) {
+ if (!noCheck && pointer > array.length)
+ throw new IllegalArgumentException("Pointer " + pointer
+ + " out of bounds " + array.length);
+ this.pointer = pointer;
+ }
+
+ /**
+ * Raises pointer by value
+ *
+ * @param i
+ * raise by
+ */
+ public void raisePointerBy(int i) {
+ // pointer+=i;
+ setPointer(pointer + i);
+ }
+
+ /**
+ * Lessens ponter by one (--)
+ */
+ public void mm() {
+ // pointer--;
+ setPointer(pointer - 1);
+ }
+
+ /**
+ * Returns underlaying array
+ *
+ * @return underlaying array
+ */
+ public Arc[] getArray() {
+ return array;
+ }
+
+ /**
+ * Sets underlaying array
+ *
+ * @param array
+ * underlaying array
+ */
+ public void setArray(Arc[] array) {
+ this.array = array;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java
new file mode 100755
index 000000000..f5932d954
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfBreakpts.java
@@ -0,0 +1,130 @@
+package com.sun.opengl.impl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class CArrayOfBreakpts {
+ /**
+ * Underlaying array
+ */
+ private Breakpt[] pole;
+
+ /**
+ * Pointer to array member
+ */
+ private int pointer;
+
+ /**
+ * Makes new CArray
+ *
+ * @param array
+ * underlaying array
+ * @param pointer
+ * pointer (index) to array
+ */
+ public CArrayOfBreakpts(Breakpt[] array, int pointer) {
+ this.pole = array;
+ this.pointer = pointer;
+ }
+
+ /**
+ * Makes new CArray from other CArray
+ *
+ * @param carray
+ * reference array
+ */
+ public CArrayOfBreakpts(CArrayOfBreakpts carray) {
+ this.pole = carray.pole;
+ this.pointer = carray.pointer;
+ }
+
+ /**
+ * Returns element at pointer
+ *
+ * @return element at pointer
+ */
+ public Breakpt get() {
+ return pole[pointer];
+ }
+
+ /**
+ * Increases pointer by one (++)
+ */
+ public void pp() {
+ pointer++;
+ }
+
+ /**
+ * Sets element at pointer
+ *
+ * @param f
+ * desired value
+ */
+ public void set(Breakpt f) {
+ pole[pointer] = f;
+
+ }
+
+ /**
+ * Returns array element at specified index
+ *
+ * @param i
+ * array index
+ * @return element at index
+ */
+ public Breakpt get(int i) {
+ return pole[i];
+ }
+
+ /**
+ * Lessens pointer by value
+ *
+ * @param i
+ * lessen by
+ */
+ public void lessenPointerBy(int i) {
+ pointer -= i;
+
+ }
+
+ /**
+ * Returns pointer value
+ *
+ * @return pointer value
+ */
+ public int getPointer() {
+ return pointer;
+ }
+
+ /**
+ * Sets ponter value
+ *
+ * @param pointer
+ * pointer value to be set
+ */
+ public void setPointer(int pointer) {
+ this.pointer = pointer;
+ }
+
+ /**
+ * Raises pointer by value
+ *
+ * @param i
+ * raise by
+ */
+ public void raisePointerBy(int i) {
+ pointer += i;
+
+ }
+
+ /**
+ * Lessens ponter by one (--)
+ */
+ public void mm() {
+ pointer--;
+
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java
new file mode 100755
index 000000000..fb3fac69b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfFloats.java
@@ -0,0 +1,195 @@
+package com.sun.opengl.impl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class CArrayOfFloats {
+
+ /**
+ * Underlaying array
+ */
+ private float[] array;
+
+ /**
+ * Pointer to array member
+ */
+ private int pointer;
+
+ /**
+ * Don't check for array borders?
+ */
+ private boolean noCheck = true;
+
+ /**
+ * Makes new CArray
+ *
+ * @param array
+ * underlaying array
+ * @param pointer
+ * pointer (index) to array
+ */
+ public CArrayOfFloats(float[] array, int pointer) {
+ this.array = array;
+ // this.pointer=pointer;
+ setPointer(pointer);
+ }
+
+ /**
+ * Makes new CArray from other CArray
+ *
+ * @param carray
+ * reference array
+ */
+ public CArrayOfFloats(CArrayOfFloats carray) {
+ this.array = carray.array;
+ // this.pointer=carray.pointer;
+ setPointer(carray.pointer);
+ }
+
+ /**
+ * Makes new CArray with pointer set to 0
+ *
+ * @param ctlarray
+ * underlaying array
+ */
+ public CArrayOfFloats(float[] ctlarray) {
+ this.array = ctlarray;
+ this.pointer = 0;
+ }
+
+ /**
+ * Returns element at pointer
+ *
+ * @return element at pointer
+ */
+ public float get() {
+ return array[pointer];
+ }
+
+ /**
+ * Increases pointer by one (++)
+ */
+ public void pp() {
+ // pointer++;
+ setPointer(pointer + 1);
+ }
+
+ /**
+ * Sets element at pointer
+ *
+ * @param f
+ * desired value
+ */
+ public void set(float f) {
+ array[pointer] = f;
+
+ }
+
+ /**
+ * Returns array element at specified index
+ *
+ * @param i
+ * array index
+ * @return element at index
+ */
+ public float get(int i) {
+ return array[i];
+ }
+
+ /**
+ * Returns array element at specified index relatively to pointer
+ *
+ * @param i
+ * relative index
+ * @return element at relative index
+ */
+ public float getRelative(int i) {
+ return array[pointer + i];
+ }
+
+ /**
+ * Sets value of element at specified index relatively to pointer
+ *
+ * @param i
+ * relative index
+ * @param value
+ * value to be set
+ */
+ public void setRelative(int i, float value) {
+ array[pointer + i] = value;
+ }
+
+ /**
+ * Lessens pointer by value
+ *
+ * @param i
+ * lessen by
+ */
+ public void lessenPointerBy(int i) {
+ // pointer-=i;
+ setPointer(pointer - i);
+ }
+
+ /**
+ * Returns pointer value
+ *
+ * @return pointer value
+ */
+ public int getPointer() {
+ return pointer;
+ }
+
+ /**
+ * Sets ponter value
+ *
+ * @param pointer
+ * pointer value to be set
+ */
+ public void setPointer(int pointer) {
+ if (!noCheck && pointer > array.length)
+ throw new IllegalArgumentException("Pointer " + pointer
+ + " out of bounds " + array.length);
+ this.pointer = pointer;
+ }
+
+ /**
+ * Raises pointer by value
+ *
+ * @param i
+ * raise by
+ */
+ public void raisePointerBy(int i) {
+ // pointer+=i;
+ setPointer(pointer + i);
+ }
+
+ /**
+ * Lessens ponter by one (--)
+ */
+ public void mm() {
+ // pointer--;
+ setPointer(pointer - 1);
+ }
+
+ /**
+ * Returns underlaying array
+ *
+ * @return underlaying array
+ */
+ public float[] getArray() {
+ return array;
+ }
+
+ /**
+ * Sets underlaying array
+ *
+ * @param array
+ * underlaying array
+ */
+ public void setArray(float[] array) {
+ this.array = array;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java
new file mode 100755
index 000000000..fed301895
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -0,0 +1,160 @@
+package com.sun.opengl.impl.glu.nurbs;
+
+/**
+ * Class replacing C language pointer
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class CArrayOfQuiltspecs {
+ /**
+ * Underlaying array
+ */
+ private Quiltspec[] array;
+
+ /**
+ * Pointer to array member
+ */
+ private int pointer;
+
+ /**
+ * Makes new CArray
+ *
+ * @param array
+ * underlaying array
+ * @param pointer
+ * pointer (index) to array
+ */
+ public CArrayOfQuiltspecs(Quiltspec[] array, int pointer) {
+ this.array = array;
+ this.pointer = pointer;
+ }
+
+ /**
+ * Makes new CArray from other CArray
+ *
+ * @param carray
+ * reference array
+ */
+ public CArrayOfQuiltspecs(CArrayOfQuiltspecs carray) {
+ this.array = carray.array;
+ this.pointer = carray.pointer;
+ }
+
+ /**
+ * Makes new CArray with pointer set to 0
+ *
+ * @param array
+ * underlaying array
+ */
+ public CArrayOfQuiltspecs(Quiltspec[] array) {
+ this.array = array;
+ this.pointer = 0;
+ }
+
+ /**
+ * Returns element at pointer
+ *
+ * @return element at pointer
+ */
+ public Quiltspec get() {
+ return array[pointer];
+ }
+
+ /**
+ * Increases pointer by one (++)
+ */
+ public void pp() {
+ pointer++;
+ }
+
+ /**
+ * Sets element at pointer
+ *
+ * @param f
+ * desired value
+ */
+ public void set(Quiltspec f) {
+ array[pointer] = f;
+
+ }
+
+ /**
+ * Returns array element at specified index
+ *
+ * @param i
+ * array index
+ * @return element at index
+ */
+ public Quiltspec get(int i) {
+ return array[i];
+ }
+
+ /**
+ * Lessens pointer by value
+ *
+ * @param i
+ * lessen by
+ */
+ public void lessenPointerBy(int i) {
+ pointer -= i;
+
+ }
+
+ /**
+ * Returns pointer value
+ *
+ * @return pointer value
+ */
+ public int getPointer() {
+ return pointer;
+ }
+
+ /**
+ * Sets ponter value
+ *
+ * @param pointer
+ * pointer value to be set
+ */
+ public void setPointer(int pointer) {
+ this.pointer = pointer;
+ }
+
+ /**
+ * Raises pointer by value
+ *
+ * @param i
+ * raise by
+ */
+ public void raisePointerBy(int i) {
+ pointer += i;
+
+ }
+
+ /**
+ * Lessens ponter by one (--)
+ */
+ public void mm() {
+ pointer--;
+
+ }
+
+ /**
+ * Returns underlaying array
+ *
+ * @return underlaying array
+ */
+ public Quiltspec[] getArray() {
+ return array;
+ }
+
+ /**
+ * Sets underlaying array
+ *
+ * @param array
+ * underlaying array
+ */
+ public void setArray(Quiltspec[] array) {
+ this.array = array;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java
new file mode 100755
index 000000000..318c8416c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curve.java
@@ -0,0 +1,238 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding curve definition
+ * @author Tomáš Hráský
+ *
+ */
+public class Curve {
+
+ /**
+ * Maximum coordinates per control point
+ */
+ private static final int MAXCOORDS = 5;
+
+ /**
+ * Max curve order
+ */
+ private static final int MAXORDER = 24;
+
+ /**
+ * Next curve in linked list
+ */
+ public Curve next;
+
+ /**
+ * OpenGL maps
+ */
+ private Mapdesc mapdesc;
+
+ /**
+ * Does the curve need sampling
+ */
+ private boolean needsSampling;
+
+ /**
+ * Culling
+ */
+ private int cullval;
+
+ /**
+ * Number of coords
+ */
+ private int stride;
+
+ /**
+ * Curve order
+ */
+ private int order;
+
+ /**
+ * Holds conversion range borders
+ */
+ private float[] range;
+
+ /**
+ * Subdivision stepsize
+ */
+ public float stepsize;
+
+ /**
+ * Minimal subdivision stepsize
+ */
+ private float minstepsize;
+
+ /**
+ * Sampling points
+ */
+ float[] spts;
+
+ /**
+ * Makes new Curve
+ *
+ * @param geo
+ * @param pta
+ * @param ptb
+ * @param c
+ * next curve in linked list
+ */
+ public Curve(Quilt geo, float[] pta, float[] ptb, Curve c) {
+
+ spts = new float[MAXORDER * MAXCOORDS];
+
+ mapdesc = geo.mapdesc;
+
+ next = c;
+ needsSampling = mapdesc.isRangeSampling() ? true : false;
+
+ cullval = mapdesc.isCulling() ? Subdivider.CULL_ACCEPT
+ : Subdivider.CULL_TRIVIAL_REJECT;
+ order = geo.qspec.get(0).order;
+ stride = MAXCOORDS;
+
+ // CArrayOfFloats ps = geo.cpts;
+ CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
+ CArrayOfQuiltspecs qs = geo.qspec;
+ ps.raisePointerBy(qs.get().offset);
+ ps.raisePointerBy(qs.get().index * qs.get().order * qs.get().stride);
+
+ if (needsSampling) {
+ mapdesc.xformSampling(ps, qs.get().order, qs.get().stride, spts,
+ stride);
+ }
+ if (cullval == Subdivider.CULL_ACCEPT) {
+ // System.out.println("TODO curve.Curve-cullval");
+ // mapdesc.xformCulling(ps,qs.get().order,qs.get().stride,cpts,stride);
+ }
+
+ range = new float[3];
+ range[0] = qs.get().breakpoints[qs.get().index];
+ range[1] = qs.get().breakpoints[qs.get().index + 1];
+ range[2] = range[1] - range[0];
+ // TODO it is necessary to solve problem with "this" pointer here
+ if (range[0] != pta[0]) {
+ // System.out.println("TODO curve.Curve-range0");
+ // Curve lower=new Curve(this,pta,0);
+ // lower.next=next;
+ // this=lower;
+ }
+ if (range[1] != ptb[0]) {
+ // System.out.println("TODO curve.Curve-range1");
+ // Curve lower=new Curve(this,ptb,0);
+ }
+ }
+
+ /**
+ * Checks culling type
+ * @return Subdivider.CULL_ACCEPT
+ */
+ public int cullCheck() {
+ if (cullval == Subdivider.CULL_ACCEPT) {
+ // System.out.println("TODO curve.cullval");
+ // cullval=mapdesc.cullCheck(cpts,order,stride);
+ }
+ // TODO compute cullval and return the computed value
+ // return cullval;
+ return Subdivider.CULL_ACCEPT;
+ }
+
+ /**
+ * Computes subdivision step size
+ */
+ public void getStepSize() {
+ minstepsize = 0;
+ if (mapdesc.isConstantSampling()) {
+ setstepsize(mapdesc.maxrate);
+ } else if (mapdesc.isDomainSampling()) {
+ setstepsize(mapdesc.maxrate * range[2]);
+ } else {
+ assert (order <= MAXORDER);
+
+ float tmp[][] = new float[MAXORDER][MAXCOORDS];
+
+ int tstride = (MAXORDER);
+
+ int val = 0;
+ // mapdesc.project(spts,stride,tmp,tstride,order);
+
+ // System.out.println("TODO curve.getsptepsize mapdesc.project");
+
+ if (val == 0) {
+ setstepsize(mapdesc.maxrate);
+ } else {
+ float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
+ if (mapdesc.isParametricDistanceSampling()) {
+ // System.out.println("TODO curve.getstepsize - parametric");
+ } else if (mapdesc.isPathLengthSampling()) {
+ // System.out.println("TODO curve.getstepsize - pathlength");
+ } else {
+ setstepsize(mapdesc.maxrate);
+ }
+ }
+
+ }
+
+ }
+
+ /**
+ * Sets maximum subdivision step size
+ * @param max maximum subdivision step size
+ */
+ private void setstepsize(float max) {
+ // DONE
+ stepsize = (max >= 1) ? (range[2] / max) : range[2];
+ minstepsize = stepsize;
+ }
+
+ /**
+ * Clamps the curve
+ */
+ public void clamp() {
+ // DONE
+ if (stepsize < minstepsize)
+ stepsize = mapdesc.clampfactor * minstepsize;
+ }
+
+ /**
+ * Tells whether curve needs subdivision
+ *
+ * @return curve needs subdivison
+ */
+ public boolean needsSamplingSubdivision() {
+ return (stepsize < minstepsize);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java
new file mode 100755
index 000000000..a6393ddf4
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/CurveEvaluator.java
@@ -0,0 +1,86 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class rendering curves with OpenGL
+ * @author Tomáš Hráský
+ *
+ */
+public interface CurveEvaluator {
+ /**
+ * Pushes eval bit
+ */
+ public void bgnmap1f();
+
+ /**
+ * Pops all OpenGL attributes
+ */
+ public void endmap1f() ;
+
+ /**
+ * Initializes opengl evaluator
+ * @param type curve type
+ * @param ulo lowest u
+ * @param uhi highest u
+ * @param stride control point coords
+ * @param order curve order
+ * @param ps control points
+ */
+ public void map1f(int type, float ulo, float uhi, int stride, int order,
+ CArrayOfFloats ps) ;
+
+ /**
+ * Calls opengl enable
+ * @param type what to enable
+ */
+ public void enable(int type) ;
+
+ /**
+ * Calls glMapGrid1f
+ * @param nu steps
+ * @param u1 low u
+ * @param u2 high u
+ */
+ public void mapgrid1f(int nu, float u1, float u2) ;
+
+ /**
+ * Evaluates a curve using glEvalMesh1f
+ * @param style Backend.N_MESHFILL/N_MESHLINE/N_MESHPOINT
+ * @param from lowest param
+ * @param to highest param
+ */
+ public void mapmesh1f(int style, int from, int to) ;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java
new file mode 100755
index 000000000..fdce39b46
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Curvelist.java
@@ -0,0 +1,121 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for woking with linked list of curves
+ * @author Tomas Hrasky
+ *
+ */
+public class Curvelist {
+
+ /**
+ * Head of linked list
+ */
+ private Curve curve;
+
+ /**
+ * Holds conversion range borders
+ */
+ float[] range;
+
+ /**
+ * Subdivision step size
+ */
+ public float stepsize;
+
+ /**
+ * Do curves need subdivision?
+ */
+ private boolean needsSubdivision;
+
+ /**
+ * Makes new instance on top of specified lis of Quilts
+ * @param qlist underlaying list of quilts
+ * @param pta range start
+ * @param ptb range end
+ */
+ public Curvelist(Quilt qlist, float[] pta, float[] ptb) {
+ // DONE
+ curve = null;
+ range = new float[3];
+
+ for (Quilt q = qlist; q != null; q = q.next) {
+ curve = new Curve(q, pta, ptb, curve);
+ }
+ range[0] = pta[0];
+ range[1] = ptb[0];
+ range[2] = range[1] - range[0];
+ }
+
+ /**
+ * Compute step size
+ */
+ public void getstepsize() {
+ // DONE
+ stepsize = range[2];
+ Curve c;
+ for (c = curve; c != null; c = c.next) {
+ c.getStepSize();
+ c.clamp();
+ stepsize = (c.stepsize < stepsize) ? c.stepsize : stepsize;
+ if (c.needsSamplingSubdivision())
+ break;
+ }
+ needsSubdivision = (c != null) ? true : false;
+
+ }
+
+ /**
+ * Indicates whether curves need subdivision
+ * @return curves need subdivision
+ */
+ public boolean needsSamplingSubdivision() {
+ // DONE
+ return needsSubdivision;
+ }
+
+ /**
+ * Checks for culling
+ * @return Subdivider.CULL_TRIVIAL_REJECT or Subdivider.CULL_ACCEPT
+ */
+ public int cullCheck() {
+ // DONE
+ for (Curve c = curve; c != null; c = c.next)
+ if (c.cullCheck() == Subdivider.CULL_TRIVIAL_REJECT)
+ return Subdivider.CULL_TRIVIAL_REJECT;
+ return Subdivider.CULL_ACCEPT;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java
new file mode 100755
index 000000000..735c36edf
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/DisplayList.java
@@ -0,0 +1,56 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import java.lang.reflect.Method;
+
+/**
+ * Display list
+ * @author Tomas Hrasky
+ *
+ */
+public class DisplayList {
+
+ /**
+ * Append action to the display list
+ * @param src source object to invoke method on
+ * @param m invoked method
+ * @param arg method argument
+ */
+ public void append(Object src, Method m, Object arg) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO displaylist append");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java
new file mode 100755
index 000000000..d9e798854
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Flist.java
@@ -0,0 +1,130 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+import java.util.Arrays;
+
+/**
+ * List of breakpoints
+ * @author Tomas Hrasky
+ *
+ */
+public class Flist {
+
+ /**
+ * Data elements end index
+ *
+ */
+ public int end;
+
+ /**
+ *Data elements start index
+ */
+ public int start;
+
+ /**
+ * Breakpoint values
+ */
+ public float[] pts;
+
+ /**
+ * Number of array fields
+ */
+ private int npts;
+
+ /**
+ * Grows list
+ * @param maxpts maximum desired size
+ */
+ public void grow(int maxpts) {
+ // DONE
+ if (npts < maxpts) {
+ // npts=2*maxpts;
+ npts = maxpts;
+ pts = new float[npts];
+ }
+ start = 0;
+ end = 0;
+ }
+
+ /**
+ * Removes duplicate array elemnts
+ */
+ public void filter() {
+ // INFO the aim of this method is to remove duplicates from array
+
+ Arrays.sort(pts);
+
+ start = 0;
+
+ int j = 0;
+
+ for (int i = 1; i < end; i++) {
+ if (pts[i] == pts[i - j - 1])
+ j++;
+ pts[i - j] = pts[i];
+ }
+
+ end -= j;
+
+ }
+
+ /**
+ * Sets start and and to real start and end of array elements
+ * @param from start from
+ * @param to end at
+ */
+ public void taper(float from, float to) {
+ // DONE
+
+ while (pts[start] != from) {
+ start++;
+ }
+
+ while (pts[end - 1] != to) {
+ end--;
+ }
+
+ }
+
+ /**
+ * Adds breakpoint value
+ * @param f value
+ */
+ public void add(float f) {
+ //DONE
+ pts[end++] = f;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java
new file mode 100755
index 000000000..bcb55388d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotspec.java
@@ -0,0 +1,557 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Knot vector specification
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class Knotspec {
+
+ /**
+ * Begin of input knots
+ */
+ public CArrayOfFloats inkbegin;
+
+ /**
+ * End of input knots
+ */
+ public CArrayOfFloats inkend;
+
+ /**
+ * Stride before knot operations
+ */
+ public int prestride;
+
+ /**
+ * Curve order
+ */
+ public int order;
+
+ /**
+ * Next knot specification in linked list (used in surfaces)
+ */
+ public Knotspec next;
+
+ /**
+ * Last knot
+ */
+ public CArrayOfFloats klast;
+
+ /**
+ * First knot
+ */
+ CArrayOfFloats kfirst;
+
+ /**
+ * Beginning of breakpoints
+ */
+ CArrayOfBreakpts bbegin;
+
+ /**
+ * End of breakpoints
+ */
+ CArrayOfBreakpts bend;
+
+ /**
+ * Considered left end knot
+ */
+ CArrayOfFloats kleft;
+
+ /**
+ * Considered right end knot
+ */
+ CArrayOfFloats kright;
+
+ /**
+ * Offset before knot operations
+ */
+ int preoffset;
+
+ /**
+ * Control points array Length after knot operations
+ */
+ int postwidth;
+
+ /**
+ * Beginning of coeficients array
+ */
+ private CArrayOfFloats sbegin;
+
+ /**
+ * Beginning of output knots
+ */
+ private CArrayOfFloats outkbegin;
+
+ /**
+ * End of output knots
+ */
+ private CArrayOfFloats outkend;
+
+ /**
+ * Control points aray length before knot operations
+ */
+ int prewidth;
+
+ /**
+ * Offset after knot operations
+ */
+ int postoffset;
+
+ /**
+ * Number of control points' coordinates after knot operations
+ */
+ public int poststride;
+
+ /**
+ * Number of control points' coordinates
+ */
+ public int ncoords;
+
+ /**
+ * Tell whether knotspec has already benn transformed
+ */
+ public boolean istransformed;
+
+ /**
+ * Knotspec to be transformed
+ */
+ public Knotspec kspectotrans;
+
+ /**
+ * Finds knot border of knot insertion and required multiplicities
+ */
+ public void preselect() {
+ // DONE
+ float kval;
+
+ klast = new CArrayOfFloats(inkend);
+ klast.lessenPointerBy(order);
+ for (kval = klast.get(); klast.getPointer() != inkend.getPointer(); klast
+ .pp()) {
+ if (!Knotvector.identical(klast.get(), kval))
+ break;
+ }
+
+ kfirst = new CArrayOfFloats(inkbegin);
+ kfirst.raisePointerBy(order - 1);
+ for (kval = kfirst.get(); kfirst.getPointer() != inkend.getPointer(); kfirst
+ .pp()) {
+ if (!Knotvector.identical(kfirst.get(), kval))
+ break;
+ }
+
+ CArrayOfFloats k = new CArrayOfFloats(kfirst);
+ k.mm();
+
+ for (; k.getPointer() >= inkbegin.getPointer(); k.mm())
+ if (!Knotvector.identical(kval, k.get()))
+ break;
+ k.pp();
+
+ Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
+ .getPointer()) + 1];
+ for (int i = 0; i < bbeginArray.length; i++)
+ bbeginArray[i] = new Breakpt();
+ bbegin = new CArrayOfBreakpts(bbeginArray, 0);
+ bbegin.get().multi = kfirst.getPointer() - k.getPointer();
+ bbegin.get().value = kval;
+
+ bend = new CArrayOfBreakpts(bbegin);
+ kleft = new CArrayOfFloats(kfirst);
+ kright = new CArrayOfFloats(kfirst);
+
+ }
+
+ /**
+ * Perpares knotspec for transformation
+ */
+ public void select() {
+ // DONE
+ breakpoints();
+ knots();
+ factors();
+
+ preoffset = kleft.getPointer() - (inkbegin.getPointer() + order);
+ postwidth = ((bend.getPointer() - bbegin.getPointer()) * order);
+ prewidth = (outkend.getPointer() - outkbegin.getPointer()) - order;
+ postoffset = (bbegin.get().def > 1) ? (bbegin.get().def - 1) : 0;
+
+ }
+
+ /**
+ * Computes alpha factors for computing new control points
+ */
+ private void factors() {
+ // DONE
+ CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
+ .getPointer() - 1)
+ - order + bend.get().multi);
+
+ CArrayOfFloats fptr = null;
+ if (sbegin != null)
+ fptr = new CArrayOfFloats(sbegin);
+
+ for (CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
+ .getPointer() >= bbegin.getPointer(); bpt.mm()) {
+ mid.lessenPointerBy(bpt.get().multi);
+ int def = bpt.get().def - 1;
+ if (def < 0)
+ continue;
+ float kv = bpt.get().value;
+
+ CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
+ .getPointer() - def)
+ + (order - 1));
+ for (CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
+ .getPointer()
+ + def); kl.getPointer() != kf.getPointer(); kl.mm()) {
+ CArrayOfFloats kh, kt;
+ for (kt = new CArrayOfFloats(kl), kh = new CArrayOfFloats(mid); kt
+ .getPointer() != kf.getPointer(); kh.mm(), kt.mm()) {
+ fptr.set((kv - kh.get()) / (kt.get() - kh.get()));
+ fptr.pp();
+ }
+ kl.set(kv);
+ }
+ }
+
+ }
+
+ /**
+ * Makes new knot vector
+ */
+ private void knots() {
+ // DONE
+ CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
+ .getPointer()
+ - order);
+ CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
+ .getPointer()
+ + bend.get().def);
+
+ outkbegin = new CArrayOfFloats(new float[inkend.getPointer()
+ - inkpt.getPointer()], 0);
+ CArrayOfFloats outkpt;
+ for (outkpt = new CArrayOfFloats(outkbegin); inkpt.getPointer() != inkend
+ .getPointer(); inkpt.pp(), outkpt.pp()) {
+ outkpt.set(inkpt.get());
+ }
+ outkend = new CArrayOfFloats(outkpt);
+ }
+
+ /**
+ * Analyzes breakpoints
+ */
+ private void breakpoints() {
+ // DONE
+ CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
+ CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
+ int nfactors = 0;
+
+ ubpt.get().value = ubend.get().value;
+ ubpt.get().multi = ubend.get().multi;
+
+ kleft = new CArrayOfFloats(kright);
+
+ for (; kright.getPointer() != klast.getPointer(); kright.pp()) {
+ if (Knotvector.identical(kright.get(), ubpt.get().value)) {
+ ubpt.get().multi++;
+ } else {
+ ubpt.get().def = order - ubpt.get().multi;
+ nfactors += (ubpt.get().def * (ubpt.get().def - 1)) / 2;
+ ubpt.pp();
+ ubpt.get().value = kright.get();
+ ubpt.get().multi = 1;
+ }
+ }
+ ubpt.get().def = order - ubpt.get().multi;
+ nfactors += (ubpt.get().def * (ubpt.get().def - 1)) / 2;
+
+ bend = new CArrayOfBreakpts(ubpt);
+
+ if (nfactors > 0) {
+ sbegin = new CArrayOfFloats(new float[nfactors], 0);
+ } else {
+ sbegin = null;
+ }
+
+ }
+
+ /**
+ * Copies control points
+ *
+ * @param _inpt
+ * input control points
+ * @param _outpt
+ * output control points
+ */
+ public void copy(CArrayOfFloats _inpt, CArrayOfFloats _outpt) {
+ CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
+ CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
+
+ inpt.raisePointerBy(preoffset);
+ if (next != null) {
+ for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+ outpt.getPointer() + prewidth); outpt.getPointer() != lpt
+ .getPointer(); outpt.raisePointerBy(poststride)) {
+ next.copy(inpt, outpt);
+ inpt.raisePointerBy(prestride);
+ }
+
+ } else {
+ for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+ outpt.getPointer() + prewidth); outpt.getPointer() != lpt
+ .getPointer(); outpt.raisePointerBy(poststride)) {
+ pt_io_copy(outpt, inpt);
+ inpt.raisePointerBy(prestride);
+ }
+ }
+
+ }
+
+ /**
+ * Copies one control point to other
+ *
+ * @param topt
+ * source control point
+ * @param frompt
+ * destination control point
+ */
+ private void pt_io_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+ // DONE
+ switch (ncoords) {
+ case 4:
+ topt.setRelative(3, frompt.getRelative(3));
+ case 3:
+ topt.setRelative(2, frompt.getRelative(2));
+ case 2:
+ topt.setRelative(1, frompt.getRelative(1));
+ case 1:
+ topt.set(frompt.get());
+ break;
+ default:
+ // TODO break with copying in general case
+ // System.out.println("TODO knotspec.pt_io_copy");
+ break;
+ }
+
+ }
+
+ /**
+ * Inserts a knot
+ *
+ * @param _p
+ * inserted knot
+ */
+ public void transform(CArrayOfFloats _p) {
+ CArrayOfFloats p = new CArrayOfFloats(_p);
+ // DONE
+ if (next != null) {//surface code
+ if (this.equals(kspectotrans)) {
+ next.transform(p);
+ } else {
+ if (istransformed) {
+ p.raisePointerBy(postoffset);
+ for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+ p.getPointer() + postwidth); p.getPointer() != pend
+ .getPointer(); p.raisePointerBy(poststride))
+ next.transform(p);
+
+ } else {
+ CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+ .getPointer()
+ + prewidth);
+ for (; p.getPointer() != pend.getPointer(); p
+ .raisePointerBy(poststride))
+ next.transform(p);
+ }
+ }
+
+ } else {//code for curve
+ if (this.equals(kspectotrans)) {
+ insert(p);
+ } else {
+ if (istransformed) {
+ p.raisePointerBy(postoffset);
+ for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+ p.getPointer() + postwidth); p.getPointer() != pend
+ .getPointer(); p.raisePointerBy(poststride)) {
+ kspectotrans.insert(p);
+ }
+ } else {
+ CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+ .getPointer()
+ + prewidth);
+ for (; p.getPointer() != pend.getPointer(); p
+ .raisePointerBy(poststride))
+ kspectotrans.insert(p);
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Inserts a knot and computes new control points
+ *
+ * @param p
+ * inserted knot
+ */
+ private void insert(CArrayOfFloats p) {
+ // DONE
+ CArrayOfFloats fptr = null;
+ if (sbegin != null)
+ fptr = new CArrayOfFloats(sbegin);
+ CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+ + prewidth - poststride);
+ // CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), prewidth -
+ // poststride);
+ CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+ + postwidth + postoffset - poststride);
+ // CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), postwidth +
+ // postoffset - poststride);
+ CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
+
+ for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
+ .getPointer()
+ - poststride * bpt.get().def); srcpt.getPointer() != pend
+ .getPointer(); pend.raisePointerBy(poststride)) {
+ CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+ for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
+ .getPointer()
+ - poststride); p2.getPointer() != pend.getPointer(); p1
+ .setPointer(p2.getPointer()), p2
+ .lessenPointerBy(poststride)) {
+ pt_oo_sum(p1, p1, p2, fptr.get(), 1.0 - fptr.get());
+ fptr.pp();
+ }
+ }
+ bpt.mm();
+ for (; bpt.getPointer() >= bbegin.getPointer(); bpt.mm()) {
+
+ for (int multi = bpt.get().multi; multi > 0; multi--) {
+ pt_oo_copy(dstpt, srcpt);
+ dstpt.lessenPointerBy(poststride);
+ srcpt.lessenPointerBy(poststride);
+ }
+ for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
+ srcpt.getPointer() - poststride * bpt.get().def); srcpt
+ .getPointer() != pend.getPointer(); pend
+ .raisePointerBy(poststride), dstpt
+ .lessenPointerBy(poststride)) {
+ pt_oo_copy(dstpt, srcpt);
+ CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+
+ for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
+ srcpt.getPointer() - poststride); p2.getPointer() != pend
+ .getPointer(); p1.setPointer(p2.getPointer()), p2
+ .lessenPointerBy(poststride)) {
+ pt_oo_sum(p1, p1, p2, fptr.get(), 1.0 - fptr.get());
+ fptr.pp();
+ }
+ }
+ }
+ }
+
+ /**
+ * Copies one control point to another
+ *
+ * @param topt
+ * source ctrl point
+ * @param frompt
+ * distance ctrl point
+ */
+ private void pt_oo_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+ // DONE
+ // this is a "trick" with case - "break" is omitted so it comes through all cases
+ switch (ncoords) {
+ case 4:
+ topt.setRelative(3, frompt.getRelative(3));
+ case 3:
+ topt.setRelative(2, frompt.getRelative(2));
+ case 2:
+ topt.setRelative(1, frompt.getRelative(1));
+ case 1:
+ topt.setRelative(0, frompt.getRelative(0));
+ break;
+ default:
+ // default uses memcpy but it is not needed (we probably won't have more than 4 coords)
+ // TODO not sure about it
+ break;
+ }
+
+ }
+
+ /**
+ * Computes new control point
+ *
+ * @param x
+ * first point
+ * @param y
+ * second point
+ * @param z
+ * third pont
+ * @param a
+ * alpha
+ * @param b
+ * 1 - alpha
+ */
+ private void pt_oo_sum(CArrayOfFloats x, CArrayOfFloats y,
+ CArrayOfFloats z, float a, double b) {
+ // DONE
+ switch (ncoords) {
+ case 4:
+ x.setRelative(3, (float) (a * y.getRelative(3) + b
+ * z.getRelative(3)));
+ case 3:
+ x.setRelative(2, (float) (a * y.getRelative(2) + b
+ * z.getRelative(2)));
+ case 2:
+ x.setRelative(1, (float) (a * y.getRelative(1) + b
+ * z.getRelative(1)));
+ case 1:
+ x.setRelative(0, (float) (a * y.getRelative(0) + b
+ * z.getRelative(0)));
+ break;
+ default:
+ //no need of default - see previous method and its case statement
+ // System.out.println("TODO pt_oo_sum default");
+ break;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java
new file mode 100755
index 000000000..c7c3d4578
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Knotvector.java
@@ -0,0 +1,179 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Knot vector used in curve specification
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class Knotvector {
+
+ /**
+ * Tolerance used when comparing knots - when difference is smaller, knots
+ * are considered equal
+ */
+ public static final float TOLERANCE = 1.0e-5f;
+
+ /**
+ * Maximum curve order
+ */
+ private static final int MAXORDER = 24;
+
+ /**
+ * Number of knots
+ */
+ int knotcount;
+
+ /**
+ * Number of control points' coordinates
+ */
+ int stride;
+
+ /**
+ * Curve order
+ */
+ int order;
+
+ /**
+ * Knots
+ */
+ float[] knotlist;
+
+ /**
+ * Makes new knotvector
+ *
+ * @param nknots
+ * number of knots
+ * @param stride
+ * number of ctrl points' corrdinates
+ * @param order
+ * curve order
+ * @param knot
+ * knots
+ */
+ public Knotvector(int nknots, int stride, int order, float[] knot) {
+ // DONE
+ init(nknots, stride, order, knot);
+ }
+
+ /**
+ * Initializes knotvector
+ *
+ * @param nknots
+ * number of knots
+ * @param stride
+ * number of ctrl points' corrdinates
+ * @param order
+ * curve order
+ * @param knot
+ * knots
+ */
+ public void init(int nknots, int stride, int order, float[] knot) {
+ // DONE
+ this.knotcount = nknots;
+ this.stride = stride;
+ this.order = order;
+ this.knotlist = new float[nknots];
+ for (int i = 0; i < nknots; i++) {
+ this.knotlist[i] = knot[i];
+ }
+
+ }
+
+ /**
+ * Validates knot vector parameters
+ *
+ * @return knot vector validity
+ */
+ public int validate() {
+ int kindex = knotcount - 1;
+ if (order < 1 || order > MAXORDER) {
+ return 1;
+ }
+ if (knotcount < 2 * order) {
+ return 2;
+ }
+ if (identical(knotlist[kindex - (order - 1)], knotlist[order - 1])) {
+ return 3;
+ }
+ for (int i = 0; i < kindex; i++) {
+ if (knotlist[i] > knotlist[i + 1])
+ return 4;
+ }
+ int multi = 1;
+ for (; kindex >= 1; kindex--) {
+ if (knotlist[kindex] - knotlist[kindex - 1] < TOLERANCE) {
+ multi++;
+ continue;
+ }
+ if (multi > order) {
+ return 5;
+ }
+ multi = 1;
+ }
+ if (multi > order) {
+ return 5;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Show specified message
+ *
+ * @param msg
+ * message to be shown
+ */
+ public void show(String msg) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO knotvector.show");
+
+ }
+
+ /**
+ * Compares two knots for equality
+ *
+ * @param a
+ * first knot
+ * @param b
+ * second knot
+ * @return knots are/are not equal
+ */
+ public static boolean identical(float a, float b) {
+ return ((a - b) < TOLERANCE) ? true : false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java
new file mode 100755
index 000000000..8b52a4a8a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Mapdesc.java
@@ -0,0 +1,442 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding properties of OpenGL map
+ * @author Tomas Hrasky
+ *
+ */
+public class Mapdesc {
+
+ /**
+ * Maximum control point coords
+ */
+ private static final int MAXCOORDS = 5;
+
+ /**
+ * Next description in list
+ */
+ public Mapdesc next;
+
+ /**
+ * Is map rational
+ */
+ public int isrational;
+
+ /**
+ * Number of control point coords
+ */
+ public int ncoords;
+
+ /**
+ * Map type
+ */
+ private int type;
+
+ /**
+ * Number of homogenous coords
+ */
+ private int hcoords;
+
+ /**
+ * Number of inhomogenous coords
+ */
+ private int inhcoords;
+
+ /**
+ * Not used
+ */
+ private int mask;
+
+ /**
+ * Value of N_PIXEL_TOLERANCE property
+ */
+ private float pixel_tolerance;
+
+ /**
+ * Value of N_ERROR_TOLERANCE property
+ */
+ private float error_tolerance;
+
+ /**
+ * Value of N_BBOX_SUBDIVIDING property
+ */
+ private float bbox_subdividing;
+
+ /**
+ * Value of N_CULLING property
+ */
+ private float culling_method;
+
+ /**
+ * Value of N_SAMPLINGMETHOD property
+ */
+ private float sampling_method;
+
+ /**
+ * Value of N_CLAMPFACTOR property
+ */
+ float clampfactor;
+
+ /**
+ * Value of N_MINSAVINGS property
+ */
+ private float minsavings;
+
+ /**
+ * Steps in u direction
+ */
+ private float s_steps;
+
+ /**
+ * Steps in v direction
+ */
+ private float t_steps;
+
+ /**
+ * Maximal step
+ */
+ float maxrate;
+
+ /**
+ * Maximal u direction step
+ */
+ private float maxsrate;
+
+ /**
+ * Maximal v direction step
+ */
+ private float maxtrate;
+
+ /**
+ * Not used
+ */
+ private float[][] bmat;
+
+ /**
+ * Sampling matrix
+ */
+ private float[][] smat;
+
+ /**
+ * Not used
+ */
+ private float[][] cmat;
+
+ /**
+ * Not used
+ */
+ private float[] bboxsize;
+
+ /**
+ * Makes new mapdesc
+ * @param type map type
+ * @param rational is rational
+ * @param ncoords number of control points coords
+ * @param backend backend object
+ */
+ public Mapdesc(int type, int rational, int ncoords, Backend backend) {
+ // DONE
+ this.type = type;
+ this.isrational = rational;
+ this.ncoords = ncoords;
+ this.hcoords = ncoords + (isrational > 0 ? 0 : 1);
+ this.inhcoords = ncoords - (isrational > 0 ? 1 : 0);
+ this.mask = ((1 << (inhcoords * 2)) - 1);
+ next = null;
+
+ assert (hcoords <= MAXCOORDS);
+ assert (inhcoords >= 1);
+
+ pixel_tolerance = 1f;
+ error_tolerance = 1f;
+ bbox_subdividing = NurbsConsts.N_NOBBOXSUBDIVISION;
+ culling_method = NurbsConsts.N_NOCULLING;
+ sampling_method = NurbsConsts.N_NOSAMPLING;
+ clampfactor = NurbsConsts.N_NOCLAMPING;
+ minsavings = NurbsConsts.N_NOSAVINGSSUBDIVISION;
+ s_steps = 0f;
+ t_steps = 0f;
+
+ maxrate = (s_steps < 0) ? 0 : s_steps;
+ maxsrate = (s_steps < 0) ? 0 : s_steps;
+ maxtrate = (t_steps < 0) ? 0 : t_steps;
+ bmat = new float[MAXCOORDS][MAXCOORDS];
+ cmat = new float[MAXCOORDS][MAXCOORDS];
+ smat = new float[MAXCOORDS][MAXCOORDS];
+
+ identify(bmat);
+ identify(cmat);
+ identify(smat);
+ bboxsize = new float[MAXCOORDS];
+ for (int i = 0; i < inhcoords; i++)
+ bboxsize[i] = 1;
+ }
+
+ /**
+ * Make matrix identity matrix
+ * @param arr matrix
+ */
+ private void identify(float[][] arr) {
+ // DONE
+ for (int i = 0; i < MAXCOORDS; i++)
+ for (int j = 0; j < MAXCOORDS; j++)
+ arr[i][j] = 0;
+ for (int i = 0; i < MAXCOORDS; i++)
+ arr[i][i] = 1;
+
+ }
+
+ /**
+ * Tells whether tag is property tag
+ * @param tag property tag
+ * @return is/is not property
+ */
+ public boolean isProperty(int tag) {
+ boolean ret;
+ switch (tag) {
+ case NurbsConsts.N_PIXEL_TOLERANCE:
+ case NurbsConsts.N_ERROR_TOLERANCE:
+ case NurbsConsts.N_CULLING:
+ case NurbsConsts.N_BBOX_SUBDIVIDING:
+ case NurbsConsts.N_S_STEPS:
+ case NurbsConsts.N_T_STEPS:
+ case NurbsConsts.N_SAMPLINGMETHOD:
+ case NurbsConsts.N_CLAMPFACTOR:
+ case NurbsConsts.N_MINSAVINGS:
+ ret = true;
+ break;
+ default:
+ ret = false;
+ break;
+ }
+ return ret;
+ }
+
+ /**
+ * Returns number of control points' coords
+ * @return number of control points' coords
+ */
+ public int getNCoords() {
+ return ncoords;
+ }
+
+ /**
+ * Returns map type
+ * @return map type
+ */
+ public int getType() {
+ return type;
+ }
+
+ /**
+ * Tells whether map is range sampling
+ * @return is map range sampling
+ */
+ public boolean isRangeSampling() {
+ // DONE
+ return (isParametricDistanceSampling() || isPathLengthSampling()
+ || isSurfaceAreaSampling() || isObjectSpaceParaSampling() || isObjectSpacePathSampling());
+ }
+
+ /**
+ * Tells whether map is object space sampling
+ * @return is map object space sampling
+ */
+ private boolean isObjectSpacePathSampling() {
+ // DONE
+ return sampling_method == NurbsConsts.N_OBJECTSPACE_PATH;
+ }
+
+ /**
+ * Tells whether map is object space parasampling
+ * @return is map object space parasampling
+ */
+ private boolean isObjectSpaceParaSampling() {
+ // DONE
+ return sampling_method == NurbsConsts.N_OBJECTSPACE_PARA;
+ }
+
+ /**
+ * Tells whether map is area sampling surface
+ * @return is map area sampling surface
+ */
+ private boolean isSurfaceAreaSampling() {
+ // DONE
+ return sampling_method == NurbsConsts.N_SURFACEAREA;
+ }
+
+ /**
+ * Tells whether map is path length sampling
+ * @return is map path length sampling
+ */
+ boolean isPathLengthSampling() {
+ // DONE
+ return sampling_method == NurbsConsts.N_PATHLENGTH;
+ }
+
+ /**
+ * Tells whether map is parametric distance sampling
+ * @return is map parametric distance sampling
+ */
+ boolean isParametricDistanceSampling() {
+ // DONE
+ return sampling_method == NurbsConsts.N_PARAMETRICDISTANCE;
+ }
+
+ /**
+ * Tells whether map is culling
+ * @return is map culling
+ */
+ public boolean isCulling() {
+ // DONE
+ return culling_method != NurbsConsts.N_NOCULLING ? true : false;
+ }
+
+ /**
+ * Tells whether map is constantly sampling
+ * @return is map constant sampling
+ */
+ public boolean isConstantSampling() {
+ return (sampling_method == NurbsConsts.N_FIXEDRATE) ? true : false;
+ }
+
+ /**
+ * Tells whether map is domain sampling
+ * @return is map domain sampling
+ */
+ public boolean isDomainSampling() {
+ return (sampling_method == NurbsConsts.N_DOMAINDISTANCE) ? true : false;
+ }
+
+ /**
+ * Returns property of specified tag value
+ * @param tag property tag
+ * @return property value
+ */
+ public float getProperty(int tag) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO mapdesc.getproperty");
+ return 0;
+ }
+
+ /**
+ * Sets property with given tag
+ * @param tag property tag
+ * @param value desired value
+ */
+ public void setProperty(int tag, float value) {
+ // TODO Auto-generated method stub
+ switch (tag) {
+ case NurbsConsts.N_PIXEL_TOLERANCE:
+ pixel_tolerance = value;
+ break;
+ case NurbsConsts.N_ERROR_TOLERANCE:
+ error_tolerance = value;
+ break;
+ case NurbsConsts.N_CULLING:
+ culling_method = value;
+ break;
+ case NurbsConsts.N_BBOX_SUBDIVIDING:
+ if (value <= 0)
+ value = NurbsConsts.N_NOBBOXSUBDIVISION;
+ bbox_subdividing = value;
+ break;
+ case NurbsConsts.N_S_STEPS:
+ if (value < 0)
+ value = 0;
+ s_steps = value;
+ maxrate = value;
+ maxsrate = value;
+ break;
+ case NurbsConsts.N_T_STEPS:
+ if (value < 0)
+ value = 0;
+ t_steps = value;
+ maxtrate = value;
+ break;
+ case NurbsConsts.N_SAMPLINGMETHOD:
+ sampling_method = value;
+ break;
+ case NurbsConsts.N_CLAMPFACTOR:
+ if (value < 0)
+ value = 0;
+ clampfactor = value;
+ break;
+ case NurbsConsts.N_MINSAVINGS:
+ if (value <= 0)
+ value = NurbsConsts.N_NOSAVINGSSUBDIVISION;
+ minsavings = value;
+ break;
+ }
+ }
+
+ /**
+ * Samples curve
+ * @param pts control points
+ * @param order curve order
+ * @param stride number of control points' coordinates
+ * @param sp breakpoints
+ * @param outstride output number of control points' coordinates
+ */
+ public void xformSampling(CArrayOfFloats pts, int order, int stride,
+ float[] sp, int outstride) {
+ // DONE
+ xFormMat(smat, pts, order, stride, sp, outstride);
+ }
+
+ /**
+ * Empty method
+ * @param mat sampling matrix
+ * @param pts ontrol points
+ * @param order curve order
+ * @param stride number of control points' coordinates
+ * @param cp breakpoints
+ * @param outstride output number of control points' coordinates
+ */
+ private void xFormMat(float[][] mat, CArrayOfFloats pts, int order,
+ int stride, float[] cp, int outstride) {
+ // TODO Auto-generated method stub
+
+ // System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
+
+ if (isrational > 0) {
+
+ } else {
+
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java
new file mode 100755
index 000000000..3b6e22ea5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Maplist.java
@@ -0,0 +1,122 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding list of Mapdescs
+ * @author Tomáš Hráský
+ *
+ */
+public class Maplist {
+ /**
+ * Head of linked list
+ */
+ private Mapdesc maps;
+
+ /**
+ * Backend class
+ */
+ private Backend backend;
+
+ /**
+ * Makes new Maplist
+ * @param backend Backend class
+ */
+ public Maplist(Backend backend) {
+ this.backend = backend;
+ }
+
+ /**
+ * Sets linked list beginning to null
+ */
+ public void initialize() {
+ // TODO mapdespool.clear ?
+ maps = null;
+ }
+
+ /**
+ * Defines new Mapdesc if it is not defined and appends it to linked list
+ * @param type map type
+ * @param rational is map rational
+ * @param ncoords number of coords
+ */
+ public void define(int type, int rational, int ncoords) {
+ // DONE
+ Mapdesc m = locate(type);
+ assert (m == null || (m.isrational == rational && m.ncoords == ncoords));
+ add(type, rational, ncoords);
+
+ }
+
+ /**
+ * Adds new Mapdesc to linked list
+ * @param type map type
+ * @param rational is map rational
+ * @param ncoords number of coords
+ */
+ private void add(int type, int rational, int ncoords) {
+ // DONE
+ Mapdesc map = new Mapdesc(type, rational, ncoords, backend);
+ if (maps == null) {
+ maps = map;
+ } else {
+ map.next = maps;
+ maps = map;
+ }
+ }
+
+ /**
+ * Tries to find Mapdesc in linked list
+ * @param type map type
+ * @return Mapdesc of type or null if there is no such map
+ */
+ public Mapdesc locate(int type) {
+ // DONE
+ Mapdesc m = null;
+ for (m = maps; m != null; m = m.next)
+ if (m.getType() == type)
+ break;
+ return m;
+ }
+
+ /**
+ * Alias for locate
+ * @param type maptype
+ * @return Mapdesc of type or null if there is no such map
+ */
+ public Mapdesc find(int type) {
+ return locate(type);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java
new file mode 100755
index 000000000..c98e74b7c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/NurbsConsts.java
@@ -0,0 +1,184 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class hodling NURBS constants as seen in OpenGL GLU documentation
+ * @author JOGL project
+ *
+ */
+public class NurbsConsts {
+ /*
+ * NURBS Properties - one set per map, each takes a single INREAL arg
+ */
+ public static final int N_SAMPLING_TOLERANCE = 1;
+
+ public static final int N_S_RATE = 6;
+
+ public static final int N_T_RATE = 7;
+
+ public static final int N_CLAMPFACTOR = 13;
+
+ public static final float N_NOCLAMPING = 0.0f;
+
+ public static final int N_MINSAVINGS = 14;
+
+ public static final float N_NOSAVINGSSUBDIVISION = 0.0f;
+
+ /*
+ * NURBS Properties - one set per map, each takes an enumerated value
+ */
+ public static final int N_CULLING = 2;
+
+ public static final float N_NOCULLING = 0.0f;
+
+ public static final float N_CULLINGON = 1.0f;
+
+ public static final int N_SAMPLINGMETHOD = 10;
+
+ public static final float N_NOSAMPLING = 0.0f;
+
+ public static final float N_FIXEDRATE = 3.0f;
+
+ public static final float N_DOMAINDISTANCE = 2.0f;
+
+ public static final float N_PARAMETRICDISTANCE = 5.0f;
+
+ public static final float N_PATHLENGTH = 6.0f;
+
+ public static final float N_SURFACEAREA = 7.0f;
+
+ public static final float N_OBJECTSPACE_PARA = 8.0f;
+
+ public static final float N_OBJECTSPACE_PATH = 9.0f;
+
+ public static final int N_BBOX_SUBDIVIDING = 17;
+
+ public static final float N_NOBBOXSUBDIVISION = 0.0f;
+
+ public static final float N_BBOXTIGHT = 1.0f;
+
+ public static final float N_BBOXROUND = 2.0f;
+
+ /*
+ * NURBS Rendering Properties - one set per renderer each takes an
+ * enumerated value
+ */
+ public static final int N_DISPLAY = 3;
+
+ public static final int N_FILL = 1;
+
+ public static final int N_OUTLINE_POLY = 2;
+
+ public static final int N_OUTLINE_TRI = 3;
+
+ public static final int N_OUTLINE_QUAD = 4;
+
+ public static final int N_OUTLINE_PATCH = 5;
+
+ public static final int N_OUTLINE_PARAM = 6;
+
+ public static final int N_OUTLINE_PARAM_S = 7;
+
+ public static final int N_OUTLINE_PARAM_ST = 8;
+
+ public static final int N_OUTLINE_SUBDIV = 9;
+
+ public static final int N_OUTLINE_SUBDIV_S = 10;
+
+ public static final int N_OUTLINE_SUBDIV_ST = 11;
+
+ public static final int N_ISOLINE_S = 12;
+
+ public static final int N_ERRORCHECKING = 4;
+
+ public static final int N_NOMSG = 0;
+
+ public static final int N_MSG = 1;
+
+ /* GL 4.0 propeties not defined above */
+
+ public static final int N_PIXEL_TOLERANCE = N_SAMPLING_TOLERANCE;
+
+ public static final int N_ERROR_TOLERANCE = 20;
+
+ public static final int N_SUBDIVISIONS = 5;
+
+ public static final int N_TILES = 8;
+
+ public static final int N_TMP1 = 9;
+
+ public static final int N_TMP2 = N_SAMPLINGMETHOD;
+
+ public static final int N_TMP3 = 11;
+
+ public static final int N_TMP4 = 12;
+
+ public static final int N_TMP5 = N_CLAMPFACTOR;
+
+ public static final int N_TMP6 = N_MINSAVINGS;
+
+ public static final int N_S_STEPS = N_S_RATE;
+
+ public static final int N_T_STEPS = N_T_RATE;
+
+ /*
+ * NURBS Rendering Properties - one set per map, each takes an INREAL matrix
+ * argument
+ */
+ public static final int N_CULLINGMATRIX = 1;
+
+ public static final int N_SAMPLINGMATRIX = 2;
+
+ public static final int N_BBOXMATRIX = 3;
+
+ /*
+ * NURBS Rendering Properties - one set per map, each takes an INREAL vector
+ * argument
+ */
+ public static final int N_BBOXSIZE = 4;
+
+ /* type argument for trimming curves */
+
+ public static final int N_P2D = 0x8;
+
+ public static final int N_P2DR = 0xd;
+
+ public static final int N_MESHLINE = 1;
+
+ public static final int N_MESHFILL = 0;
+
+ public static final int N_MESHPOINT = 2;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java
new file mode 100755
index 000000000..b130226c4
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_curve.java
@@ -0,0 +1,63 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Struct holding curve links
+ * @author Tomáš Hráský
+ *
+ */
+public class O_curve {
+
+ /**
+ * Curve type
+ */
+ public int curvetype;
+
+ /**
+ * Next curve in linked list
+ */
+ public O_curve next;
+
+ /**
+ * Curve of picewiselinear type
+ */
+ public O_pwlcurve o_pwlcurve;
+
+ /**
+ * NURBS curve
+ */
+ public O_nurbscurve o_nurbscurve;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java
new file mode 100755
index 000000000..68bf60b27
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbscurve.java
@@ -0,0 +1,80 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * NURBS curve object
+ * @author Tomáš Hráský
+ *
+ */
+public class O_nurbscurve {
+
+ /**
+ * List of bezier curves
+ */
+ public Quilt bezier_curves;
+
+ /**
+ * Curve type
+ */
+ public int type;
+
+ /**
+ * Was curve used ?
+ */
+ public boolean used;
+
+ /**
+ * Parent curve
+ */
+ public O_curve owner;
+
+ /**
+ * Next curve in list
+ */
+ public O_nurbscurve next;
+
+ /**
+ * Makes new O_nurbscurve
+ * @param realType type of curve
+ */
+ public O_nurbscurve(int realType) {
+ // DONE
+ this.type = realType;
+ this.owner = null;
+ this.next = null;
+ this.used = false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java
new file mode 100755
index 000000000..1cbaa6ccc
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_nurbssurface.java
@@ -0,0 +1,79 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * NURBS surface object
+ * @author Tomáš Hráský
+ *
+ */
+public class O_nurbssurface {
+
+ /**
+ * List of bezier patches forming NURBS surface
+ */
+ public Quilt bezier_patches;
+
+ /**
+ * Was surface used
+ */
+ public boolean used;
+
+ /**
+ * Parent O_surface
+ */
+ public O_surface owner;
+
+ /**
+ * Next surface in list
+ */
+ public O_nurbssurface next;
+
+ /**
+ * Surface type
+ */
+ private int type;
+
+ /**
+ * Makes new O_nurbssurface of type
+ * @param type surface type
+ */
+ public O_nurbssurface(int type) {
+ this.type = type;
+ this.owner = null;
+ this.next = null;
+ this.used = false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java
new file mode 100755
index 000000000..4dec066d6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_pwlcurve.java
@@ -0,0 +1,44 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomáš Hráský
+ *
+ */
+public class O_pwlcurve {
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java
new file mode 100755
index 000000000..4ef680c2f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_surface.java
@@ -0,0 +1,52 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Surface object
+ * @author Tomáš Hráský
+ *
+ */
+public class O_surface {
+ /**
+ * NURBS surface
+ */
+ public O_nurbssurface o_nurbssurface;
+
+ /**
+ * Trims
+ */
+ public O_trim o_trim;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java
new file mode 100755
index 000000000..c1f61ebab
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/O_trim.java
@@ -0,0 +1,44 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomáš Hráský
+ *
+ */
+public class O_trim {
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java
new file mode 100755
index 000000000..f15ad1f92
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patch.java
@@ -0,0 +1,54 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Empty class
+ * @author Tomas Hrasky
+ *
+ */
+public class Patch {
+
+ /**
+ * Empty constructor
+ * @param q
+ * @param pta
+ * @param ptb
+ * @param patch
+ */
+ public Patch(Quilt q, float[] pta, float[] ptb, Patch patch) {
+ // System.out.println("TODO patch.constructor");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java
new file mode 100755
index 000000000..b2b9033ec
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Patchlist.java
@@ -0,0 +1,145 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * List of patches
+ * @author Tomáš Hráský
+ *
+ */
+public class Patchlist {
+
+ /**
+ * Array of ranges
+ */
+ public Pspec[] pspec;
+
+ /**
+ * head of list of patches
+ */
+ private Patch patch;
+
+ /**
+ * Makes new list of patches
+ * @param quilts list of quilts
+ * @param pta low border
+ * @param ptb high border
+ */
+ public Patchlist(Quilt quilts, float[] pta, float[] ptb) {
+ // DONE
+ patch = null;
+
+ for (Quilt q = quilts; q != null; q = q.next)
+ patch = new Patch(q, pta, ptb, patch);
+ pspec[0] = new Pspec();
+ pspec[0].range[0] = pta[0];
+ pspec[0].range[1] = ptb[0];
+ pspec[0].range[2] = ptb[0] - pta[0];
+ pspec[1] = new Pspec();
+ pspec[1].range[0] = pta[1];
+ pspec[1].range[1] = ptb[1];
+ pspec[1].range[2] = ptb[1] - pta[1];
+
+ }
+
+ /**
+ * Empty constructor
+ * @param patchlist
+ * @param param
+ * @param mid
+ */
+ public Patchlist(Patchlist patchlist, int param, float mid) {
+ // TODO Auto-generated constructor stub
+ // System.out.println("TODO patchlist.konstruktor 2");
+ }
+
+ /**
+ * Empty method
+ * @return 0
+ */
+ public int cullCheck() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO patchlist.cullcheck");
+ return 0;
+ }
+
+ /**
+ * Empty method
+ */
+ public void getstepsize() {
+ // System.out.println("TODO patchlist.getsptepsize");
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * Empty method
+ * @return false
+ */
+ public boolean needsSamplingSubdivision() {
+ // TODO Auto-generated method stub
+ // System.out.println("patchlist.needsSamplingSubdivision");
+ return false;
+ }
+
+ /**
+ * Empty method
+ * @param i
+ * @return false
+ */
+ public boolean needsSubdivision(int i) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO patchlist.needsSubdivision");
+ return false;
+ }
+
+ /**
+ * Empty method
+ * @return false
+ */
+ public boolean needsNonSamplingSubdivision() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO patchlist.needsNonSamplingSubdivision");
+ return false;
+ }
+
+ /**
+ * Empty method
+ */
+ public void bbox() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO patchlist.bbox");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java
new file mode 100755
index 000000000..e0ad1dd32
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Property.java
@@ -0,0 +1,75 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class representing property
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class Property {
+
+ /**
+ * Property type
+ */
+ public int type;
+
+ /**
+ * Property id
+ */
+ public int tag;
+
+ /**
+ * Property value
+ */
+ public float value;
+
+ /**
+ * Makes new property with given parameters
+ *
+ * @param type
+ * property type
+ * @param tag
+ * property id
+ * @param value
+ * property value
+ */
+ public Property(int type, int tag, float value) {
+ this.type = type;
+ this.tag = tag;
+ this.value = value;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java
new file mode 100755
index 000000000..5fc66fa82
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Pspec.java
@@ -0,0 +1,47 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding range
+ * @author Tomáš Hráský
+ *
+ */
+public class Pspec {
+ /**
+ * Range
+ */
+ public float[] range;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java
new file mode 100755
index 000000000..6b8255d85
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/PwlArc.java
@@ -0,0 +1,71 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Picewiselinar trimming arc
+ * @author Tomáš Hráský
+ *
+ */
+public class PwlArc {
+
+ /**
+ * Number of points
+ */
+ private int npts;
+
+ /**
+ * Vertexes
+ */
+ public TrimVertex[] pts;
+
+ /**
+ * Arc type
+ */
+ private int type;
+
+ /**
+ * Makes new trimming arc
+ * @param i num ber of vertexes
+ * @param p trimming vertexes array
+ */
+ public PwlArc(int i, TrimVertex[] p) {
+ // DONE
+ this.npts = i;
+ this.pts = p;
+ type = NurbsConsts.N_P2D;
+
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java
new file mode 100755
index 000000000..bc058b093
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quilt.java
@@ -0,0 +1,282 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class for converting NURBS curves and surfaces to list of bezier arcs or patches repectively
+ * @author Tomáš Hráský
+ *
+ */
+public class Quilt {
+ /**
+ * Maximum quilt dimension
+ */
+ private static final int MAXDIM = 2;
+
+ /**
+ * List of map descriptions
+ */
+ Mapdesc mapdesc;
+
+ /**
+ * Array of quiltspecs pointer
+ */
+ public CArrayOfQuiltspecs qspec;
+
+ /**
+ * End array of quilt specs pointer
+ */
+ public CArrayOfQuiltspecs eqspec;
+
+ /**
+ * Control points
+ */
+ public CArrayOfFloats cpts;
+
+ /**
+ * Next quilt in list
+ */
+ public Quilt next;
+
+ /**
+ * Makes new quilt with mapdesc
+ * @param mapdesc map description
+ */
+ public Quilt(Mapdesc mapdesc) {
+ // DONE
+ this.mapdesc = mapdesc;
+ Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
+ for (int i = 0; i < tmpquilts.length; i++)
+ tmpquilts[i] = new Quiltspec();
+ this.qspec = new CArrayOfQuiltspecs(tmpquilts);
+
+ }
+
+ /**
+ * Converts NURBS surface to bezier patches
+ * @param sknotvector knots in u direction
+ * @param tknotvector knots in v direction
+ * @param ctrlarr control points
+ * @param coords control points coords
+ */
+ public void toBezier(Knotvector sknotvector, Knotvector tknotvector,
+ CArrayOfFloats ctrlarr, int coords) {
+ Splinespec spline = new Splinespec(2);
+ spline.kspecinit(sknotvector, tknotvector);
+ spline.select();
+ spline.layout(coords);
+ spline.setupquilt(this);
+ spline.copy(ctrlarr);
+ spline.transform();
+ }
+
+ /**
+ * Converts NURBS curve to list of bezier curves
+ * @param knots knot vector
+ * @param ctlarray control points
+ * @param ncoords number of coordinates
+ */
+ public void toBezier(Knotvector knots, CArrayOfFloats ctlarray, int ncoords) {
+ // DONE
+ Splinespec spline = new Splinespec(1);
+ spline.kspecinit(knots);
+ spline.select();
+ spline.layout(ncoords);
+ spline.setupquilt(this);
+ spline.copy(ctlarray);
+ spline.transform();
+ }
+
+ /**
+ * Walks thru all arcs/patches
+ * @param pta low border
+ * @param ptb high border
+ * @param backend Backend
+ */
+ public void downloadAll(float[] pta, float[] ptb, Backend backend) {
+ // DONE
+ for (Quilt m = this; m != null; m = m.next) {
+ m.select(pta, ptb);
+ m.download(backend);
+ }
+
+ }
+
+ /**
+ * Renders arcs/patches
+ * @param backend Backend for rendering
+ */
+ private void download(Backend backend) {
+ // DONE
+ if (getDimension() == 2) {
+
+ CArrayOfFloats ps = new CArrayOfFloats(cpts);
+ ps.raisePointerBy(qspec.get(0).offset);
+ ps.raisePointerBy(qspec.get(1).offset);
+ ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
+ * qspec.get(0).stride);
+ ps.raisePointerBy(qspec.get(1).index * qspec.get(1).order
+ * qspec.get(1).stride);
+
+ backend.surfpts(mapdesc.getType(), ps, qspec.get(0).stride, qspec
+ .get(1).stride, qspec.get(0).order, qspec.get(1).order,
+ qspec.get(0).breakpoints[qspec.get(0).index],
+ qspec.get(0).breakpoints[qspec.get(0).index + 1], qspec
+ .get(1).breakpoints[qspec.get(1).index], qspec
+ .get(1).breakpoints[qspec.get(1).index + 1]);
+
+ } else {// code for curves
+ // CArrayOfFloats ps=new CArrayOfFloats(cpts);
+ CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
+ ps.raisePointerBy(qspec.get(0).offset);
+ ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
+ * qspec.get(0).stride);
+ backend.curvpts(mapdesc.getType(), ps, qspec.get(0).stride, qspec
+ .get(0).order,
+ qspec.get(0).breakpoints[qspec.get(0).index],
+ qspec.get(0).breakpoints[qspec.get(0).index + 1]);
+ }
+
+ }
+
+ /**
+ * Returns quilt dimension
+ * @return quilt dimesion
+ */
+ private int getDimension() {
+ // DONE
+ return eqspec.getPointer() - qspec.getPointer();
+ }
+
+ /**
+ * Finds Quiltspec.index
+ * @param pta range
+ * @param ptb range
+ */
+ private void select(float[] pta, float[] ptb) {
+ // DONE
+ int dim = eqspec.getPointer() - qspec.getPointer();
+ int i, j;
+ for (i = 0; i < dim; i++) {
+ for (j = qspec.get(i).width - 1; j >= 0; j--)
+ if (qspec.get(i).breakpoints[j] <= pta[i]
+ && ptb[i] <= qspec.get(i).breakpoints[j + 1])
+ break;
+ assert (j != -1);
+ qspec.get(i).index = j;
+ }
+ }
+
+ /**
+ * Find range according to breakpoints
+ * @param from low param
+ * @param to high param
+ * @param bpts breakpoints
+ */
+ public void getRange(float[] from, float[] to, Flist bpts) {
+ // DONE
+ getRange(from, to, 0, bpts);
+
+ }
+
+ /**
+ * Find range according to breakpoints
+ * @param from low param
+ * @param to high param
+ * @param i from/to array index
+ * @param list breakpoints
+ */
+ private void getRange(float[] from, float[] to, int i, Flist list) {
+ // DONE
+ Quilt maps = this;
+ from[i] = maps.qspec.get(i).breakpoints[0];
+ to[i] = maps.qspec.get(i).breakpoints[maps.qspec.get(i).width];
+ int maxpts = 0;
+ Quilt m;
+ for (m = maps; m != null; m = m.next) {
+ if (m.qspec.get(i).breakpoints[0] > from[i])
+ from[i] = m.qspec.get(i).breakpoints[0];
+ if (m.qspec.get(i).breakpoints[m.qspec.get(i).width] < to[i])
+ to[i] = m.qspec.get(i).breakpoints[m.qspec.get(i).width];
+ maxpts += m.qspec.get(i).width + 1;
+ }
+ list.grow(maxpts);
+ for (m = maps; m != null; m = m.next) {
+ for (int j = 0; j <= m.qspec.get(i).width; j++) {
+ list.add(m.qspec.get(i).breakpoints[j]);
+ }
+ }
+ list.filter();
+ list.taper(from[i], to[i]);
+ }
+
+ /**
+ * Is this quilt culled
+ * @return 0 or Subdivider.CULL_ACCEPT
+ */
+ public int isCulled() {
+ if (mapdesc.isCulling()) {
+ // System.out.println("TODO quilt.isculled mapdesc.isculling");
+ return 0;
+ } else {
+ return Subdivider.CULL_ACCEPT;
+ }
+ }
+
+ /**
+ * Finds range for surface
+ * @param from low param
+ * @param to high param
+ * @param slist u direction breakpoints
+ * @param tlist v direction breakpoints
+ */
+ public void getRange(float[] from, float[] to, Flist slist, Flist tlist) {
+ // DONE
+ getRange(from, to, 0, slist);
+ getRange(from, to, 1, tlist);
+
+ }
+
+ /**
+ * Empty method
+ * @param sbrkpts
+ * @param tbrkpts
+ * @param rate
+ */
+ public void findRates(Flist sbrkpts, Flist tbrkpts, float[] rate) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO quilt.findrates");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java
new file mode 100755
index 000000000..d94986a03
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Quiltspec.java
@@ -0,0 +1,85 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Quilt definition
+ * @author Tomas Hrasky
+ *
+ */
+public class Quiltspec {
+
+ /**
+ * Stride between control points
+ */
+ public int stride;
+
+ /**
+ * Quilt width in breakpoints
+ */
+ public int width;
+
+ /**
+ * Quilt order
+ */
+ public int order;
+
+ /**
+ * Start offset
+ */
+ public int offset;
+
+ /**
+ * Breakpoint index
+ */
+ public int index;
+
+ /**
+ * Boundary
+ */
+ public int[] bdry;
+
+ /**
+ * Breakpoints
+ */
+ public float[] breakpoints;
+
+ /**
+ * Makes new quiltspec
+ */
+ public Quiltspec() {
+ this.bdry = new int[2];
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt
new file mode 100755
index 000000000..89630c71e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/README.txt
@@ -0,0 +1,59 @@
+Unimplemented functionality
+ - tesselation and callbacks
+ - trimming
+ - setting NURBS properties (-> sampling etc.)
+Differences from C++ source
+ - no pooling
+ - pointers to arrays are replaced by CArrayOf... classes and their methods
+Unimplemented or incomplete "calltree top" methods (according to glu.def in Mesa 6.5)
+ gluBeginTrim
+ gluDeleteNurbsRenderer - won't be needed
+ gluEndTrim
+ gluGetNurbsProperty
+ gluLoadSamplingMatrices
+ gluNurbsCallback
+ gluNurbsCallbackData
+ gluNurbsCallbackDataEXT
+ gluNurbsCurve - TODO type switch
+ gluNurbsProperty
+ gluPwlCurve
+ gluQuadricCallback - not a NURBS method
+As of files
+ - Arc[ST]dirSorter.java - unimplemented (part of tesselation)
+ - Backend.java:194 - wireframe quads - part of tesselation/callback
+ - Curve.java:141-204 - culling
+ - DisplayList.java:57 - append to DL - not sure whether it will be needed
+ - GLUnurbs.java :443,484 - error values
+ :445 - trimming
+ :512 - error handling (callback)
+ :530 - loadGLmatrices
+ :786 - nuid - nurbs object id - won't be needed I think
+ :803 - end trim
+ - GLUwNURBS.java:68,176 - NUBRS properties
+ - Knotspec.java :371 - copying in general case (more than 4 coords)
+ :517 - copying with more than 4 coords
+ :556 - pt_oo_sum default
+ - Knotvector.java:165 - show method (probably debugging)
+ - Mapdesc.java :354 - get property
+ :435 - xFormMat - change param cp to CArrayOfFloats; probably sampling functionality
+ - Maplist.java:68 - clear ?
+ - OpenGLCurveEvaluator.java :132 - tess./callback code
+ :168 - mapgrid1f
+ :190 - tess./callback code (output triangles)
+ - OpenGLSurfaceEvaluator.java :77 . tess./callback code
+ :81 - glGetIntegerValue
+ :114 - tess./callback code
+ :117 - Level of detail
+ :144,161,201 - tess./callback code - output triangles
+ - Patch.java:55 - constructor stuff ?
+ - Patchlist.java:55 - constructor stuff ?
+ :97 - cull check
+ :105 - step size
+ :115 - need of sampling subdivision
+ :126 - need of subdivision
+ :137 - need of non sampling subd.
+ :146 - bbox (??)
+ -Quilt.java :254 - culling
+ :282 - rates
+ -Subdivider.java - all TODOs - it's stuff about trimming probably
+ :545 - jumpbuffer - not sure purpose it exactly served in original source
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java
new file mode 100755
index 000000000..c571d9d88
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Renderhints.java
@@ -0,0 +1,128 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class holding rendering params
+ * @author Tomas Hrasky
+ *
+ */
+public class Renderhints {
+
+ /**
+ * Check for errors
+ */
+ public int errorchecking;
+
+ /**
+ * Maximum subdivisions
+ */
+ public int maxsubdivisions;
+
+ /**
+ * Number of subdivisions
+ */
+ private int subdivisions;
+
+ /**
+ * Display method
+ */
+ int display_method;
+
+ /**
+ * Output triangles
+ */
+ int wiretris;
+
+ /**
+ * Output quads
+ */
+ int wirequads;
+
+ /**
+ * Makes new Renderinghints
+ */
+ public Renderhints() {
+ display_method = NurbsConsts.N_FILL;
+ errorchecking = NurbsConsts.N_MSG;
+ subdivisions = 6;
+ // tmp1=0;
+ }
+
+ /**
+ * Set property value
+ * @param prop property
+ */
+ public void setProperty(Property prop) {
+ switch (prop.type) {
+ case NurbsConsts.N_DISPLAY:
+ display_method = (int) prop.value;
+ break;
+ case NurbsConsts.N_ERRORCHECKING:
+ errorchecking = (int) prop.value;
+ break;
+ case NurbsConsts.N_SUBDIVISIONS:
+ subdivisions = (int) prop.value;
+ break;
+ default:
+ // abort - end program
+ break;
+ }
+ }
+
+ /**
+ * Initialization
+ */
+ public void init() {
+ // DONE
+ maxsubdivisions = subdivisions;
+ if (maxsubdivisions < 0)
+ maxsubdivisions = 0;
+
+ if (display_method == NurbsConsts.N_FILL) {
+ wiretris = 0;
+ wirequads = 0;
+ } else if (display_method == NurbsConsts.N_OUTLINE_TRI) {
+ wiretris = 1;
+ wirequads = 0;
+ } else if (display_method == NurbsConsts.N_OUTLINE_QUAD) {
+ wiretris = 0;
+ wirequads = 1;
+ } else {
+ wiretris = 1;
+ wirequads = 1;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java
new file mode 100755
index 000000000..35288c67d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Splinespec.java
@@ -0,0 +1,204 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * NURBS definition
+ * @author Tomas Hrasky
+ *
+ */
+public class Splinespec {
+
+ /**
+ * Dimension
+ */
+ private int dim;
+
+ /**
+ * Knot vector specs
+ */
+ private Knotspec kspec;
+
+ /**
+ * Control points after conversion
+ */
+ private CArrayOfFloats outcpts;
+
+ /**
+ * Makes new Splinespec with given dimension
+ * @param i dimension
+ */
+ public Splinespec(int i) {
+ // DONE
+ this.dim = i;
+ }
+
+ /**
+ * Initializes knotspec according to knotvector
+ * @param knotvector basic knotvector
+ */
+ public void kspecinit(Knotvector knotvector) {
+ // DONE
+ this.kspec = new Knotspec();
+ kspec.inkbegin = new CArrayOfFloats(knotvector.knotlist, 0);
+ kspec.inkend = new CArrayOfFloats(knotvector.knotlist,
+ knotvector.knotcount);
+ kspec.prestride = knotvector.stride;
+ kspec.order = knotvector.order;
+ kspec.next = null;
+ }
+
+ /**
+ * Initializes knotspec according to knotvector - SURFACE
+ * @param sknotvector knotvector in u dir
+ * @param tknotvector knotvector in v dir
+ */
+ public void kspecinit(Knotvector sknotvector, Knotvector tknotvector) {
+ // DONE
+ this.kspec = new Knotspec();
+ Knotspec tkspec = new Knotspec();
+
+ kspec.inkbegin = new CArrayOfFloats(sknotvector.knotlist, 0);
+ kspec.inkend = new CArrayOfFloats(sknotvector.knotlist,
+ sknotvector.knotcount);
+ kspec.prestride = sknotvector.stride;
+ kspec.order = sknotvector.order;
+ kspec.next = tkspec;
+
+ tkspec.inkbegin = new CArrayOfFloats(tknotvector.knotlist, 0);
+ tkspec.inkend = new CArrayOfFloats(tknotvector.knotlist,
+ tknotvector.knotcount);
+ tkspec.prestride = tknotvector.stride;
+ tkspec.order = tknotvector.order;
+ tkspec.next = null;
+ }
+
+ /**
+ * Preselect and select knotspecs
+ */
+ public void select() {
+ // DONE
+ for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
+ knotspec.preselect();
+ knotspec.select();
+ }
+
+ }
+
+ /**
+ * Prepares for conversion
+ * @param ncoords number of coords
+ */
+ public void layout(int ncoords) {
+ // DONE
+ int stride = ncoords;
+ for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
+ knotspec.poststride = stride;
+ stride *= (knotspec.bend.getPointer() - knotspec.bbegin
+ .getPointer())
+ * knotspec.order + knotspec.postoffset;
+ knotspec.preoffset *= knotspec.prestride;
+ knotspec.prewidth *= knotspec.poststride;
+ knotspec.postwidth *= knotspec.poststride;
+ knotspec.postoffset *= knotspec.poststride;
+ knotspec.ncoords = ncoords;
+ }
+ outcpts = new CArrayOfFloats(new float[stride]);
+
+ }
+
+ /**
+ * Prepares quilt for conversion
+ * @param quilt quilt to work with
+ */
+ public void setupquilt(Quilt quilt) {
+ // DONE
+ CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
+ quilt.eqspec = new CArrayOfQuiltspecs(qspec.getArray(), dim);
+ for (Knotspec knotspec = kspec; knotspec != null;) {
+ qspec.get().stride = knotspec.poststride;
+ qspec.get().width = knotspec.bend.getPointer()
+ - knotspec.bbegin.getPointer();
+ qspec.get().order = knotspec.order;
+ qspec.get().offset = knotspec.postoffset;
+ qspec.get().index = 0;
+ qspec.get().bdry[0] = (knotspec.kleft.getPointer() == knotspec.kfirst
+ .getPointer()) ? 1 : 0;
+ qspec.get().bdry[1] = (knotspec.kright.getPointer() == knotspec.klast
+ .getPointer()) ? 1 : 0;
+ qspec.get().breakpoints = new float[qspec.get().width + 1];
+ CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
+ for (CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
+ .getPointer() <= knotspec.bend.getPointer(); bk.pp()) {
+ k.set(bk.get().value);
+ k.pp();
+ }
+ knotspec = knotspec.next;
+ if (knotspec != null)
+ qspec.pp();
+ }
+ quilt.cpts = new CArrayOfFloats(outcpts);
+ quilt.next = null;
+ }
+
+ /**
+ * Copies array of control points to output array
+ * @param ctlarray control points array
+ */
+ public void copy(CArrayOfFloats ctlarray) {
+ // DONE
+ kspec.copy(ctlarray, outcpts);
+
+ }
+
+ /**
+ * Transforms knotspecs - conversion
+ */
+ public void transform() {
+ // DONE
+ Knotspec knotspec;
+ outcpts.setPointer(0);
+ for (knotspec = kspec; knotspec != null; knotspec = knotspec.next)
+ knotspec.istransformed = false;
+
+ for (knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
+ for (Knotspec kspec2 = kspec; kspec2 != null; kspec2 = kspec2.next)
+ kspec2.kspectotrans = knotspec;
+ kspec.transform(outcpts);
+ knotspec.istransformed = true;
+ }
+
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java
new file mode 100755
index 000000000..b1506d6a1
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/Subdivider.java
@@ -0,0 +1,1167 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class working with curves and surfaces
+ * @author Tomas Hrasky
+ *
+ */
+public class Subdivider {
+ /**
+ * Cull type
+ */
+ public static final int CULL_TRIVIAL_REJECT = 0;
+
+ /**
+ * Cull type
+ */
+ public static final int CULL_ACCEPT = 1;
+
+ /**
+ * Maximum trimming arcs
+ */
+ private static final int MAXARCS = 10;
+
+ /**
+ * Linked list of Quilts
+ */
+ Quilt qlist;
+
+ /**
+ * Object holding rendering honts information
+ */
+ private Renderhints renderhints;
+
+ /**
+ * Backend object
+ */
+ private Backend backend;
+
+ /**
+ * Number of subdivisions
+ */
+ private int subdivisions;
+
+ /**
+ * U step when using domain distance sampling
+ */
+ private float domain_distance_u_rate;
+
+ /**
+ * Use domain distance sampling
+ */
+ private int is_domain_distance_sampling;
+
+ /**
+ * Initial class holding trimming arcs
+ */
+ private Bin initialbin;
+
+ /**
+ * Not used
+ */
+ private boolean showDegenerate;
+
+ /**
+ * Is triming arc type bezier arc
+ */
+ private boolean isArcTypeBezier;
+
+ /**
+ * Breakpoints in v direction
+ */
+ private Flist tpbrkpts;
+
+ /**
+ * Breakpoints in u direction
+ */
+ private Flist spbrkpts;
+
+ /**
+ * Unused
+ */
+ private int s_index;
+
+ /**
+ * Head of linked list of trimming arcs
+ */
+ private Arc pjarc;
+
+ /**
+ * Class tesselating trimming arcs
+ */
+ private ArcTesselator arctesselator;
+
+ /**
+ * Unused
+ */
+ private int t_index;
+
+ /**
+ * Breakpoints
+ */
+ private Flist smbrkpts;
+
+ /**
+ * Not used
+ */
+ private float[] stepsizes;
+
+ /**
+ * Domain distance in V direction
+ */
+ private float domain_distance_v_rate;
+
+ /**
+ * Initializes quilt list
+ */
+ public void beginQuilts(Backend backend) {
+ // DONE
+ qlist = null;
+ renderhints = new Renderhints();
+ this.backend = backend;
+
+ initialbin = new Bin();
+ arctesselator = new ArcTesselator();
+ }
+
+ /**
+ * Adds quilt to linked list
+ * @param quilt added quilt
+ */
+ public void addQuilt(Quilt quilt) {
+ // DONE
+ if (qlist == null)
+ qlist = quilt;
+ else {
+ quilt.next = qlist;
+ qlist = quilt;
+ }
+
+ }
+
+ /**
+ * Empty method
+ */
+ public void endQuilts() {
+ // DONE
+ }
+
+ /**
+ * Draws a surface
+ */
+ public void drawSurfaces() {
+ renderhints.init();
+
+ if (qlist == null) {
+ // System.out.println("qlist is null");
+ return;
+ }
+
+ for (Quilt q = qlist; q != null; q = q.next) {
+ if (q.isCulled() == CULL_TRIVIAL_REJECT) {
+ freejarcs(initialbin);
+ return;
+ }
+ }
+
+ float[] from = new float[2];
+ float[] to = new float[2];
+
+ spbrkpts = new Flist();
+ tpbrkpts = new Flist();
+ qlist.getRange(from, to, spbrkpts, tpbrkpts);
+
+ boolean optimize = (is_domain_distance_sampling > 0 && (renderhints.display_method != NurbsConsts.N_OUTLINE_PATCH));
+
+ // TODO decide whether to optimize (when there is gluNurbsProperty implemented)
+ optimize = true;
+
+ if (!initialbin.isnonempty()) {
+ if (!optimize) {
+ makeBorderTrim(from, to);
+ }
+ } else {
+ float[] rate = new float[2];
+ qlist.findRates(spbrkpts, tpbrkpts, rate);
+ // System.out.println("subdivider.drawsurfaces decompose");
+ }
+
+ backend.bgnsurf(renderhints.wiretris, renderhints.wirequads);
+
+ // TODO partition test
+
+ if (!initialbin.isnonempty() && optimize) {
+
+ int i, j;
+ int num_u_steps;
+ int num_v_steps;
+ for (i = spbrkpts.start; i < spbrkpts.end - 1; i++) {
+ for (j = tpbrkpts.start; j < tpbrkpts.end - 1; j++) {
+ float[] pta = new float[2];
+ float[] ptb = new float[2];
+
+ pta[0] = spbrkpts.pts[i];
+ ptb[0] = spbrkpts.pts[i + 1];
+ pta[1] = tpbrkpts.pts[j];
+ ptb[1] = tpbrkpts.pts[j + 1];
+ qlist.downloadAll(pta, ptb, backend);
+
+ num_u_steps = (int) (domain_distance_u_rate * (ptb[0] - pta[0]));
+ num_v_steps = (int) (domain_distance_v_rate * (ptb[1] - pta[1]));
+
+ if (num_u_steps <= 0)
+ num_u_steps = 1;
+ if (num_v_steps <= 0)
+ num_v_steps = 1;
+
+ backend.surfgrid(pta[0], ptb[0], num_u_steps, ptb[1],
+ pta[1], num_v_steps);
+ backend.surfmesh(0, 0, num_u_steps, num_v_steps);
+
+ }
+ }
+
+ } else
+
+ subdivideInS(initialbin);
+
+ backend.endsurf();
+ }
+
+ /**
+ * Empty method
+ * @param initialbin2
+ */
+ private void freejarcs(Bin initialbin2) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.freejarcs");
+ }
+
+ /**
+ * Subdivide in U direction
+ * @param source Trimming arcs source
+ */
+ private void subdivideInS(Bin source) {
+ // DONE
+ if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM) {
+ outline(source);
+ freejarcs(source);
+ } else {
+ setArcTypeBezier();
+ setNonDegenerate();
+ splitInS(source, spbrkpts.start, spbrkpts.end);
+ }
+
+ }
+
+ /**
+ * Split in U direction
+ * @param source Trimming arcs source
+ * @param start breakpoints start
+ * @param end breakpoints end
+ */
+ private void splitInS(Bin source, int start, int end) {
+ // DONE
+ if (source.isnonempty()) {
+ if (start != end) {
+ int i = start + (end - start) / 2;
+ Bin left = new Bin();
+ Bin right = new Bin();
+
+ split(source, left, right, 0, spbrkpts.pts[i]);
+ splitInS(left, start, i);
+ splitInS(right, i + 1, end);
+ } else {
+ if (start == spbrkpts.start || start == spbrkpts.end) {
+ freejarcs(source);
+ } else if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM_S) {
+ outline(source);
+ freejarcs(source);
+ } else {
+ setArcTypeBezier();
+ setNonDegenerate();
+ s_index = start;
+ splitInT(source, tpbrkpts.start, tpbrkpts.end);
+ }
+ }
+ } else{
+ // System.out.println("Source is empty - subdivider.splitins");
+ }
+ }
+
+ /**
+ * Split in V direction
+ * @param source
+ * @param start
+ * @param end
+ */
+ private void splitInT(Bin source, int start, int end) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.splitint");
+
+ if (source.isnonempty()) {
+ if (start != end) {
+ int i = start + (end - start) / 2;
+ Bin left = new Bin();
+ Bin right = new Bin();
+ split(source, left, right, 1, tpbrkpts.pts[i + 1]);
+ splitInT(left, start, i);
+ splitInT(right, i + 1, end);
+ } else {
+ if (start == tpbrkpts.start || start == tpbrkpts.end) {
+ freejarcs(source);
+ } else if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM_ST) {
+ outline(source);
+ freejarcs(source);
+ } else {
+ t_index = start;
+ setArcTypeBezier();
+ setDegenerate();
+
+ float[] pta = new float[2];
+ float[] ptb = new float[2];
+
+ pta[0] = spbrkpts.pts[s_index - 1];
+ pta[1] = tpbrkpts.pts[t_index - 1];
+
+ ptb[0] = spbrkpts.pts[s_index];
+ ptb[1] = tpbrkpts.pts[t_index];
+ qlist.downloadAll(pta, ptb, backend);
+
+ Patchlist patchlist = new Patchlist(qlist, pta, ptb);
+
+ samplingSplit(source, patchlist,
+ renderhints.maxsubdivisions, 0);
+ setNonDegenerate();
+ setArcTypeBezier();
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Sample
+ * @param source
+ * @param patchlist
+ * @param subdivisions
+ * @param param
+ */
+ private void samplingSplit(Bin source, Patchlist patchlist,
+ int subdivisions, int param) {
+ // DONE
+ if (!source.isnonempty())
+ return;
+ if (patchlist.cullCheck() == CULL_TRIVIAL_REJECT) {
+ freejarcs(source);
+ return;
+ }
+
+ patchlist.getstepsize();
+ if (renderhints.display_method == NurbsConsts.N_OUTLINE_PATCH) {
+ tesselation(source, patchlist);
+ outline(source);
+ freejarcs(source);
+ return;
+ }
+
+ tesselation(source, patchlist);
+ if (patchlist.needsSamplingSubdivision() && subdivisions > 0) {
+ if (!patchlist.needsSubdivision(0)) {
+ param = 1;
+ } else if (patchlist.needsSubdivision(1))
+ param = 0;
+ else
+ param = 1 - param;
+
+ Bin left = new Bin();
+ Bin right = new Bin();
+
+ float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+
+ split(source, left, right, param, mid);
+ Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+ samplingSplit(left, subpatchlist, subdivisions - 1, param);
+ samplingSplit(right, subpatchlist, subdivisions - 1, param);
+ } else {
+ setArcTypePwl();
+ setDegenerate();
+ nonSamplingSplit(source, patchlist, subdivisions, param);
+ setDegenerate();
+ setArcTypeBezier();
+ }
+ }
+
+ /**
+ * Not used
+ * @param source
+ * @param patchlist
+ * @param subdivisions
+ * @param param
+ */
+ private void nonSamplingSplit(Bin source, Patchlist patchlist,
+ int subdivisions, int param) {
+ // DONE
+ if (patchlist.needsNonSamplingSubdivision() && subdivisions > 0) {
+ param = 1 - param;
+
+ Bin left = new Bin();
+ Bin right = new Bin();
+
+ float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+ split(source, left, right, param, mid);
+ Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+ if (left.isnonempty()) {
+ if (subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT)
+ freejarcs(left);
+ else
+ nonSamplingSplit(left, subpatchlist, subdivisions - 1,
+ param);
+ }
+ if (right.isnonempty()) {
+ if (patchlist.cullCheck() == CULL_TRIVIAL_REJECT)
+ freejarcs(right);
+ else
+ nonSamplingSplit(right, subpatchlist, subdivisions - 1,
+ param);
+ }
+ } else {
+ patchlist.bbox();
+ backend.patch(patchlist.pspec[0].range[0],
+ patchlist.pspec[0].range[1], patchlist.pspec[1].range[0],
+ patchlist.pspec[1].range[1]);
+ if (renderhints.display_method == NurbsConsts.N_OUTLINE_SUBDIV) {
+ outline(source);
+ freejarcs(source);
+ } else {
+ setArcTypePwl();
+ setDegenerate();
+ findIrregularS(source);
+ monosplitInS(source, smbrkpts.start, smbrkpts.end);
+ }
+ }
+
+ }
+
+ /**
+ * Not used
+ * @param source
+ * @param start
+ * @param end
+ */
+ private void monosplitInS(Bin source, int start, int end) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.monosplitins");
+ }
+
+ /**
+ * Not used
+ * @param source
+ */
+ private void findIrregularS(Bin source) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.findIrregularS");
+ }
+
+ /**
+ * Not used
+ */
+ private void setArcTypePwl() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.setarctypepwl");
+ }
+
+ /**
+ * Not used
+ * @param source
+ * @param patchlist
+ */
+ private void tesselation(Bin source, Patchlist patchlist) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.tesselation");
+ }
+
+ /**
+ * Not used
+ */
+ private void setDegenerate() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.setdegenerate");
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param left
+ * @param right
+ * @param param
+ * @param value
+ */
+ private void split(Bin bin, Bin left, Bin right, int param, float value) {
+ // DONE
+ Bin intersections = new Bin();
+ Bin unknown = new Bin();
+
+ partition(bin, left, intersections, right, unknown, param, value);
+
+ int count = intersections.numarcs();
+ // TODO jumpbuffer ??
+
+ if (count % 2 == 0) {
+
+ Arc[] arclist = new Arc[MAXARCS];
+ CArrayOfArcs list;
+ if (count >= MAXARCS) {
+ list = new CArrayOfArcs(new Arc[count]);
+ } else {
+ list = new CArrayOfArcs(arclist);
+ }
+
+ CArrayOfArcs last, lptr;
+ Arc jarc;
+
+ for (last = new CArrayOfArcs(list); (jarc = intersections
+ .removearc()) != null; last.pp())
+ last.set(jarc);
+
+ if (param == 0) {// sort into incrasing t order
+ ArcSdirSorter sorter = new ArcSdirSorter(this);
+ sorter.qsort(list, count);
+
+ for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+ .getPointer(); lptr.raisePointerBy(2))
+ check_s(lptr.get(), lptr.getRelative(1));
+ for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+ .getPointer(); lptr.raisePointerBy(2))
+ join_s(left, right, lptr.get(), lptr.getRelative(1));
+ for (lptr = new CArrayOfArcs(list); lptr.getPointer() != last
+ .getPointer(); lptr.pp()) {
+ if (lptr.get().head()[0] <= value
+ && lptr.get().tail()[0] <= value)
+ left.addarc(lptr.get());
+ else
+ right.addarc(lptr.get());
+ }
+
+ } else {// sort into decreasing s order
+ ArcTdirSorter sorter = new ArcTdirSorter(this);
+ sorter.qsort(list, count);
+
+ for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+ .getPointer(); lptr.raisePointerBy(2))
+ check_t(lptr.get(), lptr.getRelative(1));
+ for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
+ .getPointer(); lptr.raisePointerBy(2))
+ join_t(left, right, lptr.get(), lptr.getRelative(1));
+ for (lptr = new CArrayOfArcs(list); lptr.getPointer() != last
+ .getPointer(); lptr.raisePointerBy(2)) {
+ if (lptr.get().head()[0] <= value
+ && lptr.get().tail()[0] <= value)
+ left.addarc(lptr.get());
+ else
+ right.addarc(lptr.get());
+ }
+
+ }
+
+ unknown.adopt();
+ }
+ }
+
+ /**
+ * Not used
+ * @param left
+ * @param right
+ * @param arc
+ * @param relative
+ */
+ private void join_t(Bin left, Bin right, Arc arc, Arc relative) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.join_t");
+ }
+
+ /**
+ * Not used
+ * @param arc
+ * @param relative
+ */
+ private void check_t(Arc arc, Arc relative) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.check_t");
+ }
+
+ /**
+ * Not used
+ * @param left
+ * @param right
+ * @param jarc1
+ * @param jarc2
+ */
+ private void join_s(Bin left, Bin right, Arc jarc1, Arc jarc2) {
+ // DONE
+ if (!jarc1.getitail())
+ jarc1 = jarc1.next;
+ if (!jarc2.getitail())
+ jarc2 = jarc2.next;
+
+ float s = jarc1.tail()[0];
+ float t1 = jarc1.tail()[1];
+ float t2 = jarc2.tail()[1];
+
+ if (t1 == t2) {
+ simplelink(jarc1, jarc2);
+ } else {
+ Arc newright = new Arc(Arc.ARC_RIGHT);
+ Arc newleft = new Arc(Arc.ARC_LEFT);
+ if (isBezierArcType()) {
+ arctesselator.bezier(newright, s, s, t1, t2);
+ arctesselator.bezier(newleft, s, s, t2, t1);
+ } else {
+ arctesselator.pwl_right(newright, s, t1, t2, stepsizes[0]);
+ arctesselator.pwl_left(newright, s, t2, t1, stepsizes[2]);
+ }
+ link(jarc1, jarc2, newright, newleft);
+ left.addarc(newright);
+ right.addarc(newleft);
+ }
+
+ }
+
+ /**
+ * Not used
+ * @param jarc1
+ * @param jarc2
+ * @param newright
+ * @param newleft
+ */
+ private void link(Arc jarc1, Arc jarc2, Arc newright, Arc newleft) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.link");
+ }
+
+ /**
+ * Not used
+ * @return true
+ */
+ private boolean isBezierArcType() {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.isbezierarc");
+ return true;
+ }
+
+ /**
+ * Not used
+ * @param jarc1
+ * @param jarc2
+ */
+ private void simplelink(Arc jarc1, Arc jarc2) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.simplelink");
+ }
+
+ /**
+ * Not used
+ * @param arc
+ * @param relative
+ */
+ private void check_s(Arc arc, Arc relative) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.check_s");
+
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param left
+ * @param intersections
+ * @param right
+ * @param unknown
+ * @param param
+ * @param value
+ */
+ private void partition(Bin bin, Bin left, Bin intersections, Bin right,
+ Bin unknown, int param, float value) {
+
+ Bin headonleft = new Bin();
+ Bin headonright = new Bin();
+ Bin tailonleft = new Bin();
+ Bin tailonright = new Bin();
+
+ for (Arc jarc = bin.removearc(); jarc != null; jarc = bin.removearc()) {
+ float tdiff = jarc.tail()[param] - value;
+ float hdiff = jarc.head()[param] - value;
+
+ if (tdiff > 0) {
+ if (hdiff > 0) {
+ right.addarc(jarc);
+ } else if (hdiff == 0) {
+ tailonright.addarc(jarc);
+ } else {
+ Arc jtemp;
+ switch (arc_split(jarc, param, value, 0)) {
+ case 2:
+ tailonright.addarc(jarc);
+ headonleft.addarc(jarc.next);
+ break;
+ // TODO rest cases
+ default:
+ System.out
+ .println("TODO subdivider.partition rest cases");
+ break;
+ }
+ }
+ } else if (tdiff == 0) {
+ if (hdiff > 0) {
+ headonright.addarc(jarc);
+ } else if (hdiff == 0) {
+ unknown.addarc(jarc);
+ } else {
+ headonright.addarc(jarc);
+ }
+ } else {
+ if (hdiff > 0) {
+ // TODO rest
+ // System.out.println("TODO subdivider.partition rest of else");
+ } else if (hdiff == 0) {
+ tailonleft.addarc(jarc);
+ } else {
+ left.addarc(jarc);
+ }
+ }
+
+ }
+ if (param == 0) {
+ classify_headonleft_s(headonleft, intersections, left, value);
+ classify_tailonleft_s(tailonleft, intersections, left, value);
+ classify_headonright_s(headonright, intersections, right, value);
+ classify_tailonright_s(tailonright, intersections, right, value);
+ } else {
+ classify_headonleft_t(headonleft, intersections, left, value);
+ classify_tailonleft_t(tailonleft, intersections, left, value);
+ classify_headonright_t(headonright, intersections, right, value);
+ classify_tailonright_t(tailonright, intersections, right, value);
+ }
+ }
+
+ /**
+ * Not used
+ * @param tailonright
+ * @param intersections
+ * @param right
+ * @param value
+ */
+ private void classify_tailonright_t(Bin tailonright, Bin intersections,
+ Bin right, float value) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.classify_tailonright_t");
+
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param in
+ * @param out
+ * @param val
+ */
+ private void classify_tailonleft_s(Bin bin, Bin in, Bin out, float val) {
+
+ // DONE
+ Arc j;
+ while ((j = bin.removearc()) != null) {
+ j.clearitail();
+
+ float diff = j.next.head()[0] - val;
+ if (diff > 0) {
+ in.addarc(j);
+ } else if (diff < 0) {
+ if (ccwTurn_sl(j, j.next))
+ out.addarc(j);
+ else
+ in.addarc(j);
+ } else {
+ if (j.next.tail()[1] > j.next.head()[1])
+ in.addarc(j);
+ else
+ out.addarc(j);
+ }
+ }
+
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param in
+ * @param out
+ * @param val
+ */
+ private void classify_headonright_s(Bin bin, Bin in, Bin out, float val) {
+ // DONE
+ Arc j;
+ while ((j = bin.removearc()) != null) {
+ j.setitail();
+
+ float diff = j.prev.tail()[0] - val;
+ if (diff > 0) {
+ if (ccwTurn_sr(j.prev, j))
+ out.addarc(j);
+ else
+ in.addarc(j);
+ } else if (diff < 0) {
+ out.addarc(j);
+ } else {
+ if (j.prev.tail()[1] > j.prev.head()[1])
+ out.addarc(j);
+ else
+ in.addarc(j);
+ }
+ }
+ }
+
+ /**
+ * Not used
+ * @param prev
+ * @param j
+ * @return false
+ */
+ private boolean ccwTurn_sr(Arc prev, Arc j) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO ccwTurn_sr");
+ return false;
+ }
+
+ /**
+ * Not used
+ * @param headonright
+ * @param intersections
+ * @param right
+ * @param value
+ */
+ private void classify_headonright_t(Bin headonright, Bin intersections,
+ Bin right, float value) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.classify_headonright_t");
+ }
+
+ /**
+ * Not used
+ * @param tailonleft
+ * @param intersections
+ * @param left
+ * @param value
+ */
+ private void classify_tailonleft_t(Bin tailonleft, Bin intersections,
+ Bin left, float value) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.classify_tailonleft_t");
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param in
+ * @param out
+ * @param val
+ */
+ private void classify_headonleft_t(Bin bin, Bin in, Bin out, float val) {
+ // DONE
+ Arc j;
+ while ((j = bin.removearc()) != null) {
+ j.setitail();
+
+ float diff = j.prev.tail()[1] - val;
+ if (diff > 0) {
+ out.addarc(j);
+ } else if (diff < 0) {
+ if (ccwTurn_tl(j.prev, j))
+ out.addarc(j);
+ else
+ in.addarc(j);
+ } else {
+ if (j.prev.tail()[0] > j.prev.head()[0])
+ out.addarc(j);
+ else
+ in.addarc(j);
+ }
+ }
+ }
+
+ /**
+ * Not used
+ * @param prev
+ * @param j
+ * @return false
+ */
+ private boolean ccwTurn_tl(Arc prev, Arc j) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.ccwTurn_tl");
+ return false;
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param in
+ * @param out
+ * @param val
+ */
+ private void classify_tailonright_s(Bin bin, Bin in, Bin out, float val) {
+ // DONE
+ Arc j;
+ while ((j = bin.removearc()) != null) {
+ j.clearitail();
+
+ float diff = j.next.head()[0] - val;
+ if (diff > 0) {
+ if (ccwTurn_sr(j, j.next))
+ out.addarc(j);
+ else
+ in.addarc(j);
+ } else if (diff < 0) {
+ in.addarc(j);
+ } else {
+ if (j.next.tail()[1] > j.next.head()[1])
+ out.addarc(j);
+ else
+ in.addarc(j);
+ }
+ }
+
+ }
+
+ /**
+ * Not used
+ * @param bin
+ * @param in
+ * @param out
+ * @param val
+ */
+ private void classify_headonleft_s(Bin bin, Bin in, Bin out, float val) {
+ // DONE
+ Arc j;
+ while ((j = bin.removearc()) != null) {
+ j.setitail();
+
+ float diff = j.prev.tail()[0] - val;
+ if (diff > 0) {
+ out.addarc(j);
+ } else if (diff < 0) {
+ if (ccwTurn_sl(j.prev, j))
+ out.addarc(j);
+ else
+ in.addarc(j);
+ } else {
+ if (j.prev.tail()[1] > j.prev.head()[1])
+ in.addarc(j);
+ else
+ out.addarc(j);
+ }
+ }
+
+ }
+
+ /**
+ * Not used
+ * @param prev
+ * @param j
+ * @return false
+ */
+ private boolean ccwTurn_sl(Arc prev, Arc j) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.ccwTurn_sl");
+ return false;
+ }
+
+ /**
+ * Not used
+ * @param jarc
+ * @param param
+ * @param value
+ * @param i
+ * @return 0
+ */
+ private int arc_split(Arc jarc, int param, float value, int i) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.arc_split");
+ return 0;
+ }
+
+ /**
+ * Not used
+ */
+ private void setNonDegenerate() {
+ // DONE
+ this.showDegenerate = false;
+
+ }
+
+ /**
+ * sets trimming arc default type to bezier
+ */
+ private void setArcTypeBezier() {
+ // DONE
+ isArcTypeBezier = true;
+ }
+
+ /**
+ * Not used
+ * @param source
+ */
+ private void outline(Bin source) {
+ // TODO Auto-generated method stub
+ // System.out.println("TODO subdivider.outline");
+ }
+
+ /**
+ * Makes default trim along surface borders
+ * @param from range beginnings
+ * @param to range ends
+ */
+ private void makeBorderTrim(float[] from, float[] to) {
+ // DONE
+ float smin = from[0];
+ float smax = to[0];
+
+ float tmin = from[1];
+ float tmax = to[1];
+
+ pjarc = null;
+ Arc jarc = null;
+
+ jarc = new Arc(Arc.ARC_BOTTOM);
+ arctesselator.bezier(jarc, smin, smax, tmin, tmin);
+ initialbin.addarc(jarc);
+ pjarc = jarc.append(pjarc);
+
+ jarc = new Arc(Arc.ARC_RIGHT);
+ arctesselator.bezier(jarc, smax, smax, tmin, tmax);
+ initialbin.addarc(jarc);
+ pjarc = jarc.append(pjarc);
+
+ jarc = new Arc(Arc.ARC_TOP);
+ arctesselator.bezier(jarc, smax, smin, tmax, tmax);
+ initialbin.addarc(jarc);
+ pjarc = jarc.append(pjarc);
+
+ jarc = new Arc(Arc.ARC_LEFT);
+ arctesselator.bezier(jarc, smin, smin, tmax, tmin);
+ initialbin.addarc(jarc);
+ jarc = jarc.append(pjarc);
+
+ // assert (jarc.check() == true);
+ }
+
+ /**
+ * Draws NURBS curve
+ */
+ public void drawCurves() {
+ // DONE
+ float[] from = new float[1];
+ float[] to = new float[1];
+
+ Flist bpts = new Flist();
+ qlist.getRange(from, to, bpts);
+
+ renderhints.init();
+
+ backend.bgncurv();
+
+ for (int i = bpts.start; i < bpts.end - 1; i++) {
+ float[] pta = new float[1];
+ float[] ptb = new float[1];
+ pta[0] = bpts.pts[i];
+ ptb[0] = bpts.pts[i + 1];
+
+ qlist.downloadAll(pta, ptb, backend);
+ Curvelist curvelist = new Curvelist(qlist, pta, ptb);
+ samplingSplit(curvelist, renderhints.maxsubdivisions);
+ }
+ backend.endcurv();
+ }
+
+ /**
+ * Samples a curve in case of need, or sends curve to backend
+ * @param curvelist list of curves
+ * @param maxsubdivisions maximum number of subdivisions
+ */
+ private void samplingSplit(Curvelist curvelist, int maxsubdivisions) {
+ if (curvelist.cullCheck() == CULL_TRIVIAL_REJECT)
+ return;
+
+ curvelist.getstepsize();
+
+ if (curvelist.needsSamplingSubdivision() && (subdivisions > 0)) {
+ // TODO kód
+ // System.out.println("TODO subdivider-needsSamplingSubdivision");
+ } else {
+ int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
+ backend.curvgrid(curvelist.range[0], curvelist.range[1], nu);
+ backend.curvmesh(0, nu);
+ }
+
+ }
+
+ /**
+ * Sets new domain_distance_u_rate value
+ * @param d new domain_distance_u_rate value
+
+ */
+ public void set_domain_distance_u_rate(double d) {
+ // DONE
+ domain_distance_u_rate = (float) d;
+ }
+
+ /**
+ * Sets new domain_distance_v_rate value
+ * @param d new domain_distance_v_rate value
+ */
+ public void set_domain_distance_v_rate(double d) {
+ // DONE
+ domain_distance_v_rate = (float) d;
+ }
+
+ /**
+ * Sets new is_domain_distance_sampling value
+ * @param i new is_domain_distance_sampling value
+ */
+ public void set_is_domain_distance_sampling(int i) {
+ // DONE
+ this.is_domain_distance_sampling = i;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java
new file mode 100755
index 000000000..feb3bc9a7
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/SurfaceEvaluator.java
@@ -0,0 +1,111 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Class rendering surfaces with OpenGL
+ * @author Tomas Hrasky
+ *
+ */
+public interface SurfaceEvaluator {
+
+ /**
+ * Pushes eval bit
+ */
+ public void bgnmap2f() ;
+
+ /**
+ * Sets glPolygonMode
+ * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
+ */
+ public void polymode(int style) ;
+
+ /**
+ * Pops all attributes
+ */
+ public void endmap2f() ;
+
+ /**
+ * Empty method
+ * @param ulo
+ * @param uhi
+ * @param vlo
+ * @param vhi
+ */
+ public void domain2f(float ulo, float uhi, float vlo, float vhi) ;
+
+ /**
+ * Defines 2D mesh
+ * @param nu number of steps in u direction
+ * @param u0 lowest u
+ * @param u1 highest u
+ * @param nv number of steps in v direction
+ * @param v0 lowest v
+ * @param v1 highest v
+ */
+ public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) ;
+
+ /**
+ * Evaluates surface
+ * @param style surface style
+ * @param umin minimum U
+ * @param umax maximum U
+ * @param vmin minimum V
+ * @param vmax maximum V
+ */
+ public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) ;
+
+ /**
+ * Initializes evaluator
+ * @param type surface type
+ * @param ulo lowest u
+ * @param uhi highest u
+ * @param ustride number of objects between control points in u direction
+ * @param uorder surface order in u direction
+ * @param vlo lowest v
+ * @param vhi highest v
+ * @param vstride number of control points' coords
+ * @param vorder surface order in v direction
+ * @param pts control points
+ */
+ public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
+ float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) ;
+
+ /**
+ * Calls opengl enable
+ * @param type what to enable
+ */
+ public void enable(int type) ;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java
new file mode 100755
index 000000000..ec3f6fc10
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/nurbs/TrimVertex.java
@@ -0,0 +1,56 @@
+package com.sun.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
+ ** file are subject only to the provisions of the License. You may not use
+ ** this file except in compliance with the License. You may obtain a copy
+ ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ **
+ ** http://oss.sgi.com/projects/FreeB
+ **
+ ** Note that, as provided in the License, the Software is distributed on an
+ ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ **
+ ** Original Code. The Original Code is: OpenGL Sample Implementation,
+ ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ ** Copyright in any portions created by third parties is as indicated
+ ** elsewhere herein. All Rights Reserved.
+ **
+ ** Additional Notice Provisions: The application programming interfaces
+ ** established by SGI in conjunction with the Original Code are The
+ ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ ** Window System(R) (Version 1.3), released October 19, 1998. This software
+ ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ ** published by SGI, but has not been independently verified as being
+ ** compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+/**
+ * Holds vertex used in trim
+ *
+ * @author Tomas Hrasky
+ *
+ */
+public class TrimVertex {
+
+ /**
+ * Trim vertex coords
+ */
+ public float[] param;
+
+ /**
+ * Makes new empty trim vertex
+ */
+ public TrimVertex() {
+ param = new float[2];
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java b/src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java
new file mode 100644
index 000000000..488a3c0f2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/registry/Registry.java
@@ -0,0 +1,79 @@
+/*
+ * License Applicability. Except to the extent portions of this file are
+ * made subject to an alternative license as permitted in the SGI Free
+ * Software License B, Version 1.1 (the "License"), the contents of this
+ * file are subject only to the provisions of the License. You may not use
+ * this file except in compliance with the License. You may obtain a copy
+ * of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+ * Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+ *
+ * http://oss.sgi.com/projects/FreeB
+ *
+ * Note that, as provided in the License, the Software is distributed on an
+ * "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+ * DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+ * CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+ *
+ * NOTE: The Original Code (as defined below) has been licensed to Sun
+ * Microsystems, Inc. ("Sun") under the SGI Free Software License B
+ * (Version 1.1), shown above ("SGI License"). Pursuant to Section
+ * 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+ * you under an alternative license ("Alternative License"). This
+ * Alternative License includes all of the provisions of the SGI License
+ * except that Section 2.2 and 11 are omitted. Any differences between
+ * the Alternative License and the SGI License are offered solely by Sun
+ * and not by SGI.
+ *
+ * Original Code. The Original Code is: OpenGL Sample Implementation,
+ * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+ * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+ * Copyright in any portions created by third parties is as indicated
+ * elsewhere herein. All Rights Reserved.
+ *
+ * Additional Notice Provisions: The application programming interfaces
+ * established by SGI in conjunction with the Original Code are The
+ * OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+ * April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+ * 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+ * Window System(R) (Version 1.3), released October 19, 1998. This software
+ * was created using the OpenGL(R) version 1.2.1 Sample Implementation
+ * published by SGI, but has not been independently verified as being
+ * compliant with the OpenGL(R) version 1.2.1 Specification.
+ */
+
+package com.sun.opengl.impl.glu.registry;
+
+import javax.media.opengl.glu.GLU;
+
+/**
+ *
+ * @author Administrator
+ */
+public class Registry {
+
+ /** Creates a new instance of Registry */
+ public Registry() {
+ }
+
+ public static String gluGetString(int name) {
+ if( name == GLU.GLU_VERSION ) {
+ return( "1.3" );
+ } else if( name == GLU.GLU_EXTENSIONS ) {
+ return( "GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess " );
+ }
+ return( null );
+ }
+
+ public static boolean gluCheckExtension( String extName, String extString ) {
+ if( extName == null || extString == null ) {
+ return( false );
+ }
+ if ((extString.indexOf(extName + " ") >= 0) ||
+ extString.endsWith(extName) ||
+ extString.equals(extName)) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java
new file mode 100644
index 000000000..a04c5c74b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/ActiveRegion.java
@@ -0,0 +1,69 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+
+class ActiveRegion {
+ GLUhalfEdge eUp; /* upper edge, directed right to left */
+ DictNode nodeUp; /* dictionary node corresponding to eUp */
+ int windingNumber; /* used to determine which regions are
+ * inside the polygon */
+ boolean inside; /* is this region inside the polygon? */
+ boolean sentinel; /* marks fake edges at t = +/-infinity */
+ boolean dirty; /* marks regions where the upper or lower
+ * edge has changed, but we haven't checked
+ * whether they intersect yet */
+ boolean fixUpperEdge; /* marks temporary edges introduced when
+ * we process a "right vertex" (one without
+ * any edges leaving to the right) */
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java
new file mode 100644
index 000000000..993671c0d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/CachedVertex.java
@@ -0,0 +1,58 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class CachedVertex {
+ public double[] coords = new double[3];
+ public Object data;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java
new file mode 100644
index 000000000..d2f6e3790
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Dict.java
@@ -0,0 +1,140 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class Dict {
+ DictNode head;
+ Object frame;
+ DictLeq leq;
+
+ private Dict() {
+ }
+
+ static Dict dictNewDict(Object frame, DictLeq leq) {
+ Dict dict = new Dict();
+ dict.head = new DictNode();
+
+ dict.head.key = null;
+ dict.head.next = dict.head;
+ dict.head.prev = dict.head;
+
+ dict.frame = frame;
+ dict.leq = leq;
+
+ return dict;
+ }
+
+ static void dictDeleteDict(Dict dict) {
+ dict.head = null;
+ dict.frame = null;
+ dict.leq = null;
+ }
+
+ static DictNode dictInsert(Dict dict, Object key) {
+ return dictInsertBefore(dict, dict.head, key);
+ }
+
+ static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
+ do {
+ node = node.prev;
+ } while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
+
+ DictNode newNode = new DictNode();
+ newNode.key = key;
+ newNode.next = node.next;
+ node.next.prev = newNode;
+ newNode.prev = node;
+ node.next = newNode;
+
+ return newNode;
+ }
+
+ static Object dictKey(DictNode aNode) {
+ return aNode.key;
+ }
+
+ static DictNode dictSucc(DictNode aNode) {
+ return aNode.next;
+ }
+
+ static DictNode dictPred(DictNode aNode) {
+ return aNode.prev;
+ }
+
+ static DictNode dictMin(Dict aDict) {
+ return aDict.head.next;
+ }
+
+ static DictNode dictMax(Dict aDict) {
+ return aDict.head.prev;
+ }
+
+ static void dictDelete(Dict dict, DictNode node) {
+ node.next.prev = node.prev;
+ node.prev.next = node.next;
+ }
+
+ static DictNode dictSearch(Dict dict, Object key) {
+ DictNode node = dict.head;
+
+ do {
+ node = node.next;
+ } while (node.key != null && !(dict.leq.leq(dict.frame, key, node.key)));
+
+ return node;
+ }
+
+ public interface DictLeq {
+ boolean leq(Object frame, Object key1, Object key2);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java
new file mode 100644
index 000000000..1222bd948
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/DictNode.java
@@ -0,0 +1,59 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class DictNode {
+ Object key;
+ DictNode next;
+ DictNode prev;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java
new file mode 100644
index 000000000..f0589dbea
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUface.java
@@ -0,0 +1,65 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class GLUface {
+ public GLUface next; /* next face (never NULL) */
+ public GLUface prev; /* previous face (never NULL) */
+ public GLUhalfEdge anEdge; /* a half edge with this left face */
+ public Object data; /* room for client's data */
+
+ /* Internal data (keep hidden) */
+ public GLUface trail; /* "stack" for conversion to strips */
+ public boolean marked; /* flag for conversion to strips */
+ public boolean inside; /* this face is in the polygon interior */
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java
new file mode 100644
index 000000000..1b6e81cc5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUhalfEdge.java
@@ -0,0 +1,71 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class GLUhalfEdge {
+ public GLUhalfEdge next; /* doubly-linked list (prev==Sym->next) */
+ public GLUhalfEdge Sym; /* same edge, opposite direction */
+ public GLUhalfEdge Onext; /* next edge CCW around origin */
+ public GLUhalfEdge Lnext; /* next edge CCW around left face */
+ public GLUvertex Org; /* origin vertex (Overtex too long) */
+ public com.sun.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 int winding; /* change in winding number when crossing */
+ public boolean first;
+
+ public GLUhalfEdge(boolean first) {
+ this.first = first;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java
new file mode 100644
index 000000000..73fbe815e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUmesh.java
@@ -0,0 +1,60 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.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 */
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java
new file mode 100644
index 000000000..f4efb116a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUtessellatorImpl.java
@@ -0,0 +1,646 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+import com.sun.opengl.impl.glu.tessellator.*;
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+public class GLUtessellatorImpl implements GLUtessellator {
+ public static final int TESS_MAX_CACHE = 100;
+
+ private int state; /* what begin/end calls have we seen? */
+
+ private GLUhalfEdge lastEdge; /* lastEdge->Org is the most recent vertex */
+ GLUmesh mesh; /* stores the input contours, and eventually
+ the tessellation itself */
+
+ /*** state needed for projecting onto the sweep plane ***/
+
+ double[] normal = new double[3]; /* user-specified normal (if provided) */
+ double[] sUnit = new double[3]; /* unit vector in s-direction (debugging) */
+ double[] tUnit = new double[3]; /* unit vector in t-direction (debugging) */
+
+ /*** state needed for the line sweep ***/
+
+ private double relTolerance; /* tolerance for merging features */
+ int windingRule; /* rule for determining polygon interior */
+ boolean fatalError; /* fatal error: needed combine callback */
+
+ Dict dict; /* edge dictionary for sweep line */
+ PriorityQ pq; /* priority queue of vertex events */
+ GLUvertex event; /* current sweep event being processed */
+
+ /*** state needed for rendering callbacks (see render.c) ***/
+
+ boolean flagBoundary; /* mark boundary edges (use EdgeFlag) */
+ boolean boundaryOnly; /* Extract contours, not triangles */
+ boolean avoidDegenerateTris; /* JOGL-specific hint to try to improve triangulation
+ by avoiding producing degenerate (zero-area) triangles;
+ has not been tested exhaustively and is therefore an option */
+
+ GLUface lonelyTriList;
+ /* list of triangles which could not be rendered as strips or fans */
+
+
+
+ /*** state needed to cache single-contour polygons for renderCache() */
+
+ private boolean flushCacheOnNextVertex; /* empty cache on next vertex() call */
+ int cacheCount; /* number of cached vertices */
+ CachedVertex[] cache = new CachedVertex[TESS_MAX_CACHE]; /* the vertex data */
+
+ /*** rendering callbacks that also pass polygon data ***/
+ private Object polygonData; /* client data for current polygon */
+
+ private GLUtessellatorCallback callBegin;
+ private GLUtessellatorCallback callEdgeFlag;
+ private GLUtessellatorCallback callVertex;
+ private GLUtessellatorCallback callEnd;
+// private GLUtessellatorCallback callMesh;
+ private GLUtessellatorCallback callError;
+ private GLUtessellatorCallback callCombine;
+
+ private GLUtessellatorCallback callBeginData;
+ private GLUtessellatorCallback callEdgeFlagData;
+ private GLUtessellatorCallback callVertexData;
+ private GLUtessellatorCallback callEndData;
+// private GLUtessellatorCallback callMeshData;
+ private GLUtessellatorCallback callErrorData;
+ private GLUtessellatorCallback callCombineData;
+
+ private static final double GLU_TESS_DEFAULT_TOLERANCE = 0.0;
+// private static final int GLU_TESS_MESH = 100112; /* void (*)(GLUmesh *mesh) */
+ private static GLUtessellatorCallback NULL_CB = new GLUtessellatorCallbackAdapter();
+
+// #define MAX_FAST_ALLOC (MAX(sizeof(EdgePair), \
+// MAX(sizeof(GLUvertex),sizeof(GLUface))))
+
+ private GLUtessellatorImpl() {
+ state = TessState.T_DORMANT;
+
+ normal[0] = 0;
+ normal[1] = 0;
+ normal[2] = 0;
+
+ relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
+ windingRule = GLU.GLU_TESS_WINDING_ODD;
+ flagBoundary = false;
+ boundaryOnly = false;
+
+ callBegin = NULL_CB;
+ callEdgeFlag = NULL_CB;
+ callVertex = NULL_CB;
+ callEnd = NULL_CB;
+ callError = NULL_CB;
+ callCombine = NULL_CB;
+// callMesh = NULL_CB;
+
+ callBeginData = NULL_CB;
+ callEdgeFlagData = NULL_CB;
+ callVertexData = NULL_CB;
+ callEndData = NULL_CB;
+ callErrorData = NULL_CB;
+ callCombineData = NULL_CB;
+
+ polygonData = null;
+
+ for (int i = 0; i < cache.length; i++) {
+ cache[i] = new CachedVertex();
+ }
+ }
+
+ static public GLUtessellator gluNewTess()
+ {
+ return new GLUtessellatorImpl();
+ }
+
+
+ private void makeDormant() {
+ /* Return the tessellator to its original dormant state. */
+
+ if (mesh != null) {
+ Mesh.__gl_meshDeleteMesh(mesh);
+ }
+ state = TessState.T_DORMANT;
+ lastEdge = null;
+ mesh = null;
+ }
+
+ private void requireState(int newState) {
+ if (state != newState) gotoState(newState);
+ }
+
+ private void gotoState(int newState) {
+ while (state != newState) {
+ /* We change the current state one level at a time, to get to
+ * the desired state.
+ */
+ if (state < newState) {
+ if (state == TessState.T_DORMANT) {
+ callErrorOrErrorData(GLU.GLU_TESS_MISSING_BEGIN_POLYGON);
+ gluTessBeginPolygon(null);
+ } else if (state == TessState.T_IN_POLYGON) {
+ callErrorOrErrorData(GLU.GLU_TESS_MISSING_BEGIN_CONTOUR);
+ gluTessBeginContour();
+ }
+ } else {
+ if (state == TessState.T_IN_CONTOUR) {
+ callErrorOrErrorData(GLU.GLU_TESS_MISSING_END_CONTOUR);
+ gluTessEndContour();
+ } else if (state == TessState.T_IN_POLYGON) {
+ callErrorOrErrorData(GLU.GLU_TESS_MISSING_END_POLYGON);
+ /* gluTessEndPolygon( tess ) is too much work! */
+ makeDormant();
+ }
+ }
+ }
+ }
+
+ public void gluDeleteTess() {
+ requireState(TessState.T_DORMANT);
+ }
+
+ public void gluTessProperty(int which, double value) {
+ switch (which) {
+ case GLU.GLU_TESS_TOLERANCE:
+ if (value < 0.0 || value > 1.0) break;
+ relTolerance = value;
+ return;
+
+ case GLU.GLU_TESS_WINDING_RULE:
+ int windingRule = (int) value;
+ if (windingRule != value) break; /* not an integer */
+
+ switch (windingRule) {
+ case GLU.GLU_TESS_WINDING_ODD:
+ case GLU.GLU_TESS_WINDING_NONZERO:
+ case GLU.GLU_TESS_WINDING_POSITIVE:
+ case GLU.GLU_TESS_WINDING_NEGATIVE:
+ case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
+ this.windingRule = windingRule;
+ return;
+ default:
+ break;
+ }
+
+ case GLU.GLU_TESS_BOUNDARY_ONLY:
+ boundaryOnly = (value != 0);
+ return;
+
+ case GLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
+ avoidDegenerateTris = (value != 0);
+ return;
+
+ default:
+ callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
+ return;
+ }
+ callErrorOrErrorData(GLU.GLU_INVALID_VALUE);
+ }
+
+/* Returns tessellator property */
+ public void gluGetTessProperty(int which, double[] value, int value_offset) {
+ switch (which) {
+ case GLU.GLU_TESS_TOLERANCE:
+/* tolerance should be in range [0..1] */
+ assert (0.0 <= relTolerance && relTolerance <= 1.0);
+ value[value_offset] = relTolerance;
+ break;
+ case GLU.GLU_TESS_WINDING_RULE:
+ assert (windingRule == GLU.GLU_TESS_WINDING_ODD ||
+ windingRule == GLU.GLU_TESS_WINDING_NONZERO ||
+ windingRule == GLU.GLU_TESS_WINDING_POSITIVE ||
+ windingRule == GLU.GLU_TESS_WINDING_NEGATIVE ||
+ windingRule == GLU.GLU_TESS_WINDING_ABS_GEQ_TWO);
+ value[value_offset] = windingRule;
+ break;
+ case GLU.GLU_TESS_BOUNDARY_ONLY:
+ assert (boundaryOnly == true || boundaryOnly == false);
+ value[value_offset] = boundaryOnly ? 1 : 0;
+ break;
+ case GLU.GLU_TESS_AVOID_DEGENERATE_TRIANGLES:
+ value[value_offset] = avoidDegenerateTris ? 1 : 0;
+ break;
+ default:
+ value[value_offset] = 0.0;
+ callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
+ break;
+ }
+ } /* gluGetTessProperty() */
+
+ public void gluTessNormal(double x, double y, double z) {
+ normal[0] = x;
+ normal[1] = y;
+ normal[2] = z;
+ }
+
+ public void gluTessCallback(int which, GLUtessellatorCallback aCallback) {
+ switch (which) {
+ case GLU.GLU_TESS_BEGIN:
+ callBegin = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_BEGIN_DATA:
+ callBeginData = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_EDGE_FLAG:
+ callEdgeFlag = aCallback == null ? NULL_CB : aCallback;
+/* If the client wants boundary edges to be flagged,
+ * we render everything as separate triangles (no strips or fans).
+ */
+ flagBoundary = aCallback != null;
+ return;
+ case GLU.GLU_TESS_EDGE_FLAG_DATA:
+ callEdgeFlagData = callBegin = aCallback == null ? NULL_CB : aCallback;
+/* If the client wants boundary edges to be flagged,
+ * we render everything as separate triangles (no strips or fans).
+ */
+ flagBoundary = (aCallback != null);
+ return;
+ case GLU.GLU_TESS_VERTEX:
+ callVertex = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_VERTEX_DATA:
+ callVertexData = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_END:
+ callEnd = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_END_DATA:
+ callEndData = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_ERROR:
+ callError = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_ERROR_DATA:
+ callErrorData = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_COMBINE:
+ callCombine = aCallback == null ? NULL_CB : aCallback;
+ return;
+ case GLU.GLU_TESS_COMBINE_DATA:
+ callCombineData = aCallback == null ? NULL_CB : aCallback;
+ return;
+// case GLU_TESS_MESH:
+// callMesh = aCallback == null ? NULL_CB : aCallback;
+// return;
+ default:
+ callErrorOrErrorData(GLU.GLU_INVALID_ENUM);
+ return;
+ }
+ }
+
+ private boolean addVertex(double[] coords, Object vertexData) {
+ GLUhalfEdge e;
+
+ e = lastEdge;
+ if (e == null) {
+/* Make a self-loop (one vertex, one edge). */
+
+ e = Mesh.__gl_meshMakeEdge(mesh);
+ if (e == null) return false;
+ if (!Mesh.__gl_meshSplice(e, e.Sym)) return false;
+ } else {
+/* Create a new vertex and edge which immediately follow e
+ * in the ordering around the left face.
+ */
+ if (Mesh.__gl_meshSplitEdge(e) == null) return false;
+ e = e.Lnext;
+ }
+
+/* The new vertex is now e.Org. */
+ e.Org.data = vertexData;
+ e.Org.coords[0] = coords[0];
+ e.Org.coords[1] = coords[1];
+ e.Org.coords[2] = coords[2];
+
+/* The winding of an edge says how the winding number changes as we
+ * cross from the edge''s right face to its left face. We add the
+ * vertices in such an order that a CCW contour will add +1 to
+ * the winding number of the region inside the contour.
+ */
+ e.winding = 1;
+ e.Sym.winding = -1;
+
+ lastEdge = e;
+
+ return true;
+ }
+
+ private void cacheVertex(double[] coords, Object vertexData) {
+ if (cache[cacheCount] == null) {
+ cache[cacheCount] = new CachedVertex();
+ }
+
+ CachedVertex v = cache[cacheCount];
+
+ v.data = vertexData;
+ v.coords[0] = coords[0];
+ v.coords[1] = coords[1];
+ v.coords[2] = coords[2];
+ ++cacheCount;
+ }
+
+
+ private boolean flushCache() {
+ CachedVertex[] v = cache;
+
+ mesh = Mesh.__gl_meshNewMesh();
+ if (mesh == null) return false;
+
+ for (int i = 0; i < cacheCount; i++) {
+ CachedVertex vertex = v[i];
+ if (!addVertex(vertex.coords, vertex.data)) return false;
+ }
+ cacheCount = 0;
+ flushCacheOnNextVertex = false;
+
+ return true;
+ }
+
+ public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
+ int i;
+ boolean tooLarge = false;
+ double x;
+ double[] clamped = new double[3];
+
+ requireState(TessState.T_IN_CONTOUR);
+
+ if (flushCacheOnNextVertex) {
+ if (!flushCache()) {
+ callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+ return;
+ }
+ lastEdge = null;
+ }
+ for (i = 0; i < 3; ++i) {
+ x = coords[i+coords_offset];
+ if (x < -GLU.GLU_TESS_MAX_COORD) {
+ x = -GLU.GLU_TESS_MAX_COORD;
+ tooLarge = true;
+ }
+ if (x > GLU.GLU_TESS_MAX_COORD) {
+ x = GLU.GLU_TESS_MAX_COORD;
+ tooLarge = true;
+ }
+ clamped[i] = x;
+ }
+ if (tooLarge) {
+ callErrorOrErrorData(GLU.GLU_TESS_COORD_TOO_LARGE);
+ }
+
+ if (mesh == null) {
+ if (cacheCount < TESS_MAX_CACHE) {
+ cacheVertex(clamped, vertexData);
+ return;
+ }
+ if (!flushCache()) {
+ callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+ return;
+ }
+ }
+
+ if (!addVertex(clamped, vertexData)) {
+ callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+ }
+ }
+
+
+ public void gluTessBeginPolygon(Object data) {
+ requireState(TessState.T_DORMANT);
+
+ state = TessState.T_IN_POLYGON;
+ cacheCount = 0;
+ flushCacheOnNextVertex = false;
+ mesh = null;
+
+ polygonData = data;
+ }
+
+
+ public void gluTessBeginContour() {
+ requireState(TessState.T_IN_POLYGON);
+
+ state = TessState.T_IN_CONTOUR;
+ lastEdge = null;
+ if (cacheCount > 0) {
+/* Just set a flag so we don't get confused by empty contours
+ * -- these can be generated accidentally with the obsolete
+ * NextContour() interface.
+ */
+ flushCacheOnNextVertex = true;
+ }
+ }
+
+
+ public void gluTessEndContour() {
+ requireState(TessState.T_IN_CONTOUR);
+ state = TessState.T_IN_POLYGON;
+ }
+
+ public void gluTessEndPolygon() {
+ GLUmesh mesh;
+
+ try {
+ requireState(TessState.T_IN_POLYGON);
+ state = TessState.T_DORMANT;
+
+ if (this.mesh == null) {
+ if (!flagBoundary /*&& callMesh == NULL_CB*/) {
+
+/* Try some special code to make the easy cases go quickly
+ * (eg. convex polygons). This code does NOT handle multiple contours,
+ * intersections, edge flags, and of course it does not generate
+ * an explicit mesh either.
+ */
+ if (Render.__gl_renderCache(this)) {
+ polygonData = null;
+ return;
+ }
+ }
+ if (!flushCache()) throw new RuntimeException(); /* could've used a label*/
+ }
+
+/* Determine the polygon normal and project vertices onto the plane
+ * of the polygon.
+ */
+ Normal.__gl_projectPolygon(this);
+
+/* __gl_computeInterior( tess ) computes the planar arrangement specified
+ * by the given contours, and further subdivides this arrangement
+ * into regions. Each region is marked "inside" if it belongs
+ * to the polygon, according to the rule given by windingRule.
+ * Each interior region is guaranteed be monotone.
+ */
+ if (!Sweep.__gl_computeInterior(this)) {
+ throw new RuntimeException(); /* could've used a label */
+ }
+
+ mesh = this.mesh;
+ if (!fatalError) {
+ boolean rc = true;
+
+/* If the user wants only the boundary contours, we throw away all edges
+ * except those which separate the interior from the exterior.
+ * Otherwise we tessellate all the regions marked "inside".
+ */
+ if (boundaryOnly) {
+ rc = TessMono.__gl_meshSetWindingNumber(mesh, 1, true);
+ } else {
+ rc = TessMono.__gl_meshTessellateInterior(mesh, avoidDegenerateTris);
+ }
+ if (!rc) throw new RuntimeException(); /* could've used a label */
+
+ Mesh.__gl_meshCheckMesh(mesh);
+
+ if (callBegin != NULL_CB || callEnd != NULL_CB
+ || callVertex != NULL_CB || callEdgeFlag != NULL_CB
+ || callBeginData != NULL_CB
+ || callEndData != NULL_CB
+ || callVertexData != NULL_CB
+ || callEdgeFlagData != NULL_CB) {
+ if (boundaryOnly) {
+ Render.__gl_renderBoundary(this, mesh); /* output boundary contours */
+ } else {
+ Render.__gl_renderMesh(this, mesh); /* output strips and fans */
+ }
+ }
+// if (callMesh != NULL_CB) {
+//
+///* Throw away the exterior faces, so that all faces are interior.
+// * This way the user doesn't have to check the "inside" flag,
+// * and we don't need to even reveal its existence. It also leaves
+// * the freedom for an implementation to not generate the exterior
+// * faces in the first place.
+// */
+// TessMono.__gl_meshDiscardExterior(mesh);
+// callMesh.mesh(mesh); /* user wants the mesh itself */
+// mesh = null;
+// polygonData = null;
+// return;
+// }
+ }
+ Mesh.__gl_meshDeleteMesh(mesh);
+ polygonData = null;
+ mesh = null;
+ } catch (Exception e) {
+ e.printStackTrace();
+ callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
+ }
+ }
+
+ /*******************************************************/
+
+/* Obsolete calls -- for backward compatibility */
+
+ public void gluBeginPolygon() {
+ gluTessBeginPolygon(null);
+ gluTessBeginContour();
+ }
+
+
+/*ARGSUSED*/
+ public void gluNextContour(int type) {
+ gluTessEndContour();
+ gluTessBeginContour();
+ }
+
+
+ public void gluEndPolygon() {
+ gluTessEndContour();
+ gluTessEndPolygon();
+ }
+
+ void callBeginOrBeginData(int a) {
+ if (callBeginData != NULL_CB)
+ callBeginData.beginData(a, polygonData);
+ else
+ callBegin.begin(a);
+ }
+
+ void callVertexOrVertexData(Object a) {
+ if (callVertexData != NULL_CB)
+ callVertexData.vertexData(a, polygonData);
+ else
+ callVertex.vertex(a);
+ }
+
+ void callEdgeFlagOrEdgeFlagData(boolean a) {
+ if (callEdgeFlagData != NULL_CB)
+ callEdgeFlagData.edgeFlagData(a, polygonData);
+ else
+ callEdgeFlag.edgeFlag(a);
+ }
+
+ void callEndOrEndData() {
+ if (callEndData != NULL_CB)
+ callEndData.endData(polygonData);
+ else
+ callEnd.end();
+ }
+
+ void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
+ if (callCombineData != NULL_CB)
+ callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
+ else
+ callCombine.combine(coords, vertexData, weights, outData);
+ }
+
+ void callErrorOrErrorData(int a) {
+ if (callErrorData != NULL_CB)
+ callErrorData.errorData(a, polygonData);
+ else
+ callError.error(a);
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java
new file mode 100644
index 000000000..e97767a12
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/GLUvertex.java
@@ -0,0 +1,65 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.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 Object data; /* client's data */
+
+ /* Internal data (keep hidden) */
+ public double[] coords = new double[3]; /* vertex location in 3D */
+ public double s, t; /* projection onto the sweep plane */
+ public int pqHandle; /* to allow deletion from priority queue */
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java
new file mode 100644
index 000000000..1287a60e0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Geom.java
@@ -0,0 +1,338 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class Geom {
+ private Geom() {
+ }
+
+ /* Given three vertices u,v,w such that VertLeq(u,v) && VertLeq(v,w),
+ * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
+ * Returns v->t - (uw)(v->s), ie. the signed distance from uw to v.
+ * If uw is vertical (and thus passes thru v), the result is zero.
+ *
+ * The calculation is extremely accurate and stable, even when v
+ * is very close to u or w. In particular if we set v->t = 0 and
+ * let r be the negated result (this evaluates (uw)(v->s)), then
+ * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
+ */
+ static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+ double gapL, gapR;
+
+ assert (VertLeq(u, v) && VertLeq(v, w));
+
+ gapL = v.s - u.s;
+ gapR = w.s - v.s;
+
+ if (gapL + gapR > 0) {
+ if (gapL < gapR) {
+ return (v.t - u.t) + (u.t - w.t) * (gapL / (gapL + gapR));
+ } else {
+ return (v.t - w.t) + (w.t - u.t) * (gapR / (gapL + gapR));
+ }
+ }
+ /* vertical line */
+ return 0;
+ }
+
+ static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+ double gapL, gapR;
+
+ assert (VertLeq(u, v) && VertLeq(v, w));
+
+ gapL = v.s - u.s;
+ gapR = w.s - v.s;
+
+ if (gapL + gapR > 0) {
+ return (v.t - w.t) * gapL + (v.t - u.t) * gapR;
+ }
+ /* vertical line */
+ return 0;
+ }
+
+
+ /***********************************************************************
+ * Define versions of EdgeSign, EdgeEval with s and t transposed.
+ */
+
+ static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+ /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
+ * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
+ * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
+ * If uw is vertical (and thus passes thru v), the result is zero.
+ *
+ * The calculation is extremely accurate and stable, even when v
+ * is very close to u or w. In particular if we set v->s = 0 and
+ * let r be the negated result (this evaluates (uw)(v->t)), then
+ * r is guaranteed to satisfy MIN(u->s,w->s) <= r <= MAX(u->s,w->s).
+ */
+ double gapL, gapR;
+
+ assert (TransLeq(u, v) && TransLeq(v, w));
+
+ gapL = v.t - u.t;
+ gapR = w.t - v.t;
+
+ if (gapL + gapR > 0) {
+ if (gapL < gapR) {
+ return (v.s - u.s) + (u.s - w.s) * (gapL / (gapL + gapR));
+ } else {
+ return (v.s - w.s) + (w.s - u.s) * (gapR / (gapL + gapR));
+ }
+ }
+ /* vertical line */
+ return 0;
+ }
+
+ static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+ /* Returns a number whose sign matches TransEval(u,v,w) but which
+ * is cheaper to evaluate. Returns > 0, == 0 , or < 0
+ * as v is above, on, or below the edge uw.
+ */
+ double gapL, gapR;
+
+ assert (TransLeq(u, v) && TransLeq(v, w));
+
+ gapL = v.t - u.t;
+ gapR = w.t - v.t;
+
+ if (gapL + gapR > 0) {
+ return (v.s - w.s) * gapL + (v.s - u.s) * gapR;
+ }
+ /* vertical line */
+ return 0;
+ }
+
+
+ static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
+ /* For almost-degenerate situations, the results are not reliable.
+ * Unless the floating-point arithmetic can be performed without
+ * rounding errors, *any* implementation will give incorrect results
+ * on some degenerate inputs, so the client must have some way to
+ * handle this situation.
+ */
+ return (u.s * (v.t - w.t) + v.s * (w.t - u.t) + w.s * (u.t - v.t)) >= 0;
+ }
+
+/* Given parameters a,x,b,y returns the value (b*x+a*y)/(a+b),
+ * or (x+y)/2 if a==b==0. It requires that a,b >= 0, and enforces
+ * this in the rare case that one argument is slightly negative.
+ * The implementation is extremely stable numerically.
+ * In particular it guarantees that the result r satisfies
+ * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
+ * even when a and b differ greatly in magnitude.
+ */
+ static double Interpolate(double a, double x, double b, double y) {
+ a = (a < 0) ? 0 : a;
+ b = (b < 0) ? 0 : b;
+ if (a <= b) {
+ if (b == 0) {
+ return (x + y) / 2.0;
+ } else {
+ return (x + (y - x) * (a / (a + b)));
+ }
+ } else {
+ return (y + (x - y) * (b / (a + b)));
+ }
+ }
+
+ static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
+ GLUvertex o2, GLUvertex d2,
+ GLUvertex v)
+/* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
+ * The computed point is guaranteed to lie in the intersection of the
+ * bounding rectangles defined by each edge.
+ */ {
+ double z1, z2;
+
+ /* This is certainly not the most efficient way to find the intersection
+ * of two line segments, but it is very numerically stable.
+ *
+ * Strategy: find the two middle vertices in the VertLeq ordering,
+ * and interpolate the intersection s-value from these. Then repeat
+ * using the TransLeq ordering to find the intersection t-value.
+ */
+
+ if (!VertLeq(o1, d1)) {
+ GLUvertex temp = o1;
+ o1 = d1;
+ d1 = temp;
+ }
+ if (!VertLeq(o2, d2)) {
+ GLUvertex temp = o2;
+ o2 = d2;
+ d2 = temp;
+ }
+ if (!VertLeq(o1, o2)) {
+ GLUvertex temp = o1;
+ o1 = o2;
+ o2 = temp;
+ temp = d1;
+ d1 = d2;
+ d2 = temp;
+ }
+
+ if (!VertLeq(o2, d1)) {
+ /* Technically, no intersection -- do our best */
+ v.s = (o2.s + d1.s) / 2.0;
+ } else if (VertLeq(d1, d2)) {
+ /* Interpolate between o2 and d1 */
+ z1 = EdgeEval(o1, o2, d1);
+ z2 = EdgeEval(o2, d1, d2);
+ if (z1 + z2 < 0) {
+ z1 = -z1;
+ z2 = -z2;
+ }
+ v.s = Interpolate(z1, o2.s, z2, d1.s);
+ } else {
+ /* Interpolate between o2 and d2 */
+ z1 = EdgeSign(o1, o2, d1);
+ z2 = -EdgeSign(o1, d2, d1);
+ if (z1 + z2 < 0) {
+ z1 = -z1;
+ z2 = -z2;
+ }
+ v.s = Interpolate(z1, o2.s, z2, d2.s);
+ }
+
+ /* Now repeat the process for t */
+
+ if (!TransLeq(o1, d1)) {
+ GLUvertex temp = o1;
+ o1 = d1;
+ d1 = temp;
+ }
+ if (!TransLeq(o2, d2)) {
+ GLUvertex temp = o2;
+ o2 = d2;
+ d2 = temp;
+ }
+ if (!TransLeq(o1, o2)) {
+ GLUvertex temp = o2;
+ o2 = o1;
+ o1 = temp;
+ temp = d2;
+ d2 = d1;
+ d1 = temp;
+ }
+
+ if (!TransLeq(o2, d1)) {
+ /* Technically, no intersection -- do our best */
+ v.t = (o2.t + d1.t) / 2.0;
+ } else if (TransLeq(d1, d2)) {
+ /* Interpolate between o2 and d1 */
+ z1 = TransEval(o1, o2, d1);
+ z2 = TransEval(o2, d1, d2);
+ if (z1 + z2 < 0) {
+ z1 = -z1;
+ z2 = -z2;
+ }
+ v.t = Interpolate(z1, o2.t, z2, d1.t);
+ } else {
+ /* Interpolate between o2 and d2 */
+ z1 = TransSign(o1, o2, d1);
+ z2 = -TransSign(o1, d2, d1);
+ if (z1 + z2 < 0) {
+ z1 = -z1;
+ z2 = -z2;
+ }
+ v.t = Interpolate(z1, o2.t, z2, d2.t);
+ }
+ }
+
+ static boolean VertEq(GLUvertex u, GLUvertex v) {
+ return u.s == v.s && u.t == v.t;
+ }
+
+ static boolean VertLeq(GLUvertex u, GLUvertex v) {
+ return u.s < v.s || (u.s == v.s && u.t <= v.t);
+ }
+
+/* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
+
+ static boolean TransLeq(GLUvertex u, GLUvertex v) {
+ return u.t < v.t || (u.t == v.t && u.s <= v.s);
+ }
+
+ static boolean EdgeGoesLeft(GLUhalfEdge e) {
+ return VertLeq(e.Sym.Org, e.Org);
+ }
+
+ static boolean EdgeGoesRight(GLUhalfEdge e) {
+ return VertLeq(e.Org, e.Sym.Org);
+ }
+
+ static double VertL1dist(GLUvertex u, GLUvertex v) {
+ return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
+ }
+
+ /***********************************************************************/
+
+ // Compute the cosine of the angle between the edges between o and
+ // v1 and between o and v2
+ static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
+ double ov1s = v1.s - o.s;
+ double ov1t = v1.t - o.t;
+ double ov2s = v2.s - o.s;
+ double ov2t = v2.t - o.t;
+ double dotp = ov1s * ov2s + ov1t * ov2t;
+ double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
+ if (len > 0.0) {
+ dotp /= len;
+ }
+ return dotp;
+ }
+
+ static final double EPSILON = 1.0e-5;
+ static final double ONE_MINUS_EPSILON = 1.0 - EPSILON;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java
new file mode 100644
index 000000000..290fb1037
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Mesh.java
@@ -0,0 +1,734 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class Mesh {
+ private Mesh() {
+ }
+
+ /************************ Utility Routines ************************/
+/* MakeEdge creates a new pair of half-edges which form their own loop.
+ * No vertex or face structures are allocated, but these must be assigned
+ * before the current edge operation is completed.
+ */
+ static com.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;
+
+// EdgePair * pair = (EdgePair *)
+// memAlloc(sizeof(EdgePair));
+// if (pair == NULL) return NULL;
+//
+// e = &pair - > e;
+ e = new com.sun.opengl.impl.glu.tessellator.GLUhalfEdge(true);
+// eSym = &pair - > eSym;
+ eSym = new com.sun.opengl.impl.glu.tessellator.GLUhalfEdge(false);
+
+
+ /* Make sure eNext points to the first edge of the edge pair */
+ if (!eNext.first) {
+ eNext = eNext.Sym;
+ }
+
+ /* Insert in circular doubly-linked list before eNext.
+ * Note that the prev pointer is stored in Sym->next.
+ */
+ ePrev = eNext.Sym.next;
+ eSym.next = ePrev;
+ ePrev.Sym.next = e;
+ e.next = eNext;
+ eNext.Sym.next = eSym;
+
+ e.Sym = eSym;
+ e.Onext = e;
+ e.Lnext = eSym;
+ e.Org = null;
+ e.Lface = null;
+ e.winding = 0;
+ e.activeRegion = null;
+
+ eSym.Sym = e;
+ eSym.Onext = eSym;
+ eSym.Lnext = e;
+ eSym.Org = null;
+ eSym.Lface = null;
+ eSym.winding = 0;
+ eSym.activeRegion = null;
+
+ return e;
+ }
+
+/* Splice( a, b ) is best described by the Guibas/Stolfi paper or the
+ * CS348a notes (see mesh.h). Basically it modifies the mesh so that
+ * a->Onext and b->Onext are exchanged. This can have various effects
+ * depending on whether a and b belong to different face or vertex rings.
+ * For more explanation see __gl_meshSplice() below.
+ */
+ static void Splice(com.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;
+
+ aOnext.Sym.Lnext = b;
+ bOnext.Sym.Lnext = a;
+ a.Onext = bOnext;
+ b.Onext = aOnext;
+ }
+
+/* MakeVertex( newVertex, eOrig, vNext ) attaches a new vertex and makes it the
+ * origin of all edges in the vertex loop to which eOrig belongs. "vNext" gives
+ * a place to insert the new vertex in the global vertex list. We insert
+ * the new vertex *before* vNext so that algorithms which walk the vertex
+ * list will not see the newly created vertices.
+ */
+ static void MakeVertex(com.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;
+
+ assert (vNew != null);
+
+ /* insert in circular doubly-linked list before vNext */
+ vPrev = vNext.prev;
+ vNew.prev = vPrev;
+ vPrev.next = vNew;
+ vNew.next = vNext;
+ vNext.prev = vNew;
+
+ vNew.anEdge = eOrig;
+ vNew.data = null;
+ /* leave coords, s, t undefined */
+
+ /* fix other edges on this vertex loop */
+ e = eOrig;
+ do {
+ e.Org = vNew;
+ e = e.Onext;
+ } while (e != eOrig);
+ }
+
+/* MakeFace( newFace, eOrig, fNext ) attaches a new face and makes it the left
+ * face of all edges in the face loop to which eOrig belongs. "fNext" gives
+ * a place to insert the new face in the global face list. We insert
+ * the new face *before* fNext so that algorithms which walk the face
+ * list will not see the newly created faces.
+ */
+ static void MakeFace(com.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;
+
+ assert (fNew != null);
+
+ /* insert in circular doubly-linked list before fNext */
+ fPrev = fNext.prev;
+ fNew.prev = fPrev;
+ fPrev.next = fNew;
+ fNew.next = fNext;
+ fNext.prev = fNew;
+
+ fNew.anEdge = eOrig;
+ fNew.data = null;
+ fNew.trail = null;
+ fNew.marked = false;
+
+ /* The new face is marked "inside" if the old one was. This is a
+ * convenience for the common case where a face has been split in two.
+ */
+ fNew.inside = fNext.inside;
+
+ /* fix other edges on this face loop */
+ e = eOrig;
+ do {
+ e.Lface = fNew;
+ e = e.Lnext;
+ } while (e != eOrig);
+ }
+
+/* KillEdge( eDel ) destroys an edge (the half-edges eDel and eDel->Sym),
+ * and removes from the global edge list.
+ */
+ static void KillEdge(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDel) {
+ com.sun.opengl.impl.glu.tessellator.GLUhalfEdge ePrev, eNext;
+
+ /* Half-edges are allocated in pairs, see EdgePair above */
+ if (!eDel.first) {
+ eDel = eDel.Sym;
+ }
+
+ /* delete from circular doubly-linked list */
+ eNext = eDel.next;
+ ePrev = eDel.Sym.next;
+ eNext.Sym.next = ePrev;
+ ePrev.Sym.next = eNext;
+ }
+
+
+/* KillVertex( vDel ) destroys a vertex and removes it from the global
+ * vertex list. It updates the vertex loop to point to a given new vertex.
+ */
+ static void KillVertex(com.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;
+
+ /* change the origin of all affected edges */
+ e = eStart;
+ do {
+ e.Org = newOrg;
+ e = e.Onext;
+ } while (e != eStart);
+
+ /* delete from circular doubly-linked list */
+ vPrev = vDel.prev;
+ vNext = vDel.next;
+ vNext.prev = vPrev;
+ vPrev.next = vNext;
+ }
+
+/* KillFace( fDel ) destroys a face and removes it from the global face
+ * list. It updates the face loop to point to a given new face.
+ */
+ static void KillFace(com.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;
+
+ /* change the left face of all affected edges */
+ e = eStart;
+ do {
+ e.Lface = newLface;
+ e = e.Lnext;
+ } while (e != eStart);
+
+ /* delete from circular doubly-linked list */
+ fPrev = fDel.prev;
+ fNext = fDel.next;
+ fNext.prev = fPrev;
+ fPrev.next = fNext;
+ }
+
+
+ /****************** Basic Edge Operations **********************/
+
+/* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
+ * The loop consists of the two new half-edges.
+ */
+ public static com.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;
+
+ e = MakeEdge(mesh.eHead);
+ if (e == null) return null;
+
+ MakeVertex(newVertex1, e, mesh.vHead);
+ MakeVertex(newVertex2, e.Sym, mesh.vHead);
+ MakeFace(newFace, e, mesh.fHead);
+ return e;
+ }
+
+
+/* __gl_meshSplice( eOrg, eDst ) is the basic operation for changing the
+ * mesh connectivity and topology. It changes the mesh so that
+ * eOrg->Onext <- OLD( eDst->Onext )
+ * eDst->Onext <- OLD( eOrg->Onext )
+ * where OLD(...) means the value before the meshSplice operation.
+ *
+ * This can have two effects on the vertex structure:
+ * - if eOrg->Org != eDst->Org, the two vertices are merged together
+ * - if eOrg->Org == eDst->Org, the origin is split into two vertices
+ * In both cases, eDst->Org is changed and eOrg->Org is untouched.
+ *
+ * Similarly (and independently) for the face structure,
+ * - if eOrg->Lface == eDst->Lface, one loop is split into two
+ * - if eOrg->Lface != eDst->Lface, two distinct loops are joined into one
+ * In both cases, eDst->Lface is changed and eOrg->Lface is unaffected.
+ *
+ * Some special cases:
+ * If eDst == eOrg, the operation has no effect.
+ * If eDst == eOrg->Lnext, the new face will have a single edge.
+ * If eDst == eOrg->Lprev, the old face will have a single edge.
+ * If eDst == eOrg->Onext, the new vertex will have a single edge.
+ * If eDst == eOrg->Oprev, the old vertex will have a single edge.
+ */
+ public static boolean __gl_meshSplice(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrg, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDst) {
+ boolean joiningLoops = false;
+ boolean joiningVertices = false;
+
+ if (eOrg == eDst) return true;
+
+ if (eDst.Org != eOrg.Org) {
+ /* We are merging two disjoint vertices -- destroy eDst->Org */
+ joiningVertices = true;
+ KillVertex(eDst.Org, eOrg.Org);
+ }
+ if (eDst.Lface != eOrg.Lface) {
+ /* We are connecting two disjoint loops -- destroy eDst.Lface */
+ joiningLoops = true;
+ KillFace(eDst.Lface, eOrg.Lface);
+ }
+
+ /* Change the edge structure */
+ Splice(eDst, eOrg);
+
+ if (!joiningVertices) {
+ com.sun.opengl.impl.glu.tessellator.GLUvertex newVertex = new com.sun.opengl.impl.glu.tessellator.GLUvertex();
+
+ /* We split one vertex into two -- the new vertex is eDst.Org.
+ * Make sure the old vertex points to a valid half-edge.
+ */
+ MakeVertex(newVertex, eDst, eOrg.Org);
+ eOrg.Org.anEdge = eOrg;
+ }
+ if (!joiningLoops) {
+ com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface();
+
+ /* We split one loop into two -- the new loop is eDst.Lface.
+ * Make sure the old face points to a valid half-edge.
+ */
+ MakeFace(newFace, eDst, eOrg.Lface);
+ eOrg.Lface.anEdge = eOrg;
+ }
+
+ return true;
+ }
+
+
+/* __gl_meshDelete( eDel ) removes the edge eDel. There are several cases:
+ * if (eDel.Lface != eDel.Rface), we join two loops into one; the loop
+ * eDel.Lface is deleted. Otherwise, we are splitting one loop into two;
+ * the newly created loop will contain eDel.Dst. If the deletion of eDel
+ * would create isolated vertices, those are deleted as well.
+ *
+ * This function could be implemented as two calls to __gl_meshSplice
+ * plus a few calls to memFree, but this would allocate and delete
+ * unnecessary vertices and faces.
+ */
+ static boolean __gl_meshDelete(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDel) {
+ com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
+ boolean joiningLoops = false;
+
+ /* First step: disconnect the origin vertex eDel.Org. We make all
+ * changes to get a consistent mesh in this "intermediate" state.
+ */
+ if (eDel.Lface != eDel.Sym.Lface) {
+ /* We are joining two loops into one -- remove the left face */
+ joiningLoops = true;
+ KillFace(eDel.Lface, eDel.Sym.Lface);
+ }
+
+ if (eDel.Onext == eDel) {
+ KillVertex(eDel.Org, null);
+ } else {
+ /* Make sure that eDel.Org and eDel.Sym.Lface point to valid half-edges */
+ eDel.Sym.Lface.anEdge = eDel.Sym.Lnext;
+ eDel.Org.anEdge = eDel.Onext;
+
+ Splice(eDel, eDel.Sym.Lnext);
+ if (!joiningLoops) {
+ com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface();
+
+ /* We are splitting one loop into two -- create a new loop for eDel. */
+ MakeFace(newFace, eDel, eDel.Lface);
+ }
+ }
+
+ /* Claim: the mesh is now in a consistent state, except that eDel.Org
+ * may have been deleted. Now we disconnect eDel.Dst.
+ */
+ if (eDelSym.Onext == eDelSym) {
+ KillVertex(eDelSym.Org, null);
+ KillFace(eDelSym.Lface, null);
+ } else {
+ /* Make sure that eDel.Dst and eDel.Lface point to valid half-edges */
+ eDel.Lface.anEdge = eDelSym.Sym.Lnext;
+ eDelSym.Org.anEdge = eDelSym.Onext;
+ Splice(eDelSym, eDelSym.Sym.Lnext);
+ }
+
+ /* Any isolated vertices or faces have already been freed. */
+ KillEdge(eDel);
+
+ return true;
+ }
+
+
+ /******************** Other Edge Operations **********************/
+
+/* All these routines can be implemented with the basic edge
+ * operations above. They are provided for convenience and efficiency.
+ */
+
+
+/* __gl_meshAddEdgeVertex( eOrg ) creates a new edge eNew such that
+ * eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
+ * eOrg and eNew will have the same left face.
+ */
+ static com.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);
+
+ eNewSym = eNew.Sym;
+
+ /* Connect the new edge appropriately */
+ Splice(eNew, eOrg.Lnext);
+
+ /* 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();
+
+ MakeVertex(newVertex, eNewSym, eNew.Org);
+ }
+ eNew.Lface = eNewSym.Lface = eOrg.Lface;
+
+ return eNew;
+ }
+
+
+/* __gl_meshSplitEdge( eOrg ) splits eOrg into two edges eOrg and eNew,
+ * such that eNew == eOrg.Lnext. The new vertex is eOrg.Sym.Org == eNew.Org.
+ * eOrg and eNew will have the same left face.
+ */
+ public static com.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);
+
+ eNew = tempHalfEdge.Sym;
+
+ /* Disconnect eOrg from eOrg.Sym.Org and connect it to eNew.Org */
+ Splice(eOrg.Sym, eOrg.Sym.Sym.Lnext);
+ Splice(eOrg.Sym, eNew);
+
+ /* Set the vertex and face information */
+ eOrg.Sym.Org = eNew.Org;
+ eNew.Sym.Org.anEdge = eNew.Sym; /* may have pointed to eOrg.Sym */
+ eNew.Sym.Lface = eOrg.Sym.Lface;
+ eNew.winding = eOrg.winding; /* copy old winding information */
+ eNew.Sym.winding = eOrg.Sym.winding;
+
+ return eNew;
+ }
+
+
+/* __gl_meshConnect( eOrg, eDst ) creates a new edge from eOrg.Sym.Org
+ * to eDst.Org, and returns the corresponding half-edge eNew.
+ * If eOrg.Lface == eDst.Lface, this splits one loop into two,
+ * and the newly created loop is eNew.Lface. Otherwise, two disjoint
+ * loops are merged into one, and the loop eDst.Lface is destroyed.
+ *
+ * If (eOrg == eDst), the new face will have only two edges.
+ * If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
+ * If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
+ */
+ static com.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;
+ boolean joiningLoops = false;
+ com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+
+ eNewSym = eNew.Sym;
+
+ if (eDst.Lface != eOrg.Lface) {
+ /* We are connecting two disjoint loops -- destroy eDst.Lface */
+ joiningLoops = true;
+ KillFace(eDst.Lface, eOrg.Lface);
+ }
+
+ /* Connect the new edge appropriately */
+ Splice(eNew, eOrg.Lnext);
+ Splice(eNewSym, eDst);
+
+ /* Set the vertex and face information */
+ eNew.Org = eOrg.Sym.Org;
+ eNewSym.Org = eDst.Org;
+ eNew.Lface = eNewSym.Lface = eOrg.Lface;
+
+ /* Make sure the old face points to a valid half-edge */
+ eOrg.Lface.anEdge = eNewSym;
+
+ if (!joiningLoops) {
+ com.sun.opengl.impl.glu.tessellator.GLUface newFace = new com.sun.opengl.impl.glu.tessellator.GLUface();
+
+ /* We split one loop into two -- the new loop is eNew.Lface */
+ MakeFace(newFace, eNew, eOrg.Lface);
+ }
+ return eNew;
+ }
+
+
+ /******************** Other Operations **********************/
+
+/* __gl_meshZapFace( fZap ) destroys a face and removes it from the
+ * global face list. All edges of fZap will have a null pointer as their
+ * left face. Any edges which also have a null pointer as their right face
+ * are deleted entirely (along with any isolated vertices this produces).
+ * An entire mesh can be deleted by zapping its faces, one at a time,
+ * in any order. Zapped faces cannot be used in further mesh operations!
+ */
+ static void __gl_meshZapFace(com.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;
+
+ /* walk around face, deleting edges whose right face is also null */
+ eNext = eStart.Lnext;
+ do {
+ e = eNext;
+ eNext = e.Lnext;
+
+ e.Lface = null;
+ if (e.Sym.Lface == null) {
+ /* delete the edge -- see __gl_MeshDelete above */
+
+ if (e.Onext == e) {
+ KillVertex(e.Org, null);
+ } else {
+ /* Make sure that e.Org points to a valid half-edge */
+ e.Org.anEdge = e.Onext;
+ Splice(e, e.Sym.Lnext);
+ }
+ eSym = e.Sym;
+ if (eSym.Onext == eSym) {
+ KillVertex(eSym.Org, null);
+ } else {
+ /* Make sure that eSym.Org points to a valid half-edge */
+ eSym.Org.anEdge = eSym.Onext;
+ Splice(eSym, eSym.Sym.Lnext);
+ }
+ KillEdge(e);
+ }
+ } while (e != eStart);
+
+ /* delete from circular doubly-linked list */
+ fPrev = fZap.prev;
+ fNext = fZap.next;
+ fNext.prev = fPrev;
+ fPrev.next = fNext;
+ }
+
+
+/* __gl_meshNewMesh() creates a new mesh with no edges, no vertices,
+ * and no loops (what we usually call a "face").
+ */
+ public static com.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();
+
+ v = mesh.vHead;
+ f = mesh.fHead;
+ e = mesh.eHead;
+ eSym = mesh.eHeadSym;
+
+ v.next = v.prev = v;
+ v.anEdge = null;
+ v.data = null;
+
+ f.next = f.prev = f;
+ f.anEdge = null;
+ f.data = null;
+ f.trail = null;
+ f.marked = false;
+ f.inside = false;
+
+ e.next = e;
+ e.Sym = eSym;
+ e.Onext = null;
+ e.Lnext = null;
+ e.Org = null;
+ e.Lface = null;
+ e.winding = 0;
+ e.activeRegion = null;
+
+ eSym.next = eSym;
+ eSym.Sym = e;
+ eSym.Onext = null;
+ eSym.Lnext = null;
+ eSym.Org = null;
+ eSym.Lface = null;
+ eSym.winding = 0;
+ eSym.activeRegion = null;
+
+ return mesh;
+ }
+
+
+/* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
+ * both meshes, and returns the new mesh (the old meshes are destroyed).
+ */
+ static com.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;
+
+ /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
+ if (f2.next != f2) {
+ f1.prev.next = f2.next;
+ f2.next.prev = f1.prev;
+ f2.prev.next = f1;
+ f1.prev = f2.prev;
+ }
+
+ if (v2.next != v2) {
+ v1.prev.next = v2.next;
+ v2.next.prev = v1.prev;
+ v2.prev.next = v1;
+ v1.prev = v2.prev;
+ }
+
+ if (e2.next != e2) {
+ e1.Sym.next.Sym.next = e2.next;
+ e2.next.Sym.next = e1.Sym.next;
+ e2.Sym.next.Sym.next = e1;
+ e1.Sym.next = e2.Sym.next;
+ }
+
+ return mesh1;
+ }
+
+
+/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
+ */
+ static void __gl_meshDeleteMeshZap(com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) {
+ com.sun.opengl.impl.glu.tessellator.GLUface fHead = mesh.fHead;
+
+ while (fHead.next != fHead) {
+ __gl_meshZapFace(fHead.next);
+ }
+ assert (mesh.vHead.next == mesh.vHead);
+ }
+
+/* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
+ */
+ public static void __gl_meshDeleteMesh(com.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;
+
+ for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
+ fNext = f.next;
+ }
+
+ for (v = mesh.vHead.next; v != mesh.vHead; v = vNext) {
+ vNext = v.next;
+ }
+
+ for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
+ /* One call frees both e and e.Sym (see EdgePair above) */
+ eNext = e.next;
+ }
+ }
+
+/* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
+ */
+ public static void __gl_meshCheckMesh(com.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;
+
+ fPrev = fHead;
+ for (fPrev = fHead; (f = fPrev.next) != fHead; fPrev = f) {
+ assert (f.prev == fPrev);
+ e = f.anEdge;
+ do {
+ assert (e.Sym != e);
+ assert (e.Sym.Sym == e);
+ assert (e.Lnext.Onext.Sym == e);
+ assert (e.Onext.Sym.Lnext == e);
+ assert (e.Lface == f);
+ e = e.Lnext;
+ } while (e != f.anEdge);
+ }
+ assert (f.prev == fPrev && f.anEdge == null && f.data == null);
+
+ vPrev = vHead;
+ for (vPrev = vHead; (v = vPrev.next) != vHead; vPrev = v) {
+ assert (v.prev == vPrev);
+ e = v.anEdge;
+ do {
+ assert (e.Sym != e);
+ assert (e.Sym.Sym == e);
+ assert (e.Lnext.Onext.Sym == e);
+ assert (e.Onext.Sym.Lnext == e);
+ assert (e.Org == v);
+ e = e.Onext;
+ } while (e != v.anEdge);
+ }
+ assert (v.prev == vPrev && v.anEdge == null && v.data == null);
+
+ ePrev = eHead;
+ for (ePrev = eHead; (e = ePrev.next) != eHead; ePrev = e) {
+ assert (e.Sym.next == ePrev.Sym);
+ assert (e.Sym != e);
+ assert (e.Sym.Sym == e);
+ assert (e.Org != null);
+ assert (e.Sym.Org != null);
+ assert (e.Lnext.Onext.Sym == e);
+ assert (e.Onext.Sym.Lnext == e);
+ }
+ assert (e.Sym.next == ePrev.Sym
+ && e.Sym == mesh.eHeadSym
+ && e.Sym.Sym == e
+ && e.Org == null && e.Sym.Org == null
+ && e.Lface == null && e.Sym.Lface == null);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java
new file mode 100644
index 000000000..feb13dfd4
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Normal.java
@@ -0,0 +1,288 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+class Normal {
+ private Normal() {
+ }
+
+ static boolean SLANTED_SWEEP = false;
+ static double S_UNIT_X; /* Pre-normalized */
+ static double S_UNIT_Y;
+ private static final boolean TRUE_PROJECT = false;
+
+ static {
+ if (SLANTED_SWEEP) {
+/* The "feature merging" is not intended to be complete. There are
+ * special cases where edges are nearly parallel to the sweep line
+ * which are not implemented. The algorithm should still behave
+ * robustly (ie. produce a reasonable tesselation) in the presence
+ * of such edges, however it may miss features which could have been
+ * merged. We could minimize this effect by choosing the sweep line
+ * direction to be something unusual (ie. not parallel to one of the
+ * coordinate axes).
+ */
+ S_UNIT_X = 0.50941539564955385; /* Pre-normalized */
+ S_UNIT_Y = 0.86052074622010633;
+ } else {
+ S_UNIT_X = 1.0;
+ S_UNIT_Y = 0.0;
+ }
+ }
+
+ private static double Dot(double[] u, double[] v) {
+ return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
+ }
+
+ static void Normalize(double[] v) {
+ double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
+
+ assert (len > 0);
+ len = Math.sqrt(len);
+ v[0] /= len;
+ v[1] /= len;
+ v[2] /= len;
+ }
+
+ static int LongAxis(double[] v) {
+ int i = 0;
+
+ if (Math.abs(v[1]) > Math.abs(v[0])) {
+ i = 1;
+ }
+ if (Math.abs(v[2]) > Math.abs(v[i])) {
+ i = 2;
+ }
+ return i;
+ }
+
+ static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
+ com.sun.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;
+ 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];
+ d1 = new double[3];
+ d2 = new double[3];
+ tNorm = new double[3];
+
+ maxVal[0] = maxVal[1] = maxVal[2] = -2 * GLU.GLU_TESS_MAX_COORD;
+ minVal[0] = minVal[1] = minVal[2] = 2 * GLU.GLU_TESS_MAX_COORD;
+
+ for (v = vHead.next; v != vHead; v = v.next) {
+ for (i = 0; i < 3; ++i) {
+ c = v.coords[i];
+ if (c < minVal[i]) {
+ minVal[i] = c;
+ minVert[i] = v;
+ }
+ if (c > maxVal[i]) {
+ maxVal[i] = c;
+ maxVert[i] = v;
+ }
+ }
+ }
+
+/* Find two vertices separated by at least 1/sqrt(3) of the maximum
+ * distance between any two vertices
+ */
+ i = 0;
+ if (maxVal[1] - minVal[1] > maxVal[0] - minVal[0]) {
+ i = 1;
+ }
+ if (maxVal[2] - minVal[2] > maxVal[i] - minVal[i]) {
+ i = 2;
+ }
+ if (minVal[i] >= maxVal[i]) {
+/* All vertices are the same -- normal doesn't matter */
+ norm[0] = 0;
+ norm[1] = 0;
+ norm[2] = 1;
+ return;
+ }
+
+/* Look for a third vertex which forms the triangle with maximum area
+ * (Length of normal == twice the triangle area)
+ */
+ maxLen2 = 0;
+ v1 = minVert[i];
+ v2 = maxVert[i];
+ d1[0] = v1.coords[0] - v2.coords[0];
+ d1[1] = v1.coords[1] - v2.coords[1];
+ d1[2] = v1.coords[2] - v2.coords[2];
+ for (v = vHead.next; v != vHead; v = v.next) {
+ d2[0] = v.coords[0] - v2.coords[0];
+ d2[1] = v.coords[1] - v2.coords[1];
+ d2[2] = v.coords[2] - v2.coords[2];
+ tNorm[0] = d1[1] * d2[2] - d1[2] * d2[1];
+ tNorm[1] = d1[2] * d2[0] - d1[0] * d2[2];
+ tNorm[2] = d1[0] * d2[1] - d1[1] * d2[0];
+ tLen2 = tNorm[0] * tNorm[0] + tNorm[1] * tNorm[1] + tNorm[2] * tNorm[2];
+ if (tLen2 > maxLen2) {
+ maxLen2 = tLen2;
+ norm[0] = tNorm[0];
+ norm[1] = tNorm[1];
+ norm[2] = tNorm[2];
+ }
+ }
+
+ if (maxLen2 <= 0) {
+/* All points lie on a single line -- any decent normal will do */
+ norm[0] = norm[1] = norm[2] = 0;
+ norm[LongAxis(d1)] = 1;
+ }
+ }
+
+ static void CheckOrientation(GLUtessellatorImpl tess) {
+ double area;
+ com.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;
+
+/* When we compute the normal automatically, we choose the orientation
+ * so that the the sum of the signed areas of all contours is non-negative.
+ */
+ area = 0;
+ for (f = fHead.next; f != fHead; f = f.next) {
+ e = f.anEdge;
+ if (e.winding <= 0) continue;
+ do {
+ area += (e.Org.s - e.Sym.Org.s) * (e.Org.t + e.Sym.Org.t);
+ e = e.Lnext;
+ } while (e != f.anEdge);
+ }
+ if (area < 0) {
+/* Reverse the orientation by flipping all the t-coordinates */
+ for (v = vHead.next; v != vHead; v = v.next) {
+ v.t = -v.t;
+ }
+ tess.tUnit[0] = -tess.tUnit[0];
+ tess.tUnit[1] = -tess.tUnit[1];
+ tess.tUnit[2] = -tess.tUnit[2];
+ }
+ }
+
+/* Determine the polygon normal and project vertices onto the plane
+ * of the polygon.
+ */
+ public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
+ com.sun.opengl.impl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+ double w;
+ double[] norm = new double[3];
+ double[] sUnit, tUnit;
+ int i;
+ boolean computedNormal = false;
+
+ norm[0] = tess.normal[0];
+ norm[1] = tess.normal[1];
+ norm[2] = tess.normal[2];
+ if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
+ ComputeNormal(tess, norm);
+ computedNormal = true;
+ }
+ sUnit = tess.sUnit;
+ tUnit = tess.tUnit;
+ i = LongAxis(norm);
+
+ if (TRUE_PROJECT) {
+/* Choose the initial sUnit vector to be approximately perpendicular
+ * to the normal.
+ */
+ Normalize(norm);
+
+ sUnit[i] = 0;
+ sUnit[(i + 1) % 3] = S_UNIT_X;
+ sUnit[(i + 2) % 3] = S_UNIT_Y;
+
+/* Now make it exactly perpendicular */
+ w = Dot(sUnit, norm);
+ sUnit[0] -= w * norm[0];
+ sUnit[1] -= w * norm[1];
+ sUnit[2] -= w * norm[2];
+ Normalize(sUnit);
+
+/* Choose tUnit so that (sUnit,tUnit,norm) form a right-handed frame */
+ tUnit[0] = norm[1] * sUnit[2] - norm[2] * sUnit[1];
+ tUnit[1] = norm[2] * sUnit[0] - norm[0] * sUnit[2];
+ tUnit[2] = norm[0] * sUnit[1] - norm[1] * sUnit[0];
+ Normalize(tUnit);
+ } else {
+/* Project perpendicular to a coordinate axis -- better numerically */
+ sUnit[i] = 0;
+ sUnit[(i + 1) % 3] = S_UNIT_X;
+ sUnit[(i + 2) % 3] = S_UNIT_Y;
+
+ tUnit[i] = 0;
+ tUnit[(i + 1) % 3] = (norm[i] > 0) ? -S_UNIT_Y : S_UNIT_Y;
+ tUnit[(i + 2) % 3] = (norm[i] > 0) ? S_UNIT_X : -S_UNIT_X;
+ }
+
+/* Project the vertices onto the sweep plane */
+ for (v = vHead.next; v != vHead; v = v.next) {
+ v.s = Dot(v.coords, sUnit);
+ v.t = Dot(v.coords, tUnit);
+ }
+ if (computedNormal) {
+ CheckOrientation(tess);
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java
new file mode 100644
index 000000000..18f2cf32c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQ.java
@@ -0,0 +1,100 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+abstract class PriorityQ {
+ public static final int INIT_SIZE = 32;
+
+ public static class PQnode {
+ int handle;
+ }
+
+ public static class PQhandleElem {
+ Object key;
+ int node;
+ }
+
+ public static interface Leq {
+ boolean leq(Object key1, Object key2);
+ }
+
+ // #ifdef FOR_TRITE_TEST_PROGRAM
+// private static boolean LEQ(PriorityQCommon.Leq leq, Object x,Object y) {
+// return pq.leq.leq(x,y);
+// }
+// #else
+/* Violates modularity, but a little faster */
+// #include "geom.h"
+ public static boolean LEQ(Leq leq, Object x, Object y) {
+ return com.sun.opengl.impl.glu.tessellator.Geom.VertLeq((com.sun.opengl.impl.glu.tessellator.GLUvertex) x, (com.sun.opengl.impl.glu.tessellator.GLUvertex) y);
+ }
+
+ static PriorityQ pqNewPriorityQ(Leq leq) {
+ return new PriorityQSort(leq);
+ }
+
+ abstract void pqDeletePriorityQ();
+
+ abstract boolean pqInit();
+
+ abstract int pqInsert(Object keyNew);
+
+ abstract Object pqExtractMin();
+
+ abstract void pqDelete(int hCurr);
+
+ abstract Object pqMinimum();
+
+ abstract boolean pqIsEmpty();
+// #endif
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java
new file mode 100644
index 000000000..2f856517a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQHeap.java
@@ -0,0 +1,262 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.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;
+ int size, max;
+ int freeList;
+ boolean initialized;
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.Leq leq;
+
+/* really __gl_pqHeapNewPriorityQ */
+ public PriorityQHeap(com.sun.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];
+ 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];
+ for (int i = 0; i < handles.length; i++) {
+ handles[i] = new PQhandleElem();
+ }
+ initialized = false;
+ freeList = 0;
+ this.leq = leq;
+
+ nodes[1].handle = 1; /* so that Minimum() returns NULL */
+ handles[1].key = null;
+ }
+
+/* really __gl_pqHeapDeletePriorityQ */
+ void pqDeletePriorityQ() {
+ handles = null;
+ nodes = null;
+ }
+
+ void FloatDown(int curr) {
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ int hCurr, hChild;
+ int child;
+
+ hCurr = n[curr].handle;
+ for (; ;) {
+ child = curr << 1;
+ if (child < size && LEQ(leq, h[n[child + 1].handle].key,
+ h[n[child].handle].key)) {
+ ++child;
+ }
+
+ assert (child <= max);
+
+ hChild = n[child].handle;
+ if (child > size || LEQ(leq, h[hCurr].key, h[hChild].key)) {
+ n[curr].handle = hCurr;
+ h[hCurr].node = curr;
+ break;
+ }
+ n[curr].handle = hChild;
+ h[hChild].node = curr;
+ curr = child;
+ }
+ }
+
+
+ void FloatUp(int curr) {
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ int hCurr, hParent;
+ int parent;
+
+ hCurr = n[curr].handle;
+ for (; ;) {
+ parent = curr >> 1;
+ hParent = n[parent].handle;
+ if (parent == 0 || LEQ(leq, h[hParent].key, h[hCurr].key)) {
+ n[curr].handle = hCurr;
+ h[hCurr].node = curr;
+ break;
+ }
+ n[curr].handle = hParent;
+ h[hParent].node = curr;
+ curr = parent;
+ }
+ }
+
+/* really __gl_pqHeapInit */
+ boolean pqInit() {
+ int i;
+
+ /* This method of building a heap is O(n), rather than O(n lg n). */
+
+ for (i = size; i >= 1; --i) {
+ FloatDown(i);
+ }
+ initialized = true;
+
+ return true;
+ }
+
+/* really __gl_pqHeapInsert */
+/* returns LONG_MAX iff out of memory */
+ int pqInsert(Object keyNew) {
+ int curr;
+ int free;
+
+ curr = ++size;
+ if ((curr * 2) > max) {
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
+
+ /* If the heap overflows, double its size. */
+ max <<= 1;
+// pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
+ PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
+ System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
+ for (int i = nodes.length; i < pqNodes.length; i++) {
+ pqNodes[i] = new PQnode();
+ }
+ nodes = pqNodes;
+ if (nodes == null) {
+ nodes = saveNodes; /* restore ptr to free upon return */
+ return Integer.MAX_VALUE;
+ }
+
+// pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
+ PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
+ System.arraycopy( handles, 0, pqHandles, 0, handles.length );
+ for (int i = handles.length; i < pqHandles.length; i++) {
+ pqHandles[i] = new PQhandleElem();
+ }
+ handles = pqHandles;
+ if (handles == null) {
+ handles = saveHandles; /* restore ptr to free upon return */
+ return Integer.MAX_VALUE;
+ }
+ }
+
+ if (freeList == 0) {
+ free = curr;
+ } else {
+ free = freeList;
+ freeList = handles[free].node;
+ }
+
+ nodes[curr].handle = free;
+ handles[free].node = curr;
+ handles[free].key = keyNew;
+
+ if (initialized) {
+ FloatUp(curr);
+ }
+ assert (free != Integer.MAX_VALUE);
+ return free;
+ }
+
+/* really __gl_pqHeapExtractMin */
+ Object pqExtractMin() {
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ int hMin = n[1].handle;
+ Object min = h[hMin].key;
+
+ if (size > 0) {
+ n[1].handle = n[size].handle;
+ h[n[1].handle].node = 1;
+
+ h[hMin].key = null;
+ h[hMin].node = freeList;
+ freeList = hMin;
+
+ if (--size > 0) {
+ FloatDown(1);
+ }
+ }
+ return min;
+ }
+
+/* really __gl_pqHeapDelete */
+ void pqDelete(int hCurr) {
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+ com.sun.opengl.impl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+ int curr;
+
+ assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
+
+ curr = h[hCurr].node;
+ n[curr].handle = n[size].handle;
+ h[n[curr].handle].node = curr;
+
+ if (curr <= --size) {
+ if (curr <= 1 || LEQ(leq, h[n[curr >> 1].handle].key, h[n[curr].handle].key)) {
+ FloatDown(curr);
+ } else {
+ FloatUp(curr);
+ }
+ }
+ h[hCurr].key = null;
+ h[hCurr].node = freeList;
+ freeList = hCurr;
+ }
+
+ Object pqMinimum() {
+ return handles[nodes[1].handle].key;
+ }
+
+ boolean pqIsEmpty() {
+ return size == 0;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java
new file mode 100644
index 000000000..67924524d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/PriorityQSort.java
@@ -0,0 +1,278 @@
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class PriorityQSort extends com.sun.opengl.impl.glu.tessellator.PriorityQ {
+ com.sun.opengl.impl.glu.tessellator.PriorityQHeap heap;
+ Object[] keys;
+
+ // JAVA: 'order' contains indices into the keys array.
+ // This simulates the indirect pointers used in the original C code
+ // (from Frank Suykens, Luciad.com).
+ int[] order;
+ int size, max;
+ boolean initialized;
+ com.sun.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);
+
+ keys = new Object[com.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE];
+
+ size = 0;
+ max = com.sun.opengl.impl.glu.tessellator.PriorityQ.INIT_SIZE;
+ initialized = false;
+ this.leq = leq;
+ }
+
+/* really __gl_pqSortDeletePriorityQ */
+ void pqDeletePriorityQ() {
+ if (heap != null) heap.pqDeletePriorityQ();
+ order = null;
+ keys = null;
+ }
+
+ private static boolean LT(com.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 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 void Swap(int[] array, int a, int b) {
+ if (true) {
+ int tmp = array[a];
+ array[a] = array[b];
+ array[b] = tmp;
+ } else {
+
+ }
+ }
+
+ private static class Stack {
+ int p, r;
+ }
+
+/* really __gl_pqSortInit */
+ boolean pqInit() {
+ int p, r, i, j;
+ int piv;
+ Stack[] stack = new Stack[50];
+ for (int k = 0; k < stack.length; k++) {
+ stack[k] = new Stack();
+ }
+ int top = 0;
+
+ int seed = 2016473283;
+
+ /* Create an array of indirect pointers to the keys, so that we
+ * the handles we have returned are still valid.
+ */
+ order = new int[size + 1];
+/* the previous line is a patch to compensate for the fact that IBM */
+/* machines return a null on a malloc of zero bytes (unlike SGI), */
+/* so we have to put in this defense to guard against a memory */
+/* fault four lines down. from [email protected]. */
+ p = 0;
+ r = size - 1;
+ for (piv = 0, i = p; i <= r; ++piv, ++i) {
+ // indirect pointers: keep an index into the keys array, not a direct pointer to its contents
+ order[i] = piv;
+ }
+
+ /* Sort the indirect pointers in descending order,
+ * using randomized Quicksort
+ */
+ stack[top].p = p;
+ stack[top].r = r;
+ ++top;
+ while (--top >= 0) {
+ p = stack[top].p;
+ r = stack[top].r;
+ while (r > p + 10) {
+ seed = Math.abs( seed * 1539415821 + 1 );
+ i = p + seed % (r - p + 1);
+ piv = order[i];
+ order[i] = order[p];
+ order[p] = piv;
+ i = p - 1;
+ j = r + 1;
+ do {
+ do {
+ ++i;
+ } while (GT(leq, keys[order[i]], keys[piv]));
+ do {
+ --j;
+ } while (LT(leq, keys[order[j]], keys[piv]));
+ Swap(order, i, j);
+ } while (i < j);
+ Swap(order, i, j); /* Undo last swap */
+ if (i - p < r - j) {
+ stack[top].p = j + 1;
+ stack[top].r = r;
+ ++top;
+ r = i - 1;
+ } else {
+ stack[top].p = p;
+ stack[top].r = i - 1;
+ ++top;
+ p = j + 1;
+ }
+ }
+ /* Insertion sort small lists */
+ for (i = p + 1; i <= r; ++i) {
+ piv = order[i];
+ for (j = i; j > p && LT(leq, keys[order[j - 1]], keys[piv]); --j) {
+ order[j] = order[j - 1];
+ }
+ order[j] = piv;
+ }
+ }
+ max = size;
+ initialized = true;
+ heap.pqInit(); /* always succeeds */
+
+/* #ifndef NDEBUG
+ p = order;
+ r = p + size - 1;
+ for (i = p; i < r; ++i) {
+ Assertion.doAssert(LEQ( * * (i + 1), **i ));
+ }
+ #endif*/
+
+ return true;
+ }
+
+/* really __gl_pqSortInsert */
+/* returns LONG_MAX iff out of memory */
+ int pqInsert(Object keyNew) {
+ int curr;
+
+ if (initialized) {
+ return heap.pqInsert(keyNew);
+ }
+ curr = size;
+ if (++size >= max) {
+ Object[] saveKey = keys;
+
+ /* If the heap overflows, double its size. */
+ max <<= 1;
+// pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
+ Object[] pqKeys = new Object[max];
+ System.arraycopy( keys, 0, pqKeys, 0, keys.length );
+ keys = pqKeys;
+ if (keys == null) {
+ keys = saveKey; /* restore ptr to free upon return */
+ return Integer.MAX_VALUE;
+ }
+ }
+ assert curr != Integer.MAX_VALUE;
+ keys[curr] = keyNew;
+
+ /* Negative handles index the sorted array. */
+ return -(curr + 1);
+ }
+
+/* really __gl_pqSortExtractMin */
+ Object pqExtractMin() {
+ Object sortMin, heapMin;
+
+ if (size == 0) {
+ return heap.pqExtractMin();
+ }
+ sortMin = keys[order[size - 1]];
+ if (!heap.pqIsEmpty()) {
+ heapMin = heap.pqMinimum();
+ if (LEQ(leq, heapMin, sortMin)) {
+ return heap.pqExtractMin();
+ }
+ }
+ do {
+ --size;
+ } while (size > 0 && keys[order[size - 1]] == null);
+ return sortMin;
+ }
+
+/* really __gl_pqSortMinimum */
+ Object pqMinimum() {
+ Object sortMin, heapMin;
+
+ if (size == 0) {
+ return heap.pqMinimum();
+ }
+ sortMin = keys[order[size - 1]];
+ if (!heap.pqIsEmpty()) {
+ heapMin = heap.pqMinimum();
+ if (com.sun.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
+ return heapMin;
+ }
+ }
+ return sortMin;
+ }
+
+/* really __gl_pqSortIsEmpty */
+ boolean pqIsEmpty() {
+ return (size == 0) && heap.pqIsEmpty();
+ }
+
+/* really __gl_pqSortDelete */
+ void pqDelete(int curr) {
+ if (curr >= 0) {
+ heap.pqDelete(curr);
+ return;
+ }
+ curr = -(curr + 1);
+ assert curr < max && keys[curr] != null;
+
+ keys[curr] = null;
+ while (size > 0 && keys[order[size - 1]] == null) {
+ --size;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java
new file mode 100644
index 000000000..cd6e02255
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Render.java
@@ -0,0 +1,557 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+class Render {
+ private static final boolean USE_OPTIMIZED_CODE_PATH = false;
+
+ private Render() {
+ }
+
+ private static final RenderFan renderFan = new RenderFan();
+ private static final RenderStrip renderStrip = new RenderStrip();
+ private static final RenderTriangle renderTriangle = new RenderTriangle();
+
+/* This structure remembers the information we need about a primitive
+ * to be able to render it later, once we have determined which
+ * primitive is able to use the most triangles.
+ */
+ private static class FaceCount {
+ public FaceCount() {
+ }
+
+ public FaceCount(long size, com.sun.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 */
+ renderCallBack render;
+ };
+
+ private static interface renderCallBack {
+ void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size);
+ }
+
+ /************************ Strips and Fans decomposition ******************/
+
+/* __gl_renderMesh( tess, mesh ) takes a mesh and breaks it into triangle
+ * fans, strips, and separate triangles. A substantial effort is made
+ * to use as few rendering primitives as possible (ie. to make the fans
+ * and strips as large as possible).
+ *
+ * The rendering output is provided as callbacks (see the api).
+ */
+ public static void __gl_renderMesh(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) {
+ com.sun.opengl.impl.glu.tessellator.GLUface f;
+
+ /* Make a list of separate triangles so we can render them all at once */
+ tess.lonelyTriList = null;
+
+ for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
+ f.marked = false;
+ }
+ for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
+
+ /* We examine all faces in an arbitrary order. Whenever we find
+ * an unprocessed face F, we output a group of faces including F
+ * whose size is maximum.
+ */
+ if (f.inside && !f.marked) {
+ RenderMaximumFaceGroup(tess, f);
+ assert (f.marked);
+ }
+ }
+ if (tess.lonelyTriList != null) {
+ RenderLonelyTriangles(tess, tess.lonelyTriList);
+ tess.lonelyTriList = null;
+ }
+ }
+
+
+ static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUface fOrig) {
+ /* We want to find the largest triangle fan or strip of unmarked faces
+ * which includes the given face fOrig. There are 3 possible fans
+ * passing through fOrig (one centered at each vertex), and 3 possible
+ * strips (one for each CCW permutation of the vertices). Our strategy
+ * is to try all of these, and take the primitive which uses the most
+ * triangles (a greedy approach).
+ */
+ com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
+ FaceCount max = new FaceCount();
+ FaceCount newFace = new FaceCount();
+
+ max.size = 1;
+ max.eStart = e;
+ max.render = renderTriangle;
+
+ if (!tess.flagBoundary) {
+ newFace = MaximumFan(e);
+ if (newFace.size > max.size) {
+ max = newFace;
+ }
+ newFace = MaximumFan(e.Lnext);
+ if (newFace.size > max.size) {
+ max = newFace;
+ }
+ newFace = MaximumFan(e.Onext.Sym);
+ if (newFace.size > max.size) {
+ max = newFace;
+ }
+
+ newFace = MaximumStrip(e);
+ if (newFace.size > max.size) {
+ max = newFace;
+ }
+ newFace = MaximumStrip(e.Lnext);
+ if (newFace.size > max.size) {
+ max = newFace;
+ }
+ newFace = MaximumStrip(e.Onext.Sym);
+ if (newFace.size > max.size) {
+ max = newFace;
+ }
+ }
+ max.render.render(tess, max.eStart, max.size);
+ }
+
+
+/* Macros which keep track of faces we have marked temporarily, and allow
+ * us to backtrack when necessary. With triangle fans, this is not
+ * really necessary, since the only awkward case is a loop of triangles
+ * around a single origin vertex. However with strips the situation is
+ * more complicated, and we need a general tracking method like the
+ * one here.
+ */
+ private static boolean Marked(com.sun.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) {
+ f.trail = t;
+ f.marked = true;
+ return f;
+ }
+
+ private static void FreeTrail(com.sun.opengl.impl.glu.tessellator.GLUface t) {
+ if (true) {
+ while (t != null) {
+ t.marked = false;
+ t = t.trail;
+ }
+ } else {
+ /* absorb trailing semicolon */
+ }
+ }
+
+ static FaceCount MaximumFan(com.sun.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;
+
+ for (e = eOrig; !Marked(e.Lface); e = e.Onext) {
+ trail = AddToTrail(e.Lface, trail);
+ ++newFace.size;
+ }
+ for (e = eOrig; !Marked(e.Sym.Lface); e = e.Sym.Lnext) {
+ trail = AddToTrail(e.Sym.Lface, trail);
+ ++newFace.size;
+ }
+ newFace.eStart = e;
+ /*LINTED*/
+ FreeTrail(trail);
+ return newFace;
+ }
+
+
+ private static boolean IsEven(long n) {
+ return (n & 0x1L) == 0;
+ }
+
+ static FaceCount MaximumStrip(com.sun.opengl.impl.glu.tessellator.GLUhalfEdge eOrig) {
+ /* Here we are looking for a maximal strip that contains the vertices
+ * eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
+ * reverse, such that all triangles are oriented CCW).
+ *
+ * Again we walk forward and backward as far as possible. However for
+ * strips there is a twist: to get CCW orientations, there must be
+ * an *even* number of triangles in the strip on one side of eOrig.
+ * We walk the strip starting on a side with an even number of triangles;
+ * if both side have an odd number, we are forced to shorten one side.
+ */
+ FaceCount newFace = new FaceCount(0, null, renderStrip);
+ long headSize = 0, tailSize = 0;
+ com.sun.opengl.impl.glu.tessellator.GLUface trail = null;
+ com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, eTail, eHead;
+
+ for (e = eOrig; !Marked(e.Lface); ++tailSize, e = e.Onext) {
+ trail = AddToTrail(e.Lface, trail);
+ ++tailSize;
+ e = e.Lnext.Sym;
+ if (Marked(e.Lface)) break;
+ trail = AddToTrail(e.Lface, trail);
+ }
+ eTail = e;
+
+ for (e = eOrig; !Marked(e.Sym.Lface); ++headSize, e = e.Sym.Onext.Sym) {
+ trail = AddToTrail(e.Sym.Lface, trail);
+ ++headSize;
+ e = e.Sym.Lnext;
+ if (Marked(e.Sym.Lface)) break;
+ trail = AddToTrail(e.Sym.Lface, trail);
+ }
+ eHead = e;
+
+ newFace.size = tailSize + headSize;
+ if (IsEven(tailSize)) {
+ newFace.eStart = eTail.Sym;
+ } else if (IsEven(headSize)) {
+ newFace.eStart = eHead;
+ } else {
+ /* Both sides have odd length, we must shorten one of them. In fact,
+ * we must start from eHead to guarantee inclusion of eOrig.Lface.
+ */
+ --newFace.size;
+ newFace.eStart = eHead.Onext;
+ }
+ /*LINTED*/
+ FreeTrail(trail);
+ return newFace;
+ }
+
+ private static class RenderTriangle implements renderCallBack {
+ public void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) {
+ /* Just add the triangle to a triangle list, so we can render all
+ * the separate triangles at once.
+ */
+ assert (size == 1);
+ tess.lonelyTriList = AddToTrail(e.Lface, tess.lonelyTriList);
+ }
+ }
+
+
+ static void RenderLonelyTriangles(GLUtessellatorImpl tess, com.sun.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;
+ int newState;
+ int edgeState = -1; /* force edge state output for first vertex */
+
+ tess.callBeginOrBeginData(GL.GL_TRIANGLES);
+
+ for (; f != null; f = f.trail) {
+ /* Loop once for each edge (there will always be 3 edges) */
+
+ e = f.anEdge;
+ do {
+ if (tess.flagBoundary) {
+ /* Set the "edge state" to true just before we output the
+ * first vertex of each edge on the polygon boundary.
+ */
+ newState = (!e.Sym.Lface.inside) ? 1 : 0;
+ if (edgeState != newState) {
+ edgeState = newState;
+ tess.callEdgeFlagOrEdgeFlagData( edgeState != 0);
+ }
+ }
+ tess.callVertexOrVertexData( e.Org.data);
+
+ e = e.Lnext;
+ } while (e != f.anEdge);
+ }
+ tess.callEndOrEndData();
+ }
+
+ private static class RenderFan implements renderCallBack {
+ public void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) {
+ /* Render as many CCW triangles as possible in a fan starting from
+ * edge "e". The fan *should* contain exactly "size" triangles
+ * (otherwise we've goofed up somewhere).
+ */
+ tess.callBeginOrBeginData( GL.GL_TRIANGLE_FAN);
+ tess.callVertexOrVertexData( e.Org.data);
+ tess.callVertexOrVertexData( e.Sym.Org.data);
+
+ while (!Marked(e.Lface)) {
+ e.Lface.marked = true;
+ --size;
+ e = e.Onext;
+ tess.callVertexOrVertexData( e.Sym.Org.data);
+ }
+
+ assert (size == 0);
+ tess.callEndOrEndData();
+ }
+ }
+
+ private static class RenderStrip implements renderCallBack {
+ public void render(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e, long size) {
+ /* Render as many CCW triangles as possible in a strip starting from
+ * edge "e". The strip *should* contain exactly "size" triangles
+ * (otherwise we've goofed up somewhere).
+ */
+ tess.callBeginOrBeginData( GL.GL_TRIANGLE_STRIP);
+ tess.callVertexOrVertexData( e.Org.data);
+ tess.callVertexOrVertexData( e.Sym.Org.data);
+
+ while (!Marked(e.Lface)) {
+ e.Lface.marked = true;
+ --size;
+ e = e.Lnext.Sym;
+ tess.callVertexOrVertexData( e.Org.data);
+ if (Marked(e.Lface)) break;
+
+ e.Lface.marked = true;
+ --size;
+ e = e.Onext;
+ tess.callVertexOrVertexData( e.Sym.Org.data);
+ }
+
+ assert (size == 0);
+ tess.callEndOrEndData();
+ }
+ }
+
+ /************************ Boundary contour decomposition ******************/
+
+/* __gl_renderBoundary( tess, mesh ) takes a mesh, and outputs one
+ * contour for each face marked "inside". The rendering output is
+ * provided as callbacks (see the api).
+ */
+ public static void __gl_renderBoundary(GLUtessellatorImpl tess, com.sun.opengl.impl.glu.tessellator.GLUmesh mesh) {
+ com.sun.opengl.impl.glu.tessellator.GLUface f;
+ com.sun.opengl.impl.glu.tessellator.GLUhalfEdge e;
+
+ for (f = mesh.fHead.next; f != mesh.fHead; f = f.next) {
+ if (f.inside) {
+ tess.callBeginOrBeginData( GL.GL_LINE_LOOP);
+ e = f.anEdge;
+ do {
+ tess.callVertexOrVertexData( e.Org.data);
+ e = e.Lnext;
+ } while (e != f.anEdge);
+ tess.callEndOrEndData();
+ }
+ }
+ }
+
+
+ /************************ Quick-and-dirty decomposition ******************/
+
+ private static final int SIGN_INCONSISTENT = 2;
+
+ static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
+/*
+ * If check==false, we compute the polygon normal and place it in norm[].
+ * If check==true, we check that each triangle in the fan from v0 has a
+ * consistent orientation with respect to norm[]. If triangles are
+ * consistently oriented CCW, return 1; if CW, return -1; if all triangles
+ * are degenerate return 0; otherwise (no consistent orientation) return
+ * SIGN_INCONSISTENT.
+ */ {
+ com.sun.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache;
+// CachedVertex vn = v0 + tess.cacheCount;
+ int vn = tess.cacheCount;
+// CachedVertex vc;
+ int vc;
+ double dot, xc, yc, zc, xp, yp, zp;
+ double[] n = new double[3];
+ int sign = 0;
+
+ /* Find the polygon normal. It is important to get a reasonable
+ * normal even when the polygon is self-intersecting (eg. a bowtie).
+ * Otherwise, the computed normal could be very tiny, but perpendicular
+ * to the true plane of the polygon due to numerical noise. Then all
+ * the triangles would appear to be degenerate and we would incorrectly
+ * decompose the polygon as a fan (or simply not render it at all).
+ *
+ * We use a sum-of-triangles normal algorithm rather than the more
+ * efficient sum-of-trapezoids method (used in CheckOrientation()
+ * in normal.c). This lets us explicitly reverse the signed area
+ * of some triangles to get a reasonable normal in the self-intersecting
+ * case.
+ */
+ if (!check) {
+ norm[0] = norm[1] = norm[2] = 0.0;
+ }
+
+ vc = 1;
+ xc = v[vc].coords[0] - v[0].coords[0];
+ yc = v[vc].coords[1] - v[0].coords[1];
+ zc = v[vc].coords[2] - v[0].coords[2];
+ while (++vc < vn) {
+ xp = xc;
+ yp = yc;
+ zp = zc;
+ xc = v[vc].coords[0] - v[0].coords[0];
+ yc = v[vc].coords[1] - v[0].coords[1];
+ zc = v[vc].coords[2] - v[0].coords[2];
+
+ /* Compute (vp - v0) cross (vc - v0) */
+ n[0] = yp * zc - zp * yc;
+ n[1] = zp * xc - xp * zc;
+ n[2] = xp * yc - yp * xc;
+
+ dot = n[0] * norm[0] + n[1] * norm[1] + n[2] * norm[2];
+ if (!check) {
+ /* Reverse the contribution of back-facing triangles to get
+ * a reasonable normal for self-intersecting polygons (see above)
+ */
+ if (dot >= 0) {
+ norm[0] += n[0];
+ norm[1] += n[1];
+ norm[2] += n[2];
+ } else {
+ norm[0] -= n[0];
+ norm[1] -= n[1];
+ norm[2] -= n[2];
+ }
+ } else if (dot != 0) {
+ /* Check the new orientation for consistency with previous triangles */
+ if (dot > 0) {
+ if (sign < 0) return SIGN_INCONSISTENT;
+ sign = 1;
+ } else {
+ if (sign > 0) return SIGN_INCONSISTENT;
+ sign = -1;
+ }
+ }
+ }
+ return sign;
+ }
+
+/* __gl_renderCache( tess ) takes a single contour and tries to render it
+ * as a triangle fan. This handles convex polygons, as well as some
+ * non-convex polygons if we get lucky.
+ *
+ * Returns true if the polygon was successfully rendered. The rendering
+ * output is provided as callbacks (see the api).
+ */
+ public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
+ com.sun.opengl.impl.glu.tessellator.CachedVertex[] v = tess.cache;
+// CachedVertex vn = v0 + tess.cacheCount;
+ int vn = tess.cacheCount;
+// CachedVertex vc;
+ int vc;
+ double[] norm = new double[3];
+ int sign;
+
+ if (tess.cacheCount < 3) {
+ /* Degenerate contour -- no output */
+ return true;
+ }
+
+ norm[0] = tess.normal[0];
+ norm[1] = tess.normal[1];
+ norm[2] = tess.normal[2];
+ if (norm[0] == 0 && norm[1] == 0 && norm[2] == 0) {
+ ComputeNormal( tess, norm, false);
+ }
+
+ sign = ComputeNormal( tess, norm, true);
+ if (sign == SIGN_INCONSISTENT) {
+ /* Fan triangles did not have a consistent orientation */
+ return false;
+ }
+ if (sign == 0) {
+ /* All triangles were degenerate */
+ return true;
+ }
+
+ if ( !USE_OPTIMIZED_CODE_PATH ) {
+ return false;
+ } else {
+ /* Make sure we do the right thing for each winding rule */
+ switch (tess.windingRule) {
+ case GLU.GLU_TESS_WINDING_ODD:
+ case GLU.GLU_TESS_WINDING_NONZERO:
+ break;
+ case GLU.GLU_TESS_WINDING_POSITIVE:
+ if (sign < 0) return true;
+ break;
+ case GLU.GLU_TESS_WINDING_NEGATIVE:
+ if (sign > 0) return true;
+ break;
+ case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
+ return true;
+ }
+
+ tess.callBeginOrBeginData( tess.boundaryOnly ? GL.GL_LINE_LOOP
+ : (tess.cacheCount > 3) ? GL.GL_TRIANGLE_FAN
+ : GL.GL_TRIANGLES);
+
+ tess.callVertexOrVertexData( v[0].data);
+ if (sign > 0) {
+ for (vc = 1; vc < vn; ++vc) {
+ tess.callVertexOrVertexData( v[vc].data);
+ }
+ } else {
+ for (vc = vn - 1; vc > 0; --vc) {
+ tess.callVertexOrVertexData( v[vc].data);
+ }
+ }
+ tess.callEndOrEndData();
+ return true;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java
new file mode 100644
index 000000000..105328d87
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/Sweep.java
@@ -0,0 +1,1353 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+class Sweep {
+ private Sweep() {
+ }
+
+// #ifdef FOR_TRITE_TEST_PROGRAM
+// extern void DebugEvent( GLUtessellator *tess );
+// #else
+ private static void DebugEvent(GLUtessellatorImpl tess) {
+
+ }
+// #endif
+
+/*
+ * Invariants for the Edge Dictionary.
+ * - each pair of adjacent edges e2=Succ(e1) satisfies EdgeLeq(e1,e2)
+ * at any valid location of the sweep event
+ * - if EdgeLeq(e2,e1) as well (at any valid sweep event), then e1 and e2
+ * share a common endpoint
+ * - for each e, e.Dst has been processed, but not e.Org
+ * - each edge e satisfies VertLeq(e.Dst,event) && VertLeq(event,e.Org)
+ * where "event" is the current sweep line event.
+ * - no edge e has zero length
+ *
+ * Invariants for the Mesh (the processed portion).
+ * - the portion of the mesh left of the sweep line is a planar graph,
+ * ie. there is *some* way to embed it in the plane
+ * - no processed edge has zero length
+ * - no two processed vertices have identical coordinates
+ * - each "inside" region is monotone, ie. can be broken into two chains
+ * of monotonically increasing vertices according to VertLeq(v1,v2)
+ * - a non-invariant: these chains may intersect (very slightly)
+ *
+ * Invariants for the Sweep.
+ * - if none of the edges incident to the event vertex have an activeRegion
+ * (ie. none of these edges are in the edge dictionary), then the vertex
+ * has only right-going edges.
+ * - if an edge is marked "fixUpperEdge" (it is a temporary edge introduced
+ * by ConnectRightVertex), then it is the only right-going edge from
+ * its associated vertex. (This says that these edges exist only
+ * when it is necessary.)
+ */
+
+/* When we merge two edges into one, we need to compute the combined
+ * winding of the new edge.
+ */
+ private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
+ eDst.winding += eSrc.winding;
+ eDst.Sym.winding += eSrc.Sym.winding;
+ }
+
+
+ private static ActiveRegion RegionBelow(ActiveRegion r) {
+ return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
+ }
+
+ private static ActiveRegion RegionAbove(ActiveRegion r) {
+ return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
+ }
+
+ static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
+/*
+ * Both edges must be directed from right to left (this is the canonical
+ * direction for the upper edge of each region).
+ *
+ * The strategy is to evaluate a "t" value for each edge at the
+ * current sweep line position, given by tess.event. The calculations
+ * are designed to be very stable, but of course they are not perfect.
+ *
+ * Special case: if both edge destinations are at the sweep event,
+ * we sort the edges by slope (they would otherwise compare equally).
+ */ {
+ GLUvertex event = tess.event;
+ GLUhalfEdge e1, e2;
+ double t1, t2;
+
+ e1 = reg1.eUp;
+ e2 = reg2.eUp;
+
+ if (e1.Sym.Org == event) {
+ if (e2.Sym.Org == event) {
+ /* Two edges right of the sweep line which meet at the sweep event.
+ * Sort them by slope.
+ */
+ if (Geom.VertLeq(e1.Org, e2.Org)) {
+ return Geom.EdgeSign(e2.Sym.Org, e1.Org, e2.Org) <= 0;
+ }
+ return Geom.EdgeSign(e1.Sym.Org, e2.Org, e1.Org) >= 0;
+ }
+ return Geom.EdgeSign(e2.Sym.Org, event, e2.Org) <= 0;
+ }
+ if (e2.Sym.Org == event) {
+ return Geom.EdgeSign(e1.Sym.Org, event, e1.Org) >= 0;
+ }
+
+ /* General case - compute signed distance *from* e1, e2 to event */
+ t1 = Geom.EdgeEval(e1.Sym.Org, event, e1.Org);
+ t2 = Geom.EdgeEval(e2.Sym.Org, event, e2.Org);
+ return (t1 >= t2);
+ }
+
+
+ static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
+ if (reg.fixUpperEdge) {
+ /* It was created with zero winding number, so it better be
+ * deleted with zero winding number (ie. it better not get merged
+ * with a real edge).
+ */
+ assert (reg.eUp.winding == 0);
+ }
+ reg.eUp.activeRegion = null;
+ Dict.dictDelete(tess.dict, reg.nodeUp); /* __gl_dictListDelete */
+ }
+
+
+ static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
+/*
+ * Replace an upper edge which needs fixing (see ConnectRightVertex).
+ */ {
+ assert (reg.fixUpperEdge);
+ if (!Mesh.__gl_meshDelete(reg.eUp)) return false;
+ reg.fixUpperEdge = false;
+ reg.eUp = newEdge;
+ newEdge.activeRegion = reg;
+
+ return true;
+ }
+
+ static ActiveRegion TopLeftRegion(ActiveRegion reg) {
+ GLUvertex org = reg.eUp.Org;
+ GLUhalfEdge e;
+
+ /* Find the region above the uppermost edge with the same origin */
+ do {
+ reg = RegionAbove(reg);
+ } while (reg.eUp.Org == org);
+
+ /* If the edge above was a temporary edge introduced by ConnectRightVertex,
+ * now is the time to fix it.
+ */
+ if (reg.fixUpperEdge) {
+ e = Mesh.__gl_meshConnect(RegionBelow(reg).eUp.Sym, reg.eUp.Lnext);
+ if (e == null) return null;
+ if (!FixUpperEdge(reg, e)) return null;
+ reg = RegionAbove(reg);
+ }
+ return reg;
+ }
+
+ static ActiveRegion TopRightRegion(ActiveRegion reg) {
+ GLUvertex dst = reg.eUp.Sym.Org;
+
+ /* Find the region above the uppermost edge with the same destination */
+ do {
+ reg = RegionAbove(reg);
+ } while (reg.eUp.Sym.Org == dst);
+ return reg;
+ }
+
+ static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
+ ActiveRegion regAbove,
+ GLUhalfEdge eNewUp)
+/*
+ * Add a new active region to the sweep line, *somewhere* below "regAbove"
+ * (according to where the new edge belongs in the sweep-line dictionary).
+ * The upper edge of the new region will be "eNewUp".
+ * Winding number and "inside" flag are not updated.
+ */ {
+ ActiveRegion regNew = new ActiveRegion();
+ if (regNew == null) throw new RuntimeException();
+
+ regNew.eUp = eNewUp;
+ /* __gl_dictListInsertBefore */
+ regNew.nodeUp = Dict.dictInsertBefore(tess.dict, regAbove.nodeUp, regNew);
+ if (regNew.nodeUp == null) throw new RuntimeException();
+ regNew.fixUpperEdge = false;
+ regNew.sentinel = false;
+ regNew.dirty = false;
+
+ eNewUp.activeRegion = regNew;
+ return regNew;
+ }
+
+ static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
+ switch (tess.windingRule) {
+ case GLU.GLU_TESS_WINDING_ODD:
+ return (n & 1) != 0;
+ case GLU.GLU_TESS_WINDING_NONZERO:
+ return (n != 0);
+ case GLU.GLU_TESS_WINDING_POSITIVE:
+ return (n > 0);
+ case GLU.GLU_TESS_WINDING_NEGATIVE:
+ return (n < 0);
+ case GLU.GLU_TESS_WINDING_ABS_GEQ_TWO:
+ return (n >= 2) || (n <= -2);
+ }
+ /*LINTED*/
+// assert (false);
+ throw new InternalError();
+ /*NOTREACHED*/
+ }
+
+
+ static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
+ reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
+ reg.inside = IsWindingInside(tess, reg.windingNumber);
+ }
+
+
+ static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
+/*
+ * Delete a region from the sweep line. This happens when the upper
+ * and lower chains of a region meet (at a vertex on the sweep line).
+ * The "inside" flag is copied to the appropriate mesh face (we could
+ * not do this before -- since the structure of the mesh is always
+ * changing, this face may not have even existed until now).
+ */ {
+ GLUhalfEdge e = reg.eUp;
+ GLUface f = e.Lface;
+
+ f.inside = reg.inside;
+ f.anEdge = e; /* optimization for __gl_meshTessellateMonoRegion() */
+ DeleteRegion(tess, reg);
+ }
+
+
+ static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
+ ActiveRegion regFirst, ActiveRegion regLast)
+/*
+ * We are given a vertex with one or more left-going edges. All affected
+ * edges should be in the edge dictionary. Starting at regFirst.eUp,
+ * we walk down deleting all regions where both edges have the same
+ * origin vOrg. At the same time we copy the "inside" flag from the
+ * active region to the face, since at this point each face will belong
+ * to at most one region (this was not necessarily true until this point
+ * in the sweep). The walk stops at the region above regLast; if regLast
+ * is null we walk as far as possible. At the same time we relink the
+ * mesh if necessary, so that the ordering of edges around vOrg is the
+ * same as in the dictionary.
+ */ {
+ ActiveRegion reg, regPrev;
+ GLUhalfEdge e, ePrev;
+
+ regPrev = regFirst;
+ ePrev = regFirst.eUp;
+ while (regPrev != regLast) {
+ regPrev.fixUpperEdge = false; /* placement was OK */
+ reg = RegionBelow(regPrev);
+ e = reg.eUp;
+ if (e.Org != ePrev.Org) {
+ if (!reg.fixUpperEdge) {
+ /* Remove the last left-going edge. Even though there are no further
+ * edges in the dictionary with this origin, there may be further
+ * such edges in the mesh (if we are adding left edges to a vertex
+ * that has already been processed). Thus it is important to call
+ * FinishRegion rather than just DeleteRegion.
+ */
+ FinishRegion(tess, regPrev);
+ break;
+ }
+ /* If the edge below was a temporary edge introduced by
+ * ConnectRightVertex, now is the time to fix it.
+ */
+ e = Mesh.__gl_meshConnect(ePrev.Onext.Sym, e.Sym);
+ if (e == null) throw new RuntimeException();
+ if (!FixUpperEdge(reg, e)) throw new RuntimeException();
+ }
+
+ /* Relink edges so that ePrev.Onext == e */
+ if (ePrev.Onext != e) {
+ if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(ePrev, e)) throw new RuntimeException();
+ }
+ FinishRegion(tess, regPrev); /* may change reg.eUp */
+ ePrev = reg.eUp;
+ regPrev = reg;
+ }
+ return ePrev;
+ }
+
+
+ static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
+ GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
+ boolean cleanUp)
+/*
+ * Purpose: insert right-going edges into the edge dictionary, and update
+ * winding numbers and mesh connectivity appropriately. All right-going
+ * edges share a common origin vOrg. Edges are inserted CCW starting at
+ * eFirst; the last edge inserted is eLast.Sym.Lnext. If vOrg has any
+ * left-going edges already processed, then eTopLeft must be the edge
+ * such that an imaginary upward vertical segment from vOrg would be
+ * contained between eTopLeft.Sym.Lnext and eTopLeft; otherwise eTopLeft
+ * should be null.
+ */ {
+ ActiveRegion reg, regPrev;
+ GLUhalfEdge e, ePrev;
+ boolean firstTime = true;
+
+ /* Insert the new right-going edges in the dictionary */
+ e = eFirst;
+ do {
+ assert (Geom.VertLeq(e.Org, e.Sym.Org));
+ AddRegionBelow(tess, regUp, e.Sym);
+ e = e.Onext;
+ } while (e != eLast);
+
+ /* Walk *all* right-going edges from e.Org, in the dictionary order,
+ * updating the winding numbers of each region, and re-linking the mesh
+ * edges to match the dictionary ordering (if necessary).
+ */
+ if (eTopLeft == null) {
+ eTopLeft = RegionBelow(regUp).eUp.Sym.Onext;
+ }
+ regPrev = regUp;
+ ePrev = eTopLeft;
+ for (; ;) {
+ reg = RegionBelow(regPrev);
+ e = reg.eUp.Sym;
+ if (e.Org != ePrev.Org) break;
+
+ if (e.Onext != ePrev) {
+ /* Unlink e from its current position, and relink below ePrev */
+ if (!Mesh.__gl_meshSplice(e.Sym.Lnext, e)) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(ePrev.Sym.Lnext, e)) throw new RuntimeException();
+ }
+ /* Compute the winding number and "inside" flag for the new regions */
+ reg.windingNumber = regPrev.windingNumber - e.winding;
+ reg.inside = IsWindingInside(tess, reg.windingNumber);
+
+ /* Check for two outgoing edges with same slope -- process these
+ * before any intersection tests (see example in __gl_computeInterior).
+ */
+ regPrev.dirty = true;
+ if (!firstTime && CheckForRightSplice(tess, regPrev)) {
+ AddWinding(e, ePrev);
+ DeleteRegion(tess, regPrev);
+ if (!Mesh.__gl_meshDelete(ePrev)) throw new RuntimeException();
+ }
+ firstTime = false;
+ regPrev = reg;
+ ePrev = e;
+ }
+ regPrev.dirty = true;
+ assert (regPrev.windingNumber - e.winding == reg.windingNumber);
+
+ if (cleanUp) {
+ /* Check for intersections between newly adjacent edges. */
+ WalkDirtyRegions(tess, regPrev);
+ }
+ }
+
+
+ static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
+ Object[] data, float[] weights, boolean needed) {
+ double[] coords = new double[3];
+
+ /* Copy coord data in case the callback changes it. */
+ coords[0] = isect.coords[0];
+ coords[1] = isect.coords[1];
+ coords[2] = isect.coords[2];
+
+ Object[] outData = new Object[1];
+ tess.callCombineOrCombineData(coords, data, weights, outData);
+ isect.data = outData[0];
+ if (isect.data == null) {
+ if (!needed) {
+ isect.data = data[0];
+ } else if (!tess.fatalError) {
+ /* The only way fatal error is when two edges are found to intersect,
+ * but the user has not provided the callback necessary to handle
+ * generated intersection points.
+ */
+ tess.callErrorOrErrorData(GLU.GLU_TESS_NEED_COMBINE_CALLBACK);
+ tess.fatalError = true;
+ }
+ }
+ }
+
+ static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
+ GLUhalfEdge e2)
+/*
+ * Two vertices with idential coordinates are combined into one.
+ * e1.Org is kept, while e2.Org is discarded.
+ */ {
+ Object[] data = new Object[4];
+ float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
+
+ data[0] = e1.Org.data;
+ data[1] = e2.Org.data;
+ CallCombine(tess, e1.Org, data, weights, false);
+ if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
+ }
+
+ static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
+ float[] weights)
+/*
+ * Find some weights which describe how the intersection vertex is
+ * a linear combination of "org" and "dest". Each of the two edges
+ * which generated "isect" is allocated 50% of the weight; each edge
+ * splits the weight between its org and dst according to the
+ * relative distance to "isect".
+ */ {
+ double t1 = Geom.VertL1dist(org, isect);
+ double t2 = Geom.VertL1dist(dst, isect);
+
+ weights[0] = (float) (0.5 * t2 / (t1 + t2));
+ weights[1] = (float) (0.5 * t1 / (t1 + t2));
+ isect.coords[0] += weights[0] * org.coords[0] + weights[1] * dst.coords[0];
+ isect.coords[1] += weights[0] * org.coords[1] + weights[1] * dst.coords[1];
+ isect.coords[2] += weights[0] * org.coords[2] + weights[1] * dst.coords[2];
+ }
+
+
+ static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
+ GLUvertex orgUp, GLUvertex dstUp,
+ GLUvertex orgLo, GLUvertex dstLo)
+/*
+ * We've computed a new intersection point, now we need a "data" pointer
+ * from the user so that we can refer to this new vertex in the
+ * rendering callbacks.
+ */ {
+ Object[] data = new Object[4];
+ float[] weights = new float[4];
+ float[] weights1 = new float[2];
+ float[] weights2 = new float[2];
+
+ data[0] = orgUp.data;
+ data[1] = dstUp.data;
+ data[2] = orgLo.data;
+ data[3] = dstLo.data;
+
+ isect.coords[0] = isect.coords[1] = isect.coords[2] = 0;
+ VertexWeights(isect, orgUp, dstUp, weights1);
+ VertexWeights(isect, orgLo, dstLo, weights2);
+ System.arraycopy(weights1, 0, weights, 0, 2);
+ System.arraycopy(weights2, 0, weights, 2, 2);
+
+ CallCombine(tess, isect, data, weights, true);
+ }
+
+ static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * Check the upper and lower edge of "regUp", to make sure that the
+ * eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
+ * origin is leftmost).
+ *
+ * The main purpose is to splice right-going edges with the same
+ * dest vertex and nearly identical slopes (ie. we can't distinguish
+ * the slopes numerically). However the splicing can also help us
+ * to recover from numerical errors. For example, suppose at one
+ * point we checked eUp and eLo, and decided that eUp.Org is barely
+ * above eLo. Then later, we split eLo into two edges (eg. from
+ * a splice operation like this one). This can change the result of
+ * our test so that now eUp.Org is incident to eLo, or barely below it.
+ * We must correct this condition to maintain the dictionary invariants.
+ *
+ * One possibility is to check these edges for intersection again
+ * (ie. CheckForIntersect). This is what we do if possible. However
+ * CheckForIntersect requires that tess.event lies between eUp and eLo,
+ * so that it has something to fall back on when the intersection
+ * calculation gives us an unusable answer. So, for those cases where
+ * we can't check for intersection, this routine fixes the problem
+ * by just splicing the offending vertex into the other edge.
+ * This is a guaranteed solution, no matter how degenerate things get.
+ * Basically this is a combinatorial solution to a numerical problem.
+ */ {
+ ActiveRegion regLo = RegionBelow(regUp);
+ GLUhalfEdge eUp = regUp.eUp;
+ GLUhalfEdge eLo = regLo.eUp;
+
+ if (Geom.VertLeq(eUp.Org, eLo.Org)) {
+ if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
+
+ /* eUp.Org appears to be below eLo */
+ if (!Geom.VertEq(eUp.Org, eLo.Org)) {
+ /* Splice eUp.Org into eLo */
+ if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eUp, eLo.Sym.Lnext)) throw new RuntimeException();
+ regUp.dirty = regLo.dirty = true;
+
+ } else if (eUp.Org != eLo.Org) {
+ /* merge the two vertices, discarding eUp.Org */
+ tess.pq.pqDelete(eUp.Org.pqHandle); /* __gl_pqSortDelete */
+ SpliceMergeVertices(tess, eLo.Sym.Lnext, eUp);
+ }
+ } else {
+ if (Geom.EdgeSign(eUp.Sym.Org, eLo.Org, eUp.Org) < 0) return false;
+
+ /* eLo.Org appears to be above eUp, so splice eLo.Org into eUp */
+ RegionAbove(regUp).dirty = regUp.dirty = true;
+ if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
+ }
+ return true;
+ }
+
+ static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * Check the upper and lower edge of "regUp", to make sure that the
+ * eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
+ * destination is rightmost).
+ *
+ * Theoretically, this should always be true. However, splitting an edge
+ * into two pieces can change the results of previous tests. For example,
+ * suppose at one point we checked eUp and eLo, and decided that eUp.Sym.Org
+ * is barely above eLo. Then later, we split eLo into two edges (eg. from
+ * a splice operation like this one). This can change the result of
+ * the test so that now eUp.Sym.Org is incident to eLo, or barely below it.
+ * We must correct this condition to maintain the dictionary invariants
+ * (otherwise new edges might get inserted in the wrong place in the
+ * dictionary, and bad stuff will happen).
+ *
+ * We fix the problem by just splicing the offending vertex into the
+ * other edge.
+ */ {
+ ActiveRegion regLo = RegionBelow(regUp);
+ GLUhalfEdge eUp = regUp.eUp;
+ GLUhalfEdge eLo = regLo.eUp;
+ GLUhalfEdge e;
+
+ assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
+
+ if (Geom.VertLeq(eUp.Sym.Org, eLo.Sym.Org)) {
+ if (Geom.EdgeSign(eUp.Sym.Org, eLo.Sym.Org, eUp.Org) < 0) return false;
+
+ /* eLo.Sym.Org is above eUp, so splice eLo.Sym.Org into eUp */
+ RegionAbove(regUp).dirty = regUp.dirty = true;
+ e = Mesh.__gl_meshSplitEdge(eUp);
+ if (e == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eLo.Sym, e)) throw new RuntimeException();
+ e.Lface.inside = regUp.inside;
+ } else {
+ if (Geom.EdgeSign(eLo.Sym.Org, eUp.Sym.Org, eLo.Org) > 0) return false;
+
+ /* eUp.Sym.Org is below eLo, so splice eUp.Sym.Org into eLo */
+ regUp.dirty = regLo.dirty = true;
+ e = Mesh.__gl_meshSplitEdge(eLo);
+ if (e == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym)) throw new RuntimeException();
+ e.Sym.Lface.inside = regUp.inside;
+ }
+ return true;
+ }
+
+
+ static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * Check the upper and lower edges of the given region to see if
+ * they intersect. If so, create the intersection and add it
+ * to the data structures.
+ *
+ * Returns true if adding the new intersection resulted in a recursive
+ * call to AddRightEdges(); in this case all "dirty" regions have been
+ * checked for intersections, and possibly regUp has been deleted.
+ */ {
+ ActiveRegion regLo = RegionBelow(regUp);
+ GLUhalfEdge eUp = regUp.eUp;
+ GLUhalfEdge eLo = regLo.eUp;
+ GLUvertex orgUp = eUp.Org;
+ GLUvertex orgLo = eLo.Org;
+ GLUvertex dstUp = eUp.Sym.Org;
+ GLUvertex dstLo = eLo.Sym.Org;
+ double tMinUp, tMaxLo;
+ GLUvertex isect = new GLUvertex();
+ GLUvertex orgMin;
+ GLUhalfEdge e;
+
+ assert (!Geom.VertEq(dstLo, dstUp));
+ assert (Geom.EdgeSign(dstUp, tess.event, orgUp) <= 0);
+ assert (Geom.EdgeSign(dstLo, tess.event, orgLo) >= 0);
+ assert (orgUp != tess.event && orgLo != tess.event);
+ assert (!regUp.fixUpperEdge && !regLo.fixUpperEdge);
+
+ if (orgUp == orgLo) return false; /* right endpoints are the same */
+
+ tMinUp = Math.min(orgUp.t, dstUp.t);
+ tMaxLo = Math.max(orgLo.t, dstLo.t);
+ if (tMinUp > tMaxLo) return false; /* t ranges do not overlap */
+
+ if (Geom.VertLeq(orgUp, orgLo)) {
+ if (Geom.EdgeSign(dstLo, orgUp, orgLo) > 0) return false;
+ } else {
+ if (Geom.EdgeSign(dstUp, orgLo, orgUp) < 0) return false;
+ }
+
+ /* At this point the edges intersect, at least marginally */
+ DebugEvent(tess);
+
+ Geom.EdgeIntersect(dstUp, orgUp, dstLo, orgLo, isect);
+ /* The following properties are guaranteed: */
+ assert (Math.min(orgUp.t, dstUp.t) <= isect.t);
+ assert (isect.t <= Math.max(orgLo.t, dstLo.t));
+ assert (Math.min(dstLo.s, dstUp.s) <= isect.s);
+ assert (isect.s <= Math.max(orgLo.s, orgUp.s));
+
+ if (Geom.VertLeq(isect, tess.event)) {
+ /* The intersection point lies slightly to the left of the sweep line,
+ * so move it until it''s slightly to the right of the sweep line.
+ * (If we had perfect numerical precision, this would never happen
+ * in the first place). The easiest and safest thing to do is
+ * replace the intersection by tess.event.
+ */
+ isect.s = tess.event.s;
+ isect.t = tess.event.t;
+ }
+ /* Similarly, if the computed intersection lies to the right of the
+ * rightmost origin (which should rarely happen), it can cause
+ * unbelievable inefficiency on sufficiently degenerate inputs.
+ * (If you have the test program, try running test54.d with the
+ * "X zoom" option turned on).
+ */
+ orgMin = Geom.VertLeq(orgUp, orgLo) ? orgUp : orgLo;
+ if (Geom.VertLeq(orgMin, isect)) {
+ isect.s = orgMin.s;
+ isect.t = orgMin.t;
+ }
+
+ if (Geom.VertEq(isect, orgUp) || Geom.VertEq(isect, orgLo)) {
+ /* Easy case -- intersection at one of the right endpoints */
+ CheckForRightSplice(tess, regUp);
+ return false;
+ }
+
+ if ((!Geom.VertEq(dstUp, tess.event)
+ && Geom.EdgeSign(dstUp, tess.event, isect) >= 0)
+ || (!Geom.VertEq(dstLo, tess.event)
+ && Geom.EdgeSign(dstLo, tess.event, isect) <= 0)) {
+ /* Very unusual -- the new upper or lower edge would pass on the
+ * wrong side of the sweep event, or through it. This can happen
+ * due to very small numerical errors in the intersection calculation.
+ */
+ if (dstLo == tess.event) {
+ /* Splice dstLo into eUp, and process the new region(s) */
+ if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eLo.Sym, eUp)) throw new RuntimeException();
+ regUp = TopLeftRegion(regUp);
+ if (regUp == null) throw new RuntimeException();
+ eUp = RegionBelow(regUp).eUp;
+ FinishLeftRegions(tess, RegionBelow(regUp), regLo);
+ AddRightEdges(tess, regUp, eUp.Sym.Lnext, eUp, eUp, true);
+ return true;
+ }
+ if (dstUp == tess.event) {
+ /* Splice dstUp into eLo, and process the new region(s) */
+ if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eUp.Lnext, eLo.Sym.Lnext)) throw new RuntimeException();
+ regLo = regUp;
+ regUp = TopRightRegion(regUp);
+ e = RegionBelow(regUp).eUp.Sym.Onext;
+ regLo.eUp = eLo.Sym.Lnext;
+ eLo = FinishLeftRegions(tess, regLo, null);
+ AddRightEdges(tess, regUp, eLo.Onext, eUp.Sym.Onext, e, true);
+ return true;
+ }
+ /* Special case: called from ConnectRightVertex. If either
+ * edge passes on the wrong side of tess.event, split it
+ * (and wait for ConnectRightVertex to splice it appropriately).
+ */
+ if (Geom.EdgeSign(dstUp, tess.event, isect) >= 0) {
+ RegionAbove(regUp).dirty = regUp.dirty = true;
+ if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+ eUp.Org.s = tess.event.s;
+ eUp.Org.t = tess.event.t;
+ }
+ if (Geom.EdgeSign(dstLo, tess.event, isect) <= 0) {
+ regUp.dirty = regLo.dirty = true;
+ if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+ eLo.Org.s = tess.event.s;
+ eLo.Org.t = tess.event.t;
+ }
+ /* leave the rest for ConnectRightVertex */
+ return false;
+ }
+
+ /* General case -- split both edges, splice into new vertex.
+ * When we do the splice operation, the order of the arguments is
+ * arbitrary as far as correctness goes. However, when the operation
+ * creates a new face, the work done is proportional to the size of
+ * the new face. We expect the faces in the processed part of
+ * the mesh (ie. eUp.Lface) to be smaller than the faces in the
+ * unprocessed original contours (which will be eLo.Sym.Lnext.Lface).
+ */
+ if (Mesh.__gl_meshSplitEdge(eUp.Sym) == null) throw new RuntimeException();
+ if (Mesh.__gl_meshSplitEdge(eLo.Sym) == null) throw new RuntimeException();
+ if (!Mesh.__gl_meshSplice(eLo.Sym.Lnext, eUp)) throw new RuntimeException();
+ eUp.Org.s = isect.s;
+ eUp.Org.t = isect.t;
+ eUp.Org.pqHandle = tess.pq.pqInsert(eUp.Org); /* __gl_pqSortInsert */
+ if (eUp.Org.pqHandle == Long.MAX_VALUE) {
+ tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
+ tess.pq = null;
+ throw new RuntimeException();
+ }
+ GetIntersectData(tess, eUp.Org, orgUp, dstUp, orgLo, dstLo);
+ RegionAbove(regUp).dirty = regUp.dirty = regLo.dirty = true;
+ return false;
+ }
+
+ static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
+/*
+ * When the upper or lower edge of any region changes, the region is
+ * marked "dirty". This routine walks through all the dirty regions
+ * and makes sure that the dictionary invariants are satisfied
+ * (see the comments at the beginning of this file). Of course
+ * new dirty regions can be created as we make changes to restore
+ * the invariants.
+ */ {
+ ActiveRegion regLo = RegionBelow(regUp);
+ GLUhalfEdge eUp, eLo;
+
+ for (; ;) {
+ /* Find the lowest dirty region (we walk from the bottom up). */
+ while (regLo.dirty) {
+ regUp = regLo;
+ regLo = RegionBelow(regLo);
+ }
+ if (!regUp.dirty) {
+ regLo = regUp;
+ regUp = RegionAbove(regUp);
+ if (regUp == null || !regUp.dirty) {
+ /* We've walked all the dirty regions */
+ return;
+ }
+ }
+ regUp.dirty = false;
+ eUp = regUp.eUp;
+ eLo = regLo.eUp;
+
+ if (eUp.Sym.Org != eLo.Sym.Org) {
+ /* Check that the edge ordering is obeyed at the Dst vertices. */
+ if (CheckForLeftSplice(tess, regUp)) {
+
+ /* If the upper or lower edge was marked fixUpperEdge, then
+ * we no longer need it (since these edges are needed only for
+ * vertices which otherwise have no right-going edges).
+ */
+ if (regLo.fixUpperEdge) {
+ DeleteRegion(tess, regLo);
+ if (!Mesh.__gl_meshDelete(eLo)) throw new RuntimeException();
+ regLo = RegionBelow(regUp);
+ eLo = regLo.eUp;
+ } else if (regUp.fixUpperEdge) {
+ DeleteRegion(tess, regUp);
+ if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
+ regUp = RegionAbove(regLo);
+ eUp = regUp.eUp;
+ }
+ }
+ }
+ if (eUp.Org != eLo.Org) {
+ if (eUp.Sym.Org != eLo.Sym.Org
+ && !regUp.fixUpperEdge && !regLo.fixUpperEdge
+ && (eUp.Sym.Org == tess.event || eLo.Sym.Org == tess.event)) {
+ /* When all else fails in CheckForIntersect(), it uses tess.event
+ * as the intersection location. To make this possible, it requires
+ * that tess.event lie between the upper and lower edges, and also
+ * that neither of these is marked fixUpperEdge (since in the worst
+ * case it might splice one of these edges into tess.event, and
+ * violate the invariant that fixable edges are the only right-going
+ * edge from their associated vertex).
+ */
+ if (CheckForIntersect(tess, regUp)) {
+ /* WalkDirtyRegions() was called recursively; we're done */
+ return;
+ }
+ } else {
+ /* Even though we can't use CheckForIntersect(), the Org vertices
+ * may violate the dictionary edge ordering. Check and correct this.
+ */
+ CheckForRightSplice(tess, regUp);
+ }
+ }
+ if (eUp.Org == eLo.Org && eUp.Sym.Org == eLo.Sym.Org) {
+ /* A degenerate loop consisting of only two edges -- delete it. */
+ AddWinding(eLo, eUp);
+ DeleteRegion(tess, regUp);
+ if (!Mesh.__gl_meshDelete(eUp)) throw new RuntimeException();
+ regUp = RegionAbove(regLo);
+ }
+ }
+ }
+
+
+ static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
+ GLUhalfEdge eBottomLeft)
+/*
+ * Purpose: connect a "right" vertex vEvent (one where all edges go left)
+ * to the unprocessed portion of the mesh. Since there are no right-going
+ * edges, two regions (one above vEvent and one below) are being merged
+ * into one. "regUp" is the upper of these two regions.
+ *
+ * There are two reasons for doing this (adding a right-going edge):
+ * - if the two regions being merged are "inside", we must add an edge
+ * to keep them separated (the combined region would not be monotone).
+ * - in any case, we must leave some record of vEvent in the dictionary,
+ * so that we can merge vEvent with features that we have not seen yet.
+ * For example, maybe there is a vertical edge which passes just to
+ * the right of vEvent; we would like to splice vEvent into this edge.
+ *
+ * However, we don't want to connect vEvent to just any vertex. We don''t
+ * want the new edge to cross any other edges; otherwise we will create
+ * intersection vertices even when the input data had no self-intersections.
+ * (This is a bad thing; if the user's input data has no intersections,
+ * we don't want to generate any false intersections ourselves.)
+ *
+ * Our eventual goal is to connect vEvent to the leftmost unprocessed
+ * vertex of the combined region (the union of regUp and regLo).
+ * But because of unseen vertices with all right-going edges, and also
+ * new vertices which may be created by edge intersections, we don''t
+ * know where that leftmost unprocessed vertex is. In the meantime, we
+ * connect vEvent to the closest vertex of either chain, and mark the region
+ * as "fixUpperEdge". This flag says to delete and reconnect this edge
+ * to the next processed vertex on the boundary of the combined region.
+ * Quite possibly the vertex we connected to will turn out to be the
+ * closest one, in which case we won''t need to make any changes.
+ */ {
+ GLUhalfEdge eNew;
+ GLUhalfEdge eTopLeft = eBottomLeft.Onext;
+ ActiveRegion regLo = RegionBelow(regUp);
+ GLUhalfEdge eUp = regUp.eUp;
+ GLUhalfEdge eLo = regLo.eUp;
+ boolean degenerate = false;
+
+ if (eUp.Sym.Org != eLo.Sym.Org) {
+ CheckForIntersect(tess, regUp);
+ }
+
+ /* Possible new degeneracies: upper or lower edge of regUp may pass
+ * through vEvent, or may coincide with new intersection vertex
+ */
+ if (Geom.VertEq(eUp.Org, tess.event)) {
+ if (!Mesh.__gl_meshSplice(eTopLeft.Sym.Lnext, eUp)) throw new RuntimeException();
+ regUp = TopLeftRegion(regUp);
+ if (regUp == null) throw new RuntimeException();
+ eTopLeft = RegionBelow(regUp).eUp;
+ FinishLeftRegions(tess, RegionBelow(regUp), regLo);
+ degenerate = true;
+ }
+ if (Geom.VertEq(eLo.Org, tess.event)) {
+ if (!Mesh.__gl_meshSplice(eBottomLeft, eLo.Sym.Lnext)) throw new RuntimeException();
+ eBottomLeft = FinishLeftRegions(tess, regLo, null);
+ degenerate = true;
+ }
+ if (degenerate) {
+ AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
+ return;
+ }
+
+ /* Non-degenerate situation -- need to add a temporary, fixable edge.
+ * Connect to the closer of eLo.Org, eUp.Org.
+ */
+ if (Geom.VertLeq(eLo.Org, eUp.Org)) {
+ eNew = eLo.Sym.Lnext;
+ } else {
+ eNew = eUp;
+ }
+ eNew = Mesh.__gl_meshConnect(eBottomLeft.Onext.Sym, eNew);
+ if (eNew == null) throw new RuntimeException();
+
+ /* Prevent cleanup, otherwise eNew might disappear before we've even
+ * had a chance to mark it as a temporary edge.
+ */
+ AddRightEdges(tess, regUp, eNew, eNew.Onext, eNew.Onext, false);
+ eNew.Sym.activeRegion.fixUpperEdge = true;
+ WalkDirtyRegions(tess, regUp);
+ }
+
+/* Because vertices at exactly the same location are merged together
+ * before we process the sweep event, some degenerate cases can't occur.
+ * However if someone eventually makes the modifications required to
+ * merge features which are close together, the cases below marked
+ * TOLERANCE_NONZERO will be useful. They were debugged before the
+ * code to merge identical vertices in the main loop was added.
+ */
+ private static final boolean TOLERANCE_NONZERO = false;
+
+ static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
+ ActiveRegion regUp, GLUvertex vEvent)
+/*
+ * The event vertex lies exacty on an already-processed edge or vertex.
+ * Adding the new vertex involves splicing it into the already-processed
+ * part of the mesh.
+ */ {
+ GLUhalfEdge e, eTopLeft, eTopRight, eLast;
+ ActiveRegion reg;
+
+ e = regUp.eUp;
+ if (Geom.VertEq(e.Org, vEvent)) {
+ /* e.Org is an unprocessed vertex - just combine them, and wait
+ * for e.Org to be pulled from the queue
+ */
+ assert (TOLERANCE_NONZERO);
+ SpliceMergeVertices(tess, e, vEvent.anEdge);
+ return;
+ }
+
+ if (!Geom.VertEq(e.Sym.Org, vEvent)) {
+ /* General case -- splice vEvent into edge e which passes through it */
+ if (Mesh.__gl_meshSplitEdge(e.Sym) == null) throw new RuntimeException();
+ if (regUp.fixUpperEdge) {
+ /* This edge was fixable -- delete unused portion of original edge */
+ if (!Mesh.__gl_meshDelete(e.Onext)) throw new RuntimeException();
+ regUp.fixUpperEdge = false;
+ }
+ if (!Mesh.__gl_meshSplice(vEvent.anEdge, e)) throw new RuntimeException();
+ SweepEvent(tess, vEvent); /* recurse */
+ return;
+ }
+
+ /* vEvent coincides with e.Sym.Org, which has already been processed.
+ * Splice in the additional right-going edges.
+ */
+ assert (TOLERANCE_NONZERO);
+ regUp = TopRightRegion(regUp);
+ reg = RegionBelow(regUp);
+ eTopRight = reg.eUp.Sym;
+ eTopLeft = eLast = eTopRight.Onext;
+ if (reg.fixUpperEdge) {
+ /* Here e.Sym.Org has only a single fixable edge going right.
+ * We can delete it since now we have some real right-going edges.
+ */
+ assert (eTopLeft != eTopRight); /* there are some left edges too */
+ DeleteRegion(tess, reg);
+ if (!Mesh.__gl_meshDelete(eTopRight)) throw new RuntimeException();
+ eTopRight = eTopLeft.Sym.Lnext;
+ }
+ if (!Mesh.__gl_meshSplice(vEvent.anEdge, eTopRight)) throw new RuntimeException();
+ if (!Geom.EdgeGoesLeft(eTopLeft)) {
+ /* e.Sym.Org had no left-going edges -- indicate this to AddRightEdges() */
+ eTopLeft = null;
+ }
+ AddRightEdges(tess, regUp, eTopRight.Onext, eLast, eTopLeft, true);
+ }
+
+
+ static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
+/*
+ * Purpose: connect a "left" vertex (one where both edges go right)
+ * to the processed portion of the mesh. Let R be the active region
+ * containing vEvent, and let U and L be the upper and lower edge
+ * chains of R. There are two possibilities:
+ *
+ * - the normal case: split R into two regions, by connecting vEvent to
+ * the rightmost vertex of U or L lying to the left of the sweep line
+ *
+ * - the degenerate case: if vEvent is close enough to U or L, we
+ * merge vEvent into that edge chain. The subcases are:
+ * - merging with the rightmost vertex of U or L
+ * - merging with the active edge of U or L
+ * - merging with an already-processed portion of U or L
+ */ {
+ ActiveRegion regUp, regLo, reg;
+ GLUhalfEdge eUp, eLo, eNew;
+ ActiveRegion tmp = new ActiveRegion();
+
+ /* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
+
+ /* Get a pointer to the active region containing vEvent */
+ tmp.eUp = vEvent.anEdge.Sym;
+ /* __GL_DICTLISTKEY */ /* __gl_dictListSearch */
+ regUp = (ActiveRegion) Dict.dictKey(Dict.dictSearch(tess.dict, tmp));
+ regLo = RegionBelow(regUp);
+ eUp = regUp.eUp;
+ eLo = regLo.eUp;
+
+ /* Try merging with U or L first */
+ if (Geom.EdgeSign(eUp.Sym.Org, vEvent, eUp.Org) == 0) {
+ ConnectLeftDegenerate(tess, regUp, vEvent);
+ return;
+ }
+
+ /* Connect vEvent to rightmost processed vertex of either chain.
+ * e.Sym.Org is the vertex that we will connect to vEvent.
+ */
+ reg = Geom.VertLeq(eLo.Sym.Org, eUp.Sym.Org) ? regUp : regLo;
+
+ if (regUp.inside || reg.fixUpperEdge) {
+ if (reg == regUp) {
+ eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
+ if (eNew == null) throw new RuntimeException();
+ } else {
+ GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
+ if (tempHalfEdge == null) throw new RuntimeException();
+
+ eNew = tempHalfEdge.Sym;
+ }
+ if (reg.fixUpperEdge) {
+ if (!FixUpperEdge(reg, eNew)) throw new RuntimeException();
+ } else {
+ ComputeWinding(tess, AddRegionBelow(tess, regUp, eNew));
+ }
+ SweepEvent(tess, vEvent);
+ } else {
+ /* The new vertex is in a region which does not belong to the polygon.
+ * We don''t need to connect this vertex to the rest of the mesh.
+ */
+ AddRightEdges(tess, regUp, vEvent.anEdge, vEvent.anEdge, null, true);
+ }
+ }
+
+
+ static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
+/*
+ * Does everything necessary when the sweep line crosses a vertex.
+ * Updates the mesh and the edge dictionary.
+ */ {
+ ActiveRegion regUp, reg;
+ GLUhalfEdge e, eTopLeft, eBottomLeft;
+
+ tess.event = vEvent; /* for access in EdgeLeq() */
+ DebugEvent(tess);
+
+ /* Check if this vertex is the right endpoint of an edge that is
+ * already in the dictionary. In this case we don't need to waste
+ * time searching for the location to insert new edges.
+ */
+ e = vEvent.anEdge;
+ while (e.activeRegion == null) {
+ e = e.Onext;
+ if (e == vEvent.anEdge) {
+ /* All edges go right -- not incident to any processed edges */
+ ConnectLeftVertex(tess, vEvent);
+ return;
+ }
+ }
+
+ /* Processing consists of two phases: first we "finish" all the
+ * active regions where both the upper and lower edges terminate
+ * at vEvent (ie. vEvent is closing off these regions).
+ * We mark these faces "inside" or "outside" the polygon according
+ * to their winding number, and delete the edges from the dictionary.
+ * This takes care of all the left-going edges from vEvent.
+ */
+ regUp = TopLeftRegion(e.activeRegion);
+ if (regUp == null) throw new RuntimeException();
+ reg = RegionBelow(regUp);
+ eTopLeft = reg.eUp;
+ eBottomLeft = FinishLeftRegions(tess, reg, null);
+
+ /* Next we process all the right-going edges from vEvent. This
+ * involves adding the edges to the dictionary, and creating the
+ * associated "active regions" which record information about the
+ * regions between adjacent dictionary edges.
+ */
+ if (eBottomLeft.Onext == eTopLeft) {
+ /* No right-going edges -- add a temporary "fixable" edge */
+ ConnectRightVertex(tess, regUp, eBottomLeft);
+ } else {
+ AddRightEdges(tess, regUp, eBottomLeft.Onext, eTopLeft, eTopLeft, true);
+ }
+ }
+
+
+/* Make the sentinel coordinates big enough that they will never be
+ * merged with real input features. (Even with the largest possible
+ * input contour and the maximum tolerance of 1.0, no merging will be
+ * done with coordinates larger than 3 * GLU_TESS_MAX_COORD).
+ */
+ private static final double SENTINEL_COORD = (4.0 * GLU.GLU_TESS_MAX_COORD);
+
+ static void AddSentinel(GLUtessellatorImpl tess, double t)
+/*
+ * We add two sentinel edges above and below all other edges,
+ * to avoid special cases at the top and bottom.
+ */ {
+ GLUhalfEdge e;
+ ActiveRegion reg = new ActiveRegion();
+ if (reg == null) throw new RuntimeException();
+
+ e = Mesh.__gl_meshMakeEdge(tess.mesh);
+ if (e == null) throw new RuntimeException();
+
+ e.Org.s = SENTINEL_COORD;
+ e.Org.t = t;
+ e.Sym.Org.s = -SENTINEL_COORD;
+ e.Sym.Org.t = t;
+ tess.event = e.Sym.Org; /* initialize it */
+
+ reg.eUp = e;
+ reg.windingNumber = 0;
+ reg.inside = false;
+ reg.fixUpperEdge = false;
+ reg.sentinel = true;
+ reg.dirty = false;
+ reg.nodeUp = Dict.dictInsert(tess.dict, reg); /* __gl_dictListInsertBefore */
+ if (reg.nodeUp == null) throw new RuntimeException();
+ }
+
+
+ static void InitEdgeDict(final GLUtessellatorImpl tess)
+/*
+ * We maintain an ordering of edge intersections with the sweep line.
+ * This order is maintained in a dynamic dictionary.
+ */ {
+ /* __gl_dictListNewDict */
+ tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
+ public boolean leq(Object frame, Object key1, Object key2) {
+ return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
+ }
+ });
+ if (tess.dict == null) throw new RuntimeException();
+
+ AddSentinel(tess, -SENTINEL_COORD);
+ AddSentinel(tess, SENTINEL_COORD);
+ }
+
+
+ static void DoneEdgeDict(GLUtessellatorImpl tess) {
+ ActiveRegion reg;
+ int fixedEdges = 0;
+
+ /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
+ while ((reg = (ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))) != null) {
+ /*
+ * At the end of all processing, the dictionary should contain
+ * only the two sentinel edges, plus at most one "fixable" edge
+ * created by ConnectRightVertex().
+ */
+ if (!reg.sentinel) {
+ assert (reg.fixUpperEdge);
+ assert (++fixedEdges == 1);
+ }
+ assert (reg.windingNumber == 0);
+ DeleteRegion(tess, reg);
+/* __gl_meshDelete( reg.eUp );*/
+ }
+ Dict.dictDeleteDict(tess.dict); /* __gl_dictListDeleteDict */
+ }
+
+
+ static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
+/*
+ * Remove zero-length edges, and contours with fewer than 3 vertices.
+ */ {
+ GLUhalfEdge e, eNext, eLnext;
+ GLUhalfEdge eHead = tess.mesh.eHead;
+
+ /*LINTED*/
+ for (e = eHead.next; e != eHead; e = eNext) {
+ eNext = e.next;
+ eLnext = e.Lnext;
+
+ if (Geom.VertEq(e.Org, e.Sym.Org) && e.Lnext.Lnext != e) {
+ /* Zero-length edge, contour has at least 3 edges */
+
+ SpliceMergeVertices(tess, eLnext, e); /* deletes e.Org */
+ if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException(); /* e is a self-loop */
+ e = eLnext;
+ eLnext = e.Lnext;
+ }
+ if (eLnext.Lnext == e) {
+ /* Degenerate contour (one or two edges) */
+
+ if (eLnext != e) {
+ if (eLnext == eNext || eLnext == eNext.Sym) {
+ eNext = eNext.next;
+ }
+ if (!Mesh.__gl_meshDelete(eLnext)) throw new RuntimeException();
+ }
+ if (e == eNext || e == eNext.Sym) {
+ eNext = eNext.next;
+ }
+ if (!Mesh.__gl_meshDelete(e)) throw new RuntimeException();
+ }
+ }
+ }
+
+ static boolean InitPriorityQ(GLUtessellatorImpl tess)
+/*
+ * Insert all vertices into the priority queue which determines the
+ * order in which vertices cross the sweep line.
+ */ {
+ PriorityQ pq;
+ GLUvertex v, vHead;
+
+ /* __gl_pqSortNewPriorityQ */
+ pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
+ public boolean leq(Object key1, Object key2) {
+ return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
+ }
+ });
+ if (pq == null) return false;
+
+ vHead = tess.mesh.vHead;
+ for (v = vHead.next; v != vHead; v = v.next) {
+ v.pqHandle = pq.pqInsert(v); /* __gl_pqSortInsert */
+ if (v.pqHandle == Long.MAX_VALUE) break;
+ }
+ if (v != vHead || !pq.pqInit()) { /* __gl_pqSortInit */
+ tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
+ tess.pq = null;
+ return false;
+ }
+
+ return true;
+ }
+
+
+ static void DonePriorityQ(GLUtessellatorImpl tess) {
+ tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
+ }
+
+
+ static boolean RemoveDegenerateFaces(GLUmesh mesh)
+/*
+ * Delete any degenerate faces with only two edges. WalkDirtyRegions()
+ * will catch almost all of these, but it won't catch degenerate faces
+ * produced by splice operations on already-processed edges.
+ * The two places this can happen are in FinishLeftRegions(), when
+ * we splice in a "temporary" edge produced by ConnectRightVertex(),
+ * and in CheckForLeftSplice(), where we splice already-processed
+ * edges to ensure that our dictionary invariants are not violated
+ * by numerical errors.
+ *
+ * In both these cases it is *very* dangerous to delete the offending
+ * edge at the time, since one of the routines further up the stack
+ * will sometimes be keeping a pointer to that edge.
+ */ {
+ GLUface f, fNext;
+ GLUhalfEdge e;
+
+ /*LINTED*/
+ for (f = mesh.fHead.next; f != mesh.fHead; f = fNext) {
+ fNext = f.next;
+ e = f.anEdge;
+ assert (e.Lnext != e);
+
+ if (e.Lnext.Lnext == e) {
+ /* A face with only two edges */
+ AddWinding(e.Onext, e);
+ if (!Mesh.__gl_meshDelete(e)) return false;
+ }
+ }
+ return true;
+ }
+
+ public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
+/*
+ * __gl_computeInterior( tess ) computes the planar arrangement specified
+ * by the given contours, and further subdivides this arrangement
+ * into regions. Each region is marked "inside" if it belongs
+ * to the polygon, according to the rule given by tess.windingRule.
+ * Each interior region is guaranteed be monotone.
+ */ {
+ GLUvertex v, vNext;
+
+ tess.fatalError = false;
+
+ /* Each vertex defines an event for our sweep line. Start by inserting
+ * all the vertices in a priority queue. Events are processed in
+ * lexicographic order, ie.
+ *
+ * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
+ */
+ RemoveDegenerateEdges(tess);
+ if (!InitPriorityQ(tess)) return false; /* if error */
+ InitEdgeDict(tess);
+
+ /* __gl_pqSortExtractMin */
+ while ((v = (GLUvertex) tess.pq.pqExtractMin()) != null) {
+ for (; ;) {
+ vNext = (GLUvertex) tess.pq.pqMinimum(); /* __gl_pqSortMinimum */
+ if (vNext == null || !Geom.VertEq(vNext, v)) break;
+
+ /* Merge together all vertices at exactly the same location.
+ * This is more efficient than processing them one at a time,
+ * simplifies the code (see ConnectLeftDegenerate), and is also
+ * important for correct handling of certain degenerate cases.
+ * For example, suppose there are two identical edges A and B
+ * that belong to different contours (so without this code they would
+ * be processed by separate sweep events). Suppose another edge C
+ * crosses A and B from above. When A is processed, we split it
+ * at its intersection point with C. However this also splits C,
+ * so when we insert B we may compute a slightly different
+ * intersection point. This might leave two edges with a small
+ * gap between them. This kind of error is especially obvious
+ * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY).
+ */
+ vNext = (GLUvertex) tess.pq.pqExtractMin(); /* __gl_pqSortExtractMin*/
+ SpliceMergeVertices(tess, v.anEdge, vNext.anEdge);
+ }
+ SweepEvent(tess, v);
+ }
+
+ /* Set tess.event for debugging purposes */
+ /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
+ tess.event = ((ActiveRegion) Dict.dictKey(Dict.dictMin(tess.dict))).eUp.Org;
+ DebugEvent(tess);
+ DoneEdgeDict(tess);
+ DonePriorityQ(tess);
+
+ if (!RemoveDegenerateFaces(tess.mesh)) return false;
+ Mesh.__gl_meshCheckMesh(tess.mesh);
+
+ return true;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java
new file mode 100644
index 000000000..fe0f7946c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessMono.java
@@ -0,0 +1,241 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class TessMono {
+/* __gl_meshTessellateMonoRegion( face ) tessellates a monotone region
+ * (what else would it do??) The region must consist of a single
+ * loop of half-edges (see mesh.h) oriented CCW. "Monotone" in this
+ * case means that any vertical line intersects the interior of the
+ * region in a single interval.
+ *
+ * Tessellation consists of adding interior edges (actually pairs of
+ * half-edges), to split the region into non-overlapping triangles.
+ *
+ * The basic idea is explained in Preparata and Shamos (which I don''t
+ * have handy right now), although their implementation is more
+ * complicated than this one. The are two edge chains, an upper chain
+ * and a lower chain. We process all vertices from both chains in order,
+ * from right to left.
+ *
+ * The algorithm ensures that the following invariant holds after each
+ * vertex is processed: the untessellated region consists of two
+ * chains, where one chain (say the upper) is a single edge, and
+ * the other chain is concave. The left vertex of the single edge
+ * is always to the left of all vertices in the concave chain.
+ *
+ * Each step consists of adding the rightmost unprocessed vertex to one
+ * of the two chains, and forming a fan of triangles from the rightmost
+ * of two chain endpoints. Determining whether we can add each triangle
+ * to the fan is a simple orientation test. By making the fan as large
+ * as possible, we restore the invariant (check it yourself).
+ */
+ static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
+ GLUhalfEdge up, lo;
+
+ /* All edges are oriented CCW around the boundary of the region.
+ * First, find the half-edge whose origin vertex is rightmost.
+ * Since the sweep goes from left to right, face->anEdge should
+ * be close to the edge we want.
+ */
+ up = face.anEdge;
+ assert (up.Lnext != up && up.Lnext.Lnext != up);
+
+ for (; Geom.VertLeq(up.Sym.Org, up.Org); up = up.Onext.Sym)
+ ;
+ for (; Geom.VertLeq(up.Org, up.Sym.Org); up = up.Lnext)
+ ;
+ lo = up.Onext.Sym;
+
+ boolean mustConnect = false; // hack for avoidDegenerateTris
+
+ while (up.Lnext != lo) {
+ if (avoidDegenerateTris && !mustConnect) {
+ // Skip over regions where several vertices are collinear,
+ // to try to avoid producing degenerate (zero-area) triangles
+ //
+ // The "mustConnect" flag is a hack to try to avoid
+ // skipping too large regions and causing incorrect
+ // triangulations. This entire modification is overall
+ // not robust and needs more work
+ if (Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON) {
+ // Lines around lo
+ do {
+ lo = lo.Onext.Sym;
+ mustConnect = true;
+ } while (up.Lnext != lo &&
+ Geom.EdgeCos(lo.Lnext.Org, lo.Org, lo.Lnext.Lnext.Org) <= -Geom.ONE_MINUS_EPSILON);
+ } else if (Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON) {
+ // Lines around up
+ do {
+ up = up.Lnext;
+ mustConnect = true;
+ } while (up.Lnext != lo &&
+ Geom.EdgeCos(up.Onext.Sym.Org, up.Org, up.Onext.Sym.Onext.Sym.Org) <= -Geom.ONE_MINUS_EPSILON);
+ }
+
+ if (up.Lnext == lo)
+ break;
+ }
+
+ if (Geom.VertLeq(up.Sym.Org, lo.Org)) {
+ /* up.Sym.Org is on the left. It is safe to form triangles from lo.Org.
+ * The EdgeGoesLeft test guarantees progress even when some triangles
+ * are CW, given that the upper and lower chains are truly monotone.
+ */
+ while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
+ || Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
+ GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+ mustConnect = false;
+ if (tempHalfEdge == null) return false;
+ lo = tempHalfEdge.Sym;
+ }
+ lo = lo.Onext.Sym;
+ } else {
+ /* lo.Org is on the left. We can make CCW triangles from up.Sym.Org. */
+ while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
+ || Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
+ GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
+ mustConnect = false;
+ if (tempHalfEdge == null) return false;
+ up = tempHalfEdge.Sym;
+ }
+ up = up.Lnext;
+ }
+ }
+
+ /* Now lo.Org == up.Sym.Org == the leftmost vertex. The remaining region
+ * can be tessellated in a fan from this leftmost vertex.
+ */
+ assert (lo.Lnext != up);
+ while (lo.Lnext.Lnext != up) {
+ GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+ if (tempHalfEdge == null) return false;
+ lo = tempHalfEdge.Sym;
+ }
+
+ return true;
+ }
+
+
+/* __gl_meshTessellateInterior( mesh ) tessellates each region of
+ * the mesh which is marked "inside" the polygon. Each such region
+ * must be monotone.
+ */
+ public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
+ GLUface f, next;
+
+ /*LINTED*/
+ for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
+ /* Make sure we don''t try to tessellate the new triangles. */
+ next = f.next;
+ if (f.inside) {
+ if (!__gl_meshTessellateMonoRegion(f, avoidDegenerateTris)) return false;
+ }
+ }
+
+ return true;
+ }
+
+
+/* __gl_meshDiscardExterior( mesh ) zaps (ie. sets to NULL) all faces
+ * which are not marked "inside" the polygon. Since further mesh operations
+ * on NULL faces are not allowed, the main purpose is to clean up the
+ * mesh so that exterior loops are not represented in the data structure.
+ */
+ public static void __gl_meshDiscardExterior(GLUmesh mesh) {
+ GLUface f, next;
+
+ /*LINTED*/
+ for (f = mesh.fHead.next; f != mesh.fHead; f = next) {
+ /* Since f will be destroyed, save its next pointer. */
+ next = f.next;
+ if (!f.inside) {
+ Mesh.__gl_meshZapFace(f);
+ }
+ }
+ }
+
+ private static final int MARKED_FOR_DELETION = 0x7fffffff;
+
+/* __gl_meshSetWindingNumber( mesh, value, keepOnlyBoundary ) resets the
+ * winding numbers on all edges so that regions marked "inside" the
+ * polygon have a winding number of "value", and regions outside
+ * have a winding number of 0.
+ *
+ * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
+ * separate an interior region from an exterior one.
+ */
+ public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
+ GLUhalfEdge e, eNext;
+
+ for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
+ eNext = e.next;
+ if (e.Sym.Lface.inside != e.Lface.inside) {
+
+ /* This is a boundary edge (one side is interior, one is exterior). */
+ e.winding = (e.Lface.inside) ? value : -value;
+ } else {
+
+ /* Both regions are interior, or both are exterior. */
+ if (!keepOnlyBoundary) {
+ e.winding = 0;
+ } else {
+ if (!Mesh.__gl_meshDelete(e)) return false;
+ }
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java
new file mode 100644
index 000000000..9cf192529
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/glu/tessellator/TessState.java
@@ -0,0 +1,59 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package com.sun.opengl.impl.glu.tessellator;
+
+class TessState {
+ public static final int T_DORMANT = 0;
+ public static final int T_IN_POLYGON = 1;
+ public static final int T_IN_CONTOUR = 2;
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
new file mode 100644
index 000000000..b424e9516
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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;
+
+public abstract class MacOSXCGLContext extends GLContextImpl
+{
+ protected MacOSXCGLDrawable drawable;
+ protected long nsContext; // NSOpenGLContext
+ private CGLExt cglExt;
+ // Table that holds the addresses of the native C-language entry points for
+ // CGL extension functions.
+ private CGLExtProcAddressTable cglExtProcAddressTable;
+
+ public MacOSXCGLContext(MacOSXCGLDrawable drawable,
+ GLContext shareWith)
+ {
+ super(drawable.getGLProfile(), shareWith);
+ this.drawable = drawable;
+ }
+
+ public Object getPlatformGLExtensions() {
+ return getCGLExt();
+ }
+
+ public CGLExt getCGLExt() {
+ if (cglExt == null) {
+ cglExt = new CGLExtImpl(this);
+ }
+ return cglExt;
+ }
+
+ public final ProcAddressTable getPlatformExtProcAddressTable() {
+ return getCGLExtProcAddressTable();
+ }
+
+ public final CGLExtProcAddressTable getCGLExtProcAddressTable() {
+ return cglExtProcAddressTable;
+ }
+
+ public GLDrawable getGLDrawable() {
+ return drawable;
+ }
+
+ protected String mapToRealGLFunctionName(String glFunctionName)
+ {
+ return glFunctionName;
+ }
+
+ protected String mapToRealGLExtensionName(String glExtensionName)
+ {
+ return glExtensionName;
+ }
+
+ protected abstract boolean create();
+
+ /**
+ * Creates and initializes an appropriate OpenGl nsContext. Should only be
+ * called by {@link makeCurrentImpl()}.
+ */
+ protected boolean create(boolean pbuffer, boolean floatingPoint) {
+ MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
+ long share = 0;
+ if (other != null) {
+ share = other.getNSContext();
+ if (share == 0) {
+ throw new GLException("GLContextShareSet returned an invalid OpenGL context");
+ }
+ }
+ MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getRequestedCapabilities();
+ GLProfile glProfile = capabilities.getGLProfile();
+ if(glProfile.isGL3()) {
+ throw new GLException("GL3 profile currently not supported on MacOSX, due to the lack of a OpenGL 3.1 implementation");
+ }
+ // FIXME: Shall being moved to MacOSXCGLGraphicsConfiguration !
+ int[] viewNotReady = new int[1];
+ int[] iattribs = new int[128];
+ int[] ivalues = new int[128];
+ int idx = 0;
+ if (pbuffer) {
+ iattribs[idx] = CGL.NSOpenGLPFAPixelBuffer; ivalues[idx] = 1; idx++;
+ }
+ if (floatingPoint) {
+ iattribs[idx] = CGL.kCGLPFAColorFloat; ivalues[idx] = 1; idx++;
+ }
+ iattribs[idx] = CGL.NSOpenGLPFADoubleBuffer; ivalues[idx] = (capabilities.getDoubleBuffered() ? 1 : 0); idx++;
+ iattribs[idx] = CGL.NSOpenGLPFAStereo; ivalues[idx] = (capabilities.getStereo() ? 1 : 0); idx++;
+ iattribs[idx] = CGL.NSOpenGLPFAColorSize; ivalues[idx] = (capabilities.getRedBits() +
+ capabilities.getGreenBits() +
+ capabilities.getBlueBits()); idx++;
+ iattribs[idx] = CGL.NSOpenGLPFAAlphaSize; ivalues[idx] = capabilities.getAlphaBits(); idx++;
+ iattribs[idx] = CGL.NSOpenGLPFADepthSize; ivalues[idx] = capabilities.getDepthBits(); idx++;
+ iattribs[idx] = CGL.NSOpenGLPFAAccumSize; ivalues[idx] = (capabilities.getAccumRedBits() +
+ capabilities.getAccumGreenBits() +
+ capabilities.getAccumBlueBits() +
+ capabilities.getAccumAlphaBits()); idx++;
+ iattribs[idx] = CGL.NSOpenGLPFAStencilSize; ivalues[idx] = capabilities.getStencilBits(); idx++;
+ if (capabilities.getSampleBuffers()) {
+ iattribs[idx] = CGL.NSOpenGLPFASampleBuffers; ivalues[idx] = 1; idx++;
+ iattribs[idx] = CGL.NSOpenGLPFASamples; ivalues[idx] = capabilities.getNumSamples(); idx++;
+ }
+
+ long pixelFormat = CGL.createPixelFormat(iattribs, 0, idx, ivalues, 0);
+ if (pixelFormat == 0) {
+ throw new GLException("Unable to allocate pixel format with requested GLCapabilities");
+ }
+ try {
+ // Try to allocate a context with this
+ nsContext = CGL.createContext(share,
+ drawable.getNativeWindow().getSurfaceHandle(),
+ pixelFormat,
+ viewNotReady, 0);
+ if (nsContext == 0) {
+ if (viewNotReady[0] == 1) {
+ if (DEBUG) {
+ System.err.println("!!! View not ready for " + getClass().getName());
+ }
+ // View not ready at the window system level -- this is OK
+ return false;
+ }
+ throw new GLException("Error creating NSOpenGLContext with requested pixel format");
+ }
+
+ if (!pbuffer && !capabilities.isBackgroundOpaque()) {
+ // Set the context opacity
+ CGL.setContextOpacity(nsContext, 0);
+ }
+
+ // On this platform the pixel format is associated with the
+ // context and not the drawable. However it's a reasonable
+ // approximation to just store the chosen pixel format up in the
+ // NativeWindow's AbstractGraphicsConfiguration,
+ // since the public API doesn't provide for a different GLCapabilities per context.
+ // Note: These restrictions of the platform's API might be considered as a bug anyways.
+ {
+ // Figure out what attributes we really got
+ GLCapabilities caps = new GLCapabilities(glProfile);
+ CGL.queryPixelFormat(pixelFormat, iattribs, 0, idx, ivalues, 0);
+ for (int i = 0; i < idx; i++) {
+ int attr = iattribs[i];
+ switch (attr) {
+ case CGL.kCGLPFAColorFloat:
+ caps.setPbufferFloatingPointBuffers(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFADoubleBuffer:
+ caps.setDoubleBuffered(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFAStereo:
+ caps.setStereo(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFAColorSize:
+ {
+ int bitSize = ivalues[i];
+ if (bitSize == 32)
+ bitSize = 24;
+ bitSize /= 3;
+ caps.setRedBits(bitSize);
+ caps.setGreenBits(bitSize);
+ caps.setBlueBits(bitSize);
+ }
+ break;
+
+ case CGL.NSOpenGLPFAAlphaSize:
+ caps.setAlphaBits(ivalues[i]);
+ break;
+
+ case CGL.NSOpenGLPFADepthSize:
+ caps.setDepthBits(ivalues[i]);
+ break;
+
+ case CGL.NSOpenGLPFAAccumSize:
+ {
+ int bitSize = ivalues[i] / 4;
+ caps.setAccumRedBits(bitSize);
+ caps.setAccumGreenBits(bitSize);
+ caps.setAccumBlueBits(bitSize);
+ caps.setAccumAlphaBits(bitSize);
+ }
+ break;
+
+ case CGL.NSOpenGLPFAStencilSize:
+ caps.setStencilBits(ivalues[i]);
+ break;
+
+ case CGL.NSOpenGLPFASampleBuffers:
+ caps.setSampleBuffers(ivalues[i] != 0);
+ break;
+
+ case CGL.NSOpenGLPFASamples:
+ caps.setNumSamples(ivalues[i]);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ config.setChosenCapabilities(caps);
+ }
+ } finally {
+ CGL.deletePixelFormat(pixelFormat);
+ }
+ if (!CGL.makeCurrentContext(nsContext)) {
+ throw new GLException("Error making nsContext current");
+ }
+ setGLFunctionAvailability(true);
+ GLContextShareSet.contextCreated(this);
+ return true;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
+ if (DEBUG) {
+ System.err.println("drawable not properly initialized");
+ }
+ return CONTEXT_NOT_CURRENT;
+ }
+ boolean created = false;
+ if (nsContext == 0) {
+ if (!create()) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ if (DEBUG) {
+ System.err.println("!!! Created OpenGL context " + toHexString(nsContext) + " for " + getClass().getName());
+ }
+ created = true;
+ }
+
+ if (!CGL.makeCurrentContext(nsContext)) {
+ throw new GLException("Error making nsContext current");
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ if (!CGL.clearCurrentContext(nsContext)) {
+ throw new GLException("Error freeing OpenGL nsContext");
+ }
+ }
+
+ protected void destroyImpl() throws GLException {
+ if (nsContext != 0) {
+ if (!CGL.deleteContext(nsContext)) {
+ throw new GLException("Unable to delete OpenGL context");
+ }
+ if (DEBUG) {
+ System.err.println("!!! Destroyed OpenGL context " + nsContext);
+ }
+ nsContext = 0;
+ GLContextShareSet.contextDestroyed(this);
+ }
+ }
+
+ public boolean isCreated() {
+ return (nsContext != 0);
+ }
+
+ public void copy(GLContext source, int mask) throws GLException {
+ long dst = getNSContext();
+ long src = ((MacOSXCGLContext) source).getNSContext();
+ if (src == 0) {
+ throw new GLException("Source OpenGL context has not been created");
+ }
+ if (dst == 0) {
+ throw new GLException("Destination OpenGL context has not been created");
+ }
+ CGL.copyContext(dst, src, mask);
+ }
+
+ protected void updateGLProcAddressTable() {
+ super.updateGLProcAddressTable();
+ if (DEBUG) {
+ System.err.println("!!! Initializing CGL extension address table");
+ }
+ if (cglExtProcAddressTable == null) {
+ // FIXME: cache ProcAddressTables by capability bits so we can
+ // share them among contexts with the same capabilities
+ cglExtProcAddressTable = new CGLExtProcAddressTable();
+ }
+ resetProcAddressTable(getCGLExtProcAddressTable());
+ }
+
+ public String getPlatformExtensionsString()
+ {
+ return "";
+ }
+
+ public void setSwapInterval(int interval) {
+ if (nsContext == 0) {
+ throw new GLException("OpenGL context not current");
+ }
+ CGL.setSwapInterval(nsContext, interval);
+ }
+
+ public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ // FIXME: apparently the Apple extension doesn't require a custom memory allocator
+ throw new GLException("Not yet implemented");
+ }
+
+ public boolean isFunctionAvailable(String glFunctionName)
+ {
+ return super.isFunctionAvailable(glFunctionName);
+ }
+
+ public boolean isExtensionAvailable(String glExtensionName) {
+ if (glExtensionName.equals("GL_ARB_pbuffer") ||
+ glExtensionName.equals("GL_ARB_pixel_format")) {
+ return true;
+ }
+ return super.isExtensionAvailable(glExtensionName);
+ }
+
+ public int getOffscreenContextPixelDataType() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getOffscreenContextReadBuffer() {
+ throw new GLException("Should not call this");
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ throw new GLException("Should not call this");
+ }
+
+ public void bindPbufferToTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ public void releasePbufferFromTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ // Support for "mode switching" as described in MacOSXCGLDrawable
+ public abstract void setOpenGLMode(int mode);
+ public abstract int getOpenGLMode();
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ public long getNSContext() {
+ return nsContext;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
new file mode 100644
index 000000000..662c2ba78
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.gluegen.runtime.DynamicLookupHelper;
+
+public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
+ // The Java2D/OpenGL pipeline on OS X uses low-level CGLContextObjs
+ // to represent the contexts for e.g. the Java2D back buffer. When
+ // the Java2D/JOGL bridge is active, this means that if we want to
+ // be able to share textures and display lists with the Java2D
+ // contexts, we need to use the CGL APIs rather than the NSOpenGL
+ // APIs on the JOGL side. For example, if we create a pbuffer using
+ // the NSOpenGL APIs and want to share textures and display lists
+ // between it and the Java2D back buffer, there is no way to do so,
+ // because the Java2D context is actually a CGLContextObj and the
+ // NSOpenGLContext's initWithFormat:shareContext: only accepts an
+ // NSOpenGLContext as its second argument. Of course there is no way
+ // to wrap an NSOpenGLContext around an arbitrary CGLContextObj.
+ //
+ // The situation we care most about is allowing a GLPbuffer to share
+ // textures, etc. with a GLJPanel when the Java2D/JOGL bridge is
+ // active; several of the demos rely on this functionality. We aim
+ // to get there by allowing a GLPBuffer to switch its implementation
+ // between using an NSOpenGLPixelBuffer and a CGLPBufferObj. In
+ // order to track whether this has been done we need to have the
+ // notion of a "mode" of both the MacOSXCGLDrawable and the
+ // MacOSXGLContext. Initially the mode is "unspecified", meaning it
+ // leans toward the default (NSOpenGL). If sharing is requested
+ // between either a GLJPanel and a GLPbuffer or a GLCanvas and a
+ // GLPbuffer, the GLPbuffer will be switched into the appropriate
+ // mode: CGL mode for a GLJPanel and NSOpenGL mode for a GLCanvas.
+ // To avoid thrashing we support exactly one such switch during the
+ // lifetime of a given GLPbuffer. This is not a fully general
+ // solution (for example, you can't share textures among a
+ // GLPbuffer, a GLJPanel and a GLCanvas simultaneously) but should
+ // be enough to get things off the ground.
+ public static final int NSOPENGL_MODE = 1;
+ public static final int CGL_MODE = 2;
+
+ public MacOSXCGLDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized) {
+ super(factory, comp, realized);
+ }
+
+ public void setRealized(boolean realized) {
+ super.setRealized(realized);
+
+ if(realized) {
+ 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();
+ }
+ }
+ }
+
+ public DynamicLookupHelper getDynamicLookupHelper() {
+ return (MacOSXCGLDrawableFactory) getFactoryImpl() ;
+ }
+
+ protected static String getThreadName() {
+ return Thread.currentThread().getName();
+ }
+
+ // Support for "mode switching" as per above
+ public abstract void setOpenGLMode(int mode);
+ public abstract int getOpenGLMode();
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
new file mode 100644
index 000000000..d8c2a016d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+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.nativewindow.impl.*;
+import com.sun.gluegen.runtime.DynamicLookupHelper;
+
+public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl implements DynamicLookupHelper {
+ public MacOSXCGLDrawableFactory() {
+ super();
+
+ // Register our GraphicsConfigurationFactory implementations
+ // The act of constructing them causes them to be registered
+ new MacOSXCGLGraphicsConfigurationFactory();
+
+ try {
+ NWReflection.createInstance("com.sun.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory",
+ new Object[] {});
+ } catch (Throwable t) { }
+ }
+
+ public GLDrawable createGLDrawable(NativeWindow target) {
+ if (target == null) {
+ throw new IllegalArgumentException("Null target");
+ }
+ NativeWindowFactory factory = NativeWindowFactory.getFactory(target.getClass());
+ target = NativeWindowFactory.getNativeWindow(target, null);
+ return new MacOSXOnscreenCGLDrawable(this, target);
+ }
+
+ public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ return new MacOSXOffscreenCGLDrawable(this, aScreen, capabilities, chooser, width, height);
+ }
+
+ public boolean canCreateGLPbuffer() {
+ return true;
+ }
+
+ public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
+ final GLCapabilitiesChooser chooser,
+ final int initialWidth,
+ final int initialHeight,
+ final GLContext shareWith) {
+ final List returnList = new ArrayList();
+ final GLDrawableFactory factory = this;
+ Runnable r = new Runnable() {
+ public void run() {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ MacOSXPbufferCGLDrawable pbufferDrawable = new MacOSXPbufferCGLDrawable(factory, aScreen, capabilities, chooser,
+ initialWidth,
+ initialHeight);
+ GLPbufferImpl pbuffer = new GLPbufferImpl(pbufferDrawable, shareWith);
+ returnList.add(pbuffer);
+ }
+ };
+ maybeDoSingleThreadedWorkaround(r);
+ return (GLPbuffer) returnList.get(0);
+ }
+
+ public GLContext createExternalGLContext() {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ return new MacOSXExternalCGLContext(aScreen);
+ }
+
+ public boolean canCreateExternalGLDrawable() {
+ return false;
+ }
+
+ public GLDrawable createExternalGLDrawable() {
+ // FIXME
+ throw new GLException("Not yet implemented");
+ }
+
+ public void loadGLULibrary() {
+ // Nothing to do; already loaded by native code; not much point in
+ // making it lazier on this platform
+ }
+
+ public long dynamicLookupFunction(String glFuncName) {
+ return CGL.getProcAddress(glFuncName);
+ }
+
+ private void maybeDoSingleThreadedWorkaround(Runnable action) {
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ Threading.invokeOnOpenGLThread(action);
+ } else {
+ action.run();
+ }
+ }
+
+ public boolean canCreateContextOnJava2DSurface() {
+ return false;
+ }
+
+ public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+ throws GLException {
+ throw new GLException("not supported in non AWT enviroment");
+ }
+
+ //------------------------------------------------------
+ // Gamma-related functionality
+ //
+
+ private static final int GAMMA_RAMP_LENGTH = 256;
+
+ /** Returns the length of the computed gamma ramp for this OS and
+ hardware. Returns 0 if gamma changes are not supported. */
+ protected int getGammaRampLength() {
+ return GAMMA_RAMP_LENGTH;
+ }
+
+ protected boolean setGammaRamp(float[] ramp) {
+ return CGL.setGammaRamp(ramp.length,
+ ramp, 0,
+ ramp, 0,
+ ramp, 0);
+ }
+
+ protected Buffer getGammaRamp() {
+ return null;
+ }
+
+ protected void resetGammaRamp(Buffer originalGammaRamp) {
+ CGL.resetGammaRamp();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
new file mode 100644
index 000000000..b5d2fc38e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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 {
+ public MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen, GLCapabilities capsChosen, GLCapabilities capsRequested) {
+ super(screen, capsChosen, capsRequested);
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ protected void setChosenCapabilities(GLCapabilities caps) {
+ super.setChosenCapabilities(caps);
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..f59268b5e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.macosx.*;
+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 OSX platforms. Toolkits will likely need to delegate
+ to this one to change the accepted and returned types of the
+ GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class MacOSXCGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration");
+
+ public MacOSXCGLGraphicsConfigurationFactory() {
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.macosx.MacOSXGraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ return chooseGraphicsConfigurationStatic(capabilities, chooser, absScreen, false);
+ }
+
+ protected static MacOSXCGLGraphicsConfiguration chooseGraphicsConfigurationStatic(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen, boolean usePBuffer) {
+ if (absScreen == null) {
+ throw new IllegalArgumentException("AbstractGraphicsScreen is null");
+ }
+
+ if (capabilities != null &&
+ !(capabilities instanceof GLCapabilities)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ if (capabilities == null) {
+ capabilities = new GLCapabilities(null);
+ }
+
+ return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilities)capabilities, (GLCapabilities)capabilities);
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
new file mode 100644
index 000000000..7283122f4
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXExternalCGLContext.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+
+public class MacOSXExternalCGLContext extends MacOSXCGLContext {
+ private boolean firstMakeCurrent = true;
+ private boolean created = true;
+ private GLContext lastContext;
+
+ public MacOSXExternalCGLContext(AbstractGraphicsScreen absScreen) {
+ super(null, null);
+
+ // FIXME: we don't have a "current context" primitive implemented
+ // yet on OS X. In the current implementation this would need to
+ // return an NSOpenGLContext*, but "external" toolkits are not
+ // guaranteed to be using the Cocoa OpenGL API. Additionally, if
+ // we switched this implementation to use the low-level CGL APIs,
+ // we would lose the ability to share textures and display lists
+ // between contexts since you need an NSOpenGLContext, not a
+ // CGLContextObj, in order to share textures and display lists
+ // between two NSOpenGLContexts.
+ //
+ // The ramifications here are that it is not currently possible to
+ // share textures and display lists between an OpenGL context
+ // created by JOGL and one created by a third-party library on OS
+ // X.
+
+ // context = CGL.CGLGetCurrentContext();
+
+ GLContextShareSet.contextCreated(this);
+ setGLFunctionAvailability(false);
+ }
+
+ protected boolean create() {
+ return true;
+ }
+
+ public int makeCurrent() throws GLException {
+ // Save last context if necessary to allow external GLContexts to
+ // talk to other GLContexts created by this library
+ GLContext cur = getCurrent();
+ if (cur != null && cur != this) {
+ lastContext = cur;
+ setCurrent(null);
+ }
+ return super.makeCurrent();
+ }
+
+ public void release() throws GLException {
+ super.release();
+ setCurrent(lastContext);
+ lastContext = null;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (firstMakeCurrent) {
+ firstMakeCurrent = false;
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ }
+
+ protected void destroyImpl() throws GLException {
+ created = false;
+ GLContextShareSet.contextDestroyed(this);
+ }
+
+ public boolean isCreated() {
+ return created;
+ }
+
+ public void setOpenGLMode(int mode) {
+ if (mode != MacOSXCGLDrawable.NSOPENGL_MODE)
+ throw new GLException("OpenGL mode switching not supported for external GLContexts");
+ }
+
+ public int getOpenGLMode() {
+ return MacOSXCGLDrawable.NSOPENGL_MODE;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java
new file mode 100644
index 000000000..b60c48237
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLContext.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class MacOSXOffscreenCGLContext extends MacOSXPbufferCGLContext
+{
+ public MacOSXOffscreenCGLContext(MacOSXPbufferCGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ }
+
+ 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;
+ }
+
+ public int getOffscreenContextReadBuffer() {
+ return GL.GL_FRONT;
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ return true;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
new file mode 100644
index 000000000..3ff1c0a91
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+
+public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
+
+ public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
+ AbstractGraphicsScreen absScreen,
+ GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ super(factory, absScreen, capabilities, chooser, width, height);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new MacOSXOffscreenCGLContext(this, shareWith);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
new file mode 100644
index 000000000..f87cc150b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import java.util.*;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class MacOSXOnscreenCGLContext extends MacOSXCGLContext {
+ protected MacOSXOnscreenCGLDrawable drawable;
+
+ public MacOSXOnscreenCGLContext(MacOSXOnscreenCGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ this.drawable = drawable;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ int lockRes = drawable.lockSurface();
+ boolean exceptionOccurred = false;
+ try {
+ if (lockRes == NativeWindow.LOCK_SURFACE_NOT_READY) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ int ret = super.makeCurrentImpl();
+ if ((ret == CONTEXT_CURRENT) ||
+ (ret == CONTEXT_CURRENT_NEW)) {
+ // Assume the canvas might have been resized or moved and tell the OpenGL
+ // context to update itself. This used to be done only upon receiving a
+ // reshape event but that doesn't appear to be sufficient. An experiment
+ // was also done to add a HierarchyBoundsListener to the GLCanvas and
+ // do this updating only upon reshape of this component or reshape or movement
+ // of an ancestor, but this also wasn't sufficient and left garbage on the
+ // screen in some situations.
+ CGL.updateContext(nsContext);
+ } else {
+ if (!isOptimizable()) {
+ // This can happen if the window currently is zero-sized, for example.
+ // Make sure we don't leave the surface locked in this case.
+ drawable.unlockSurface();
+ lockRes = NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+ }
+ return ret;
+ } catch (RuntimeException e) {
+ exceptionOccurred = true;
+ throw e;
+ } finally {
+ if (exceptionOccurred ||
+ (isOptimizable() && lockRes != NativeWindow.LOCK_SURFACE_NOT_READY)) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ protected void releaseImpl() throws GLException {
+ try {
+ super.releaseImpl();
+ } finally {
+ if (!isOptimizable() && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ public void swapBuffers() throws GLException {
+ if (!CGL.flushBuffer(nsContext)) {
+ throw new GLException("Error swapping buffers");
+ }
+ }
+
+ protected void update() throws GLException {
+ if (nsContext == 0) {
+ throw new GLException("Context not created");
+ }
+ CGL.updateContext(nsContext);
+ }
+
+ protected boolean create() {
+ return create(false, false);
+ }
+
+ public void setOpenGLMode(int mode) {
+ if (mode != MacOSXCGLDrawable.NSOPENGL_MODE)
+ throw new GLException("OpenGL mode switching not supported for on-screen GLContexts");
+ }
+
+ public int getOpenGLMode() {
+ return MacOSXCGLDrawable.NSOPENGL_MODE;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
new file mode 100644
index 000000000..98687b5ef
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import java.lang.ref.WeakReference;
+import java.security.*;
+import java.util.*;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable {
+ private List/*<WeakReference<GLContext>>*/ createdContexts =
+ new ArrayList();
+
+ protected MacOSXOnscreenCGLDrawable(GLDrawableFactory factory, NativeWindow component) {
+ super(factory, component, false);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ MacOSXOnscreenCGLContext context =
+ new MacOSXOnscreenCGLContext(this, shareWith);
+ // NOTE: we need to keep track of the created contexts in order to
+ // implement swapBuffers() because of how Mac OS X implements its
+ // OpenGL window interface
+ synchronized (this) {
+ List newContexts = new ArrayList();
+ newContexts.addAll(createdContexts);
+ newContexts.add(new WeakReference(context));
+ createdContexts = newContexts;
+ }
+ return context;
+ }
+
+ public int getWidth() {
+ return component.getWidth();
+ }
+
+ public int getHeight() {
+ return component.getHeight();
+ }
+
+ public void swapBuffers() throws GLException {
+ for (Iterator iter = createdContexts.iterator(); iter.hasNext(); ) {
+ WeakReference ref = (WeakReference) iter.next();
+ MacOSXOnscreenCGLContext ctx = (MacOSXOnscreenCGLContext) ref.get();
+ // FIXME: clear out unreachable contexts
+ if (ctx != null) {
+ ctx.swapBuffers();
+ }
+ }
+ }
+
+ public void setOpenGLMode(int mode) {
+ if (mode != NSOPENGL_MODE)
+ throw new GLException("OpenGL mode switching not supported for on-screen GLDrawables");
+ }
+
+ public int getOpenGLMode() {
+ return NSOPENGL_MODE;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
new file mode 100644
index 000000000..4a8712b06
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
@@ -0,0 +1,353 @@
+package com.sun.opengl.impl.macosx.cgl;
+
+import java.security.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+
+public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
+ protected MacOSXPbufferCGLDrawable drawable;
+
+ // State for render-to-texture and render-to-texture-rectangle support
+ private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+ private int texture; // actual texture object
+
+ private static boolean isTigerOrLater;
+
+ static {
+ String osVersion =
+ (String) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty("os.version");
+ }
+ });
+ StringTokenizer tok = new StringTokenizer(osVersion, ". ");
+ int major = Integer.parseInt(tok.nextToken());
+ int minor = Integer.parseInt(tok.nextToken());
+ isTigerOrLater = ((major > 10) || (minor > 3));
+ }
+
+ public MacOSXPbufferCGLContext(MacOSXPbufferCGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ this.drawable = drawable;
+ initOpenGLImpl();
+ }
+
+ public void bindPbufferToTexture() {
+ GL gl = getGL();
+ gl.glBindTexture(textureTarget, texture);
+ // FIXME: not clear whether this is really necessary, but since
+ // the API docs seem to imply it is and since it doesn't seem to
+ // impact performance, leaving it in
+ CGL.setContextTextureImageToPBuffer(nsContext, drawable.getPbuffer(), GL.GL_FRONT);
+ }
+
+ public void releasePbufferFromTexture() {
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (drawable.getPbuffer() == 0) {
+ if (DEBUG) {
+ System.err.println("Pbuffer not instantiated yet for " + this);
+ }
+ // pbuffer not instantiated yet
+ return CONTEXT_NOT_CURRENT;
+ }
+
+ if (getOpenGLMode() != drawable.getOpenGLMode()) {
+ setOpenGLMode(drawable.getOpenGLMode());
+ }
+
+ boolean created = false;
+ if (nsContext == 0) {
+ if (!create()) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ if (DEBUG) {
+ System.err.println("!!! Created OpenGL context " + toHexString(nsContext) + " for " + getClass().getName());
+ }
+ created = true;
+ }
+
+ if (!impl.makeCurrent(nsContext)) {
+ throw new GLException("Error making nsContext current");
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+
+ // 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();
+ if (rect) {
+ if (!gl.isExtensionAvailable("GL_EXT_texture_rectangle")) {
+ System.err.println("MacOSXPbufferCGLContext: WARNING: GL_EXT_texture_rectangle extension not " +
+ "supported; skipping requested render_to_texture_rectangle support for pbuffer");
+ rect = false;
+ }
+ }
+ textureTarget = (rect ? GL2.GL_TEXTURE_RECTANGLE_EXT: GL.GL_TEXTURE_2D);
+ int[] tmp = new int[1];
+ gl.glGenTextures(1, tmp, 0);
+ texture = tmp[0];
+ gl.glBindTexture(textureTarget, texture);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);
+ gl.glCopyTexImage2D(textureTarget, 0, GL.GL_RGB, 0, 0, drawable.getWidth(), drawable.getHeight(), 0);
+
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ if (!impl.release(nsContext)) {
+ throw new GLException("Error releasing OpenGL nsContext");
+ }
+ }
+
+ protected void destroyImpl() throws GLException {
+ if (nsContext != 0) {
+ if (!impl.destroy(nsContext)) {
+ throw new GLException("Unable to delete OpenGL context");
+ }
+ if (DEBUG) {
+ System.err.println("!!! Destroyed OpenGL context " + nsContext);
+ }
+ nsContext = 0;
+ GLContextShareSet.contextDestroyed(this);
+ }
+ }
+
+ public void setSwapInterval(int interval) {
+ if (nsContext == 0) {
+ throw new GLException("OpenGL context not current");
+ }
+ impl.setSwapInterval(nsContext, interval);
+ }
+
+ public int getFloatingPointMode() {
+ return GLPbuffer.APPLE_FLOAT;
+ }
+
+ protected boolean create() {
+ DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities();
+ if (capabilities.getPbufferFloatingPointBuffers() &&
+ !isTigerOrLater) {
+ throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
+ }
+ // Change our OpenGL mode to match that of any share context before we create ourselves
+ MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
+ if (other != null) {
+ setOpenGLMode(other.getOpenGLMode());
+ }
+ // Will throw exception upon error
+ nsContext = impl.create();
+
+ if (!impl.makeCurrent(nsContext)) {
+ throw new GLException("Error making nsContext current");
+ }
+ setGLFunctionAvailability(true);
+
+ return true;
+ }
+
+ //---------------------------------------------------------------------------
+ // OpenGL "mode switching" functionality
+ //
+ private boolean haveSetOpenGLMode = false;
+ // FIXME: should consider switching the default mode based on
+ // whether the Java2D/JOGL bridge is active -- need to ask ourselves
+ // whether it's more likely that we will share with a GLCanvas or a
+ // GLJPanel when the bridge is turned on
+ private int openGLMode = MacOSXCGLDrawable.NSOPENGL_MODE;
+ // Implementation object (either NSOpenGL-based or CGL-based)
+ protected Impl impl;
+
+ public void setOpenGLMode(int mode) {
+ if (mode == openGLMode) {
+ return;
+ }
+ if (haveSetOpenGLMode) {
+ throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once");
+ }
+ destroyImpl();
+ drawable.setOpenGLMode(mode);
+ openGLMode = mode;
+ haveSetOpenGLMode = true;
+ if (DEBUG) {
+ System.err.println("Switching PBuffer context mode to " +
+ ((mode == MacOSXCGLDrawable.NSOPENGL_MODE) ? "NSOPENGL_MODE" : "CGL_MODE"));
+ }
+ initOpenGLImpl();
+ }
+
+ public int getOpenGLMode() {
+ return openGLMode;
+ }
+
+ private void initOpenGLImpl() {
+ switch (openGLMode) {
+ case MacOSXCGLDrawable.NSOPENGL_MODE:
+ impl = new NSOpenGLImpl();
+ break;
+ case MacOSXCGLDrawable.CGL_MODE:
+ impl = new CGLImpl();
+ break;
+ default:
+ throw new InternalError("Illegal implementation mode " + openGLMode);
+ }
+ }
+
+ // Abstract interface for implementation of this context (either
+ // NSOpenGL-based or CGL-based)
+ interface Impl {
+ public long create();
+ public boolean destroy(long ctx);
+ public boolean makeCurrent(long ctx);
+ public boolean release(long ctx);
+ public void setSwapInterval(long ctx, int interval);
+ }
+
+ // NSOpenGLContext-based implementation
+ class NSOpenGLImpl implements Impl {
+ public long create() {
+ DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities();
+ if (capabilities.getPbufferFloatingPointBuffers() &&
+ !isTigerOrLater) {
+ throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
+ }
+ if (!MacOSXPbufferCGLContext.this.create(true, capabilities.getPbufferFloatingPointBuffers())) {
+ throw new GLException("Error creating context for pbuffer");
+ }
+ // Must now associate the pbuffer with our newly-created context
+ CGL.setContextPBuffer(nsContext, drawable.getPbuffer());
+ return nsContext;
+ }
+
+ public boolean destroy(long ctx) {
+ return CGL.deleteContext(ctx);
+ }
+
+ public boolean makeCurrent(long ctx) {
+ return CGL.makeCurrentContext(ctx);
+ }
+
+ public boolean release(long ctx) {
+ return CGL.clearCurrentContext(ctx);
+ }
+
+ public void setSwapInterval(long ctx, int interval) {
+ CGL.setSwapInterval(ctx, interval);
+ }
+ }
+
+ class CGLImpl implements Impl {
+ public long create() {
+ // Find and configure share context
+ MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(MacOSXPbufferCGLContext.this);
+ long share = 0;
+ if (other != null) {
+ // Reconfigure pbuffer-based GLContexts
+ if (other instanceof MacOSXPbufferCGLContext) {
+ MacOSXPbufferCGLContext ctx = (MacOSXPbufferCGLContext) other;
+ ctx.setOpenGLMode(MacOSXCGLDrawable.CGL_MODE);
+ } else {
+ if (other.getOpenGLMode() != MacOSXCGLDrawable.CGL_MODE) {
+ throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
+ }
+ }
+ share = other.getNSContext();
+ // Note we don't check for a 0 return value, since switching
+ // the context's mode causes it to be destroyed and not
+ // re-initialized until the next makeCurrent
+ }
+
+ // Set up pixel format attributes
+ // FIXME: shall go into MacOSXCGLGraphicsConfiguration
+ int[] attrs = new int[256];
+ int i = 0;
+ attrs[i++] = CGL.kCGLPFAPBuffer;
+ DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities();
+ if (capabilities.getPbufferFloatingPointBuffers())
+ attrs[i++] = CGL.kCGLPFAColorFloat;
+ if (capabilities.getDoubleBuffered())
+ attrs[i++] = CGL.kCGLPFADoubleBuffer;
+ if (capabilities.getStereo())
+ attrs[i++] = CGL.kCGLPFAStereo;
+ attrs[i++] = CGL.kCGLPFAColorSize;
+ attrs[i++] = (capabilities.getRedBits() +
+ capabilities.getGreenBits() +
+ capabilities.getBlueBits());
+ attrs[i++] = CGL.kCGLPFAAlphaSize;
+ attrs[i++] = capabilities.getAlphaBits();
+ attrs[i++] = CGL.kCGLPFADepthSize;
+ attrs[i++] = capabilities.getDepthBits();
+ // FIXME: should validate stencil size as is done in MacOSXWindowSystemInterface.m
+ attrs[i++] = CGL.kCGLPFAStencilSize;
+ attrs[i++] = capabilities.getStencilBits();
+ attrs[i++] = CGL.kCGLPFAAccumSize;
+ attrs[i++] = (capabilities.getAccumRedBits() +
+ capabilities.getAccumGreenBits() +
+ capabilities.getAccumBlueBits() +
+ capabilities.getAccumAlphaBits());
+ if (capabilities.getSampleBuffers()) {
+ attrs[i++] = CGL.kCGLPFASampleBuffers;
+ attrs[i++] = 1;
+ attrs[i++] = CGL.kCGLPFASamples;
+ attrs[i++] = capabilities.getNumSamples();
+ }
+
+ // Use attribute array to select pixel format
+ long[] fmt = new long[1];
+ long[] numScreens = new long[1];
+ int res = CGL.CGLChoosePixelFormat(attrs, 0, fmt, 0, numScreens, 0);
+ if (res != CGL.kCGLNoError) {
+ throw new GLException("Error code " + res + " while choosing pixel format");
+ }
+
+ // Create new context
+ long[] ctx = new long[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]);
+ 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);
+ if (res != CGL.kCGLNoError) {
+ throw new GLException("Error code " + res + " while attaching context to pbuffer");
+ }
+ return ctx[0];
+ }
+
+ public boolean destroy(long ctx) {
+ return (CGL.CGLDestroyContext(ctx) == CGL.kCGLNoError);
+ }
+
+ public boolean makeCurrent(long ctx) {
+ return CGL.CGLSetCurrentContext(ctx) == CGL.kCGLNoError;
+ }
+
+ public boolean release(long ctx) {
+ return (CGL.CGLSetCurrentContext(0) == CGL.kCGLNoError);
+ }
+
+ public void setSwapInterval(long ctx, int interval) {
+ // For now not supported (not really relevant for off-screen contexts anyway)
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
new file mode 100644
index 000000000..54101331d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+
+public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
+ private static final boolean DEBUG = Debug.debug("MacOSXPbufferCGLDrawable");
+
+ // State for render-to-texture and render-to-texture-rectangle support
+ private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+ private int texture; // actual texture object
+
+ // NSOpenGLPbuffer (for normal mode)
+ // CGLPbufferObj (for CGL_MODE situation, i.e., when Java2D/JOGL bridge is active)
+ // Note that we can not store this in the NativeWindow because the
+ // semantic is that contains an NSView
+ protected long pBuffer;
+
+ public MacOSXPbufferCGLDrawable(GLDrawableFactory factory,
+ AbstractGraphicsScreen absScreen,
+ GLCapabilities caps,
+ GLCapabilitiesChooser chooser,
+ int width, int height) {
+ super(factory, new NullWindow(MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(caps, chooser, absScreen, true)), true);
+ NullWindow nw = (NullWindow) getNativeWindow();
+ nw.setSize(width, height);
+ initOpenGLImpl();
+ createPbuffer();
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new MacOSXPbufferCGLContext(this, shareWith);
+ }
+
+ public void destroy() {
+ if (this.pBuffer != 0) {
+ impl.destroy(pBuffer);
+ this.pBuffer = 0;
+ if (DEBUG) {
+ System.err.println("Destroyed pbuffer: " + pBuffer);
+ }
+ }
+ }
+
+ public long getPbuffer() {
+ return pBuffer;
+ }
+
+ public void swapBuffers() throws GLException {
+ // FIXME: do we need to do anything if the pbuffer is double-buffered?
+ }
+
+ private void createPbuffer() {
+ NullWindow nw = (NullWindow) getNativeWindow();
+ DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) nw.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities();
+ GLProfile glProfile = capabilities.getGLProfile();
+ int renderTarget;
+ if (glProfile.isGL2() && capabilities.getPbufferRenderToTextureRectangle()) {
+ renderTarget = GL2.GL_TEXTURE_RECTANGLE_EXT;
+ } else {
+ int w = getNextPowerOf2(getWidth());
+ int h = getNextPowerOf2(getHeight());
+ nw.setSize(w, h);
+ renderTarget = GL.GL_TEXTURE_2D;
+ }
+
+ int internalFormat = GL.GL_RGBA;
+ if (capabilities.getPbufferFloatingPointBuffers()) {
+ // FIXME: want to check availability of GL_APPLE_float_pixels
+ // extension, but need valid OpenGL context in order to do so --
+ // in worst case would need to create dummy window / GLCanvas
+ // (undesirable) -- could maybe also do this with pbuffers
+ /*
+ if (!gl.isExtensionAvailable("GL_APPLE_float_pixels")) {
+ throw new GLException("Floating-point support (GL_APPLE_float_pixels) not available");
+ }
+ */
+ if(glProfile.isGL2()) {
+ switch (capabilities.getRedBits()) {
+ case 16: internalFormat = GL2.GL_RGBA_FLOAT16_APPLE; break;
+ case 32: internalFormat = GL2.GL_RGBA_FLOAT32_APPLE; break;
+ default: throw new GLException("Invalid floating-point bit depth (only 16 and 32 supported)");
+ }
+ } else {
+ internalFormat = GL.GL_RGBA;
+ }
+ }
+
+ pBuffer = impl.create(renderTarget, internalFormat, getWidth(), getHeight());
+ if (pBuffer == 0) {
+ throw new GLException("pbuffer creation error: CGL.createPBuffer() failed");
+ }
+
+ if (DEBUG) {
+ System.err.println("Created pbuffer " + nw + " for " + this);
+ }
+ }
+
+ private int getNextPowerOf2(int number) {
+ if (((number-1) & number) == 0) {
+ //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
+ return number;
+ }
+ int power = 0;
+ while (number > 0) {
+ number = number>>1;
+ power++;
+ }
+ return (1<<power);
+ }
+
+ //---------------------------------------------------------------------------
+ // OpenGL "mode switching" functionality
+ //
+ private boolean haveSetOpenGLMode = false;
+ // FIXME: should consider switching the default mode based on
+ // whether the Java2D/JOGL bridge is active -- need to ask ourselves
+ // whether it's more likely that we will share with a GLCanvas or a
+ // GLJPanel when the bridge is turned on
+ private int openGLMode = NSOPENGL_MODE;
+ // Implementation object (either NSOpenGL-based or CGL-based)
+ protected Impl impl;
+
+ public void setOpenGLMode(int mode) {
+ if (mode == openGLMode) {
+ return;
+ }
+ if (haveSetOpenGLMode) {
+ throw new GLException("Can't switch between using NSOpenGLPixelBuffer and CGLPBufferObj more than once");
+ }
+ destroy();
+ openGLMode = mode;
+ haveSetOpenGLMode = true;
+ if (DEBUG) {
+ System.err.println("Switching PBuffer drawable mode to " +
+ ((mode == MacOSXCGLDrawable.NSOPENGL_MODE) ? "NSOPENGL_MODE" : "CGL_MODE"));
+ }
+ initOpenGLImpl();
+ createPbuffer();
+ }
+
+ public int getOpenGLMode() {
+ return openGLMode;
+ }
+
+ private void initOpenGLImpl() {
+ switch (openGLMode) {
+ case NSOPENGL_MODE:
+ impl = new NSOpenGLImpl();
+ break;
+ case CGL_MODE:
+ impl = new CGLImpl();
+ break;
+ default:
+ throw new InternalError("Illegal implementation mode " + openGLMode);
+ }
+ }
+
+ // Abstract interface for implementation of this drawable (either
+ // NSOpenGL-based or CGL-based)
+ interface Impl {
+ public long create(int renderTarget, int internalFormat, int width, int height);
+ public void destroy(long pbuffer);
+ }
+
+ // NSOpenGLPixelBuffer implementation
+ class NSOpenGLImpl implements Impl {
+ public long create(int renderTarget, int internalFormat, int width, int height) {
+ return CGL.createPBuffer(renderTarget, internalFormat, width, height);
+ }
+
+ public void destroy(long pbuffer) {
+ CGL.destroyPBuffer(0, pbuffer);
+ }
+ }
+
+ // 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);
+ if (res != CGL.kCGLNoError) {
+ throw new GLException("Error creating CGL-based pbuffer: error code " + res);
+ }
+ return pbuffer[0];
+ }
+
+ public void destroy(long pbuffer) {
+ int res = CGL.CGLDestroyPBuffer(pbuffer);
+ if (res != CGL.kCGLNoError) {
+ throw new GLException("Error destroying CGL-based pbuffer: error code " + res);
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java
new file mode 100644
index 000000000..d100ab442
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLDrawableFactory.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl.awt;
+
+import java.lang.reflect.InvocationTargetException;
+import java.nio.*;
+import java.util.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.opengl.impl.awt.*;
+import com.sun.opengl.impl.macosx.cgl.*;
+
+public class MacOSXAWTCGLDrawableFactory extends MacOSXCGLDrawableFactory {
+
+ public MacOSXAWTCGLDrawableFactory() {
+ super();
+ }
+
+ public boolean canCreateContextOnJava2DSurface() {
+ return true;
+ }
+
+ public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+ throws GLException {
+ return new MacOSXJava2DCGLContext(shareWith);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..5e43eea49
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.macosx.cgl.awt;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.macosx.*;
+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.*;
+
+public class MacOSXAWTCGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration");
+
+ public MacOSXAWTCGLGraphicsConfigurationFactory() {
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ GraphicsDevice device = null;
+ if (absScreen != null &&
+ !(absScreen instanceof AWTGraphicsScreen)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
+ }
+
+ if(null==absScreen) {
+ absScreen = AWTGraphicsScreen.createScreenDevice(-1);
+ }
+ AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+ device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
+
+ if (capabilities != null &&
+ !(capabilities instanceof GLCapabilities)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ if(DEBUG) {
+ System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: got "+absScreen);
+ }
+
+ long displayHandle = 0;
+
+ MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice();
+ DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
+ if(DEBUG) {
+ System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: made "+macScreen);
+ }
+
+ GraphicsConfiguration gc = device.getDefaultConfiguration();
+ AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capabilities, gc);
+ if(DEBUG) {
+ System.err.println("AWT Colormodel compatible: "+capabilities);
+ }
+
+ MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(macDevice).chooseGraphicsConfiguration(capabilities,
+ chooser,
+ macScreen);
+
+ if (macConfig == null) {
+ throw new GLException("Unable to choose a GraphicsConfiguration: "+capabilities+",\n\t"+chooser+"\n\t"+macScreen);
+ }
+
+ // FIXME: we have nothing to match .. so choose the default
+ return new AWTGraphicsConfiguration(awtScreen, macConfig.getChosenCapabilities(), macConfig.getRequestedCapabilities(), gc, macConfig);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
new file mode 100644
index 000000000..4423f8da5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/macosx/cgl/awt/MacOSXJava2DCGLContext.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.macosx.cgl.awt;
+
+import com.sun.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.*;
+
+/** MacOSXCGLContext implementation supporting the Java2D/JOGL bridge
+ * on Mac OS X. The external GLDrawable mechanism does not work on Mac
+ * OS X due to how drawables and contexts are operated upon on this
+ * platform, so it is necessary to supply an alternative means to
+ * create, make current, and destroy contexts on the Java2D "drawable"
+ * on the Mac platform.
+ */
+
+public class MacOSXJava2DCGLContext extends MacOSXCGLContext implements Java2DGLContext {
+ private Graphics graphics;
+
+ // FIXME: ignoring context sharing for the time being; will need to
+ // rethink this in particular if using FBOs to implement the
+ // Java2D/OpenGL pipeline on Mac OS X
+
+ public MacOSXJava2DCGLContext(GLContext shareWith) {
+ super(null, shareWith);
+ }
+
+ public void setGraphics(Graphics g) {
+ this.graphics = g;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ boolean created = false;
+ if (nsContext == 0) {
+ if (!create()) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ if (DEBUG) {
+ System.err.println("!!! Created GL nsContext for " + getClass().getName());
+ }
+ created = true;
+ }
+
+ if (!Java2D.makeOGLContextCurrentOnSurface(graphics, nsContext)) {
+ throw new GLException("Error making context current");
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected boolean create() {
+ // Find and configure share context
+ MacOSXCGLContext other = (MacOSXCGLContext) GLContextShareSet.getShareContext(this);
+ long share = 0;
+ if (other != null) {
+ // Reconfigure pbuffer-based GLContexts
+ if (other instanceof MacOSXPbufferCGLContext) {
+ MacOSXPbufferCGLContext ctx = (MacOSXPbufferCGLContext) other;
+ ctx.setOpenGLMode(MacOSXCGLDrawable.CGL_MODE);
+ } else {
+ if (other.getOpenGLMode() != MacOSXCGLDrawable.CGL_MODE) {
+ throw new GLException("Can't share between NSOpenGLContexts and CGLContextObjs");
+ }
+ }
+ share = other.getNSContext();
+ // Note we don't check for a 0 return value, since switching
+ // the context's mode causes it to be destroyed and not
+ // re-initialized until the next makeCurrent
+ }
+
+ if (DEBUG) {
+ System.err.println("!!! Share context is " + toHexString(share) + " for " + getClass().getName());
+ }
+
+ long ctx = Java2D.createOGLContextOnSurface(graphics, share);
+ if (ctx == 0) {
+ return false;
+ }
+ // FIXME: think about GLContext sharing
+ nsContext = ctx;
+ return true;
+ }
+
+ protected void releaseImpl() throws GLException {
+ // FIXME: would need another primitive in the Java2D class in
+ // order to implement this; hopefully should not matter for
+ // correctness
+ }
+
+ protected void destroyImpl() throws GLException {
+ if (nsContext != 0) {
+ Java2D.destroyOGLContext(nsContext);
+ if (DEBUG) {
+ System.err.println("!!! Destroyed OpenGL context " + nsContext);
+ }
+ nsContext = 0;
+ // FIXME
+ // GLContextShareSet.contextDestroyed(this);
+ }
+ }
+
+ public void setSwapInterval(int interval) {
+ // Not supported in this context implementation
+ }
+
+ public void setOpenGLMode(int mode) {
+ if (mode != MacOSXCGLDrawable.CGL_MODE)
+ throw new GLException("OpenGL mode switching not supported for Java2D GLContexts");
+ }
+
+ public int getOpenGLMode() {
+ return MacOSXCGLDrawable.CGL_MODE;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
new file mode 100644
index 000000000..62388173c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+
+public class WindowsDummyWGLDrawable extends WindowsWGLDrawable {
+ private long hwnd, hdc;
+
+ public WindowsDummyWGLDrawable(GLDrawableFactory factory) {
+ super(factory, new NullWindow(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(null, false)), true);
+ // All entries to CreateDummyWindow must synchronize on one object
+ // to avoid accidentally registering the dummy window class twice
+ synchronized (WindowsDummyWGLDrawable.class) {
+ hwnd = WGL.CreateDummyWindow(0, 0, 1, 1);
+ }
+ hdc = WGL.GetDC(hwnd);
+ NullWindow nw = (NullWindow) getNativeWindow();
+ nw.setSurfaceHandle(hdc);
+ // Choose a (hopefully hardware-accelerated) OpenGL pixel format for this device context
+ GLCapabilities caps = new GLCapabilities(null);
+ caps.setDepthBits(16);
+ PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps, true);
+ int pixelFormat = WGL.ChoosePixelFormat(hdc, pfd);
+ if ((pixelFormat == 0) ||
+ (!WGL.SetPixelFormat(hdc, pixelFormat, pfd))) {
+ destroy();
+ }
+ }
+
+ public void setSize(int width, int height) {
+ }
+
+ public int getWidth() {
+ return 1;
+ }
+
+ public int getHeight() {
+ return 1;
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ if (hdc == 0) {
+ // Construction failed
+ return null;
+ }
+ // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
+ return new WindowsWGLContext(this, shareWith);
+ }
+
+ public void destroy() {
+ if (hdc != 0) {
+ WGL.ReleaseDC(hwnd, hdc);
+ hdc = 0;
+ }
+ if (hwnd != 0) {
+ WGL.ShowWindow(hwnd, WGL.SW_HIDE);
+ WGL.DestroyWindow(hwnd);
+ hwnd = 0;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java
new file mode 100755
index 000000000..b42a54104
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLContext.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import java.nio.*;
+import java.util.*;
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+
+public class WindowsExternalWGLContext extends WindowsWGLContext {
+ private boolean firstMakeCurrent = true;
+ private boolean created = true;
+ private GLContext lastContext;
+
+ public WindowsExternalWGLContext(AbstractGraphicsScreen absScreen) {
+ // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
+ super(null, null);
+ hglrc = WGL.wglGetCurrentContext();
+ if (hglrc == 0) {
+ throw new GLException("Error: attempted to make an external GLContext without a drawable/context current");
+ }
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Created external OpenGL context " + toHexString(hglrc) + " for " + this);
+ }
+ GLContextShareSet.contextCreated(this);
+ setGLFunctionAvailability(false);
+ }
+
+ public int makeCurrent() throws GLException {
+ // Save last context if necessary to allow external GLContexts to
+ // talk to other GLContexts created by this library
+ GLContext cur = getCurrent();
+ if (cur != null && cur != this) {
+ lastContext = cur;
+ setCurrent(null);
+ }
+ return super.makeCurrent();
+ }
+
+ public void release() throws GLException {
+ super.release();
+ setCurrent(lastContext);
+ lastContext = null;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (firstMakeCurrent) {
+ firstMakeCurrent = false;
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ }
+
+ protected void destroyImpl() throws GLException {
+ created = false;
+ GLContextShareSet.contextDestroyed(this);
+ }
+
+ public boolean isCreated() {
+ return created;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
new file mode 100755
index 000000000..164216c2d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+
+public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
+
+ public WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeWindow component) {
+ super(factory, component, true);
+ }
+
+ public static WindowsExternalWGLDrawable create(GLDrawableFactory factory, AbstractGraphicsScreen absScreen) {
+ long hdc = WGL.wglGetCurrentDC();
+ NullWindow nw = new NullWindow(WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(absScreen, false));
+ nw.setSurfaceHandle(hdc);
+ if (nw.getSurfaceHandle() == 0) {
+ throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
+ }
+ return new WindowsExternalWGLDrawable(factory, nw);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new WindowsWGLContext(this, shareWith);
+ }
+
+ public void setSize(int newWidth, int newHeight) {
+ throw new GLException("Should not call this");
+ }
+
+ public int getWidth() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getHeight() {
+ throw new GLException("Should not call this");
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java
new file mode 100644
index 000000000..9f0a5d2a6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLContext.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class WindowsOffscreenWGLContext extends WindowsWGLContext {
+ public WindowsOffscreenWGLContext(WindowsOffscreenWGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ }
+
+ public int getOffscreenContextPixelDataType() {
+ return GL.GL_UNSIGNED_BYTE;
+ }
+
+ public int getOffscreenContextReadBuffer() {
+ // On Windows these contexts are always single-buffered
+ return GL.GL_FRONT;
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ // We can take care of this in the DIB creation (see below)
+ return false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
new file mode 100644
index 000000000..dc9d66073
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+
+public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
+ private long origbitmap;
+ private long hbitmap;
+
+ public WindowsOffscreenWGLDrawable(GLDrawableFactory factory,
+ AbstractGraphicsScreen absScreen,
+ GLCapabilities requestedCapabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ super(factory, new NullWindow(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(requestedCapabilities, chooser, absScreen, true)), true);
+ ((NullWindow) getNativeWindow()).setSize(width, height);
+ create();
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new WindowsOffscreenWGLContext(this, shareWith);
+ }
+
+ private void create() {
+ NullWindow nw = (NullWindow) getNativeWindow();
+ WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)nw.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getRequestedCapabilities();
+ int width = getWidth();
+ int height = getHeight();
+ BITMAPINFO info = BITMAPINFO.create();
+ BITMAPINFOHEADER header = info.bmiHeader();
+ int bitsPerPixel = (capabilities.getRedBits() +
+ capabilities.getGreenBits() +
+ capabilities.getBlueBits());
+ header.biSize(header.size());
+ header.biWidth(width);
+ // NOTE: negating the height causes the DIB to be in top-down row
+ // order rather than bottom-up; ends up being correct during pixel
+ // readback
+ header.biHeight(-1 * height);
+ header.biPlanes((short) 1);
+ header.biBitCount((short) bitsPerPixel);
+ header.biXPelsPerMeter(0);
+ header.biYPelsPerMeter(0);
+ header.biClrUsed(0);
+ header.biClrImportant(0);
+ header.biCompression(WGL.BI_RGB);
+ header.biSizeImage(width * height * bitsPerPixel / 8);
+
+ long hdc = WGL.CreateCompatibleDC(0);
+ if (hdc == 0) {
+ System.out.println("LastError: " + WGL.GetLastError());
+ throw new GLException("Error creating device context for offscreen OpenGL context");
+ }
+ nw.setSurfaceHandle(hdc);
+
+ hbitmap = WGL.CreateDIBSection(hdc, info, WGL.DIB_RGB_COLORS, 0, 0, 0);
+ if (hbitmap == 0) {
+ WGL.DeleteDC(hdc);
+ hdc = 0;
+ throw new GLException("Error creating offscreen bitmap of width " + width +
+ ", height " + height);
+ }
+ if ((origbitmap = WGL.SelectObject(hdc, hbitmap)) == 0) {
+ WGL.DeleteObject(hbitmap);
+ hbitmap = 0;
+ WGL.DeleteDC(hdc);
+ hdc = 0;
+ throw new GLException("Error selecting bitmap into new device context");
+ }
+
+ config.updateGraphicsConfiguration(getFactory(), nw, true);
+ }
+
+ public void destroy() {
+ NullWindow nw = (NullWindow) getNativeWindow();
+ if (nw.getSurfaceHandle() != 0) {
+ // Must destroy bitmap and device context
+ WGL.SelectObject(nw.getSurfaceHandle(), origbitmap);
+ WGL.DeleteObject(hbitmap);
+ WGL.DeleteDC(nw.getSurfaceHandle());
+ origbitmap = 0;
+ hbitmap = 0;
+ nw.setSurfaceHandle(0);
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
new file mode 100644
index 000000000..2261f7742
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import java.util.*;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class WindowsOnscreenWGLContext extends WindowsWGLContext {
+ protected WindowsOnscreenWGLDrawable drawable;
+
+ public WindowsOnscreenWGLContext(WindowsOnscreenWGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ this.drawable = drawable;
+ }
+
+ // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release]
+ protected int makeCurrentImpl() throws GLException {
+ int lockRes = drawable.lockSurface();
+ boolean exceptionOccurred = false;
+ try {
+ if (lockRes == NativeWindow.LOCK_SURFACE_NOT_READY) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ int ret = super.makeCurrentImpl();
+ return ret;
+ } catch (RuntimeException e) {
+ exceptionOccurred = true;
+ throw e;
+ } finally {
+ if (exceptionOccurred ||
+ (isOptimizable() && lockRes != NativeWindow.LOCK_SURFACE_NOT_READY) && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release]
+ protected void releaseImpl() throws GLException {
+ try {
+ super.releaseImpl();
+ } finally {
+ if (!isOptimizable() && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
new file mode 100644
index 000000000..31925589b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
+ private static final boolean PROFILING = Debug.debug("WindowsOnscreenWGLDrawable.profiling");
+ private static final int PROFILING_TICKS = 200;
+ private int profilingLockSurfaceTicks;
+ private long profilingLockSurfaceTime;
+ private int profilingUnlockSurfaceTicks;
+ private long profilingUnlockSurfaceTime;
+ private int profilingSwapBuffersTicks;
+ private long profilingSwapBuffersTime;
+
+ protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeWindow component) {
+ super(factory, component, false);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new WindowsOnscreenWGLContext(this, shareWith);
+ }
+
+ public int getWidth() {
+ return component.getWidth();
+ }
+
+ public int getHeight() {
+ return component.getHeight();
+ }
+
+ public void swapBuffers() throws GLException {
+ 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;
+ }
+
+ long startTime = 0;
+ if (PROFILING) {
+ startTime = System.currentTimeMillis();
+ }
+
+ if (!WGL.SwapBuffers(getNativeWindow().getSurfaceHandle()) && (WGL.GetLastError() != 0)) {
+ throw new GLException("Error swapping buffers");
+ }
+
+ if (PROFILING) {
+ long endTime = System.currentTimeMillis();
+ profilingSwapBuffersTime += (endTime - startTime);
+ int ticks = PROFILING_TICKS;
+ if (++profilingSwapBuffersTicks == ticks) {
+ System.err.println("SwapBuffers calls: " + profilingSwapBuffersTime + " ms / " + ticks + " calls (" +
+ ((float) profilingSwapBuffersTime / (float) ticks) + " ms/call)");
+ profilingSwapBuffersTime = 0;
+ profilingSwapBuffersTicks = 0;
+ }
+ }
+ } finally {
+ if (didLock) {
+ unlockSurface();
+ }
+ }
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
new file mode 100644
index 000000000..9c492e244
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+public class WindowsPbufferWGLContext extends WindowsWGLContext {
+ private static final boolean DEBUG = Debug.debug("WindowsPbufferWGLContext");
+
+ // State for render-to-texture and render-to-texture-rectangle support
+ private WindowsPbufferWGLDrawable drawable;
+ private boolean rtt; // render-to-texture?
+ private boolean hasRTT; // render-to-texture extension available?
+ private boolean rect; // render-to-texture-rectangle?
+ private int textureTarget; // e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV
+ private int texture; // actual texture object
+
+ public WindowsPbufferWGLContext(WindowsPbufferWGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ this.drawable = drawable;
+ }
+
+ public void bindPbufferToTexture() {
+ if (!rtt) {
+ throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
+ "specified in its GLCapabilities");
+ }
+ GL gl = getGL();
+ WGLExt wglExt = getWGLExt();
+ gl.glBindTexture(textureTarget, texture);
+ if (rtt && hasRTT) {
+ if (!wglExt.wglBindTexImageARB(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT_ARB)) {
+ throw new GLException("Binding of pbuffer to texture failed: " + wglGetLastError());
+ }
+ }
+ // FIXME: comment is wrong now
+ // Note that if the render-to-texture extension is not supported,
+ // we perform a glCopyTexImage2D in swapBuffers().
+ }
+
+ public void releasePbufferFromTexture() {
+ if (!rtt) {
+ throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
+ "specified in its GLCapabilities");
+ }
+ if (rtt && hasRTT) {
+ WGLExt wglExt = getWGLExt();
+ if (!wglExt.wglReleaseTexImageARB(drawable.getPbuffer(), WGLExt.WGL_FRONT_LEFT_ARB)) {
+ throw new GLException("Releasing of pbuffer from texture failed: " + wglGetLastError());
+ }
+ }
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ int res = super.makeCurrentImpl();
+ if (DEBUG && VERBOSE) {
+ System.err.println("WindowsPbufferWGLContext: super.makeCurrentImpl() = " + res);
+ }
+ if (res == CONTEXT_CURRENT_NEW) {
+ GLCapabilities capabilities = drawable.getChosenGLCapabilities();
+
+ // Initialize render-to-texture support if requested
+ GL gl = getGL();
+ rtt = capabilities.getPbufferRenderToTexture();
+ rect = gl.isGL2() && capabilities.getPbufferRenderToTextureRectangle();
+
+ if (rtt) {
+ if (DEBUG) {
+ System.err.println("Initializing render-to-texture support");
+ }
+
+ if (!gl.isExtensionAvailable("WGL_ARB_render_texture")) {
+ System.err.println("WindowsPbufferWGLContext: WARNING: WGL_ARB_render_texture extension not " +
+ "supported; implementing render_to_texture support using slow texture readback");
+ } else {
+ hasRTT = true;
+
+ if (rect && !gl.isExtensionAvailable("GL_NV_texture_rectangle")) {
+ System.err.println("WindowsPbufferWGLContext: WARNING: GL_NV_texture_rectangle extension not " +
+ "supported; skipping requested render_to_texture_rectangle support for pbuffer");
+ rect = false;
+ }
+ if (rect) {
+ if (DEBUG) {
+ System.err.println(" Using render-to-texture-rectangle");
+ }
+ textureTarget = GL2.GL_TEXTURE_RECTANGLE_ARB;
+ } else {
+ if (DEBUG) {
+ System.err.println(" Using vanilla render-to-texture");
+ }
+ textureTarget = GL.GL_TEXTURE_2D;
+ }
+ int[] tmp = new int[1];
+ gl.glGenTextures(1, tmp, 0);
+ texture = tmp[0];
+ gl.glBindTexture(textureTarget, texture);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
+ gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);
+ gl.glCopyTexImage2D(textureTarget, 0, GL.GL_RGB, 0, 0, drawable.getWidth(), drawable.getHeight(), 0);
+ }
+ }
+ }
+ return res;
+ }
+
+ public int getFloatingPointMode() {
+ return drawable.getFloatingPointMode();
+ }
+
+ private static String wglGetLastError() {
+ return WindowsWGLDrawableFactory.wglGetLastError();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
new file mode 100644
index 000000000..2d996ca40
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -0,0 +1,336 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+
+public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
+ private long cachedParentHdc;
+ private WGLExt cachedWGLExt; // cached WGLExt instance from parent GLCanvas,
+ // needed to destroy pbuffer
+ private long buffer; // pbuffer handle
+
+ private int floatMode;
+
+ public WindowsPbufferWGLDrawable(GLDrawableFactory factory,
+ AbstractGraphicsScreen absScreen,
+ GLCapabilities requestedCapabilities,
+ final GLCapabilitiesChooser chooser,
+ int width,
+ int height,
+ WindowsWGLDrawable dummyDrawable,
+ WGLExt wglExt) {
+ super(factory, new NullWindow(WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(
+ requestedCapabilities, chooser, absScreen, true) ), true);
+ if (width <= 0 || height <= 0) {
+ throw new GLException("Width and height of pbuffer must be positive (were (" +
+ width + ", " + height + "))");
+ }
+ NullWindow nw = (NullWindow) getNativeWindow();
+ nw.setSize(width, height);
+
+ if (DEBUG) {
+ System.out.println("Pbuffer caps: " + requestedCapabilities);
+ }
+
+ createPbuffer(dummyDrawable.getNativeWindow().getSurfaceHandle(), wglExt);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new WindowsPbufferWGLContext(this, shareWith);
+ }
+
+ public void destroy() {
+ NullWindow nw = (NullWindow) getNativeWindow();
+ if (nw.getSurfaceHandle() != 0) {
+ // Must release DC and pbuffer
+ // NOTE that since the context is not current, glGetError() can
+ // not be called here, so we skip the use of any composable
+ // pipelines (see WindowsOnscreenWGLContext.makeCurrentImpl)
+ WGLExt wglExt = cachedWGLExt;
+ if (wglExt.wglReleasePbufferDCARB(buffer, nw.getSurfaceHandle()) == 0) {
+ throw new GLException("Error releasing pbuffer device context: error code " + WGL.GetLastError());
+ }
+ nw.setSurfaceHandle(0);
+ if (!wglExt.wglDestroyPbufferARB(buffer)) {
+ throw new GLException("Error destroying pbuffer: error code " + WGL.GetLastError());
+ }
+ buffer = 0;
+ }
+ }
+
+ public long getPbuffer() {
+ return buffer;
+ }
+
+ public int getFloatingPointMode() {
+ return floatMode;
+ }
+
+ public void swapBuffers() throws GLException {
+ // FIXME: this doesn't make sense any more because we don't have
+ // access to our OpenGL context here
+ /*
+ // FIXME: do we need to do anything if the pbuffer is double-buffered?
+ // For now, just grab the pixels for the render-to-texture support.
+ if (rtt && !hasRTT) {
+ if (DEBUG) {
+ System.err.println("Copying pbuffer data to GL_TEXTURE_2D state");
+ }
+
+ GL gl = getGL();
+ gl.glCopyTexSubImage2D(textureTarget, 0, 0, 0, 0, 0, width, height);
+ }
+ */
+ }
+
+ private void createPbuffer(long parentHdc, WGLExt wglExt) {
+ int[] iattributes = new int [2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
+ float[] fattributes = new float[1];
+ int[] floatModeTmp = new int[1];
+ int niattribs = 0;
+ int width, height;
+
+ WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities)config.getRequestedCapabilities();
+ GLProfile glProfile = capabilities.getGLProfile();
+
+ if (DEBUG) {
+ System.out.println("Pbuffer parentHdc = " + toHexString(parentHdc));
+ System.out.println("Pbuffer caps: " + capabilities);
+ }
+
+ if(!WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
+ iattributes,
+ wglExt,
+ true,
+ floatModeTmp)){
+ throw new GLException("Pbuffer-related extensions not supported");
+ }
+
+ floatMode = floatModeTmp[0];
+ boolean rtt = capabilities.getPbufferRenderToTexture();
+ boolean rect = capabilities.getPbufferRenderToTextureRectangle();
+ boolean useFloat = capabilities.getPbufferFloatingPointBuffers();
+ boolean ati = false;
+
+ if (useFloat) {
+ ati = (floatMode == GLPbuffer.ATI_FLOAT);
+ }
+
+ int[] pformats = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS];
+ int nformats;
+ int[] nformatsTmp = new int[1];
+ if (!wglExt.wglChoosePixelFormatARB(parentHdc,
+ iattributes, 0,
+ fattributes, 0,
+ WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
+ pformats, 0,
+ nformatsTmp, 0)) {
+ throw new GLException("pbuffer creation error: wglChoosePixelFormat() failed");
+ }
+ nformats = nformatsTmp[0];
+ if (nformats <= 0) {
+ throw new GLException("pbuffer creation error: Couldn't find a suitable pixel format");
+ }
+
+ boolean haveMultisample = wglExt.isExtensionAvailable("WGL_ARB_multisample");
+
+ if (DEBUG) {
+ System.err.println("" + nformats + " suitable pixel formats found");
+ // query pixel format
+ iattributes[0] = WGLExt.WGL_RED_BITS_ARB;
+ iattributes[1] = WGLExt.WGL_GREEN_BITS_ARB;
+ iattributes[2] = WGLExt.WGL_BLUE_BITS_ARB;
+ iattributes[3] = WGLExt.WGL_ALPHA_BITS_ARB;
+ iattributes[4] = WGLExt.WGL_DEPTH_BITS_ARB;
+ iattributes[5] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[6] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[7] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[8] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
+ int[] ivalues = new int[9];
+ for (int i = 0; i < nformats; i++) {
+ if (!wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[i], 0, 9, iattributes, 0, ivalues, 0)) {
+ throw new GLException("Error while querying pixel format " + pformats[i] +
+ "'s (index " + i + "'s) capabilities for debugging");
+ }
+ System.err.print("pixel format " + pformats[i] + " (index " + i + "): ");
+ System.err.print( "r: " + ivalues[0]);
+ System.err.print(" g: " + ivalues[1]);
+ System.err.print(" b: " + ivalues[2]);
+ System.err.print(" a: " + ivalues[3]);
+ System.err.print(" depth: " + ivalues[4]);
+ if (haveMultisample) {
+ System.err.print(" multisample: " + ivalues[6]);
+ }
+ System.err.print(" samples: " + ivalues[7]);
+ if (useFloat) {
+ if (ati) {
+ if (ivalues[5] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) {
+ System.err.print(" [ati float]");
+ } else if (ivalues[5] != WGLExt.WGL_TYPE_RGBA_ARB) {
+ System.err.print(" [unknown pixel type " + ivalues[5] + "]");
+ }
+ } else {
+ if (ivalues[5] != 0) {
+ System.err.print(" [float]");
+ }
+ }
+ }
+
+ if (ivalues[8] != 0) {
+ System.err.print(" [pbuffer]");
+ }
+ System.err.println();
+ }
+ }
+
+ long tmpBuffer = 0;
+ int whichFormat = -1;
+ // Loop is a workaround for bugs in NVidia's recent drivers
+ for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
+ int format = pformats[whichFormat];
+
+ // Create the p-buffer.
+ niattribs = 0;
+
+ if (rtt) {
+ iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FORMAT_ARB;
+ if (useFloat) {
+ iattributes[niattribs++] = WGLExt.WGL_TEXTURE_FLOAT_RGB_NV;
+ } else {
+ iattributes[niattribs++] = WGLExt.WGL_TEXTURE_RGBA_ARB;
+ }
+
+ iattributes[niattribs++] = WGLExt.WGL_TEXTURE_TARGET_ARB;
+ iattributes[niattribs++] = rect ? WGLExt.WGL_TEXTURE_RECTANGLE_NV : WGLExt.WGL_TEXTURE_2D_ARB;
+
+ iattributes[niattribs++] = WGLExt.WGL_MIPMAP_TEXTURE_ARB;
+ iattributes[niattribs++] = GL.GL_FALSE;
+
+ iattributes[niattribs++] = WGLExt.WGL_PBUFFER_LARGEST_ARB;
+ iattributes[niattribs++] = GL.GL_FALSE;
+ }
+
+ iattributes[niattribs++] = 0;
+
+ tmpBuffer = wglExt.wglCreatePbufferARB(parentHdc, format, getWidth(), getHeight(), iattributes, 0);
+ if (tmpBuffer != 0) {
+ // Done
+ break;
+ }
+ }
+
+ if (tmpBuffer == 0) {
+ throw new GLException("pbuffer creation error: wglCreatePbuffer() failed: tried " + nformats +
+ " pixel formats, last error was: " + wglGetLastError());
+ }
+
+ // Get the device context.
+ long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
+ if (tmpHdc == 0) {
+ throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
+ }
+
+ NullWindow nw = (NullWindow) getNativeWindow();
+ // Set up instance variables
+ buffer = tmpBuffer;
+ nw.setSurfaceHandle(tmpHdc);
+ cachedWGLExt = wglExt;
+ cachedParentHdc = parentHdc;
+
+ // Re-query chosen pixel format
+ {
+ niattribs = 0;
+ iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
+ iattributes[niattribs++] = (useFloat ? (ati ? WGLExt.WGL_PIXEL_TYPE_ARB : WGLExt.WGL_FLOAT_COMPONENTS_NV) : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLE_BUFFERS_ARB : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[niattribs++] = (haveMultisample ? WGLExt.WGL_SAMPLES_ARB : WGLExt.WGL_RED_BITS_ARB);
+ iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
+ int[] ivalues = new int[niattribs];
+ if (wglExt.wglGetPixelFormatAttribivARB(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) {
+ GLCapabilities newCaps = WindowsWGLGraphicsConfiguration.AttribList2GLCapabilities(glProfile, iattributes, niattribs, ivalues, false);
+ PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
+ if (WGL.DescribePixelFormat(parentHdc, pformats[whichFormat], pfd.size(), pfd) == 0) {
+ throw new GLException("Unable to describe pixel format " + pformats[whichFormat]);
+ }
+ config.setCapsPFD(newCaps, pfd, pformats[whichFormat]);
+ } else {
+ PIXELFORMATDESCRIPTOR pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
+ if (WGL.DescribePixelFormat(parentHdc, pformats[whichFormat], pfd.size(), pfd) == 0) {
+ throw new GLException("Unable to describe pixel format " + pformats[whichFormat]);
+ }
+ GLCapabilities newCaps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, pfd);
+ config.setCapsPFD(newCaps, pfd, pformats[whichFormat]);
+ }
+ }
+
+ // Determine the actual width and height we were able to create.
+ int[] tmp = new int[1];
+ wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_WIDTH_ARB, tmp, 0 );
+ width = tmp[0];
+ wglExt.wglQueryPbufferARB( buffer, WGLExt.WGL_PBUFFER_HEIGHT_ARB, tmp, 0 );
+ height = tmp[0];
+ nw.setSize(width, height);
+
+ if (DEBUG) {
+ System.err.println("Created pbuffer " + width + " x " + height);
+ }
+ }
+
+ private static String wglGetLastError() {
+ return WindowsWGLDrawableFactory.wglGetLastError();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java
new file mode 100644
index 000000000..1bc3acada
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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;
+
+public class WindowsWGLContext extends GLContextImpl {
+ protected WindowsWGLDrawable drawable;
+ protected long hglrc;
+ private boolean wglGetExtensionsStringEXTInitialized;
+ private boolean wglGetExtensionsStringEXTAvailable;
+ private static final Map/*<String, String>*/ functionNameMap;
+ private static final Map/*<String, String>*/ extensionNameMap;
+ private WGLExt wglExt;
+ // Table that holds the addresses of the native C-language entry points for
+ // WGL extension functions.
+ private WGLExtProcAddressTable wglExtProcAddressTable;
+
+ static {
+ functionNameMap = new HashMap();
+ functionNameMap.put("glAllocateMemoryNV", "wglAllocateMemoryNV");
+ functionNameMap.put("glFreeMemoryNV", "wglFreeMemoryNV");
+
+ extensionNameMap = new HashMap();
+ extensionNameMap.put("GL_ARB_pbuffer", "WGL_ARB_pbuffer");
+ extensionNameMap.put("GL_ARB_pixel_format", "WGL_ARB_pixel_format");
+ }
+
+ // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
+ public WindowsWGLContext(WindowsWGLDrawable drawable,
+ GLContext shareWith) {
+ super(drawable.getGLProfile(), shareWith);
+ this.drawable = drawable;
+ }
+
+ public Object getPlatformGLExtensions() {
+ return getWGLExt();
+ }
+
+ public WGLExt getWGLExt() {
+ if (wglExt == null) {
+ wglExt = new WGLExtImpl(this);
+ }
+ return wglExt;
+ }
+
+ public final ProcAddressTable getPlatformExtProcAddressTable() {
+ return getWGLExtProcAddressTable();
+ }
+
+ public final WGLExtProcAddressTable getWGLExtProcAddressTable() {
+ return wglExtProcAddressTable;
+ }
+
+ public GLDrawable getGLDrawable() {
+ return drawable;
+ }
+
+ protected String mapToRealGLFunctionName(String glFunctionName) {
+ String lookup = (String) functionNameMap.get(glFunctionName);
+ if (lookup != null) {
+ return lookup;
+ }
+ return glFunctionName;
+ }
+
+ protected String mapToRealGLExtensionName(String glExtensionName) {
+ String lookup = (String) extensionNameMap.get(glExtensionName);
+ if (lookup != null) {
+ return lookup;
+ }
+ return glExtensionName;
+ }
+
+ /**
+ * Creates and initializes an appropriate OpenGL context. Should only be
+ * called by {@link #makeCurrentImpl()}.
+ */
+ protected void create() {
+ GLCapabilities glCaps = drawable.getChosenGLCapabilities();
+ if(DEBUG) {
+ System.err.println("WindowsWGLContext.create got "+glCaps);
+ }
+
+ 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;
+ if (other != null) {
+ hglrc2 = other.getHGLRC();
+ if (hglrc2 == 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");
+ }
+ if (temp_hglrc == 0) {
+ throw new GLException("Unable to create temp OpenGL context for device context " + toHexString(drawable.getNativeWindow().getSurfaceHandle()));
+ } else {
+ if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), temp_hglrc)) {
+ throw new GLException("Error making temp context current: " + WGL.GetLastError());
+ }
+ setGLFunctionAvailability(true);
+
+ if( !isFunctionAvailable("wglCreateContextAttribsARB") ||
+ !isExtensionAvailable("WGL_ARB_create_context") ) {
+ if(glCaps.getGLProfile().isGL3()) {
+ if (!WGL.wglMakeCurrent(0, 0)) {
+ throw new GLException("Error freeing temp OpenGL context: " + WGL.GetLastError());
+ }
+ if (!WGL.wglDeleteContext(temp_hglrc)) {
+ throw new GLException("Unable to delete OpenGL context");
+ }
+ throw new GLException("Unable to create OpenGL 3.1 context (no WGL_ARB_create_context)");
+ }
+
+ // 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();
+
+ // preset with default values
+ int attribs[] = {
+ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
+ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, 0,
+ WGLExt.WGL_CONTEXT_FLAGS_ARB, 0,
+ 0
+ };
+
+ if(glCaps.getGLProfile().isGL3()) {
+ attribs[1] |= 3;
+ attribs[3] |= 1;
+ // attribs[5] |= WGLExt.WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB ; // NVidia WGL driver doesn't support this one ..
+ // attribs[5] |= WGLExt.WGL_CONTEXT_DEBUG_BIT_ARB ;
+ }
+
+ hglrc = wglExt.wglCreateContextAttribsARB(drawable.getNativeWindow().getSurfaceHandle(), hglrc2, attribs, 0);
+ if(0==hglrc) {
+ if(glCaps.getGLProfile().isGL3()) {
+ if (!WGL.wglMakeCurrent(0, 0)) {
+ throw new GLException("Error freeing temp OpenGL context: " + WGL.GetLastError());
+ }
+ if (!WGL.wglDeleteContext(temp_hglrc)) {
+ throw new GLException("Unable to delete OpenGL context");
+ }
+ 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(DEBUG) {
+ System.err.println("WindowsWGLContext.create done (old ctx < 3.0 - no 3.0) 0x"+Long.toHexString(hglrc));
+ }
+ } else {
+ hglrc2 = 0; // mark as shared ..
+ if (!WGL.wglMakeCurrent(0, 0)) {
+ throw new GLException("Error freeing temp OpenGL context: " + WGL.GetLastError());
+ }
+ if (!WGL.wglDeleteContext(temp_hglrc)) {
+ throw new GLException("Unable to delete temp OpenGL context");
+ }
+
+ if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), hglrc)) {
+ throw new GLException("Error making new context current: " + WGL.GetLastError());
+ }
+ updateGLProcAddressTable();
+ if(DEBUG) {
+ System.err.println("WindowsWGLContext.create done (new ctx >= 3.0) 0x"+Long.toHexString(hglrc));
+ }
+ }
+ }
+ }
+ if(0!=hglrc2) {
+ if (!WGL.wglShareLists(hglrc2, hglrc)) {
+ throw new GLException("wglShareLists(" + toHexString(hglrc2) +
+ ", " + toHexString(hglrc) + ") failed: error code " +
+ WGL.GetLastError());
+ }
+ }
+ GLContextShareSet.contextCreated(this);
+ 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;
+ }
+ boolean created = false;
+ if (hglrc == 0) {
+ create();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Created GL context for " + getClass().getName());
+ }
+ created = true;
+ }
+
+ if (WGL.wglGetCurrentContext() != hglrc) {
+ if (!WGL.wglMakeCurrent(drawable.getNativeWindow().getSurfaceHandle(), hglrc)) {
+ throw new GLException("Error making context current: " + WGL.GetLastError());
+ } else {
+ if (DEBUG && VERBOSE) {
+ System.err.println(getThreadName() + ": wglMakeCurrent(hdc " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) +
+ ", hglrc " + toHexString(hglrc) + ") succeeded");
+ }
+ }
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ if (!WGL.wglMakeCurrent(0, 0)) {
+ throw new GLException("Error freeing OpenGL context: " + WGL.GetLastError());
+ }
+ }
+
+ protected void destroyImpl() throws GLException {
+ if (DEBUG) {
+ Exception e = new Exception(getThreadName() + ": !!! Destroyed OpenGL context " + toHexString(hglrc));
+ e.printStackTrace();
+ }
+ if (hglrc != 0) {
+ if (!WGL.wglDeleteContext(hglrc)) {
+ throw new GLException("Unable to delete OpenGL context");
+ }
+ hglrc = 0;
+ GLContextShareSet.contextDestroyed(this);
+ }
+ }
+
+ public boolean isCreated() {
+ return (hglrc != 0);
+ }
+
+ public void copy(GLContext source, int mask) throws GLException {
+ long dst = getHGLRC();
+ long src = ((WindowsWGLContext) source).getHGLRC();
+ if (src == 0) {
+ throw new GLException("Source OpenGL context has not been created");
+ }
+ if (dst == 0) {
+ throw new GLException("Destination OpenGL context has not been created");
+ }
+ if (!WGL.wglCopyContext(src, dst, mask)) {
+ throw new GLException("wglCopyContext failed");
+ }
+ }
+
+ protected void updateGLProcAddressTable() {
+ super.updateGLProcAddressTable();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Initializing WGL extension address table for " + this);
+ }
+ if (wglExtProcAddressTable == null) {
+ // FIXME: cache ProcAddressTables by capability bits so we can
+ // share them among contexts with the same capabilities
+ wglExtProcAddressTable = new WGLExtProcAddressTable();
+ }
+ resetProcAddressTable(getWGLExtProcAddressTable());
+ }
+
+ public String getPlatformExtensionsString() {
+ if (!wglGetExtensionsStringEXTInitialized) {
+ wglGetExtensionsStringEXTAvailable = (WGL.wglGetProcAddress("wglGetExtensionsStringEXT") != 0);
+ wglGetExtensionsStringEXTInitialized = true;
+ }
+ if (wglGetExtensionsStringEXTAvailable) {
+ return getWGLExt().wglGetExtensionsStringEXT();
+ } else {
+ return "";
+ }
+ }
+
+ public boolean isFunctionAvailable(String glFunctionName)
+ {
+ boolean available = super.isFunctionAvailable(glFunctionName);
+
+ // Sanity check for implementations that use proc addresses for run-time
+ // linking: if the function IS available, then make sure there's a proc
+ // address for it if it's an extension or not part of the OpenGL 1.1 core
+ // (post GL 1.1 functions are run-time linked on windows).
+ /* FIXME:
+ assert(!available ||
+ (getGLProcAddressTable().getAddressFor(mapToRealGLFunctionName(glFunctionName)) != 0 ||
+ FunctionAvailabilityCache.isPartOfGLCore("1.1", mapToRealGLFunctionName(glFunctionName)))
+ ); */
+
+ return available;
+ }
+
+ public void setSwapInterval(int interval) {
+ // FIXME: make the context current first? Currently assumes that
+ // will not be necessary. Make the caller do this?
+ WGLExt wglExt = getWGLExt();
+ if (wglExt.isExtensionAvailable("WGL_EXT_swap_control")) {
+ wglExt.wglSwapIntervalEXT(interval);
+ }
+ }
+
+ public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return getWGLExt().wglAllocateMemoryNV(arg0, arg1, arg2, arg3);
+ }
+
+ public int getOffscreenContextPixelDataType() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getOffscreenContextReadBuffer() {
+ throw new GLException("Should not call this");
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ throw new GLException("Should not call this");
+ }
+
+ public void bindPbufferToTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ public void releasePbufferFromTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ public long getHGLRC() {
+ return hglrc;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
new file mode 100644
index 000000000..464cfbcc2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.gluegen.runtime.DynamicLookupHelper;
+
+public abstract class WindowsWGLDrawable extends GLDrawableImpl {
+ private static final int MAX_SET_PIXEL_FORMAT_FAIL_COUNT = 5;
+
+ public WindowsWGLDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized) {
+ super(factory, comp, realized);
+ }
+
+ public void setRealized(boolean realized) {
+ super.setRealized(realized);
+
+ if(!realized) {
+ return; // nothing todo ..
+ }
+
+ if(NativeWindow.LOCK_SURFACE_NOT_READY == lockSurface()) {
+ throw new GLException("WindowsWGLDrawable.setRealized(true): lockSurface - surface not ready");
+ }
+ try {
+ NativeWindow nativeWindow = getNativeWindow();
+ WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)nativeWindow.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ config.updateGraphicsConfiguration(getFactory(), nativeWindow, false);
+ if (DEBUG) {
+ System.err.println("!!! WindowsWGLDrawable.setRealized(true): "+config);
+ }
+ } finally {
+ unlockSurface();
+ }
+ }
+
+ public DynamicLookupHelper getDynamicLookupHelper() {
+ return (WindowsWGLDrawableFactory) getFactoryImpl() ;
+ }
+
+ protected static String getThreadName() {
+ return Thread.currentThread().getName();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
new file mode 100644
index 000000000..d15ba3423
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -0,0 +1,297 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import java.nio.*;
+import java.util.*;
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NWReflection;
+import com.sun.gluegen.runtime.DynamicLookupHelper;
+
+public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl implements DynamicLookupHelper {
+ private static final boolean VERBOSE = Debug.verbose();
+
+ // Handle to GLU32.dll
+ // FIXME: this should go away once we delete support for the C GLU library
+ private long hglu32;
+
+ // Handle to core OpenGL32.dll
+ private long hopengl32;
+
+ public WindowsWGLDrawableFactory() {
+ super();
+
+ // Register our GraphicsConfigurationFactory implementations
+ // The act of constructing them causes them to be registered
+ new WindowsWGLGraphicsConfigurationFactory();
+ try {
+ NWReflection.createInstance("com.sun.opengl.impl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
+ new Object[] {});
+ } catch (Throwable t) { }
+
+ loadOpenGL32Library();
+ }
+
+ public GLDrawable createGLDrawable(NativeWindow target) {
+ if (target == null) {
+ throw new IllegalArgumentException("Null target");
+ }
+ target = NativeWindowFactory.getNativeWindow(target, null);
+ return new WindowsOnscreenWGLDrawable(this, target);
+ }
+
+ public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ return new WindowsOffscreenWGLDrawable(this, aScreen, capabilities, chooser, width, height);
+ }
+
+ 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);
+ }
+ return canCreateGLPbuffer;
+ }
+
+ public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
+ final GLCapabilitiesChooser chooser,
+ final int initialWidth,
+ final int initialHeight,
+ final GLContext shareWith) {
+ if (!canCreateGLPbuffer()) {
+ throw new GLException("Pbuffer support not available with current graphics card");
+ }
+ final List returnList = new ArrayList();
+ final GLDrawableFactory factory = this;
+ 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();
+ try {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ WindowsPbufferWGLDrawable pbufferDrawable = new WindowsPbufferWGLDrawable(factory, aScreen, capabilities, chooser,
+ initialWidth,
+ initialHeight,
+ dummyDrawable,
+ dummyWGLExt);
+ GLPbufferImpl pbuffer = new GLPbufferImpl(pbufferDrawable, shareWith);
+ returnList.add(pbuffer);
+ dummyContext.release();
+ dummyContext.destroy();
+ dummyDrawable.destroy();
+ } finally {
+ if (lastContext != null) {
+ lastContext.makeCurrent();
+ }
+ }
+ }
+ };
+ maybeDoSingleThreadedWorkaround(r);
+ return (GLPbuffer) returnList.get(0);
+ }
+
+ public GLContext createExternalGLContext() {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ return new WindowsExternalWGLContext(aScreen);
+ }
+
+ public boolean canCreateExternalGLDrawable() {
+ return true;
+ }
+
+ public GLDrawable createExternalGLDrawable() {
+ AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault();
+ return WindowsExternalWGLDrawable.create(this, aScreen);
+ }
+
+ public void loadOpenGL32Library() {
+ if (hopengl32 == 0) {
+ hopengl32 = WGL.LoadLibraryA("OpenGL32");
+ if (DEBUG) {
+ if (hopengl32 == 0) {
+ System.err.println("WindowsWGLDrawableFactory: Could not load OpenGL32.dll - maybe an embedded device");
+ }
+ }
+ }
+ }
+
+ public void loadGLULibrary() {
+ if (hglu32 == 0) {
+ hglu32 = WGL.LoadLibraryA("GLU32");
+ if (hglu32 == 0) {
+ throw new GLException("Error loading GLU32.DLL");
+ }
+ }
+ }
+
+ public long dynamicLookupFunction(String glFuncName) {
+ long res = WGL.wglGetProcAddress(glFuncName);
+ if (res == 0) {
+ // It may happen that a driver doesn't return the OpenGL32 core function pointer
+ // with wglGetProcAddress (e.g. NVidia GL 3.1) - hence we have to look harder.
+ if (hopengl32 != 0) {
+ res = WGL.GetProcAddress(hopengl32, glFuncName);
+ }
+ }
+ if (res == 0) {
+ // GLU routines aren't known to the OpenGL function lookup
+ if (hglu32 != 0) {
+ res = WGL.GetProcAddress(hglu32, glFuncName);
+ }
+ }
+ return res;
+ }
+
+ static String wglGetLastError() {
+ long err = WGL.GetLastError();
+ String detail = null;
+ switch ((int) err) {
+ case WGL.ERROR_INVALID_PIXEL_FORMAT: detail = "ERROR_INVALID_PIXEL_FORMAT"; break;
+ case WGL.ERROR_NO_SYSTEM_RESOURCES: detail = "ERROR_NO_SYSTEM_RESOURCES"; break;
+ case WGL.ERROR_INVALID_DATA: detail = "ERROR_INVALID_DATA"; break;
+ case WGL.ERROR_PROC_NOT_FOUND: detail = "ERROR_PROC_NOT_FOUND"; break;
+ case WGL.ERROR_INVALID_WINDOW_HANDLE:detail = "ERROR_INVALID_WINDOW_HANDLE"; break;
+ default: detail = "(Unknown error code " + err + ")"; break;
+ }
+ return detail;
+ }
+
+ private void maybeDoSingleThreadedWorkaround(Runnable action) {
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ Threading.invokeOnOpenGLThread(action);
+ } else {
+ action.run();
+ }
+ }
+
+ public boolean canCreateContextOnJava2DSurface() {
+ return false;
+ }
+
+ public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+ throws GLException {
+ throw new GLException("Unimplemented on this platform");
+ }
+
+ //------------------------------------------------------
+ // Gamma-related functionality
+ //
+
+ private static final int GAMMA_RAMP_LENGTH = 256;
+
+ protected int getGammaRampLength() {
+ return GAMMA_RAMP_LENGTH;
+ }
+
+ protected boolean setGammaRamp(float[] ramp) {
+ short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
+ for (int i = 0; i < GAMMA_RAMP_LENGTH; i++) {
+ short scaledValue = (short) (ramp[i] * 65535);
+ rampData[i] = scaledValue;
+ rampData[i + GAMMA_RAMP_LENGTH] = scaledValue;
+ rampData[i + 2 * GAMMA_RAMP_LENGTH] = scaledValue;
+ }
+
+ long screenDC = WGL.GetDC(0);
+ boolean res = WGL.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
+ WGL.ReleaseDC(0, screenDC);
+ return res;
+ }
+
+ protected Buffer getGammaRamp() {
+ ShortBuffer rampData = ShortBuffer.allocate(3 * GAMMA_RAMP_LENGTH);
+ long screenDC = WGL.GetDC(0);
+ boolean res = WGL.GetDeviceGammaRamp(screenDC, rampData);
+ WGL.ReleaseDC(0, screenDC);
+ if (!res) {
+ return null;
+ }
+ return rampData;
+ }
+
+ protected void resetGammaRamp(Buffer originalGammaRamp) {
+ if (originalGammaRamp == null) {
+ // getGammaRamp failed earlier
+ return;
+ }
+ long screenDC = WGL.GetDC(0);
+ WGL.SetDeviceGammaRamp(screenDC, originalGammaRamp);
+ WGL.ReleaseDC(0, screenDC);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
new file mode 100644
index 000000000..8b721824e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -0,0 +1,443 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.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;
+
+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 int MAX_PFORMATS = 256;
+ protected static final int MAX_ATTRIBS = 256;
+
+ private PIXELFORMATDESCRIPTOR pixelfmt;
+ private int pixelfmtID;
+ private boolean isChosen = false;
+ private GLCapabilitiesChooser chooser;
+
+ public WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen, GLCapabilities capsChosen, GLCapabilities capsRequested,
+ PIXELFORMATDESCRIPTOR pixelfmt, int pixelfmtID, GLCapabilitiesChooser chooser) {
+ super(screen, capsChosen, capsRequested);
+ this.chooser=chooser;
+ this.pixelfmt = pixelfmt;
+ this.pixelfmtID = pixelfmtID;
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ protected void updateGraphicsConfiguration(GLDrawableFactory factory, NativeWindow nativeWindow, boolean useOffScreen) {
+ WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, nativeWindow, useOffScreen);
+ }
+ protected void setCapsPFD(GLCapabilities caps, PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+ // FIXME: setScreen ( .. )
+ this.pixelfmt = pfd;
+ this.pixelfmtID = pfdID;
+ setChosenCapabilities(caps);
+ isChosen=true;
+ }
+
+ public boolean getCapabilitiesChosen() {
+ return isChosen;
+ }
+
+ public PIXELFORMATDESCRIPTOR getPixelFormat() { return pixelfmt; }
+ public int getPixelFormatID() { return pixelfmtID; }
+
+ public static boolean GLCapabilities2AttribList(GLCapabilities caps,
+ int[] iattributes,
+ WGLExt wglExt,
+ boolean pbuffer,
+ int[] floatMode) throws GLException {
+ if (!wglExt.isExtensionAvailable("WGL_ARB_pixel_format")) {
+ return false;
+ }
+
+ int niattribs = 0;
+
+ iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ if (pbuffer) {
+ iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_PBUFFER_ARB;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ } else {
+ iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ }
+
+ iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
+ if (caps.getDoubleBuffered()) {
+ iattributes[niattribs++] = GL.GL_TRUE;
+ } else {
+ iattributes[niattribs++] = GL.GL_FALSE;
+ }
+
+ iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
+ if (caps.getStereo()) {
+ iattributes[niattribs++] = GL.GL_TRUE;
+ } else {
+ iattributes[niattribs++] = GL.GL_FALSE;
+ }
+
+ iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
+ iattributes[niattribs++] = caps.getDepthBits();
+ iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
+ iattributes[niattribs++] = caps.getRedBits();
+ iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
+ iattributes[niattribs++] = caps.getGreenBits();
+ iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
+ iattributes[niattribs++] = caps.getBlueBits();
+ iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
+ iattributes[niattribs++] = caps.getAlphaBits();
+ iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
+ iattributes[niattribs++] = caps.getStencilBits();
+ if (caps.getAccumRedBits() > 0 ||
+ caps.getAccumGreenBits() > 0 ||
+ caps.getAccumBlueBits() > 0 ||
+ caps.getAccumAlphaBits() > 0) {
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_BITS_ARB;
+ iattributes[niattribs++] = (caps.getAccumRedBits() +
+ caps.getAccumGreenBits() +
+ caps.getAccumBlueBits() +
+ caps.getAccumAlphaBits());
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
+ iattributes[niattribs++] = caps.getAccumRedBits();
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
+ iattributes[niattribs++] = caps.getAccumGreenBits();
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
+ iattributes[niattribs++] = caps.getAccumBlueBits();
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
+ iattributes[niattribs++] = caps.getAccumAlphaBits();
+ }
+
+ if (wglExt.isExtensionAvailable("WGL_ARB_multisample")) {
+ if (caps.getSampleBuffers()) {
+ iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
+ iattributes[niattribs++] = caps.getNumSamples();
+ }
+ }
+
+ boolean rtt = caps.getPbufferRenderToTexture();
+ boolean rect = caps.getPbufferRenderToTextureRectangle();
+ boolean useFloat = caps.getPbufferFloatingPointBuffers();
+ boolean ati = false;
+ if (pbuffer) {
+ // Check some invariants and set up some state
+ if (rect && !rtt) {
+ throw new GLException("Render-to-texture-rectangle requires render-to-texture to be specified");
+ }
+
+ if (rect) {
+ if (!wglExt.isExtensionAvailable("GL_NV_texture_rectangle")) {
+ throw new GLException("Render-to-texture-rectangle requires GL_NV_texture_rectangle extension");
+ }
+ }
+
+ if (useFloat) {
+ if (!wglExt.isExtensionAvailable("WGL_ATI_pixel_format_float") &&
+ !wglExt.isExtensionAvailable("WGL_NV_float_buffer")) {
+ throw new GLException("Floating-point pbuffers not supported by this hardware");
+ }
+
+ // Prefer NVidia extension over ATI
+ if (wglExt.isExtensionAvailable("WGL_NV_float_buffer")) {
+ ati = false;
+ floatMode[0] = GLPbuffer.NV_FLOAT;
+ } else {
+ ati = true;
+ floatMode[0] = GLPbuffer.ATI_FLOAT;
+ }
+ if (DEBUG) {
+ System.err.println("Using " + (ati ? "ATI" : "NVidia") + " floating-point extension");
+ }
+ }
+
+ // See whether we need to change the pixel type to support ATI's
+ // floating-point pbuffers
+ if (useFloat && ati) {
+ if (rtt) {
+ throw new GLException("Render-to-floating-point-texture not supported on ATI hardware");
+ } else {
+ iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_FLOAT_ARB;
+ }
+ } else {
+ if (!rtt) {
+ // Currently we don't support non-truecolor visuals in the
+ // GLCapabilities, so we don't offer the option of making
+ // color-index pbuffers.
+ iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB;
+ }
+ }
+
+ if (useFloat && !ati) {
+ iattributes[niattribs++] = WGLExt.WGL_FLOAT_COMPONENTS_NV;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ }
+
+ if (rtt) {
+ if (useFloat) {
+ assert(!ati);
+ if (!rect) {
+ throw new GLException("Render-to-floating-point-texture only supported on NVidia hardware with render-to-texture-rectangle");
+ }
+ iattributes[niattribs++] = WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ } else {
+ iattributes[niattribs++] = rect ? WGLExt.WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV : WGLExt.WGL_BIND_TO_TEXTURE_RGB_ARB;
+ iattributes[niattribs++] = GL.GL_TRUE;
+ }
+ }
+ } else {
+ iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA_ARB;
+ }
+ iattributes[niattribs++] = 0;
+
+ return true;
+ }
+
+ public static GLCapabilities AttribList2GLCapabilities(GLProfile glp, int[] iattribs,
+ int niattribs,
+ int[] iresults,
+ boolean requireRenderToWindow) {
+ GLCapabilities res = new GLCapabilities(glp);
+ for (int i = 0; i < niattribs; i++) {
+ int attr = iattribs[i];
+ switch (attr) {
+ case WGLExt.WGL_DRAW_TO_WINDOW_ARB:
+ if (requireRenderToWindow && iresults[i] != GL.GL_TRUE) {
+ return null;
+ }
+ break;
+
+ case WGLExt.WGL_DRAW_TO_PBUFFER_ARB:
+ break;
+
+ case WGLExt.WGL_ACCELERATION_ARB:
+ res.setHardwareAccelerated(iresults[i] == WGLExt.WGL_FULL_ACCELERATION_ARB);
+ break;
+
+ case WGLExt.WGL_SUPPORT_OPENGL_ARB:
+ if (iresults[i] != GL.GL_TRUE) {
+ return null;
+ }
+ break;
+
+ case WGLExt.WGL_DEPTH_BITS_ARB:
+ res.setDepthBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_STENCIL_BITS_ARB:
+ res.setStencilBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_DOUBLE_BUFFER_ARB:
+ res.setDoubleBuffered(iresults[i] == GL.GL_TRUE);
+ break;
+
+ case WGLExt.WGL_STEREO_ARB:
+ res.setStereo(iresults[i] == GL.GL_TRUE);
+ break;
+
+ case WGLExt.WGL_PIXEL_TYPE_ARB:
+ // Fail softly with unknown results here
+ if (iresults[i] == WGLExt.WGL_TYPE_RGBA_ARB||
+ iresults[i] == WGLExt.WGL_TYPE_RGBA_FLOAT_ARB) {
+ res.setPbufferFloatingPointBuffers(true);
+ }
+ break;
+
+ case WGLExt.WGL_FLOAT_COMPONENTS_NV:
+ if (iresults[i] != 0) {
+ res.setPbufferFloatingPointBuffers(true);
+ }
+ break;
+
+ case WGLExt.WGL_RED_BITS_ARB:
+ res.setRedBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_GREEN_BITS_ARB:
+ res.setGreenBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_BLUE_BITS_ARB:
+ res.setBlueBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_ALPHA_BITS_ARB:
+ res.setAlphaBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_ACCUM_RED_BITS_ARB:
+ res.setAccumRedBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_ACCUM_GREEN_BITS_ARB:
+ res.setAccumGreenBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_ACCUM_BLUE_BITS_ARB:
+ res.setAccumBlueBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_ACCUM_ALPHA_BITS_ARB:
+ res.setAccumAlphaBits(iresults[i]);
+ break;
+
+ case WGLExt.WGL_SAMPLE_BUFFERS_ARB:
+ res.setSampleBuffers(iresults[i] != 0);
+ break;
+
+ case WGLExt.WGL_SAMPLES_ARB:
+ res.setNumSamples(iresults[i]);
+ break;
+
+ default:
+ throw new GLException("Unknown pixel format attribute " + iattribs[i]);
+ }
+ }
+ return res;
+ }
+
+ // PIXELFORMAT
+
+ public static GLCapabilities PFD2GLCapabilities(GLProfile glp, PIXELFORMATDESCRIPTOR pfd) {
+ if ((pfd.dwFlags() & WGL.PFD_SUPPORT_OPENGL) == 0) {
+ return null;
+ }
+ GLCapabilities res = new GLCapabilities(glp);
+ res.setRedBits (pfd.cRedBits());
+ res.setGreenBits (pfd.cGreenBits());
+ res.setBlueBits (pfd.cBlueBits());
+ res.setAlphaBits (pfd.cAlphaBits());
+ res.setAccumRedBits (pfd.cAccumRedBits());
+ res.setAccumGreenBits(pfd.cAccumGreenBits());
+ res.setAccumBlueBits (pfd.cAccumBlueBits());
+ res.setAccumAlphaBits(pfd.cAccumAlphaBits());
+ res.setDepthBits (pfd.cDepthBits());
+ res.setStencilBits (pfd.cStencilBits());
+ res.setDoubleBuffered((pfd.dwFlags() & WGL.PFD_DOUBLEBUFFER) != 0);
+ res.setStereo ((pfd.dwFlags() & WGL.PFD_STEREO) != 0);
+ res.setHardwareAccelerated(((pfd.dwFlags() & WGL.PFD_GENERIC_FORMAT) == 0) ||
+ ((pfd.dwFlags() & WGL.PFD_GENERIC_ACCELERATED) != 0));
+ /* FIXME: Missing ??
+ if (GLXUtil.isMultisampleAvailable()) {
+ res.setSampleBuffers(glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
+ res.setNumSamples (glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLES, tmp, 0));
+ }
+ res.setBackgroundOpaque(glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_TYPE, tmp, 0) != GLX.GLX_NONE);
+ try {
+ res.setPbufferFloatingPointBuffers(glXGetFBConfig(display, fbcfg, GLXExt.GLX_FLOAT_COMPONENTS_NV, tmp, 0) != GL.GL_FALSE);
+ } catch (Exception e) {}
+ */
+ return res;
+ }
+
+ public static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilities caps, boolean offscreen) {
+ int colorDepth = (caps.getRedBits() +
+ caps.getGreenBits() +
+ caps.getBlueBits());
+ if (colorDepth < 15) {
+ throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported");
+ }
+ PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
+ int pfdFlags = (WGL.PFD_SUPPORT_OPENGL |
+ WGL.PFD_GENERIC_ACCELERATED);
+ if (caps.getDoubleBuffered()) {
+ pfdFlags |= WGL.PFD_DOUBLEBUFFER;
+ }
+ if (offscreen) {
+ pfdFlags |= WGL.PFD_DRAW_TO_BITMAP;
+ } else {
+ pfdFlags |= WGL.PFD_DRAW_TO_WINDOW;
+ }
+ if (caps.getStereo()) {
+ pfdFlags |= WGL.PFD_STEREO;
+ }
+ pfd.dwFlags(pfdFlags);
+ pfd.iPixelType((byte) WGL.PFD_TYPE_RGBA);
+ pfd.cColorBits((byte) colorDepth);
+ pfd.cRedBits ((byte) caps.getRedBits());
+ pfd.cGreenBits((byte) caps.getGreenBits());
+ pfd.cBlueBits ((byte) caps.getBlueBits());
+ pfd.cAlphaBits((byte) caps.getAlphaBits());
+ int accumDepth = (caps.getAccumRedBits() +
+ caps.getAccumGreenBits() +
+ caps.getAccumBlueBits());
+ pfd.cAccumBits ((byte) accumDepth);
+ pfd.cAccumRedBits ((byte) caps.getAccumRedBits());
+ pfd.cAccumGreenBits((byte) caps.getAccumGreenBits());
+ pfd.cAccumBlueBits ((byte) caps.getAccumBlueBits());
+ pfd.cAccumAlphaBits((byte) caps.getAccumAlphaBits());
+ pfd.cDepthBits((byte) caps.getDepthBits());
+ pfd.cStencilBits((byte) caps.getStencilBits());
+ pfd.iLayerType((byte) WGL.PFD_MAIN_PLANE);
+
+ /* FIXME: Missing:
+ caps.getSampleBuffers()
+ caps.getNumSamples ()
+ }
+ caps.getBackgroundOpaque()
+ try {
+ caps.getPbufferFloatingPointBuffers()
+ } catch (Exception e) {}
+ */
+ return pfd;
+ }
+
+ public static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor() {
+ PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
+ pfd.nSize((short) pfd.size());
+ pfd.nVersion((short) 1);
+ return pfd;
+ }
+
+ public String toString() {
+ return "WindowsWGLGraphicsConfiguration["+getScreen()+", pfdID " + pixelfmtID +
+ ",\n\trequested " + getRequestedCapabilities() +
+ ",\n\tchosen " + getChosenCapabilities() +
+ "]";
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..df8081f05
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.windows.wgl;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.windows.*;
+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 Windows platforms. Toolkits will likely need to delegate
+ to this one to change the accepted and returned types of the
+ GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class WindowsWGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration");
+
+ public WindowsWGLGraphicsConfigurationFactory() {
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.windows.WindowsGraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ return chooseGraphicsConfigurationStatic((GLCapabilities)capabilities, chooser, absScreen, false);
+ }
+
+ protected static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(AbstractGraphicsScreen absScreen, boolean useOffScreen) {
+ GLCapabilities caps = new GLCapabilities(null);
+ if(null==absScreen) {
+ absScreen = DefaultGraphicsScreen.createScreenDevice(0);
+ }
+ return new WindowsWGLGraphicsConfiguration(absScreen, caps, caps, WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps, useOffScreen), -1, null);
+ }
+
+ protected static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilities caps,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen, boolean useOffScreen) {
+ if(null==absScreen) {
+ absScreen = DefaultGraphicsScreen.createScreenDevice(0);
+ }
+ return new WindowsWGLGraphicsConfiguration(absScreen, caps, caps, WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(caps, useOffScreen), -1,
+ (GLCapabilitiesChooser)chooser);
+ }
+
+ protected static void updateGraphicsConfiguration(CapabilitiesChooser chooser,
+ GLDrawableFactory factory, NativeWindow nativeWindow, boolean useOffScreen) {
+ if (nativeWindow == null) {
+ throw new IllegalArgumentException("NativeWindow is null");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) nativeWindow.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ GLCapabilities capabilities = (GLCapabilities) config.getRequestedCapabilities();
+ GLProfile glProfile = capabilities.getGLProfile();
+ long hdc = nativeWindow.getSurfaceHandle();
+
+ if (DEBUG) {
+ Exception ex = new Exception("WindowsWGLGraphicsConfigurationFactory got HDC 0x"+Long.toHexString(hdc));
+ ex.printStackTrace();
+ System.err.println("WindowsWGLGraphicsConfigurationFactory got NW "+nativeWindow);
+ }
+
+ PIXELFORMATDESCRIPTOR pfd = null;
+ int pixelFormat = 0;
+ GLCapabilities chosenCaps = null;
+
+ if (!useOffScreen) {
+ if ((pixelFormat = WGL.GetPixelFormat(hdc)) != 0) {
+ // Pixelformat already set by either
+ // - a previous updateGraphicsConfiguration() call on the same HDC,
+ // - the graphics driver, copying the HDC's pixelformat to the new one,
+ // - or the Java2D/OpenGL pipeline's configuration
+ if (DEBUG) {
+ System.err.println("!!!! NOTE: pixel format already chosen for HDC: 0x" + Long.toHexString(hdc)+
+ ", pixelformat "+WGL.GetPixelFormat(hdc));
+ }
+ pfd = WindowsWGLGraphicsConfiguration.createPixelFormatDescriptor();
+ if (WGL.DescribePixelFormat(hdc, pixelFormat, pfd.size(), pfd) == 0) {
+ // FIXME: should this just be a warning? Not really critical...
+ throw new GLException("Unable to describe pixel format " + pixelFormat +
+ " of window set by Java2D/OpenGL pipeline");
+ }
+ config.setCapsPFD(WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, pfd), pfd, pixelFormat);
+ return;
+ }
+
+ GLCapabilities[] availableCaps = null;
+ int numFormats = 0;
+ 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();
+ }
+ }
+ int recommendedPixelFormat = -1;
+ boolean haveWGLChoosePixelFormatARB = false;
+ boolean haveWGLARBMultisample = false;
+ boolean gotAvailableCaps = false;
+ if (dummyWGLExt != null) {
+ try {
+ haveWGLChoosePixelFormatARB = dummyWGLExt.isExtensionAvailable("WGL_ARB_pixel_format");
+ if (haveWGLChoosePixelFormatARB) {
+ haveWGLARBMultisample = dummyWGLExt.isExtensionAvailable("WGL_ARB_multisample");
+
+ int[] iattributes = new int [2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
+ int[] iresults = new int [2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS];
+ float[] fattributes = new float[1];
+
+ if(WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
+ iattributes,
+ dummyWGLExt,
+ false,
+ null)) {
+ int[] pformats = new int[WindowsWGLGraphicsConfiguration.MAX_PFORMATS];
+ int[] numFormatsTmp = new int[1];
+ if (dummyWGLExt.wglChoosePixelFormatARB(hdc,
+ iattributes, 0,
+ fattributes, 0,
+ WindowsWGLGraphicsConfiguration.MAX_PFORMATS,
+ pformats, 0,
+ numFormatsTmp, 0)) {
+ numFormats = numFormatsTmp[0];
+ if (numFormats > 0) {
+ // Remove one-basing of pixel format (added on later)
+ recommendedPixelFormat = pformats[0] - 1;
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": Used wglChoosePixelFormatARB to recommend pixel format " + recommendedPixelFormat);
+ }
+ }
+ } else {
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": wglChoosePixelFormatARB failed: " + WGL.GetLastError() );
+ Thread.dumpStack();
+ }
+ }
+ if (DEBUG) {
+ if (recommendedPixelFormat < 0) {
+ System.err.print(getThreadName() + ": wglChoosePixelFormatARB didn't recommend a pixel format");
+ if (capabilities.getSampleBuffers()) {
+ System.err.print(" for multisampled GLCapabilities");
+ }
+ System.err.println();
+ }
+ }
+
+ // Produce a list of GLCapabilities to give to the
+ // GLCapabilitiesChooser.
+ // Use wglGetPixelFormatAttribivARB instead of
+ // DescribePixelFormat to get higher-precision information
+ // about the pixel format (should make the GLCapabilities
+ // more precise as well...i.e., remove the
+ // "HardwareAccelerated" bit, which is basically
+ // meaningless, and put in whether it can render to a
+ // window, to a pbuffer, or to a pixmap)
+ int niattribs = 0;
+ iattributes[0] = WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB;
+ if (dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, iattributes, 0, iresults, 0)) {
+ numFormats = iresults[0];
+
+ if (DEBUG) {
+ System.err.println("wglGetPixelFormatAttribivARB reported WGL_NUMBER_PIXEL_FORMATS = " + numFormats);
+ }
+
+ // Should we be filtering out the pixel formats which aren't
+ // applicable, as we are doing here?
+ // We don't have enough information in the GLCapabilities to
+ // represent those that aren't...
+ iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCELERATION_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_SUPPORT_OPENGL_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_DEPTH_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_STENCIL_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_DOUBLE_BUFFER_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_STEREO_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_RED_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_GREEN_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_BLUE_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ALPHA_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_RED_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_GREEN_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_BLUE_BITS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_ACCUM_ALPHA_BITS_ARB;
+ if (haveWGLARBMultisample) {
+ iattributes[niattribs++] = WGLExt.WGL_SAMPLE_BUFFERS_ARB;
+ iattributes[niattribs++] = WGLExt.WGL_SAMPLES_ARB;
+ }
+
+ availableCaps = new GLCapabilities[numFormats];
+ for (int i = 0; i < numFormats; i++) {
+ if (!dummyWGLExt.wglGetPixelFormatAttribivARB(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) {
+ throw new GLException("Error getting pixel format attributes for pixel format " + (i + 1) + " of device context");
+ }
+ availableCaps[i] = WindowsWGLGraphicsConfiguration.AttribList2GLCapabilities(glProfile, iattributes, niattribs, iresults, true);
+ }
+ gotAvailableCaps = true;
+ } else {
+ long lastErr = WGL.GetLastError();
+ // Intel Extreme graphics fails with a zero error code
+ if (lastErr != 0) {
+ throw new GLException("Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code " + WGL.GetLastError());
+ }
+ }
+ }
+ }
+ } finally {
+ dummyContext.release();
+ dummyContext.destroy();
+ dummyDrawable.destroy();
+ }
+ }
+
+ // Fallback path for older cards, in particular Intel Extreme motherboard graphics
+ if (!gotAvailableCaps) {
+ if (DEBUG) {
+ if (!capabilities.getSampleBuffers()) {
+ System.err.println(getThreadName() + ": Using ChoosePixelFormat because multisampling not requested");
+ } else {
+ System.err.println(getThreadName() + ": Using ChoosePixelFormat because no wglChoosePixelFormatARB");
+ }
+ }
+ pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(capabilities, !useOffScreen);
+ recommendedPixelFormat = WGL.ChoosePixelFormat(hdc, pfd);
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": Recommended pixel format = " + recommendedPixelFormat);
+ }
+ // Remove one-basing of pixel format (added on later)
+ recommendedPixelFormat -= 1;
+
+ numFormats = WGL.DescribePixelFormat(hdc, 1, 0, null);
+ if (numFormats == 0) {
+ throw new GLException("Unable to enumerate pixel formats of window " +
+ toHexString(hdc) + " for GLCapabilitiesChooser");
+ }
+ availableCaps = new GLCapabilities[numFormats];
+ for (int i = 0; i < numFormats; i++) {
+ if (WGL.DescribePixelFormat(hdc, 1 + i, pfd.size(), pfd) == 0) {
+ throw new GLException("Error describing pixel format " + (1 + i) + " of device context");
+ }
+ availableCaps[i] = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, pfd);
+ }
+ }
+
+ // NOTE: officially, should make a copy of all of these
+ // GLCapabilities to avoid mutation by the end user during the
+ // chooseCapabilities call, but for the time being, assume they
+ // won't be changed
+
+ if(null!=chooser) {
+ // Supply information to chooser
+ try {
+ pixelFormat = chooser.chooseCapabilities(capabilities, availableCaps, recommendedPixelFormat);
+ } catch (NativeWindowException e) {
+ throw new GLException(e);
+ }
+ } else {
+ pixelFormat = recommendedPixelFormat;
+ }
+ if ((pixelFormat < 0) || (pixelFormat >= numFormats)) {
+ throw new GLException("Invalid result " + pixelFormat +
+ " from GLCapabilitiesChooser (should be between 0 and " +
+ (numFormats - 1) + ")");
+ }
+ pixelFormat += 1; // one-base the index
+ chosenCaps = availableCaps[pixelFormat-1];
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": Chosen pixel format (" + pixelFormat + "):");
+ System.err.println(chosenCaps);
+ }
+ if (WGL.DescribePixelFormat(hdc, pixelFormat, pfd.size(), pfd) == 0) {
+ throw new GLException("Error re-describing the chosen pixel format: " + WGL.GetLastError());
+ }
+ } else {
+ // For now, use ChoosePixelFormat for offscreen surfaces until
+ // we figure out how to properly choose an offscreen-
+ // compatible pixel format
+ pfd = WindowsWGLGraphicsConfiguration.GLCapabilities2PFD(capabilities, !useOffScreen);
+ pixelFormat = WGL.ChoosePixelFormat(hdc, pfd);
+ }
+ if (!WGL.SetPixelFormat(hdc, pixelFormat, pfd)) {
+ long lastError = WGL.GetLastError();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": SetPixelFormat failed: current context = " + WGL.wglGetCurrentContext() +
+ ", current DC = " + WGL.wglGetCurrentDC());
+ System.err.println(getThreadName() + ": GetPixelFormat(hdc " + toHexString(hdc) + ") returns " + WGL.GetPixelFormat(hdc));
+ }
+ throw new GLException("Unable to set pixel format " + pixelFormat + " for device context " + toHexString(hdc) + ": error code " + lastError);
+ }
+ // Reuse the previously-constructed GLCapabilities because it
+ // turns out that using DescribePixelFormat on some pixel formats
+ // (which, for example, support full-scene antialiasing) for some
+ // reason return that they are not OpenGL-capable
+ if (chosenCaps != null) {
+ capabilities = chosenCaps;
+ } else {
+ capabilities = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(glProfile, pfd);
+ }
+ config.setCapsPFD(capabilities, pfd, pixelFormat);
+ }
+
+ protected static String getThreadName() {
+ return Thread.currentThread().getName();
+ }
+ public static String toHexString(long hex) {
+ return "0x" + Long.toHexString(hex);
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..f4c0a8049
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.windows.wgl.awt;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.windows.*;
+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.*;
+
+public class WindowsAWTWGLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("GraphicsConfiguration");
+
+ public WindowsAWTWGLGraphicsConfigurationFactory() {
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ GraphicsDevice device = null;
+ if (absScreen != null &&
+ !(absScreen instanceof AWTGraphicsScreen)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
+ }
+
+ if(null==absScreen) {
+ absScreen = AWTGraphicsScreen.createScreenDevice(-1);
+ }
+ AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+ device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
+
+ if (capabilities != null &&
+ !(capabilities instanceof GLCapabilities)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ if(DEBUG) {
+ System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: got "+absScreen);
+ }
+ GraphicsConfiguration gc = device.getDefaultConfiguration();
+ AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capabilities, gc);
+ if(DEBUG) {
+ System.err.println("AWT Colormodel compatible: "+capabilities);
+ }
+
+ long displayHandle = 0;
+
+ WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice();
+ DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
+ if(DEBUG) {
+ System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: made "+winScreen);
+ }
+
+ WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(winDevice).chooseGraphicsConfiguration(capabilities,
+ chooser,
+ winScreen);
+
+ if (winConfig == null) {
+ throw new GLException("Unable to choose a GraphicsConfiguration: "+capabilities+",\n\t"+chooser+"\n\t"+winScreen);
+ }
+
+ if(DEBUG) {
+ System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: chosen "+winConfig);
+ }
+
+ // FIXME: we have nothing to match .. so choose the default
+ return new AWTGraphicsConfiguration(awtScreen, winConfig.getChosenCapabilities(), winConfig.getRequestedCapabilities(), gc, winConfig);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java
new file mode 100644
index 000000000..b8968ee99
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/GLXUtil.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.opengl.*;
+
+import com.sun.opengl.impl.*;
+import javax.media.nativewindow.NativeWindowFactory;
+import com.sun.nativewindow.impl.x11.*;
+
+public class GLXUtil {
+ private static final boolean DEBUG = Debug.debug("GLXUtil");
+
+ private GLXUtil() {}
+
+ // ATI's proprietary drivers apparently send GLX tokens even for
+ // direct contexts, so we need to disable the context optimizations
+ // in this case
+ private static boolean isVendorATI;
+
+ // Display connection for use by visual selection algorithm and by all offscreen surfaces
+ private static boolean multisampleAvailable=false;
+
+ private static boolean isInit=false;
+
+ private static void init() {
+ if (!isInit) {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ long staticDisplay = X11Util.getStaticDefaultDisplay();
+ if(staticDisplay!=0) {
+ if (DEBUG) {
+ long display = staticDisplay;
+ int screen = X11Lib.DefaultScreen(display);
+ System.err.println("!!! GLX server vendor : " +
+ GLX.glXQueryServerString(display, screen, GLX.GLX_VENDOR));
+ System.err.println("!!! GLX server version: " +
+ GLX.glXQueryServerString(display, screen, GLX.GLX_VERSION));
+ System.err.println("!!! GLX client vendor : " +
+ GLX.glXGetClientString(display, GLX.GLX_VENDOR));
+ System.err.println("!!! GLX client version: " +
+ GLX.glXGetClientString(display, GLX.GLX_VERSION));
+ }
+ String vendor = GLX.glXGetClientString(staticDisplay, GLX.GLX_VENDOR);
+ if (vendor != null && vendor.startsWith("ATI")) {
+ isVendorATI = true;
+ }
+ String exts = GLX.glXGetClientString(staticDisplay, GLX.GLX_EXTENSIONS);
+ if (exts != null) {
+ multisampleAvailable = (exts.indexOf("GLX_ARB_multisample") >= 0);
+ }
+ isInit=true;
+ } else {
+ throw new GLException("Unable to open default display, needed for visual selection and offscreen surface handling");
+ }
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+ }
+ }
+
+ public static boolean isMultisampleAvailable() {
+ init();
+ return multisampleAvailable;
+ }
+
+ /** Workaround for apparent issue with ATI's proprietary drivers
+ where direct contexts still send GLX tokens for GL calls */
+ public static boolean isVendorATI() {
+ init();
+ return isVendorATI;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
new file mode 100755
index 000000000..6491c33da
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+import com.sun.nativewindow.impl.x11.*;
+
+public class X11ExternalGLXContext extends X11GLXContext {
+ private boolean firstMakeCurrent = true;
+ private boolean created = true;
+ private GLContext lastContext;
+
+ public X11ExternalGLXContext(AbstractGraphicsScreen screen) {
+ super(null, null);
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ context = GLX.glXGetCurrentContext();
+ if (context == 0) {
+ throw new GLException("Error: attempted to make an external GLContext without a drawable/context current");
+ }
+ NullWindow nw = new NullWindow(X11GLXGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(screen, false));
+ drawable = new Drawable(getGLDrawable().getFactory(), nw);
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ GLContextShareSet.contextCreated(this);
+ setGLFunctionAvailability(false);
+ }
+
+ protected void create() {
+ }
+
+ public int makeCurrent() throws GLException {
+ // Save last context if necessary to allow external GLContexts to
+ // talk to other GLContexts created by this library
+ GLContext cur = getCurrent();
+ if (cur != null && cur != this) {
+ lastContext = cur;
+ setCurrent(null);
+ }
+ return super.makeCurrent();
+ }
+
+ public void release() throws GLException {
+ super.release();
+ setCurrent(lastContext);
+ lastContext = null;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (firstMakeCurrent) {
+ firstMakeCurrent = false;
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ }
+
+ protected void destroyImpl() throws GLException {
+ created = false;
+ GLContextShareSet.contextDestroyed(this);
+ }
+
+ public boolean isCreated() {
+ return created;
+ }
+
+ // Need to provide the display connection to extension querying APIs
+ class Drawable extends X11GLXDrawable {
+ Drawable(GLDrawableFactory factory, NativeWindow comp) {
+ super(factory, comp, true);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ throw new GLException("Should not call this");
+ }
+
+ public int getWidth() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getHeight() {
+ throw new GLException("Should not call this");
+ }
+
+ public void setSize(int width, int height) {
+ throw new GLException("Should not call this");
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
new file mode 100755
index 000000000..7f65c0d89
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+import com.sun.nativewindow.impl.x11.*;
+
+import java.nio.LongBuffer;
+
+public class X11ExternalGLXDrawable extends X11GLXDrawable {
+ private int fbConfigID;
+ private int renderType;
+ private long readDrawable;
+
+ private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeWindow component) {
+ super(factory, component, true);
+
+ readDrawable = GLX.glXGetCurrentReadDrawable();
+
+ // Need GLXFBConfig ID in order to properly create new contexts
+ // on this drawable
+ long display = getNativeWindow().getDisplayHandle();
+ long context = GLX.glXGetCurrentContext();
+ int[] val = new int[1];
+ GLX.glXQueryContext(display, context, GLX.GLX_FBCONFIG_ID, val, 0);
+ fbConfigID = val[0];
+ renderType = GLX.GLX_RGBA_TYPE;
+ GLX.glXQueryContext(display, context, GLX.GLX_RENDER_TYPE, val, 0);
+ if ((val[0] & GLX.GLX_RGBA_BIT) == 0) {
+ if (DEBUG) {
+ System.err.println("X11ExternalGLXDrawable: WARNING: forcing GLX_RGBA_TYPE for newly created contexts");
+ }
+ }
+ }
+
+ protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, AbstractGraphicsScreen aScreen) {
+ ((GLDrawableFactoryImpl) factory).lockToolkit();
+ try {
+ long display = GLX.glXGetCurrentDisplay();
+ long context = GLX.glXGetCurrentContext();
+ int[] val = new int[1];
+ GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val, 0);
+ int screen = val[0];
+ long drawable = GLX.glXGetCurrentDrawable();
+ if (drawable == 0) {
+ throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
+ }
+
+ if(screen!=aScreen.getIndex()) {
+ throw new GLException("Error: Passed AbstractGraphicsScreen's index is not current: "+aScreen+", GLX-screen "+screen);
+ }
+ if(display!=aScreen.getDevice().getHandle()) {
+ throw new GLException("Error: Passed AbstractGraphicsScreen's display is not current: "+aScreen+", GLX-display 0x"+Long.toHexString(display));
+ }
+
+ NullWindow nw = new NullWindow(X11GLXGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(aScreen, false));
+ nw.setSurfaceHandle(drawable);
+ return new X11ExternalGLXDrawable(factory, nw);
+ } finally {
+ ((GLDrawableFactoryImpl) factory).unlockToolkit();
+ }
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new Context(this, shareWith);
+ }
+
+ public void setSize(int newWidth, int newHeight) {
+ throw new GLException("Should not call this");
+ }
+
+ public int getWidth() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getHeight() {
+ throw new GLException("Should not call this");
+ }
+
+ class Context extends X11GLXContext {
+ Context(X11GLXDrawable drawable, GLContext shareWith) {
+ super(drawable, shareWith);
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
+ // parent drawable not properly initialized
+ // FIXME: signal error?
+ if (DEBUG) {
+ System.err.println("parent drawable not properly initialized");
+ }
+ return CONTEXT_NOT_CURRENT;
+ }
+
+ // Note that we have to completely override makeCurrentImpl
+ // because the underlying makeCurrent call differs from the norm
+ getFactoryImpl().lockToolkit();
+ try {
+ boolean created = false;
+ if (context == 0) {
+ create();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Created GL context for " + getClass().getName());
+ }
+ created = true;
+ }
+
+ if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
+ readDrawable,
+ context)) {
+ throw new GLException("Error making context current");
+ } else {
+ if (DEBUG && VERBOSE) {
+ System.err.println(getThreadName() + ": glXMakeCurrent(display " + toHexString(drawable.getNativeWindow().getDisplayHandle()) +
+ ", drawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) +
+ ", context " + toHexString(context) + ") succeeded");
+ }
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ } finally {
+ getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void releaseImpl() throws GLException {
+ getFactoryImpl().lockToolkit();
+ try {
+ if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(), 0, 0, 0)) {
+ throw new GLException("Error freeing OpenGL context");
+ }
+ } finally {
+ getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void create() {
+ long display = getNativeWindow().getDisplayHandle();
+ int screen = getNativeWindow().getScreenIndex();
+ // We already have the GLXFBConfig ID for the context. All we
+ // need to do is use it to choose the GLXFBConfig and then
+ // create a context with it.
+ int[] iattributes = new int[] {
+ GLX.GLX_FBCONFIG_ID,
+ fbConfigID,
+ 0,
+ 0
+ };
+ float[] fattributes = new float[0];
+ int[] nelementsTmp = new int[1];
+ LongBuffer fbConfigs = GLX.glXChooseFBConfigCopied(display, screen, iattributes, 0, nelementsTmp, 0);
+ int nelements = nelementsTmp[0];
+ if (nelements <= 0) {
+ throw new GLException("context creation error: couldn't find a suitable frame buffer configuration");
+ }
+ if (nelements != 1) {
+ throw new GLException("context creation error: shouldn't get more than one GLXFBConfig");
+ }
+ // Note that we currently don't allow selection of anything but
+ // the first GLXFBConfig in the returned list (there should be only one)
+ long fbConfig = fbConfigs.get(0);
+ // Create a gl context for the drawable
+ 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");
+ }
+ }
+ // FIXME: how to determine "direct" bit?
+ context = GLX.glXCreateNewContext(display, fbConfig, renderType, share, true);
+ if (context == 0) {
+ String detail = " display=" + toHexString(display) +
+ " fbconfig=" + fbConfig +
+ " fbconfigID=" + toHexString(fbConfigID) +
+ " renderType=" + toHexString(renderType) +
+ " share=" + toHexString(share);
+ throw new GLException("context creation error: glXCreateNewContext() failed: " + detail);
+ }
+ GLContextShareSet.contextCreated(this);
+
+ if (DEBUG) {
+ System.err.println("Created context " + toHexString(context) +
+ " for GLXDrawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()));
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
new file mode 100644
index 000000000..921d305a8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
@@ -0,0 +1,439 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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;
+
+public abstract class X11GLXContext extends GLContextImpl {
+ protected X11GLXDrawable drawable;
+ protected long context;
+ private boolean glXQueryExtensionsStringInitialized;
+ private boolean glXQueryExtensionsStringAvailable;
+ private static final Map/*<String, String>*/ functionNameMap;
+ private GLXExt glXExt;
+ // Table that holds the addresses of the native C-language entry points for
+ // GLX extension functions.
+ private GLXExtProcAddressTable glXExtProcAddressTable;
+
+ static {
+ functionNameMap = new HashMap();
+ functionNameMap.put("glAllocateMemoryNV", "glXAllocateMemoryNV");
+ functionNameMap.put("glFreeMemoryNV", "glXFreeMemoryNV");
+ }
+
+ public X11GLXContext(X11GLXDrawable drawable,
+ GLContext shareWith) {
+ super(drawable.getGLProfile(), shareWith);
+ this.drawable = drawable;
+ }
+
+ public final ProcAddressTable getPlatformExtProcAddressTable() {
+ return getGLXExtProcAddressTable();
+ }
+
+ public final GLXExtProcAddressTable getGLXExtProcAddressTable() {
+ return glXExtProcAddressTable;
+ }
+
+ public Object getPlatformGLExtensions() {
+ return getGLXExt();
+ }
+
+ public GLXExt getGLXExt() {
+ if (glXExt == null) {
+ glXExt = new GLXExtImpl(this);
+ }
+ return glXExt;
+ }
+
+ public GLDrawable getGLDrawable() {
+ return drawable;
+ }
+
+ protected String mapToRealGLFunctionName(String glFunctionName) {
+ String lookup = (String) functionNameMap.get(glFunctionName);
+ if (lookup != null) {
+ return lookup;
+ }
+ return glFunctionName;
+ }
+
+ protected String mapToRealGLExtensionName(String glExtensionName) {
+ return glExtensionName;
+ }
+
+ /** 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();
+
+ /**
+ * Creates and initializes an appropriate OpenGL context. Should only be
+ * called by {@link create()}.
+ */
+ protected void createContext(boolean onscreen) {
+ 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)drawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ if(DEBUG) {
+ System.err.println("X11GLXContext.createContext got "+config);
+ }
+ GLCapabilities glCaps = (GLCapabilities) config.getChosenCapabilities();
+ long display = config.getScreen().getDevice().getHandle();
+
+ if(config.getFBConfigID()<0) {
+ // not able to use FBConfig
+ if(glCaps.getGLProfile().isGL3()) {
+ throw new GLException("Unable to create OpenGL 3.1 context");
+ }
+ context = GLX.glXCreateContext(display, config.getXVisualInfo(), share, onscreen);
+ if (context == 0) {
+ throw new GLException("Unable to create OpenGL context");
+ }
+ if (!GLX.glXMakeContextCurrent(display,
+ drawable.getNativeWindow().getSurfaceHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
+ context)) {
+ throw new GLException("Error making temp context (old2) current: display 0x"+Long.toHexString(display)+", context 0x"+Long.toHexString(context)+", drawable "+drawable);
+ }
+ setGLFunctionAvailability(true);
+ if(DEBUG) {
+ System.err.println("X11GLXContext.createContext done (old2 ctx) 0x"+Long.toHexString(context));
+ }
+
+ } else {
+
+ // 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, onscreen);
+ if (temp_context == 0) {
+ throw new GLException("Unable to create temp OpenGL context");
+ } else {
+ if (!GLX.glXMakeContextCurrent(display,
+ drawable.getNativeWindow().getSurfaceHandle(),
+ drawable.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);
+ }
+ setGLFunctionAvailability(true);
+
+ if( !isFunctionAvailable("glXCreateContextAttribsARB") ||
+ !isExtensionAvailable("GLX_ARB_create_context") ) {
+ if(glCaps.getGLProfile().isGL3()) {
+ if (!GLX.glXMakeContextCurrent(display, 0, 0, 0)) {
+ throw new GLException("Error freeing temp OpenGL context");
+ }
+ 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[] = {
+ GLX.GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+ GLX.GLX_CONTEXT_MINOR_VERSION_ARB, 0,
+ GLX.GLX_CONTEXT_FLAGS_ARB, 0,
+ GLX.GLX_RENDER_TYPE, GLX.GLX_RGBA_TYPE,
+ 0
+ };
+
+ if(glCaps.getGLProfile().isGL3()) {
+ attribs[1] |= 3;
+ attribs[3] |= 1;
+ attribs[5] |= GLX.GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB /* | GLX.GLX_CONTEXT_DEBUG_BIT_ARB */;
+ }
+
+ context = glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, onscreen, attribs, 0);
+ if(0==context) {
+ if(glCaps.getGLProfile().isGL3()) {
+ if (!GLX.glXMakeContextCurrent(display, 0, 0, 0)) {
+ throw new GLException("Error freeing temp OpenGL context");
+ }
+ 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(DEBUG) {
+ System.err.println("X11GLXContext.createContext done (old ctx < 3.0 - no 3.0) 0x"+Long.toHexString(context));
+ }
+ } else {
+ if (!GLX.glXMakeContextCurrent(display, 0, 0, 0)) {
+ throw new GLException("Error freeing temp OpenGL context");
+ }
+ GLX.glXDestroyContext(display, temp_context);
+
+ // need to update the GL func table ..
+ if (!GLX.glXMakeContextCurrent(display,
+ drawable.getNativeWindow().getSurfaceHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
+ context)) {
+ throw new GLException("Error making context (new) current: display 0x"+Long.toHexString(display)+", context 0x"+Long.toHexString(context)+", drawable "+drawable);
+ }
+ updateGLProcAddressTable();
+ if(DEBUG) {
+ System.err.println("X11GLXContext.createContext done (new ctx >= 3.0) 0x"+Long.toHexString(context));
+ }
+ }
+ }
+ }
+ }
+ GLContextShareSet.contextCreated(this);
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
+ if (DEBUG) {
+ System.err.println("drawable not properly initialized");
+ }
+ return CONTEXT_NOT_CURRENT;
+ }
+ boolean created = false;
+ if (context == 0) {
+ create();
+ 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(),
+ drawable.getNativeWindow().getSurfaceHandle(),
+ context)) {
+ throw new GLException("Error making context current");
+ }
+ if (DEBUG && (VERBOSE || created)) {
+ System.err.println(getThreadName() + ": glXMakeCurrent(display " +
+ toHexString(drawable.getNativeWindow().getDisplayHandle()) +
+ ", drawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) +
+ ", context " + toHexString(context) + ") succeeded");
+ }
+ }
+
+ if (created) {
+ setGLFunctionAvailability(false);
+ return CONTEXT_CURRENT_NEW;
+ }
+ return CONTEXT_CURRENT;
+ }
+
+ protected void releaseImpl() throws GLException {
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(), 0, 0, 0)) {
+ throw new GLException("Error freeing OpenGL context");
+ }
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void destroyImpl() throws GLException {
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ if (context != 0) {
+ if (DEBUG) {
+ System.err.println("glXDestroyContext(0x" +
+ Long.toHexString(drawable.getNativeWindow().getDisplayHandle()) +
+ ", 0x" +
+ Long.toHexString(context) + ")");
+ }
+ GLX.glXDestroyContext(drawable.getNativeWindow().getDisplayHandle(), context);
+ if (DEBUG) {
+ System.err.println("!!! Destroyed OpenGL context " + context);
+ }
+ context = 0;
+ GLContextShareSet.contextDestroyed(this);
+ }
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ public boolean isCreated() {
+ return (context != 0);
+ }
+
+ public void copy(GLContext source, int mask) throws GLException {
+ long dst = getContext();
+ long src = ((X11GLXContext) source).getContext();
+ if (src == 0) {
+ throw new GLException("Source OpenGL context has not been created");
+ }
+ if (dst == 0) {
+ throw new GLException("Destination OpenGL context has not been created");
+ }
+ if (drawable.getNativeWindow().getDisplayHandle() == 0) {
+ throw new GLException("Connection to X display not yet set up");
+ }
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ GLX.glXCopyContext(drawable.getNativeWindow().getDisplayHandle(), src, dst, mask);
+ // Should check for X errors and raise GLException
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void updateGLProcAddressTable() {
+ super.updateGLProcAddressTable();
+ if (DEBUG) {
+ System.err.println(getThreadName() + ": !!! Initializing GLX extension address table");
+ }
+ if (glXExtProcAddressTable == null) {
+ // FIXME: cache ProcAddressTables by capability bits so we can
+ // share them among contexts with the same capabilities
+ glXExtProcAddressTable = new GLXExtProcAddressTable();
+ }
+ resetProcAddressTable(getGLXExtProcAddressTable());
+ }
+
+ public synchronized String getPlatformExtensionsString() {
+ if (!glXQueryExtensionsStringInitialized) {
+ glXQueryExtensionsStringAvailable =
+ getDrawableImpl().getDynamicLookupHelper().dynamicLookupFunction("glXQueryExtensionsString") != 0;
+ glXQueryExtensionsStringInitialized = true;
+ }
+ if (glXQueryExtensionsStringAvailable) {
+ GLDrawableFactoryImpl factory = getDrawableImpl().getFactoryImpl();
+ factory.lockToolkit();
+ try {
+ String ret = GLX.glXQueryExtensionsString(drawable.getNativeWindow().getDisplayHandle(),
+ drawable.getNativeWindow().getScreenIndex());
+ if (DEBUG) {
+ System.err.println("!!! GLX extensions: " + ret);
+ }
+ return ret;
+ } finally {
+ factory.unlockToolkit();
+ }
+ } else {
+ return "";
+ }
+ }
+
+ public boolean isExtensionAvailable(String glExtensionName) {
+ if (glExtensionName.equals("GL_ARB_pbuffer") ||
+ glExtensionName.equals("GL_ARB_pixel_format")) {
+ return getGLDrawable().getFactory().canCreateGLPbuffer();
+ }
+ return super.isExtensionAvailable(glExtensionName);
+ }
+
+
+ public void setSwapInterval(int interval) {
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ // FIXME: make the context current first? Currently assumes that
+ // will not be necessary. Make the caller do this?
+ GLXExt glXExt = getGLXExt();
+ if (glXExt.isExtensionAvailable("GLX_SGI_swap_control")) {
+ glXExt.glXSwapIntervalSGI(interval);
+ }
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3) {
+ return getGLXExt().glXAllocateMemoryNV(arg0, arg1, arg2, arg3);
+ }
+
+ public int getOffscreenContextPixelDataType() {
+ throw new GLException("Should not call this");
+ }
+
+ public int getOffscreenContextReadBuffer() {
+ throw new GLException("Should not call this");
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ throw new GLException("Should not call this");
+ }
+
+ public void bindPbufferToTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ public void releasePbufferFromTexture() {
+ throw new GLException("Should not call this");
+ }
+
+ public boolean isOptimizable() {
+ return (super.isOptimizable() &&
+ !GLXUtil.isVendorATI());
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ public long getContext() {
+ return context;
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java
new file mode 100644
index 000000000..a454cc429
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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;
+
+public abstract class X11GLXDrawable extends GLDrawableImpl {
+ protected X11GLXDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized) {
+ super(factory, comp, realized);
+ }
+
+ public DynamicLookupHelper getDynamicLookupHelper() {
+ return (X11GLXDrawableFactory) getFactoryImpl() ;
+ }
+
+ public void setRealized(boolean realized) {
+ super.setRealized(realized);
+
+ if(!realized) {
+ return; // nothing to do
+ }
+
+ if(NativeWindow.LOCK_SURFACE_NOT_READY == lockSurface()) {
+ throw new GLException("X11GLXDrawable.setRealized(true): lockSurface - surface not ready");
+ }
+ try {
+ X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ config.updateGraphicsConfiguration();
+ if (DEBUG) {
+ System.err.println("!!! X11GLXDrawable.setRealized(true): "+config);
+ }
+ } finally {
+ 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/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
new file mode 100644
index 000000000..7491c6d7c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+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.sun.nativewindow.impl.jawt.x11.*;
+
+public class X11GLXDrawableFactory extends GLDrawableFactoryImpl implements DynamicLookupHelper {
+ public X11GLXDrawableFactory() {
+ super();
+ // Must initialize GLX support eagerly in case a pbuffer is the
+ // first thing instantiated
+ GLProcAddressHelper.resetProcAddressTable(GLX.getGLXProcAddressTable(), this);
+ // Register our GraphicsConfigurationFactory implementations
+ // The act of constructing them causes them to be registered
+ new X11GLXGraphicsConfigurationFactory();
+ try {
+ NWReflection.createInstance("com.sun.opengl.impl.x11.glx.awt.X11AWTGLXGraphicsConfigurationFactory",
+ new Object[] {});
+ } catch (Throwable t) { }
+ }
+
+ public GLDrawable createGLDrawable(NativeWindow target) {
+ if (target == null) {
+ throw new IllegalArgumentException("Null target");
+ }
+ target = NativeWindowFactory.getNativeWindow(target, null);
+ return new X11OnscreenGLXDrawable(this, target);
+ }
+
+ public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault();
+ return new X11OffscreenGLXDrawable(this, screen, capabilities, chooser, width, height);
+ }
+
+ private boolean pbufferSupportInitialized = false;
+ private boolean canCreateGLPbuffer = false;
+ public boolean canCreateGLPbuffer() {
+ if (!pbufferSupportInitialized) {
+ Runnable r = new Runnable() {
+ public void run() {
+ lockToolkit();
+ try {
+ long display = X11Util.getStaticDefaultDisplay();
+ 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");
+ }
+ 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;
+ } finally {
+ unlockToolkit();
+ }
+ }
+ };
+ maybeDoSingleThreadedWorkaround(r);
+ }
+ return canCreateGLPbuffer;
+ }
+
+ public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
+ final GLCapabilitiesChooser chooser,
+ final int initialWidth,
+ final int initialHeight,
+ final GLContext shareWith) {
+ if (!canCreateGLPbuffer()) {
+ throw new GLException("Pbuffer support not available with current graphics card");
+ }
+ final List returnList = new ArrayList();
+ final GLDrawableFactory factory = this;
+ Runnable r = new Runnable() {
+ public void run() {
+ AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault();
+ X11PbufferGLXDrawable pbufferDrawable = new X11PbufferGLXDrawable(factory, screen, capabilities, chooser,
+ initialWidth,
+ initialHeight);
+ GLPbufferImpl pbuffer = new GLPbufferImpl(pbufferDrawable, shareWith);
+ returnList.add(pbuffer);
+ }
+ };
+ maybeDoSingleThreadedWorkaround(r);
+ return (GLPbuffer) returnList.get(0);
+ }
+
+ public GLContext createExternalGLContext() {
+ AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault();
+ return new X11ExternalGLXContext(screen);
+ }
+
+ public boolean canCreateExternalGLDrawable() {
+ return canCreateGLPbuffer();
+ }
+
+ public GLDrawable createExternalGLDrawable() {
+ AbstractGraphicsScreen screen = X11GraphicsScreen.createDefault();
+ return X11ExternalGLXDrawable.create(this, screen);
+ }
+
+ public void loadGLULibrary() {
+ X11Lib.dlopen("/usr/lib/libGLU.so");
+ }
+
+ public long dynamicLookupFunction(String glFuncName) {
+ long res = 0;
+ res = GLX.glXGetProcAddressARB(glFuncName);
+ if (res == 0) {
+ // GLU routines aren't known to the OpenGL function lookup
+ res = X11Lib.dlsym(glFuncName);
+ }
+ return res;
+ }
+
+ private void maybeDoSingleThreadedWorkaround(Runnable action) {
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ Threading.invokeOnOpenGLThread(action);
+ } else {
+ action.run();
+ }
+ }
+
+ public boolean canCreateContextOnJava2DSurface() {
+ return false;
+ }
+
+ public GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith)
+ throws GLException {
+ throw new GLException("Unimplemented on this platform");
+ }
+
+ //----------------------------------------------------------------------
+ // Gamma-related functionality
+ //
+
+ private boolean gotGammaRampLength;
+ private int gammaRampLength;
+ protected synchronized int getGammaRampLength() {
+ if (gotGammaRampLength) {
+ return gammaRampLength;
+ }
+
+ int[] size = new int[1];
+ lockToolkit();
+ try {
+ long display = X11Util.getStaticDefaultDisplay();
+ boolean res = X11Lib.XF86VidModeGetGammaRampSize(display,
+ X11Lib.DefaultScreen(display),
+ size, 0);
+ if (!res) {
+ return 0;
+ }
+ } finally {
+ unlockToolkit();
+ }
+ gotGammaRampLength = true;
+ gammaRampLength = size[0];
+ return gammaRampLength;
+ }
+
+ protected boolean setGammaRamp(float[] ramp) {
+ int len = ramp.length;
+ short[] rampData = new short[len];
+ for (int i = 0; i < len; i++) {
+ rampData[i] = (short) (ramp[i] * 65535);
+ }
+
+ lockToolkit();
+ try {
+ long display = X11Util.getStaticDefaultDisplay();
+ boolean res = X11Lib.XF86VidModeSetGammaRamp(display,
+ X11Lib.DefaultScreen(display),
+ rampData.length,
+ rampData, 0,
+ rampData, 0,
+ rampData, 0);
+ return res;
+ } finally {
+ unlockToolkit();
+ }
+ }
+
+ protected Buffer getGammaRamp() {
+ int size = getGammaRampLength();
+ ShortBuffer rampData = ShortBuffer.allocate(3 * size);
+ rampData.position(0);
+ rampData.limit(size);
+ ShortBuffer redRampData = rampData.slice();
+ rampData.position(size);
+ rampData.limit(2 * size);
+ ShortBuffer greenRampData = rampData.slice();
+ rampData.position(2 * size);
+ rampData.limit(3 * size);
+ ShortBuffer blueRampData = rampData.slice();
+ lockToolkit();
+ try {
+ long display = X11Util.getStaticDefaultDisplay();
+ boolean res = X11Lib.XF86VidModeGetGammaRamp(display,
+ X11Lib.DefaultScreen(display),
+ size,
+ redRampData,
+ greenRampData,
+ blueRampData);
+ if (!res) {
+ return null;
+ }
+ } finally {
+ unlockToolkit();
+ }
+ return rampData;
+ }
+
+ protected void resetGammaRamp(Buffer originalGammaRamp) {
+ if (originalGammaRamp == null)
+ return; // getGammaRamp failed originally
+ ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
+ int capacity = rampData.capacity();
+ if ((capacity % 3) != 0) {
+ throw new IllegalArgumentException("Must not be the original gamma ramp");
+ }
+ int size = capacity / 3;
+ rampData.position(0);
+ rampData.limit(size);
+ ShortBuffer redRampData = rampData.slice();
+ rampData.position(size);
+ rampData.limit(2 * size);
+ ShortBuffer greenRampData = rampData.slice();
+ rampData.position(2 * size);
+ rampData.limit(3 * size);
+ ShortBuffer blueRampData = rampData.slice();
+ lockToolkit();
+ try {
+ long display = X11Util.getStaticDefaultDisplay();
+ X11Lib.XF86VidModeSetGammaRamp(display,
+ X11Lib.DefaultScreen(display),
+ size,
+ redRampData,
+ greenRampData,
+ blueRampData);
+ } finally {
+ unlockToolkit();
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java
new file mode 100644
index 000000000..404881329
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -0,0 +1,442 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import java.util.*;
+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.nativewindow.impl.x11.*;
+
+public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implements Cloneable {
+ protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+ public static final int MAX_ATTRIBS = 128;
+ private long fbConfig;
+ private int fbConfigID;
+ private GLCapabilitiesChooser chooser;
+
+ public X11GLXGraphicsConfiguration(X11GraphicsScreen screen,
+ GLCapabilities capsChosen, GLCapabilities capsRequested, GLCapabilitiesChooser chooser,
+ XVisualInfo info, long fbcfg, int fbcfgID) {
+ super(screen, capsChosen, capsRequested, info);
+ this.chooser=chooser;
+ fbConfig = fbcfg;
+ fbConfigID = fbcfgID;
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ public long getFBConfig() { return fbConfig; }
+ public int getFBConfigID() { return fbConfigID; }
+
+ protected void updateGraphicsConfiguration() {
+ X11GLXGraphicsConfiguration newConfig = (X11GLXGraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(getScreen().getDevice()).chooseGraphicsConfiguration(getRequestedCapabilities(),
+ chooser,
+ getScreen());
+ if(null!=newConfig) {
+ // FIXME: setScreen( ... );
+ setXVisualInfo(newConfig.getXVisualInfo());
+ setChosenCapabilities(newConfig.getChosenCapabilities());
+ fbConfig = newConfig.getFBConfig();
+ fbConfigID = newConfig.getFBConfigID();
+ if(DEBUG) {
+ System.err.println("!!! updateGraphicsConfiguration: "+this);
+ }
+ }
+ }
+
+ public static int[] GLCapabilities2AttribList(GLCapabilities caps,
+ boolean forFBAttr,
+ boolean isMultisampleAvailable,
+ boolean usePBuffer,
+ long display,
+ int screen)
+ {
+ int colorDepth = (caps.getRedBits() +
+ caps.getGreenBits() +
+ caps.getBlueBits());
+ if (colorDepth < 15) {
+ throw new GLException("Bit depths < 15 (i.e., non-true-color) not supported");
+ }
+ int[] res = new int[MAX_ATTRIBS];
+ int idx = 0;
+
+ if (forFBAttr) {
+ res[idx++] = GLX.GLX_DRAWABLE_TYPE;
+ res[idx++] = usePBuffer?GLX.GLX_PBUFFER_BIT:GLX.GLX_WINDOW_BIT;
+ }
+
+ if (forFBAttr) {
+ res[idx++] = GLX.GLX_RENDER_TYPE;
+ res[idx++] = GLX.GLX_RGBA_BIT;
+ } else {
+ res[idx++] = GLX.GLX_RGBA;
+ }
+
+ // FIXME: Still a bug is Mesa: PBUFFER && GLX_STEREO==GL_FALSE ?
+ if (forFBAttr) {
+ res[idx++] = GLX.GLX_DOUBLEBUFFER;
+ res[idx++] = caps.getDoubleBuffered()?GL.GL_TRUE:GL.GL_FALSE;
+ res[idx++] = GLX.GLX_STEREO;
+ res[idx++] = caps.getStereo()?GL.GL_TRUE:GL.GL_FALSE;
+ res[idx++] = GLX.GLX_TRANSPARENT_TYPE;
+ res[idx++] = caps.isBackgroundOpaque()?GLX.GLX_NONE:GLX.GLX_TRANSPARENT_RGB;
+ if(!caps.isBackgroundOpaque()) {
+ res[idx++] = GLX.GLX_TRANSPARENT_RED_VALUE;
+ res[idx++] = caps.getTransparentRedValue()>=0?caps.getTransparentRedValue():(int)GLX.GLX_DONT_CARE;
+ res[idx++] = GLX.GLX_TRANSPARENT_GREEN_VALUE;
+ res[idx++] = caps.getTransparentGreenValue()>=0?caps.getTransparentGreenValue():(int)GLX.GLX_DONT_CARE;
+ res[idx++] = GLX.GLX_TRANSPARENT_BLUE_VALUE;
+ res[idx++] = caps.getTransparentBlueValue()>=0?caps.getTransparentBlueValue():(int)GLX.GLX_DONT_CARE;
+ res[idx++] = GLX.GLX_TRANSPARENT_ALPHA_VALUE;
+ res[idx++] = caps.getTransparentAlphaValue()>=0?caps.getTransparentAlphaValue():(int)GLX.GLX_DONT_CARE;
+ }
+ } else {
+ if (caps.getDoubleBuffered()) {
+ res[idx++] = GLX.GLX_DOUBLEBUFFER;
+ }
+ if (caps.getStereo()) {
+ res[idx++] = GLX.GLX_STEREO;
+ }
+ }
+
+ res[idx++] = GLX.GLX_RED_SIZE;
+ res[idx++] = caps.getRedBits();
+ res[idx++] = GLX.GLX_GREEN_SIZE;
+ res[idx++] = caps.getGreenBits();
+ res[idx++] = GLX.GLX_BLUE_SIZE;
+ res[idx++] = caps.getBlueBits();
+ res[idx++] = GLX.GLX_ALPHA_SIZE;
+ res[idx++] = caps.getAlphaBits();
+ res[idx++] = GLX.GLX_DEPTH_SIZE;
+ res[idx++] = caps.getDepthBits();
+ if (caps.getStencilBits() > 0) {
+ res[idx++] = GLX.GLX_STENCIL_SIZE;
+ res[idx++] = caps.getStencilBits();
+ }
+ if (caps.getAccumRedBits() > 0 ||
+ caps.getAccumGreenBits() > 0 ||
+ caps.getAccumBlueBits() > 0 ||
+ caps.getAccumAlphaBits() > 0) {
+ res[idx++] = GLX.GLX_ACCUM_RED_SIZE;
+ res[idx++] = caps.getAccumRedBits();
+ res[idx++] = GLX.GLX_ACCUM_GREEN_SIZE;
+ res[idx++] = caps.getAccumGreenBits();
+ res[idx++] = GLX.GLX_ACCUM_BLUE_SIZE;
+ res[idx++] = caps.getAccumBlueBits();
+ res[idx++] = GLX.GLX_ACCUM_ALPHA_SIZE;
+ res[idx++] = caps.getAccumAlphaBits();
+ }
+ if (isMultisampleAvailable && caps.getSampleBuffers()) {
+ res[idx++] = GLX.GLX_SAMPLE_BUFFERS;
+ res[idx++] = GL.GL_TRUE;
+ res[idx++] = GLX.GLX_SAMPLES;
+ res[idx++] = caps.getNumSamples();
+ }
+ if (usePBuffer) {
+ if (caps.getPbufferFloatingPointBuffers()) {
+ String glXExtensions = GLX.glXQueryExtensionsString(display, screen);
+ if (glXExtensions == null ||
+ glXExtensions.indexOf("GLX_NV_float_buffer") < 0) {
+ throw new GLException("Floating-point pbuffers on X11 currently require NVidia hardware");
+ }
+ res[idx++] = GLXExt.GLX_FLOAT_COMPONENTS_NV;
+ res[idx++] = GL.GL_TRUE;
+ }
+ }
+ res[idx++] = 0;
+ return res;
+ }
+
+ public static GLCapabilities AttribList2GLCapabilities(GLProfile glp,
+ int[] iattribs,
+ int niattribs,
+ int[] ivalues,
+ boolean usePBuffer) {
+ GLCapabilities caps = new GLCapabilities(glp);
+
+ for (int i = 0; i < niattribs; i++) {
+ int attr = iattribs[i];
+ switch (attr) {
+ case GLX.GLX_DOUBLEBUFFER:
+ caps.setDoubleBuffered(ivalues[i] != GL.GL_FALSE);
+ break;
+
+ case GLX.GLX_STEREO:
+ caps.setStereo(ivalues[i] != GL.GL_FALSE);
+ break;
+
+ case GLX.GLX_RED_SIZE:
+ caps.setRedBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_GREEN_SIZE:
+ caps.setGreenBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_BLUE_SIZE:
+ caps.setBlueBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_ALPHA_SIZE:
+ caps.setAlphaBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_DEPTH_SIZE:
+ caps.setDepthBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_STENCIL_SIZE:
+ caps.setStencilBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_ACCUM_RED_SIZE:
+ caps.setAccumRedBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_ACCUM_GREEN_SIZE:
+ caps.setAccumGreenBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_ACCUM_BLUE_SIZE:
+ caps.setAccumBlueBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_ACCUM_ALPHA_SIZE:
+ caps.setAccumAlphaBits(ivalues[i]);
+ break;
+
+ case GLX.GLX_SAMPLE_BUFFERS:
+ caps.setSampleBuffers(ivalues[i] != GL.GL_FALSE);
+ break;
+
+ case GLX.GLX_SAMPLES:
+ caps.setNumSamples(ivalues[i]);
+ break;
+
+ case GLX.GLX_CONFIG_CAVEAT:
+ caps.setHardwareAccelerated(ivalues[i] != GLX.GLX_SLOW_CONFIG);
+ break;
+
+ case GLX.GLX_TRANSPARENT_TYPE:
+ caps.setBackgroundOpaque(ivalues[i] == GLX.GLX_NONE);
+ break;
+
+ case GLXExt.GLX_FLOAT_COMPONENTS_NV:
+ caps.setPbufferFloatingPointBuffers(ivalues[i] != GL.GL_FALSE);
+ break;
+
+ case GLX.GLX_TRANSPARENT_RED_VALUE:
+ caps.setTransparentRedValue(ivalues[i]);
+ break;
+
+ case GLX.GLX_TRANSPARENT_GREEN_VALUE:
+ caps.setTransparentGreenValue(ivalues[i]);
+ break;
+
+ case GLX.GLX_TRANSPARENT_BLUE_VALUE:
+ caps.setTransparentBlueValue(ivalues[i]);
+ break;
+
+ case GLX.GLX_TRANSPARENT_ALPHA_VALUE:
+ caps.setTransparentAlphaValue(ivalues[i]);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return caps;
+ }
+
+ // FBConfig
+
+ public static GLCapabilities GLXFBConfig2GLCapabilities(GLProfile glp, long display, long fbcfg) {
+ int[] tmp = new int[1];
+ 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");
+ }
+ GLCapabilities res = new GLCapabilities(glp);
+ res.setDoubleBuffered(glXGetFBConfig(display, fbcfg, GLX.GLX_DOUBLEBUFFER, tmp, 0) != 0);
+ res.setStereo (glXGetFBConfig(display, fbcfg, GLX.GLX_STEREO, tmp, 0) != 0);
+ res.setHardwareAccelerated(glXGetFBConfig(display, fbcfg, GLX.GLX_CONFIG_CAVEAT, tmp, 0) != GLX.GLX_SLOW_CONFIG);
+ res.setDepthBits (glXGetFBConfig(display, fbcfg, GLX.GLX_DEPTH_SIZE, tmp, 0));
+ res.setStencilBits (glXGetFBConfig(display, fbcfg, GLX.GLX_STENCIL_SIZE, tmp, 0));
+ res.setRedBits (glXGetFBConfig(display, fbcfg, GLX.GLX_RED_SIZE, tmp, 0));
+ res.setGreenBits (glXGetFBConfig(display, fbcfg, GLX.GLX_GREEN_SIZE, tmp, 0));
+ res.setBlueBits (glXGetFBConfig(display, fbcfg, GLX.GLX_BLUE_SIZE, tmp, 0));
+ res.setAlphaBits (glXGetFBConfig(display, fbcfg, GLX.GLX_ALPHA_SIZE, tmp, 0));
+ res.setAccumRedBits (glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_RED_SIZE, tmp, 0));
+ res.setAccumGreenBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_GREEN_SIZE, tmp, 0));
+ res.setAccumBlueBits (glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_BLUE_SIZE, tmp, 0));
+ res.setAccumAlphaBits(glXGetFBConfig(display, fbcfg, GLX.GLX_ACCUM_ALPHA_SIZE, tmp, 0));
+ if (GLXUtil.isMultisampleAvailable()) {
+ res.setSampleBuffers(glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
+ res.setNumSamples (glXGetFBConfig(display, fbcfg, GLX.GLX_SAMPLES, tmp, 0));
+ }
+ res.setBackgroundOpaque(glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_TYPE, tmp, 0) == GLX.GLX_NONE);
+ if(!res.isBackgroundOpaque()) {
+ glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_RED_VALUE, tmp, 0);
+ res.setTransparentRedValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+
+ glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_GREEN_VALUE, tmp, 0);
+ res.setTransparentGreenValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+
+ glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_BLUE_VALUE, tmp, 0);
+ res.setTransparentBlueValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+
+ glXGetFBConfig(display, fbcfg, GLX.GLX_TRANSPARENT_ALPHA_VALUE, tmp, 0);
+ res.setTransparentAlphaValue(tmp[0]==GLX.GLX_DONT_CARE?-1:tmp[0]);
+ }
+ try {
+ res.setPbufferFloatingPointBuffers(glXGetFBConfig(display, fbcfg, GLXExt.GLX_FLOAT_COMPONENTS_NV, tmp, 0) != GL.GL_FALSE);
+ } catch (Exception e) {}
+ return res;
+ }
+
+ private static String glXGetFBConfigErrorCode(int err) {
+ switch (err) {
+ case GLX.GLX_NO_EXTENSION: return "GLX_NO_EXTENSION";
+ case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
+ default: return "Unknown error code " + err;
+ }
+ }
+
+ public static int glXGetFBConfig(long display, long cfg, int attrib, int[] tmp, int tmp_offset) {
+ if (display == 0) {
+ throw new GLException("No display connection");
+ }
+ int res = GLX.glXGetFBConfigAttrib(display, cfg, attrib, tmp, tmp_offset);
+ if (res != 0) {
+ throw new GLException("glXGetFBConfig(0x"+Long.toHexString(attrib)+") failed: error code " + glXGetFBConfigErrorCode(res));
+ }
+ return tmp[tmp_offset];
+ }
+
+ // Visual Info
+
+ public static XVisualInfo XVisualID2XVisualInfo(long display, long visualID) {
+ XVisualInfo res = null;
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try{
+ int[] count = new int[1];
+ XVisualInfo template = XVisualInfo.create();
+ template.visualid(visualID);
+ XVisualInfo[] infos = X11Lib.XGetVisualInfoCopied(display, X11Lib.VisualIDMask, template, count, 0);
+ if (infos == null || infos.length == 0) {
+ return null;
+ }
+ res = XVisualInfo.create(infos[0]);
+ } finally {
+ 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.visualid()));
+ }
+ return res;
+ }
+
+ public static GLCapabilities XVisualInfo2GLCapabilities(GLProfile glp, long display, XVisualInfo info) {
+ 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");
+ }
+ val = glXGetConfig(display, info, GLX.GLX_RGBA, tmp, 0);
+ if (val == 0) {
+ throw new GLException("Visual does not support RGBA");
+ }
+ GLCapabilities res = new GLCapabilities(glp);
+ res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER, tmp, 0) != 0);
+ res.setStereo (glXGetConfig(display, info, GLX.GLX_STEREO, tmp, 0) != 0);
+ // Note: use of hardware acceleration is determined by
+ // glXCreateContext, not by the XVisualInfo. Optimistically claim
+ // that all GLCapabilities have the capability to be hardware
+ // accelerated.
+ res.setHardwareAccelerated(true);
+ res.setDepthBits (glXGetConfig(display, info, GLX.GLX_DEPTH_SIZE, tmp, 0));
+ res.setStencilBits (glXGetConfig(display, info, GLX.GLX_STENCIL_SIZE, tmp, 0));
+ res.setRedBits (glXGetConfig(display, info, GLX.GLX_RED_SIZE, tmp, 0));
+ res.setGreenBits (glXGetConfig(display, info, GLX.GLX_GREEN_SIZE, tmp, 0));
+ res.setBlueBits (glXGetConfig(display, info, GLX.GLX_BLUE_SIZE, tmp, 0));
+ res.setAlphaBits (glXGetConfig(display, info, GLX.GLX_ALPHA_SIZE, tmp, 0));
+ res.setAccumRedBits (glXGetConfig(display, info, GLX.GLX_ACCUM_RED_SIZE, tmp, 0));
+ res.setAccumGreenBits(glXGetConfig(display, info, GLX.GLX_ACCUM_GREEN_SIZE, tmp, 0));
+ res.setAccumBlueBits (glXGetConfig(display, info, GLX.GLX_ACCUM_BLUE_SIZE, tmp, 0));
+ res.setAccumAlphaBits(glXGetConfig(display, info, GLX.GLX_ACCUM_ALPHA_SIZE, tmp, 0));
+ if (GLXUtil.isMultisampleAvailable()) {
+ res.setSampleBuffers(glXGetConfig(display, info, GLX.GLX_SAMPLE_BUFFERS, tmp, 0) != 0);
+ res.setNumSamples (glXGetConfig(display, info, GLX.GLX_SAMPLES, tmp, 0));
+ }
+ return res;
+ }
+
+ private static String glXGetConfigErrorCode(int err) {
+ switch (err) {
+ case GLX.GLX_NO_EXTENSION: return "GLX_NO_EXTENSION";
+ case GLX.GLX_BAD_SCREEN: return "GLX_BAD_SCREEN";
+ case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
+ case GLX.GLX_BAD_VISUAL: return "GLX_BAD_VISUAL";
+ default: return "Unknown error code " + err;
+ }
+ }
+
+ public static int glXGetConfig(long display, XVisualInfo info, int attrib, int[] tmp, int tmp_offset) {
+ if (display == 0) {
+ throw new GLException("No display connection");
+ }
+ int res = GLX.glXGetConfig(display, info, attrib, tmp, tmp_offset);
+ if (res != 0) {
+ throw new GLException("glXGetConfig(0x"+Long.toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res));
+ }
+ return tmp[tmp_offset];
+ }
+
+ public String toString() {
+ return "X11GLXGraphicsConfiguration["+getScreen()+", visualID 0x" + Long.toHexString(getVisualID()) + ", fbConfigID 0x" + Long.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/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..1e2f2f185
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -0,0 +1,296 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import com.sun.nativewindow.impl.NativeWindowFactoryImpl;
+import com.sun.nativewindow.impl.x11.*;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.opengl.impl.x11.glx.*;
+
+/** Subclass of GraphicsConfigurationFactory used when non-AWT tookits
+ are used on X11 platforms. Toolkits will likely need to delegate
+ to this one to change the accepted and returned types of the
+ GraphicsDevice and GraphicsConfiguration abstractions. */
+
+public class X11GLXGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+ public X11GLXGraphicsConfigurationFactory() {
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ return chooseGraphicsConfigurationStatic(capabilities, chooser, absScreen, false);
+ }
+
+ protected static X11GLXGraphicsConfiguration createDefaultGraphicsConfiguration(AbstractGraphicsScreen absScreen, boolean usePBuffer) {
+ if (absScreen == null) {
+ throw new IllegalArgumentException("AbstractGraphicsScreen is null");
+ }
+ if (!(absScreen instanceof X11GraphicsScreen)) {
+ throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
+ }
+ X11GraphicsScreen x11Screen = (X11GraphicsScreen)absScreen;
+
+ GLProfile glProfile = GLProfile.getDefault();
+ GLCapabilities caps=null;
+ XVisualInfo xvis=null;
+ long fbcfg = 0;
+ int fbid = -1;
+
+ long display = x11Screen.getDevice().getHandle();
+ int screen = x11Screen.getIndex();
+
+ // Utilizing FBConfig
+ //
+ GLCapabilities capsFB = null;
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ long visID = X11Lib.DefaultVisualID(display, x11Screen.getIndex());
+ xvis = X11GLXGraphicsConfiguration.XVisualID2XVisualInfo(display, visID);
+ caps = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(glProfile, display, xvis);
+
+ int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(caps, true, GLXUtil.isMultisampleAvailable(), usePBuffer, 0, 0);
+ int[] count = { -1 };
+ java.nio.LongBuffer fbcfgsL = GLX.glXChooseFBConfigCopied(display, screen, attribs, 0, count, 0);
+ if (fbcfgsL == null || fbcfgsL.limit()<1) {
+ throw new Exception("Could not fetch FBConfig for "+caps);
+ }
+ fbcfg = fbcfgsL.get(0);
+ capsFB = X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(glProfile, display, fbcfg);
+
+ int[] tmpID = new int[1];
+ fbid = X11GLXGraphicsConfiguration.glXGetFBConfig(display, fbcfg, GLX.GLX_FBCONFIG_ID, tmpID, 0);
+
+ xvis = GLX.glXGetVisualFromFBConfigCopied(display, fbcfg);
+ if (xvis==null) {
+ throw new GLException("Error: Choosen FBConfig has no visual");
+ }
+ } catch (Throwable t) {
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+
+ return new X11GLXGraphicsConfiguration(x11Screen, (null!=capsFB)?capsFB:caps, caps, null, xvis, fbcfg, fbid);
+ }
+
+ protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen,
+ boolean usePBuffer) {
+ if (absScreen == null) {
+ throw new IllegalArgumentException("AbstractGraphicsScreen is null");
+ }
+ if (!(absScreen instanceof X11GraphicsScreen)) {
+ throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
+ }
+ X11GraphicsScreen x11Screen = (X11GraphicsScreen)absScreen;
+
+
+ if (capabilities != null &&
+ !(capabilities instanceof GLCapabilities)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ if (capabilities == null) {
+ capabilities = new GLCapabilities(null);
+ }
+
+
+ X11GLXGraphicsConfiguration res;
+ res = chooseGraphicsConfigurationFBConfig((GLCapabilities) capabilities,
+ (GLCapabilitiesChooser) chooser,
+ x11Screen, usePBuffer);
+ if(null==res) {
+ if(usePBuffer) {
+ throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration based on FBConfig");
+ }
+ res = chooseGraphicsConfigurationXVisual((GLCapabilities) capabilities,
+ (GLCapabilitiesChooser) chooser,
+ x11Screen);
+ }
+ if(null==res) {
+ throw new GLException("Error: Couldn't create X11GLXGraphicsConfiguration");
+ }
+ if(DEBUG) {
+ System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationStatic("+x11Screen+","+capabilities+", pbuffer "+usePBuffer+"): "+res);
+ }
+ return res;
+ }
+
+ protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ X11GraphicsScreen x11Screen,
+ boolean usePBuffer) {
+ int screen = x11Screen.getIndex();
+ AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+ long display = absDevice.getHandle();
+
+ int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capabilities, true, GLXUtil.isMultisampleAvailable(), usePBuffer, 0, 0);
+ int[] count = { -1 };
+ int recommendedIndex = -1;
+ GLCapabilities[] caps = null;
+ java.nio.LongBuffer fbcfgsL = null;
+ int chosen=-1;
+ int retFBID=-1;
+ XVisualInfo retXVisualInfo = null;
+ GLProfile glProfile = capabilities.getGLProfile();
+
+ // Utilizing FBConfig
+ //
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ fbcfgsL = GLX.glXChooseFBConfigCopied(display, screen, attribs, 0, count, 0);
+ if (fbcfgsL == null || fbcfgsL.limit()<1) {
+ if(DEBUG) {
+ System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: glXChooseFBConfig ("+x11Screen+","+capabilities+"): "+fbcfgsL+", "+count[0]);
+ }
+ 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));
+ }
+
+ if(null==chooser) {
+ chosen = recommendedIndex;
+ } else {
+ try {
+ chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex);
+ } catch (NativeWindowException e) {
+ throw new GLException(e);
+ }
+ }
+
+ if (chosen < 0 || chosen >= caps.length) {
+ throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
+ }
+
+ int[] tmpID = new int[1];
+ retFBID = X11GLXGraphicsConfiguration.glXGetFBConfig(display, fbcfgsL.get(chosen), GLX.GLX_FBCONFIG_ID, tmpID, 0);
+
+ retXVisualInfo = GLX.glXGetVisualFromFBConfigCopied(display, fbcfgsL.get(chosen));
+ if (retXVisualInfo==null) {
+ if(DEBUG) {
+ System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: glXGetVisualFromFBConfig ("+x11Screen+", "+fbcfgsL.get(chosen) +": "+fbcfgsL);
+ }
+ return null;
+ }
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+
+ return new X11GLXGraphicsConfiguration(x11Screen, caps[chosen], capabilities, chooser, retXVisualInfo, fbcfgsL.get(chosen), retFBID);
+ }
+
+ protected static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ X11GraphicsScreen x11Screen) {
+
+ if (chooser == null) {
+ chooser = new DefaultGLCapabilitiesChooser();
+ }
+
+ int screen = x11Screen.getIndex();
+ AbstractGraphicsDevice absDevice = x11Screen.getDevice();
+ long display = absDevice.getHandle();
+
+ // Until we have a rock-solid visual selection algorithm written
+ // in pure Java, we're going to provide the underlying window
+ // system's selection to the chooser as a hint
+
+ GLProfile glProfile = capabilities.getGLProfile();
+ int[] attribs = X11GLXGraphicsConfiguration.GLCapabilities2AttribList(capabilities, false, GLXUtil.isMultisampleAvailable(), false, 0, 0);
+ XVisualInfo[] infos = null;
+ GLCapabilities[] caps = null;
+ int recommendedIndex = -1;
+ XVisualInfo retXVisualInfo = null;
+ int chosen;
+
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ 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.visualid()));
+ }
+ }
+ int[] count = new int[1];
+ XVisualInfo template = XVisualInfo.create();
+ template.screen(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]);
+ // Attempt to find the visual chosen by glXChooseVisual
+ if (recommendedVis != null && recommendedVis.visualid() == infos[i].visualid()) {
+ recommendedIndex = i;
+ }
+ }
+ try {
+ chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex);
+ } catch (NativeWindowException e) {
+ throw new GLException(e);
+ }
+ if (chosen < 0 || 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 {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+ return new X11GLXGraphicsConfiguration(x11Screen, caps[chosen], capabilities, chooser, retXVisualInfo, 0, -1);
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java
new file mode 100644
index 000000000..c6d787f2b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXContext.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.opengl.impl.x11.*;
+
+public class X11OffscreenGLXContext extends X11GLXContext {
+ private X11OffscreenGLXDrawable drawable;
+
+ public X11OffscreenGLXContext(X11OffscreenGLXDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ this.drawable = drawable;
+ }
+
+ 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;
+ }
+
+ public int getOffscreenContextReadBuffer() {
+ if (drawable.isDoubleBuffered()) {
+ return GL.GL_BACK;
+ }
+ return GL.GL_FRONT;
+ }
+
+ public boolean offscreenImageNeedsVerticalFlip() {
+ // There doesn't seem to be a way to do this in the construction
+ // of the Pixmap or GLXPixmap
+ return true;
+ }
+
+ protected int makeCurrentImpl() throws GLException {
+ getDrawableImpl().getFactoryImpl().lockToolkit();
+ try {
+ return super.makeCurrentImpl();
+ } finally {
+ getDrawableImpl().getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ protected void create() {
+ createContext(false);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
new file mode 100644
index 000000000..69ecc34d2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NullWindow;
+import com.sun.nativewindow.impl.x11.*;
+
+public class X11OffscreenGLXDrawable extends X11GLXDrawable {
+ private long pixmap;
+ private boolean isDoubleBuffered;
+
+ protected X11OffscreenGLXDrawable(GLDrawableFactory factory, AbstractGraphicsScreen screen,
+ GLCapabilities caps,
+ GLCapabilitiesChooser chooser,
+ int width,
+ int height) {
+ super(factory, new NullWindow(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(caps, chooser, screen, false)), true);
+ ((NullWindow) getNativeWindow()).setSize(width, height);
+ create();
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new X11OffscreenGLXContext(this, shareWith);
+ }
+
+ private void create() {
+ NullWindow nw = (NullWindow) getNativeWindow();
+ X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) nw.getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ XVisualInfo vis = config.getXVisualInfo();
+ int bitsPerPixel = vis.depth();
+ AbstractGraphicsScreen aScreen = config.getScreen();
+ AbstractGraphicsDevice aDevice = aScreen.getDevice();
+ long dpy = aDevice.getHandle();
+ int screen = aScreen.getIndex();
+
+ getFactoryImpl().lockToolkit();
+ try {
+ 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");
+ }
+ nw.setSurfaceHandle(drawable);
+ isDoubleBuffered = (X11GLXGraphicsConfiguration.glXGetConfig(dpy, vis, GLX.GLX_DOUBLEBUFFER, new int[1], 0) != 0);
+ if (DEBUG) {
+ System.err.println("Created pixmap " + toHexString(pixmap) +
+ ", GLXPixmap " + toHexString(drawable) +
+ ", display " + toHexString(dpy));
+ }
+ } finally {
+ getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ public void destroy() {
+ if (pixmap == 0) return;
+ try {
+ NativeWindow nw = getNativeWindow();
+ long display = nw.getDisplayHandle();
+ long drawable = nw.getSurfaceHandle();
+ if (DEBUG) {
+ System.err.println("Destroying pixmap " + toHexString(pixmap) +
+ ", GLXPixmap " + toHexString(drawable) +
+ ", display " + toHexString(display));
+ }
+
+ // Must destroy pixmap and GLXPixmap
+ getFactoryImpl().lockToolkit();
+
+ 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;
+ display = 0;
+ } finally {
+ getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ public boolean isDoubleBuffered() {
+ return isDoubleBuffered;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java
new file mode 100644
index 000000000..c37ddd49c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.*;
+
+public class X11OnscreenGLXContext extends X11GLXContext {
+ // This indicates whether the context we have created is indirect
+ // and therefore requires the toolkit to be locked around all GL
+ // calls rather than just all GLX calls
+ protected boolean isIndirect;
+
+ public X11OnscreenGLXContext(X11OnscreenGLXDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ }
+
+ // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release]
+ protected int makeCurrentImpl() throws GLException {
+ int lockRes = drawable.lockSurface();
+ boolean exceptionOccurred = false;
+ try {
+ if (lockRes == NativeWindow.LOCK_SURFACE_NOT_READY) {
+ return CONTEXT_NOT_CURRENT;
+ }
+ return super.makeCurrentImpl();
+ } catch (RuntimeException e) {
+ exceptionOccurred = true;
+ throw e;
+ } finally {
+ if (exceptionOccurred ||
+ (isOptimizable() && lockRes != NativeWindow.LOCK_SURFACE_NOT_READY) && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ // Note: Usually the surface shall be locked within [makeCurrent .. swap .. release]
+ protected void releaseImpl() throws GLException {
+ try {
+ super.releaseImpl();
+ } finally {
+ if (!isOptimizable() && drawable.isSurfaceLocked()) {
+ drawable.unlockSurface();
+ }
+ }
+ }
+
+ public boolean isOptimizable() {
+ return super.isOptimizable() && !isIndirect;
+ }
+
+ protected void create() {
+ createContext(true);
+ isIndirect = !GLX.glXIsDirect(drawable.getNativeWindow().getDisplayHandle(), context);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
new file mode 100644
index 000000000..d80a833f5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.opengl.impl.x11.*;
+
+public class X11OnscreenGLXDrawable extends X11GLXDrawable {
+ protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeWindow component) {
+ super(factory, component, false);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new X11OnscreenGLXContext(this, shareWith);
+ }
+
+ public int getWidth() {
+ return component.getWidth();
+ }
+
+ public int getHeight() {
+ return component.getHeight();
+ }
+
+ public void swapBuffers() throws GLException {
+ 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();
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
new file mode 100644
index 000000000..3938c0ecc
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.impl.x11.glx;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+import com.sun.opengl.impl.x11.*;
+
+public class X11PbufferGLXContext extends X11GLXContext {
+ private X11PbufferGLXDrawable drawable;
+
+ public X11PbufferGLXContext(X11PbufferGLXDrawable drawable,
+ GLContext shareWith) {
+ super(drawable, shareWith);
+ this.drawable = drawable;
+ }
+
+ public void bindPbufferToTexture() {
+ // FIXME: figure out how to implement this
+ throw new GLException("Not yet implemented");
+ }
+
+ public void releasePbufferFromTexture() {
+ // FIXME: figure out how to implement this
+ throw new GLException("Not yet implemented");
+ }
+
+
+ public int getFloatingPointMode() {
+ return drawable.getFloatingPointMode();
+ }
+
+ 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());
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
new file mode 100644
index 000000000..1aafe89c8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.NullWindow;
+import com.sun.nativewindow.impl.x11.*;
+
+import java.nio.LongBuffer;
+
+public class X11PbufferGLXDrawable extends X11GLXDrawable {
+ protected X11PbufferGLXDrawable(GLDrawableFactory factory, AbstractGraphicsScreen screen,
+ GLCapabilities caps,
+ GLCapabilitiesChooser chooser,
+ int width, int height) {
+ super(factory, new NullWindow(X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(caps, chooser, screen, true)), true);
+ if (width <= 0 || height <= 0) {
+ throw new GLException("Width and height of pbuffer must be positive (were (" +
+ width + ", " + height + "))");
+ }
+ NullWindow nw = (NullWindow) getNativeWindow();
+ nw.setSize(width, height);
+
+ if (DEBUG) {
+ System.out.println("Pbuffer config: " + getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration());
+ }
+
+ createPbuffer();
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return new X11PbufferGLXContext(this, shareWith);
+ }
+
+ public void destroy() {
+ getFactoryImpl().lockToolkit();
+ try {
+ NullWindow nw = (NullWindow) getNativeWindow();
+ if (nw.getSurfaceHandle() != 0) {
+ GLX.glXDestroyPbuffer(nw.getDisplayHandle(), nw.getSurfaceHandle());
+ }
+ nw.invalidate();
+ } finally {
+ getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ private void createPbuffer() {
+ getFactoryImpl().lockToolkit();
+ try {
+ X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration();
+ AbstractGraphicsScreen aScreen = config.getScreen();
+ AbstractGraphicsDevice aDevice = aScreen.getDevice();
+ long display = aDevice.getHandle();
+ int screen = aScreen.getIndex();
+
+ if (display==0) {
+ throw new GLException("Null display");
+ }
+
+ NullWindow nw = (NullWindow) getNativeWindow();
+
+ GLCapabilities capabilities = (GLCapabilities)config.getChosenCapabilities();
+
+ if (capabilities.getPbufferRenderToTexture()) {
+ throw new GLException("Render-to-texture pbuffers not supported yet on X11");
+ }
+
+ if (capabilities.getPbufferRenderToTextureRectangle()) {
+ throw new GLException("Render-to-texture-rectangle pbuffers not supported yet on X11");
+ }
+
+ // Create the p-buffer.
+ int niattribs = 0;
+ int[] iattributes = new int[5];
+
+ iattributes[niattribs++] = GLX.GLX_PBUFFER_WIDTH;
+ iattributes[niattribs++] = nw.getWidth();
+ iattributes[niattribs++] = GLX.GLX_PBUFFER_HEIGHT;
+ iattributes[niattribs++] = nw.getHeight();
+ iattributes[niattribs++] = 0;
+
+ long drawable = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes, 0);
+ if (drawable == 0) {
+ // FIXME: query X error code for detail error message
+ throw new GLException("pbuffer creation error: glXCreatePbuffer() failed");
+ }
+
+ // Set up instance variables
+ nw.setSurfaceHandle(drawable);
+
+ // Determine the actual width and height we were able to create.
+ int[] tmp = new int[1];
+ GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, tmp, 0);
+ int width = tmp[0];
+ GLX.glXQueryDrawable(display, drawable, GLX.GLX_HEIGHT, tmp, 0);
+ int height = tmp[0];
+ nw.setSize(width, height);
+
+ if (DEBUG) {
+ System.err.println("Created pbuffer " + width + " x " + height);
+ }
+ } finally {
+ getFactoryImpl().unlockToolkit();
+ }
+ }
+
+ public int getFloatingPointMode() {
+ // Floating-point pbuffers currently require NVidia hardware on X11
+ return GLPbuffer.NV_FLOAT;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
new file mode 100644
index 000000000..78ff306aa
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.impl.x11.glx.awt;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+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.*;
+
+public class X11AWTGLXGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+ public X11AWTGLXGraphicsConfigurationFactory() {
+ GraphicsConfigurationFactory.registerFactory(javax.media.nativewindow.awt.AWTGraphicsDevice.class, this);
+ }
+
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen absScreen) {
+ GraphicsDevice device = null;
+ if (absScreen != null &&
+ !(absScreen instanceof AWTGraphicsScreen)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
+ }
+
+ if(null==absScreen) {
+ absScreen = AWTGraphicsScreen.createScreenDevice(-1);
+ }
+ AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+ device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
+
+ if (capabilities != null &&
+ !(capabilities instanceof GLCapabilities)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilities objects");
+ }
+
+ if (chooser != null &&
+ !(chooser instanceof GLCapabilitiesChooser)) {
+ throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only GLCapabilitiesChooser objects");
+ }
+
+ if(DEBUG) {
+ System.err.println("X11AWTGLXGraphicsConfigurationFactory: got "+absScreen);
+ }
+
+ // Need the lock here, since it could be an AWT owned display connection
+ X11GraphicsDevice x11Device;
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ long displayHandle = X11SunJDKReflection.graphicsDeviceGetDisplay(device);
+ if(0==displayHandle) {
+ displayHandle = X11Util.getThreadLocalDefaultDisplay();
+ if(DEBUG) {
+ System.err.println("X11AWTGLXGraphicsConfigurationFactory: using a thread local X11 display");
+ }
+ } else if(DEBUG) {
+ System.err.println("X11AWTGLXGraphicsConfigurationFactory: using AWT X11 display 0x"+Long.toHexString(displayHandle));
+ }
+ ((AWTGraphicsDevice)awtScreen.getDevice()).setHandle(displayHandle);
+ x11Device = new X11GraphicsDevice(displayHandle);
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+
+ X11GraphicsScreen x11Screen = new X11GraphicsScreen(x11Device, awtScreen.getIndex());
+ if(DEBUG) {
+ System.err.println("X11AWTGLXGraphicsConfigurationFactory: made "+x11Screen);
+ }
+
+ GraphicsConfiguration gc = device.getDefaultConfiguration();
+ AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capabilities, gc);
+ if(DEBUG) {
+ System.err.println("AWT Colormodel compatible: "+capabilities);
+ }
+
+ X11GraphicsConfiguration x11Config = (X11GraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(x11Device).chooseGraphicsConfiguration(capabilities,
+ chooser,
+ x11Screen);
+ if (x11Config == null) {
+ throw new GLException("Unable to choose a GraphicsConfiguration: "+capabilities+",\n\t"+chooser+"\n\t"+x11Screen);
+ }
+
+ long visualID = x11Config.getVisualID();
+ // Now figure out which GraphicsConfiguration corresponds to this
+ // visual by matching the visual ID
+ GraphicsConfiguration[] configs = device.getConfigurations();
+ for (int i = 0; i < configs.length; i++) {
+ GraphicsConfiguration config = configs[i];
+ if (config != null) {
+ if (X11SunJDKReflection.graphicsConfigurationGetVisualID(config) == visualID) {
+ return new AWTGraphicsConfiguration(awtScreen, x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(),
+ config, x11Config);
+ }
+ }
+ }
+ // Either we weren't able to reflectively introspect on the
+ // X11GraphicsConfig or something went wrong in the steps above;
+ // Let's take the default configuration as used on Windows and MacOSX then ..
+ if(DEBUG) {
+ System.err.println("!!! Using default configuration");
+ }
+ return new AWTGraphicsConfiguration(awtScreen, x11Config.getChosenCapabilities(), x11Config.getRequestedCapabilities(), gc, x11Config);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java
new file mode 100644
index 000000000..9809e44d2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/AWTAnimatorImpl.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.util;
+
+import java.awt.Component;
+import java.awt.EventQueue;
+import java.awt.Rectangle;
+import java.util.*;
+import javax.swing.*;
+
+import javax.media.opengl.*;
+
+/** Abstraction to factor out AWT dependencies from the Animator's
+ implementation in a way that still allows the FPSAnimator to pick
+ up this behavior if desired. */
+
+class AWTAnimatorImpl extends AnimatorImpl {
+ // For efficient rendering of Swing components, in particular when
+ // they overlap one another
+ private List lightweights = new ArrayList();
+ private Map repaintManagers = new IdentityHashMap();
+ private Map dirtyRegions = new IdentityHashMap();
+
+ public void display(Animator animator,
+ boolean ignoreExceptions,
+ boolean printExceptions) {
+ Iterator iter = animator.drawableIterator();
+ while (iter.hasNext()) {
+ GLAutoDrawable drawable = (GLAutoDrawable) iter.next();
+ if (drawable instanceof JComponent) {
+ // Lightweight components need a more efficient drawing
+ // scheme than simply forcing repainting of each one in
+ // turn since drawing one can force another one to be
+ // drawn in turn
+ lightweights.add(drawable);
+ } else {
+ try {
+ drawable.display();
+ } catch (RuntimeException e) {
+ if (ignoreExceptions) {
+ if (printExceptions) {
+ e.printStackTrace();
+ }
+ } else {
+ throw(e);
+ }
+ }
+ }
+ }
+ if (lightweights.size() > 0) {
+ try {
+ SwingUtilities.invokeAndWait(drawWithRepaintManagerRunnable);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ lightweights.clear();
+ }
+ }
+
+ // Uses RepaintManager APIs to implement more efficient redrawing of
+ // the Swing widgets we're animating
+ private Runnable drawWithRepaintManagerRunnable = new Runnable() {
+ public void run() {
+ for (Iterator iter = lightweights.iterator(); iter.hasNext(); ) {
+ JComponent comp = (JComponent) iter.next();
+ RepaintManager rm = RepaintManager.currentManager(comp);
+ rm.markCompletelyDirty(comp);
+ repaintManagers.put(rm, rm);
+
+ // RepaintManagers don't currently optimize the case of
+ // overlapping sibling components. If we have two
+ // JInternalFrames in a JDesktopPane, the redraw of the
+ // bottom one will cause the top one to be redrawn as
+ // well. The top one will then be redrawn separately. In
+ // order to optimize this case we need to compute the union
+ // of all of the dirty regions on a particular JComponent if
+ // optimized drawing isn't enabled for it.
+
+ // Walk up the hierarchy trying to find a non-optimizable
+ // ancestor
+ Rectangle visible = comp.getVisibleRect();
+ int x = visible.x;
+ int y = visible.y;
+ while (comp != null) {
+ x += comp.getX();
+ y += comp.getY();
+ Component c = comp.getParent();
+ if ((c == null) || (!(c instanceof JComponent))) {
+ comp = null;
+ } else {
+ comp = (JComponent) c;
+ if (!comp.isOptimizedDrawingEnabled()) {
+ rm = RepaintManager.currentManager(comp);
+ repaintManagers.put(rm, rm);
+ // Need to dirty this region
+ Rectangle dirty = (Rectangle) dirtyRegions.get(comp);
+ if (dirty == null) {
+ dirty = new Rectangle(x, y, visible.width, visible.height);
+ dirtyRegions.put(comp, dirty);
+ } else {
+ // Compute union with already dirty region
+ // Note we could compute multiple non-overlapping
+ // regions: might want to do that in the future
+ // (prob. need more complex algorithm -- dynamic
+ // programming?)
+ dirty.add(new Rectangle(x, y, visible.width, visible.height));
+ }
+ }
+ }
+ }
+ }
+
+ // Dirty any needed regions on non-optimizable components
+ for (Iterator iter = dirtyRegions.keySet().iterator(); iter.hasNext(); ) {
+ JComponent comp = (JComponent) iter.next();
+ Rectangle rect = (Rectangle) dirtyRegions.get(comp);
+ RepaintManager rm = RepaintManager.currentManager(comp);
+ rm.addDirtyRegion(comp, rect.x, rect.y, rect.width, rect.height);
+ }
+
+ // Draw all dirty regions
+ for (Iterator iter = repaintManagers.keySet().iterator(); iter.hasNext(); ) {
+ ((RepaintManager) iter.next()).paintDirtyRegions();
+ }
+ dirtyRegions.clear();
+ repaintManagers.clear();
+ }
+ };
+
+ public boolean skipWaitForStop(Thread thread) {
+ return ((Thread.currentThread() == thread) || EventQueue.isDispatchThread());
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/Animator.java b/src/jogl/classes/com/sun/opengl/util/Animator.java
new file mode 100755
index 000000000..84637433e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/Animator.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util;
+
+import java.util.*;
+
+import javax.media.opengl.*;
+
+/** <P> An Animator can be attached to one or more {@link
+ GLAutoDrawable}s to drive their display() methods in a loop. </P>
+
+ <P> The Animator class creates a background thread in which the
+ calls to <code>display()</code> are performed. After each drawable
+ has been redrawn, a brief pause is performed to avoid swamping the
+ CPU, unless {@link #setRunAsFastAsPossible} has been called. </P>
+*/
+
+public class Animator {
+ private volatile ArrayList/*<GLAutoDrawable>*/ drawables = new ArrayList();
+ private AnimatorImpl impl;
+ private Runnable runnable;
+ private boolean runAsFastAsPossible;
+ protected Thread thread;
+ protected volatile boolean shouldStop;
+ protected boolean ignoreExceptions;
+ protected boolean printExceptions;
+
+ /** Creates a new, empty Animator. */
+ public Animator() {
+ try {
+ // Try to use the AWT-capable Animator implementation by default
+ impl = (AnimatorImpl) Class.forName("com.sun.opengl.util.awt.AWTAnimatorImpl").newInstance();
+ } catch (Exception e) {
+ impl = new AnimatorImpl();
+ }
+ }
+
+ /** Creates a new Animator for a particular drawable. */
+ public Animator(GLAutoDrawable drawable) {
+ this();
+ add(drawable);
+ }
+
+ /** Adds a drawable to the list managed by this Animator. */
+ public synchronized void add(GLAutoDrawable drawable) {
+ ArrayList newList = (ArrayList) drawables.clone();
+ newList.add(drawable);
+ drawables = newList;
+ notifyAll();
+ }
+
+ /** Removes a drawable from the list managed by this Animator. */
+ public synchronized void remove(GLAutoDrawable drawable) {
+ ArrayList newList = (ArrayList) drawables.clone();
+ newList.remove(drawable);
+ drawables = newList;
+ }
+
+ /** Returns an iterator over the drawables managed by this
+ Animator. */
+ public Iterator/*<GLAutoDrawable>*/ drawableIterator() {
+ return drawables.iterator();
+ }
+
+ /** Sets a flag causing this Animator to ignore exceptions produced
+ while redrawing the drawables. By default this flag is set to
+ false, causing any exception thrown to halt the Animator. */
+ public void setIgnoreExceptions(boolean ignoreExceptions) {
+ this.ignoreExceptions = ignoreExceptions;
+ }
+
+ /** Sets a flag indicating that when exceptions are being ignored by
+ this Animator (see {@link #setIgnoreExceptions}), to print the
+ exceptions' stack traces for diagnostic information. Defaults to
+ false. */
+ public void setPrintExceptions(boolean printExceptions) {
+ this.printExceptions = printExceptions;
+ }
+
+ /** Sets a flag in this Animator indicating that it is to run as
+ fast as possible. By default there is a brief pause in the
+ animation loop which prevents the CPU from getting swamped.
+ This method may not have an effect on subclasses. */
+ public final void setRunAsFastAsPossible(boolean runFast) {
+ runAsFastAsPossible = runFast;
+ }
+
+ /** Called every frame to cause redrawing of all of the
+ GLAutoDrawables this Animator manages. Subclasses should call
+ this to get the most optimized painting behavior for the set of
+ components this Animator manages, in particular when multiple
+ lightweight widgets are continually being redrawn. */
+ protected void display() {
+ impl.display(this, ignoreExceptions, printExceptions);
+ }
+
+ class MainLoop implements Runnable {
+ public void run() {
+ try {
+ while (!shouldStop) {
+ // Don't consume CPU unless there is work to be done
+ if (drawables.size() == 0) {
+ synchronized (Animator.this) {
+ while (drawables.size() == 0 && !shouldStop) {
+ try {
+ Animator.this.wait();
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+ }
+ display();
+ if (!runAsFastAsPossible) {
+ // Avoid swamping the CPU
+ Thread.yield();
+ }
+ }
+ } finally {
+ shouldStop = false;
+ synchronized (Animator.this) {
+ thread = null;
+ Animator.this.notify();
+ }
+ }
+ }
+ }
+
+ /** Starts this animator. */
+ public synchronized void start() {
+ if (thread != null) {
+ throw new GLException("Already started");
+ }
+ if (runnable == null) {
+ runnable = new MainLoop();
+ }
+ thread = new Thread(runnable);
+ thread.start();
+ }
+
+ /** Indicates whether this animator is currently running. This
+ should only be used as a heuristic to applications because in
+ some circumstances the Animator may be in the process of
+ shutting down and this method will still return true. */
+ public synchronized boolean isAnimating() {
+ return (thread != null);
+ }
+
+ /** Stops this animator. In most situations this method blocks until
+ completion, except when called from the animation thread itself
+ or in some cases from an implementation-internal thread like the
+ AWT event queue thread. */
+ public synchronized void stop() {
+ shouldStop = true;
+ notifyAll();
+
+ // It's hard to tell whether the thread which calls stop() has
+ // dependencies on the Animator's internal thread. Currently we
+ // use a couple of heuristics to determine whether we should do
+ // the blocking wait().
+ if (impl.skipWaitForStop(thread)) {
+ return;
+ }
+
+ while (shouldStop && thread != null) {
+ try {
+ wait();
+ } catch (InterruptedException ie) {
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java b/src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java
new file mode 100644
index 000000000..8bba4b71a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/AnimatorImpl.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.opengl.util;
+
+import java.util.*;
+import javax.media.opengl.*;
+
+/** Abstraction to factor out AWT dependencies from the Animator's
+ implementation in a way that still allows the FPSAnimator to pick
+ up this behavior if desired. */
+
+class AnimatorImpl {
+ public void display(Animator animator,
+ boolean ignoreExceptions,
+ boolean printExceptions) {
+ Iterator iter = animator.drawableIterator();
+ while (iter.hasNext()) {
+ GLAutoDrawable drawable = (GLAutoDrawable) iter.next();
+ try {
+ drawable.display();
+ } catch (RuntimeException e) {
+ if (ignoreExceptions) {
+ if (printExceptions) {
+ e.printStackTrace();
+ }
+ } else {
+ throw(e);
+ }
+ }
+ }
+ }
+
+ public boolean skipWaitForStop(Thread thread) {
+ return (Thread.currentThread() == thread);
+ }
+}
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
new file mode 100755
index 000000000..40f035514
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javame_cdc_fp
@@ -0,0 +1,449 @@
+/*
+ * 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
new file mode 100755
index 000000000..d02f3d15f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/BufferUtil.java.javase
@@ -0,0 +1,499 @@
+/*
+ * 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/com/sun/opengl/util/FBObject.java b/src/jogl/classes/com/sun/opengl/util/FBObject.java
new file mode 100755
index 000000000..c308f430f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/FBObject.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+
+public class FBObject {
+ private int width, height, attr;
+ private int fb, fbo_tex, depth_rb, stencil_rb, vStatus;
+ private int texInternalFormat, texDataFormat, texDataType;
+
+ public static final int ATTR_DEPTH = 1 << 0;
+ public static final int ATTR_STENCIL = 1 << 1;
+
+ public FBObject(int width, int height, int attributes) {
+ this.width = width;
+ this.height = height;
+ this.attr = attributes;
+ }
+
+
+ public boolean validateStatus(GL gl)
+ {
+ if(!gl.glIsFramebuffer(fb)) {
+ vStatus=-1;
+ return false;
+ }
+ vStatus=gl.glCheckFramebufferStatus(gl.GL_FRAMEBUFFER);
+ //vStatus=gl.glCheckFramebufferStatus(fb);
+
+ switch(vStatus) {
+ case GL.GL_FRAMEBUFFER_COMPLETE:
+ return true;
+ case GL.GL_FRAMEBUFFER_UNSUPPORTED:
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
+ //case GL2.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
+ //case GL2.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
+ //case GL2.GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT:
+ case 0:
+ default:
+ return false;
+ }
+ }
+
+ public String getStatusString()
+ {
+ switch(vStatus) {
+ case -1:
+ return "NOT A FBO";
+ case GL.GL_FRAMEBUFFER_COMPLETE:
+ return "OK";
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
+ return("GL FBO: incomplete,incomplete attachment\n");
+ case GL.GL_FRAMEBUFFER_UNSUPPORTED:
+ return("GL FBO: Unsupported framebuffer format");
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
+ return("GL FBO: incomplete,missing attachment");
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
+ return("GL FBO: incomplete,attached images must have same dimensions");
+ case GL.GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
+ return("GL FBO: incomplete,attached images must have same format");
+ /*
+ case GL2.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
+ return("GL FBO: incomplete,missing draw buffer");
+ case GL2.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
+ return("GL FBO: incomplete,missing read buffer");
+ case GL2.GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT:
+ return("GL FBO: incomplete, duplicate attachment");
+ */
+ case 0:
+ return("GL FBO: incomplete, implementation fault");
+ default:
+ return("GL FBO: incomplete, implementation ERROR");
+ }
+ }
+
+ public void init(GL gl) {
+ int textureInternalFormat, textureDataFormat, textureDataType;
+
+ if(gl.isGL2()) {
+ textureInternalFormat=GL.GL_RGBA8;
+ textureDataFormat=GL2.GL_BGRA;
+ textureDataType=GL2.GL_UNSIGNED_INT_8_8_8_8_REV;
+ } else if(gl.isGLES()) {
+ textureInternalFormat=GL.GL_RGBA;
+ textureDataFormat=GL.GL_RGBA;
+ textureDataType=GL.GL_UNSIGNED_BYTE;
+ } else {
+ textureInternalFormat=GL.GL_RGB;
+ textureDataFormat=GL.GL_RGB;
+ textureDataType=GL.GL_UNSIGNED_BYTE;
+ }
+ init(gl, textureInternalFormat, textureDataFormat, textureDataType);
+ }
+
+ public void init(GL gl, int textureInternalFormat, int textureDataFormat, int textureDataType) {
+ texInternalFormat=textureInternalFormat;
+ texDataFormat=textureDataFormat;
+ texDataType=textureDataType;
+
+ // generate fbo ..
+ int name[] = new int[1];
+
+ gl.glGenFramebuffers(1, name, 0);
+ fb = name[0];
+ System.out.println("fb: "+fb);
+
+ gl.glGenTextures(1, name, 0);
+ fbo_tex = name[0];
+ System.out.println("fbo_tex: "+fbo_tex);
+
+ if(0!=(attr&ATTR_DEPTH)) {
+ gl.glGenRenderbuffers(1, name, 0);
+ depth_rb = name[0];
+ System.out.println("depth_rb: "+depth_rb);
+ } else {
+ depth_rb = 0;
+ }
+ if(0!=(attr&ATTR_STENCIL)) {
+ gl.glGenRenderbuffers(1, name, 0);
+ stencil_rb = name[0];
+ System.out.println("stencil_rb: "+stencil_rb);
+ } else {
+ stencil_rb = 0;
+ }
+
+ // bind fbo ..
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, fb);
+
+ gl.glBindTexture(GL.GL_TEXTURE_2D, fbo_tex);
+ gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, texInternalFormat, width, height, 0,
+ texDataFormat, texDataType, null);
+ gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
+ gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+ //gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP);
+ //gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP);
+
+
+ // Set up the color buffer for use as a renderable texture:
+ gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER,
+ GL.GL_COLOR_ATTACHMENT0,
+ GL.GL_TEXTURE_2D, fbo_tex, 0);
+
+ if(depth_rb!=0) {
+ // Initialize the depth buffer:
+ gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, depth_rb);
+ gl.glRenderbufferStorage(GL.GL_RENDERBUFFER,
+ GL.GL_DEPTH_COMPONENT16, width, height);
+ // Set up the depth buffer attachment:
+ gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+ GL.GL_DEPTH_ATTACHMENT,
+ GL.GL_RENDERBUFFER, depth_rb);
+ }
+
+ if(stencil_rb!=0) {
+ // Initialize the stencil buffer:
+ gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, stencil_rb);
+ gl.glRenderbufferStorage(GL.GL_RENDERBUFFER,
+ GL.GL_STENCIL_INDEX8, width, height);
+ gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
+ GL.GL_STENCIL_ATTACHMENT,
+ GL.GL_RENDERBUFFER, stencil_rb);
+ }
+
+ // Check the FBO for completeness
+ if(validateStatus(gl)) {
+ System.out.println("Framebuffer " + fb + " is complete");
+ } else {
+ System.out.println("Framebuffer " + fb + " is incomplete: status = 0x" + Integer.toHexString(vStatus) +
+ " : " + getStatusString());
+ }
+
+ unbind(gl);
+ }
+
+ public void destroy(GL gl) {
+ unbind(gl);
+
+ int name[] = new int[1];
+
+ if(0!=stencil_rb) {
+ name[0] = stencil_rb;
+ gl.glDeleteRenderbuffers(1, name, 0);
+ stencil_rb = 0;
+ }
+ if(0!=depth_rb) {
+ name[0] = depth_rb;
+ gl.glDeleteRenderbuffers(1, name, 0);
+ depth_rb=0;
+ }
+ if(0!=fbo_tex) {
+ name[0] = fbo_tex;
+ gl.glDeleteTextures(1, name, 0);
+ fbo_tex = 0;
+ }
+ if(0!=fb) {
+ name[0] = fb;
+ gl.glDeleteFramebuffers(1, name, 0);
+ fb = 0;
+ }
+ }
+
+ public void bind(GL gl) {
+ gl.glBindTexture(GL.GL_TEXTURE_2D, fbo_tex);
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, fb);
+ }
+
+ public void unbind(GL gl) {
+ gl.glBindTexture(GL.GL_TEXTURE_2D, 0);
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
+ }
+
+ public void use(GL gl) {
+ gl.glBindTexture(GL.GL_TEXTURE_2D, 0);
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
+ gl.glBindTexture(GL.GL_TEXTURE_2D, fbo_tex); // to use it ..
+ }
+
+ public int getFBName() {
+ return fb;
+ }
+ public int getTextureName() {
+ return fbo_tex;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/FPSAnimator.java b/src/jogl/classes/com/sun/opengl/util/FPSAnimator.java
new file mode 100755
index 000000000..290de89d6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/FPSAnimator.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util;
+
+import java.util.*;
+import javax.media.opengl.*;
+
+/** An Animator subclass which attempts to achieve a target
+ frames-per-second rate to avoid using all CPU time. The target FPS
+ is only an estimate and is not guaranteed. */
+
+public class FPSAnimator extends Animator {
+ private Timer timer;
+ private int fps;
+ private boolean scheduleAtFixedRate;
+
+ /** Creates an FPSAnimator with a given target frames-per-second
+ value. Equivalent to <code>FPSAnimator(null, fps)</code>. */
+ public FPSAnimator(int fps) {
+ this(null, fps);
+ }
+
+ /** Creates an FPSAnimator with a given target frames-per-second
+ value and a flag indicating whether to use fixed-rate
+ scheduling. Equivalent to <code>FPSAnimator(null, fps,
+ scheduleAtFixedRate)</code>. */
+ public FPSAnimator(int fps, boolean scheduleAtFixedRate) {
+ this(null, fps, scheduleAtFixedRate);
+ }
+
+ /** Creates an FPSAnimator with a given target frames-per-second
+ value and an initial drawable to animate. Equivalent to
+ <code>FPSAnimator(null, fps, false)</code>. */
+ public FPSAnimator(GLAutoDrawable drawable, int fps) {
+ this(drawable, fps, false);
+ }
+
+ /** Creates an FPSAnimator with a given target frames-per-second
+ value, an initial drawable to animate, and a flag indicating
+ whether to use fixed-rate scheduling. */
+ public FPSAnimator(GLAutoDrawable drawable, int fps, boolean scheduleAtFixedRate) {
+ this.fps = fps;
+ if (drawable != null) {
+ add(drawable);
+ }
+ this.scheduleAtFixedRate = scheduleAtFixedRate;
+ }
+
+ /** Starts this FPSAnimator. */
+ public synchronized void start() {
+ if (timer != null) {
+ throw new GLException("Already started");
+ }
+ timer = new Timer();
+ long delay = (long) (1000.0f / (float) fps);
+ TimerTask task = new TimerTask() {
+ public void run() {
+ display();
+ }
+ };
+ if (scheduleAtFixedRate) {
+ timer.scheduleAtFixedRate(task, 0, delay);
+ } else {
+ timer.schedule(task, 0, delay);
+ }
+ }
+
+ /** Indicates whether this FPSAnimator is currently running. This
+ should only be used as a heuristic to applications because in
+ some circumstances the FPSAnimator may be in the process of
+ shutting down and this method will still return true. */
+ public synchronized boolean isAnimating() {
+ return (timer != null);
+ }
+
+ /** Stops this FPSAnimator. Due to the implementation of the
+ FPSAnimator it is not guaranteed that the FPSAnimator will be
+ completely stopped by the time this method returns. */
+ public synchronized void stop() {
+ if (timer == null) {
+ throw new GLException("Already stopped");
+ }
+ timer.cancel();
+ timer = null;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/FileUtil.java b/src/jogl/classes/com/sun/opengl/util/FileUtil.java
new file mode 100755
index 000000000..84b846853
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/FileUtil.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util;
+
+import java.io.*;
+
+/** Utilities for dealing with files. */
+
+public class FileUtil {
+ private FileUtil() {}
+
+ /**
+ * Returns the lowercase suffix of the given file name (the text
+ * after the last '.' in the file name). Returns null if the file
+ * name has no suffix. Only operates on the given file name;
+ * performs no I/O operations.
+ *
+ * @param file name of the file
+ * @return lowercase suffix of the file name
+ * @throws NullPointerException if file is null
+ */
+
+ public static String getFileSuffix(File file) {
+ return getFileSuffix(file.getName());
+ }
+
+ /**
+ * Returns the lowercase suffix of the given file name (the text
+ * after the last '.' in the file name). Returns null if the file
+ * name has no suffix. Only operates on the given file name;
+ * performs no I/O operations.
+ *
+ * @param filename name of the file
+ * @return lowercase suffix of the file name
+ * @throws NullPointerException if filename is null
+ */
+ public static String getFileSuffix(String filename) {
+ int lastDot = filename.lastIndexOf('.');
+ if (lastDot < 0) {
+ return null;
+ }
+ return toLowerCase(filename.substring(lastDot + 1));
+ }
+
+ private static String toLowerCase(String arg) {
+ if (arg == null) {
+ return null;
+ }
+
+ return arg.toLowerCase();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/FixedPoint.java b/src/jogl/classes/com/sun/opengl/util/FixedPoint.java
new file mode 100644
index 000000000..e9bdae0e9
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/FixedPoint.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.opengl.util;
+
+public class FixedPoint {
+ public static final int toFixed(int value) {
+ if (value < -32768) value = -32768;
+ if (value > 32767) value = 32767;
+ return value * 65536;
+ }
+
+ public static final int toFixed(float value) {
+ if (value < -32768) value = -32768;
+ if (value > 32767) value = 32767;
+ return (int)(value * 65536.0f);
+ }
+
+ public static final float toFloat(int value) {
+ return (float)value/65536.0f;
+ }
+
+ public static final int mult(int x1, int x2) {
+ return (int) ( ((long)x1*(long)x2)/65536 );
+ }
+
+ public static final int div(int x1, int x2) {
+ return (int) ( (((long)x1)<<16)/x2 );
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java
new file mode 100644
index 000000000..e05a77226
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataClient.java
@@ -0,0 +1,353 @@
+
+package com.sun.opengl.util;
+
+import java.security.*;
+
+import javax.media.opengl.*;
+
+import com.sun.opengl.util.glsl.*;
+
+import com.sun.opengl.impl.SystemUtil;
+
+import java.nio.*;
+
+public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayDataEditable {
+
+ /**
+ * The OpenGL ES emulation on the PC probably has a buggy VBO implementation,
+ * where we have to 'refresh' the VertexPointer or VertexAttribArray after each
+ * BindBuffer !
+ *
+ * This should not be necessary on proper native implementations.
+ */
+ public static final boolean hasVBOBug = AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return SystemUtil.getenv("JOGL_VBO_BUG");
+ }
+ }) != null;
+
+ /**
+ * @arg index The GL array index
+ * @arg name The optional custom name for the GL array index, maybe null.
+ * If null, the default name mapping will be used, see 'getPredefinedArrayIndexName(int)'.
+ * This name might be used as the shader attribute name.
+ * @arg comps The array component number
+ * @arg dataType The array index GL data type
+ * @arg normalized Wheather the data shall be normalized
+ *
+ * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
+ */
+ public static GLArrayDataClient createFixed(GL gl, int index, String name, int comps, int dataType, boolean normalized,
+ int initialSize)
+ throws GLException
+ {
+ gl.getGLProfile().isValidArrayDataType(index, comps, dataType, false, true);
+ GLArrayDataClient adc = new GLArrayDataClient();
+ GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
+ adc.init(name, index, comps, dataType, normalized, 0, null, initialSize, false, glArrayHandler, 0, 0);
+ return adc;
+ }
+
+ public static GLArrayDataClient createFixed(GL gl, int index, String name, int comps, int dataType, boolean normalized,
+ int stride, Buffer buffer)
+ throws GLException
+ {
+ gl.getGLProfile().isValidArrayDataType(index, comps, dataType, false, true);
+ GLArrayDataClient adc = new GLArrayDataClient();
+ GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
+ adc.init(name, index, comps, dataType, normalized, stride, buffer, comps*comps, false, glArrayHandler, 0, 0);
+ return adc;
+ }
+
+ public static GLArrayDataClient createGLSL(GL gl, String name, int comps, int dataType, boolean normalized,
+ int initialSize)
+ throws GLException
+ {
+ if(!gl.hasGLSL()) {
+ throw new GLException("GLArrayDataClient.GLSL not supported: "+gl);
+ }
+ gl.getGLProfile().isValidArrayDataType(-1, comps, dataType, true, true);
+
+ GLArrayDataClient adc = new GLArrayDataClient();
+ GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
+ adc.init(name, -1, comps, dataType, normalized, 0, null, initialSize, true, glArrayHandler, 0, 0);
+ return adc;
+ }
+
+ public static GLArrayDataClient createGLSL(GL gl, String name, int comps, int dataType, boolean normalized,
+ int stride, Buffer buffer)
+ throws GLException
+ {
+ if(!gl.hasGLSL()) {
+ throw new GLException("GLArrayDataClient.GLSL not supported: "+gl);
+ }
+ gl.getGLProfile().isValidArrayDataType(-1, comps, dataType, true, true);
+
+ GLArrayDataClient adc = new GLArrayDataClient();
+ GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
+ adc.init(name, -1, comps, dataType, normalized, stride, buffer, comps*comps, true, glArrayHandler, 0, 0);
+ return adc;
+ }
+
+ //
+ // Data read access
+ //
+
+ public final boolean isBufferWritten() { return bufferWritten; }
+
+ public final boolean sealed() { return sealed; }
+
+ public int getBufferUsage() { return -1; }
+
+ //
+ // Data and GL state modification ..
+ //
+
+ public final void setBufferWritten(boolean written) { bufferWritten=written; }
+
+ public void destroy(GL gl) {
+ reset(gl);
+ buffer=null;
+ }
+
+ public void reset(GL gl) {
+ enableBuffer(gl, false);
+ reset();
+ }
+
+ public void seal(GL gl, boolean seal)
+ {
+ seal(seal);
+ if(sealedGL==seal) return;
+ sealedGL = seal;
+ if(seal) {
+ init_vbo(gl);
+
+ enableBuffer(gl, true);
+ } else {
+ enableBuffer(gl, false);
+ }
+ }
+
+ public void enableBuffer(GL gl, boolean enable) {
+ if(enableBufferAlways && enable) {
+ bufferEnabled = false;
+ }
+ if( bufferEnabled != enable && components>0 ) {
+ if(enable) {
+ checkSeal(true);
+ if(null!=buffer) {
+ buffer.rewind();
+ }
+ }
+ glArrayHandler.enableBuffer(gl, enable);
+ bufferEnabled = enable;
+ }
+ }
+
+ public void setEnableAlways(boolean always) {
+ enableBufferAlways = always;
+ }
+
+ //
+ // Data modification ..
+ //
+
+ public void reset() {
+ if(buffer!=null) {
+ buffer.clear();
+ }
+ this.sealed=false;
+ this.bufferEnabled=false;
+ this.bufferWritten=false;
+ }
+
+ public void seal(boolean seal)
+ {
+ if(sealed==seal) return;
+ sealed = seal;
+ if(seal) {
+ bufferWritten=false;
+ if (null!=buffer) {
+ buffer.flip();
+ }
+ } else {
+ if (null!=buffer) {
+ buffer.position(buffer.limit());
+ buffer.limit(buffer.capacity());
+ }
+ }
+ }
+
+
+ public void rewind() {
+ if(buffer!=null) {
+ buffer.rewind();
+ }
+ }
+
+ public void padding(int done) {
+ if ( buffer==null || sealed ) return;
+ while(done<strideL) {
+ BufferUtil.putb(buffer, (byte)0);
+ done++;
+ }
+ }
+
+ /**
+ * Generic buffer relative put method.
+ *
+ * This class buffer Class must match the arguments buffer class.
+ * The arguments remaining elements must be a multiple of this arrays element stride.
+ */
+ public void put(Buffer v) {
+ if ( buffer==null || sealed ) return;
+ if(0!=(v.remaining() % strideL)) {
+ throw new GLException("Buffer length ("+v.remaining()+") is not a multiple of component-stride:\n\t"+this);
+ }
+ growBufferIfNecessary(v.remaining());
+ BufferUtil.put(buffer, v);
+ }
+
+ public void putb(byte v) {
+ if ( buffer==null || sealed ) return;
+ growBufferIfNecessary(1);
+ BufferUtil.putb(buffer, v);
+ }
+
+ public void puts(short v) {
+ if ( buffer==null || sealed ) return;
+ growBufferIfNecessary(1);
+ BufferUtil.puts(buffer, v);
+ }
+
+ public void puti(int v) {
+ if ( buffer==null || sealed ) return;
+ growBufferIfNecessary(1);
+ BufferUtil.puti(buffer, v);
+ }
+
+ public void putx(int v) {
+ puti(v);
+ }
+
+ public void putf(float v) {
+ if ( buffer==null || sealed ) return;
+ growBufferIfNecessary(1);
+ BufferUtil.putf(buffer, v);
+ }
+
+ public String toString() {
+ return "GLArrayDataClient["+name+
+ ", index "+index+
+ ", location "+location+
+ ", isVertexAttribute "+isVertexAttribute+
+ ", dataType "+dataType+
+ ", bufferClazz "+clazz+
+ ", elements "+getElementNumber()+
+ ", components "+components+
+ ", stride "+stride+"u "+strideB+"b "+strideL+"c"+
+ ", initialSize "+initialSize+
+ ", sealed "+sealed+
+ ", bufferEnabled "+bufferEnabled+
+ ", bufferWritten "+bufferWritten+
+ ", buffer "+buffer+
+ "]";
+ }
+
+ // non public matters
+
+ protected final boolean growBufferIfNecessary(int spare) {
+ if(buffer==null || buffer.remaining()<spare) {
+ growBuffer(initialSize);
+ return true;
+ }
+ return false;
+ }
+
+ protected final void growBuffer(int additional) {
+ if(sealed || 0==additional || 0==components) return;
+
+ // add the stride delta
+ additional += (additional/components)*(strideL-components);
+
+ if(components>0) {
+ int osize = (buffer!=null)?buffer.capacity():0;
+ if(clazz==ByteBuffer.class) {
+ ByteBuffer newBBuffer = BufferUtil.newByteBuffer( (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 );
+ if(buffer!=null) {
+ buffer.flip();
+ newSBuffer.put((ShortBuffer)buffer);
+ }
+ buffer = newSBuffer;
+ } else if(clazz==IntBuffer.class) {
+ IntBuffer newIBuffer = BufferUtil.newIntBuffer( (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 );
+ if(buffer!=null) {
+ buffer.flip();
+ newFBuffer.put((FloatBuffer)buffer);
+ }
+ buffer = newFBuffer;
+ } else {
+ throw new GLException("Given Buffer Class not supported: "+clazz+":\n\t"+this);
+ }
+ }
+ }
+
+ protected final void checkSeal(boolean test) throws GLException {
+ if(sealed!=test) {
+ if(test) {
+ throw new GLException("Not Sealed yet, seal first:\n\t"+this);
+ } else {
+ throw new GLException("Already Sealed, can't modify VBO:\n\t"+this);
+ }
+ }
+ }
+
+ protected void init(String name, int index, int comps, int dataType, boolean normalized, int stride, Buffer data,
+ int initialSize, boolean isVertexAttribute, GLArrayHandler handler,
+ int vboName, long bufferOffset)
+ throws GLException
+ {
+ super.init(name, index, comps, dataType, normalized, stride, data, isVertexAttribute,
+ vboName, bufferOffset);
+
+ this.initialSize = initialSize;
+ this.glArrayHandler = handler;
+ this.sealed=false;
+ this.sealedGL=false;
+ this.bufferEnabled=false;
+ this.enableBufferAlways=false;
+ this.bufferWritten=false;
+ if(null==buffer) {
+ growBuffer(initialSize);
+ }
+ }
+
+ protected void init_vbo(GL gl) {}
+
+ protected GLArrayDataClient() { }
+
+ protected boolean sealed, sealedGL;
+ protected boolean bufferEnabled;
+ protected boolean bufferWritten;
+ protected boolean enableBufferAlways;
+
+ protected int initialSize;
+
+ protected GLArrayHandler glArrayHandler;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java
new file mode 100644
index 000000000..c8fcbf573
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataEditable.java
@@ -0,0 +1,110 @@
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+
+import java.nio.*;
+
+/**
+ *
+ * The total number of bytes hold by the referenced buffer is:
+ * getComponentSize()* getComponentNumber() * getElementNumber()
+ *
+ */
+public interface GLArrayDataEditable extends GLArrayData {
+
+ public boolean sealed();
+
+ /**
+ * The VBO buffer usage, if it's an VBO, otherwise -1
+ */
+ public int getBufferUsage();
+
+ /**
+ * Is the buffer written to the GPU ?
+ */
+ public boolean isBufferWritten();
+
+ /**
+ * Marks the buffer written to the GPU
+ */
+ public void setBufferWritten(boolean written);
+
+ //
+ // Data and GL state modification ..
+ //
+
+ public void destroy(GL gl);
+
+ public void reset(GL gl);
+
+ /**
+ * If seal is true, it
+ * disable write operations to the buffer.
+ * Calls flip, ie limit:=position and position:=0.
+ * Also enables the buffer for OpenGL, and passes the data.
+ *
+ * If seal is false, it
+ * enable write operations continuing
+ * at the buffer position, where you left off at seal(true),
+ * ie position:=limit and limit:=capacity.
+ * Also disables the buffer for OpenGL.
+ *
+ * @see #seal(boolean)
+ */
+ public void seal(GL gl, boolean seal);
+
+ /**
+ * Enables/disables the buffer, which implies
+ * the client state, binding the VBO
+ * and transfering the data if not done yet.
+ *
+ * The above will only be executed,
+ * if the buffer is disabled,
+ * or 'setEnableAlways' was called with 'true'.
+ *
+ * @see #setEnableAlways(boolean)
+ */
+ public void enableBuffer(GL gl, boolean enable);
+
+ /**
+ * Affects the behavior of 'enableBuffer'.
+ *
+ * The default is 'false'
+ *
+ * This is usefull when you mix up
+ * GLArrayData usage with conventional GL array calls.
+ *
+ * @see #enableBuffer(GL, boolean)
+ */
+ public void setEnableAlways(boolean always);
+
+ //
+ // Data modification ..
+ //
+
+ public void reset();
+
+ /**
+ * If seal is true, it
+ * disable write operations to the buffer.
+ * Calls flip, ie limit:=position and position:=0.
+ *
+ * If seal is false, it
+ * enable write operations continuing
+ * at the buffer position, where you left off at seal(true),
+ * ie position:=limit and limit:=capacity.
+ *
+ */
+ public void seal(boolean seal);
+
+ public void rewind();
+ public void padding(int done);
+ public void put(Buffer v);
+ public void putb(byte v);
+ public void puts(short v);
+ public void puti(int v);
+ public void putx(int v);
+ public void putf(float v);
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java
new file mode 100644
index 000000000..e9a5e2754
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataServer.java
@@ -0,0 +1,209 @@
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+import java.nio.*;
+
+import com.sun.opengl.util.glsl.*;
+
+public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataEditable {
+
+ //
+ // lifetime matters
+ //
+
+ /**
+ * Create a VBOBuffer object, using a predefined fixed function array index
+ * and starting with a given Buffer object incl it's stride
+ *
+ * On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
+ * On profile ES2 the fixed function emulation will transform these calls to
+ * EnableVertexAttribArray and VertexAttribPointer calls,
+ * and a predefined vertex attribute variable name will be choosen.
+ *
+ * @arg index The GL array index
+ * @arg name The optional custom name for the GL array index, maybe null.
+ * If null, the default name mapping will be used, see 'getPredefinedArrayIndexName(int)'.
+ * This name might be used as the shader attribute name.
+ * @arg comps The array component number
+ * @arg dataType The array index GL data type
+ * @arg normalized Wheather the data shall be normalized
+ *
+ * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
+ */
+ public static GLArrayDataServer createFixed(GL gl, int index, String name, int comps, int dataType, boolean normalized,
+ int stride, Buffer buffer, int vboBufferUsage)
+ throws GLException
+ {
+ gl.getGLProfile().isValidArrayDataType(index, comps, dataType, false, true);
+
+ GLArrayDataServer ads = new GLArrayDataServer();
+ GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
+ ads.init(gl, name, index, comps, dataType, normalized, stride, buffer, buffer.limit(), false, glArrayHandler,
+ 0, 0, vboBufferUsage);
+ return ads;
+ }
+
+ /**
+ * Create a VBOBuffer object, using a predefined fixed function array index
+ * and starting with a new created Buffer object with initialSize size
+ *
+ * On profiles GL2 and ES1 the fixed function pipeline behavior is as expected.
+ * On profile ES2 the fixed function emulation will transform these calls to
+ * EnableVertexAttribArray and VertexAttribPointer calls,
+ * and a predefined vertex attribute variable name will be choosen.
+ *
+ * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
+ */
+ public static GLArrayDataServer createFixed(GL gl, int index, String name, int comps, int dataType, boolean normalized,
+ int initialSize, int vboBufferUsage)
+ throws GLException
+ {
+ gl.getGLProfile().isValidArrayDataType(index, comps, dataType, false, true);
+
+ GLArrayDataServer ads = new GLArrayDataServer();
+ GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
+ ads.init(gl, name, index, comps, dataType, normalized, 0, null, initialSize, false, glArrayHandler,
+ 0, 0, vboBufferUsage);
+ return ads;
+ }
+
+ /**
+ * Create a VBOBuffer object, using a custom GLSL array attribute name
+ * and starting with a new created Buffer object with initialSize size
+ *
+ * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
+ */
+ public static GLArrayDataServer createGLSL(GL gl, String name, int comps, int dataType, boolean normalized,
+ int initialSize, int vboBufferUsage)
+ throws GLException
+ {
+ if(!gl.hasGLSL()) {
+ throw new GLException("GLArrayDataServer.GLSL not supported: "+gl);
+ }
+ gl.getGLProfile().isValidArrayDataType(-1, comps, dataType, true, true);
+
+ GLArrayDataServer ads = new GLArrayDataServer();
+ GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+ ads.init(gl, name, -1, comps, dataType, normalized, 0, null, initialSize, true, glArrayHandler,
+ 0, 0, vboBufferUsage);
+ return ads;
+ }
+
+ /**
+ * Create a VBOBuffer object, using a custom GLSL array attribute name
+ * and starting with a given Buffer object incl it's stride
+ *
+ * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
+ */
+ public static GLArrayDataServer createGLSL(GL gl, String name, int comps, int dataType, boolean normalized,
+ int stride, Buffer buffer, int vboBufferUsage)
+ throws GLException
+ {
+ if(!gl.hasGLSL()) {
+ throw new GLException("GLArrayDataServer.GLSL not supported: "+gl);
+ }
+ gl.getGLProfile().isValidArrayDataType(-1, comps, dataType, true, true);
+
+ GLArrayDataServer ads = new GLArrayDataServer();
+ GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+ ads.init(gl, name, -1, comps, dataType, normalized, stride, buffer, buffer.limit(), true, glArrayHandler,
+ 0, 0, vboBufferUsage);
+ return ads;
+ }
+
+ //
+ // Data matters GLArrayData
+ //
+
+ public int getBufferUsage() { return vboBufferUsage; }
+
+ //
+ // Data and GL state modification ..
+ //
+
+ public void destroy(GL gl) {
+ super.destroy(gl);
+ if(vboName!=0) {
+ int[] tmp = new int[1];
+ tmp[0] = vboName;
+ gl.glDeleteBuffers(1, tmp, 0);
+ vboName = 0;
+ }
+ }
+
+ //
+ // data matters
+ //
+
+ /**
+ * Convenient way do disable the VBO behavior and
+ * switch to client side data one
+ * Only possible if buffer is defined.
+ */
+ public void setVBOUsage(boolean vboUsage) {
+ checkSeal(false);
+ super.setVBOUsage(vboUsage);
+ }
+
+ public String toString() {
+ return "GLArrayDataServer["+name+
+ ", index "+index+
+ ", location "+location+
+ ", isVertexAttribute "+isVertexAttribute+
+ ", dataType "+dataType+
+ ", bufferClazz "+clazz+
+ ", elements "+getElementNumber()+
+ ", components "+components+
+ ", stride "+stride+"u "+strideB+"b "+strideL+"c"+
+ ", initialSize "+initialSize+
+ ", vboBufferUsage "+vboBufferUsage+
+ ", vboUsage "+vboUsage+
+ ", vboName "+vboName+
+ ", sealed "+sealed+
+ ", bufferEnabled "+bufferEnabled+
+ ", bufferWritten "+bufferWritten+
+ ", buffer "+buffer+
+ ", offset "+bufferOffset+
+ "]";
+ }
+
+ //
+ // non public matters ..
+ //
+
+ protected void init(GL gl, String name, int index, int comps, int dataType, boolean normalized,
+ int stride, Buffer data, int initialSize, boolean isVertexAttribute,
+ GLArrayHandler glArrayHandler,
+ int vboName, long bufferOffset, int vboBufferUsage)
+ throws GLException
+ {
+ super.init(name, index, comps, dataType, normalized, stride, data, initialSize, isVertexAttribute, glArrayHandler,
+ vboName, bufferOffset);
+
+ vboUsage=true;
+
+ if( ! (gl.isGL2ES2() && vboBufferUsage==GL2ES2.GL_STREAM_DRAW) ) {
+ switch(vboBufferUsage) {
+ case -1: // nop
+ case GL.GL_STATIC_DRAW:
+ case GL.GL_DYNAMIC_DRAW:
+ break;
+ default:
+ throw new GLException("invalid vboBufferUsage: "+vboBufferUsage+":\n\t"+this);
+ }
+ }
+ this.vboBufferUsage=vboBufferUsage;
+ }
+
+ protected void init_vbo(GL gl) {
+ if(vboUsage && vboName==0) {
+ int[] tmp = new int[1];
+ gl.glGenBuffers(1, tmp, 0);
+ vboName = tmp[0];
+ }
+ }
+
+ protected int vboBufferUsage;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java
new file mode 100644
index 000000000..72e7c19bb
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/GLArrayDataWrapper.java
@@ -0,0 +1,215 @@
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+
+import com.sun.opengl.util.glsl.fixedfunc.impl.*;
+
+import java.nio.*;
+
+public class GLArrayDataWrapper implements GLArrayData {
+
+ public static GLArrayDataWrapper createFixed(GL gl, int index, int comps, int dataType, boolean normalized,
+ int stride, Buffer buffer,
+ int vboName, long bufferOffset)
+ throws GLException
+ {
+ gl.getGLProfile().isValidArrayDataType(index, comps, dataType, false, true);
+ GLArrayDataWrapper adc = new GLArrayDataWrapper();
+ adc.init(null, index, comps, dataType, normalized, stride, buffer, false,
+ vboName, bufferOffset);
+ return adc;
+ }
+
+ public static GLArrayDataWrapper createGLSL(GL gl, String name, int comps, int dataType, boolean normalized,
+ int stride, Buffer buffer,
+ int vboName, long bufferOffset)
+ throws GLException
+ {
+ if(!gl.hasGLSL()) {
+ throw new GLException("GLArrayDataWrapper.GLSL not supported: "+gl);
+ }
+ gl.getGLProfile().isValidArrayDataType(-1, comps, dataType, true, true);
+
+ GLArrayDataWrapper adc = new GLArrayDataWrapper();
+ adc.init(name, -1, comps, dataType, normalized, stride, buffer, true,
+ vboName, bufferOffset);
+ return adc;
+ }
+
+ //
+ // Data read access
+ //
+
+ public final boolean isVertexAttribute() { return isVertexAttribute; }
+
+ public final int getIndex() { return index; }
+
+ public final int getLocation() { return location; }
+
+ public final void setLocation(int v) { location = v; }
+
+ public final String getName() { return name; }
+
+ public final long getOffset() { return vboUsage?bufferOffset:-1; }
+
+ public final int getVBOName() { return vboUsage?vboName:-1; }
+
+ public final boolean isVBO() { return vboUsage; }
+
+ public final Buffer getBuffer() { return buffer; }
+
+ public final int getComponentNumber() { return components; }
+
+ public final int getComponentType() { return dataType; }
+
+ public final int getComponentSize() {
+ if(clazz==ByteBuffer.class) {
+ return BufferUtil.SIZEOF_BYTE;
+ }
+ if(clazz==ShortBuffer.class) {
+ return BufferUtil.SIZEOF_SHORT;
+ }
+ if(clazz==IntBuffer.class) {
+ return BufferUtil.SIZEOF_INT;
+ }
+ if(clazz==FloatBuffer.class) {
+ return BufferUtil.SIZEOF_FLOAT;
+ }
+ throw new GLException("Given Buffer Class not supported: "+clazz+":\n\t"+this);
+ }
+
+ public final int getElementNumber() {
+ if(null==buffer) return 0;
+ return ( buffer.position()==0 ) ? ( buffer.limit() / components ) : ( buffer.position() / components ) ;
+ }
+
+ public final boolean getNormalized() { return normalized; }
+
+ public final int getStride() { return stride; }
+
+ public final Class getBufferClass() { return clazz; }
+
+ public void destroy(GL gl) {
+ this.buffer = null;
+ this.components = 0;
+ this.stride=0;
+ this.strideB=0;
+ this.strideL=0;
+ this.vboName=0;
+ this.vboUsage=false;
+ this.bufferOffset=0;
+ }
+
+ public String toString() {
+ return "GLArrayDataWrapper["+name+
+ ", index "+index+
+ ", location "+location+
+ ", isVertexAttribute "+isVertexAttribute+
+ ", dataType "+dataType+
+ ", bufferClazz "+clazz+
+ ", elements "+getElementNumber()+
+ ", components "+components+
+ ", stride "+stride+"u "+strideB+"b "+strideL+"c"+
+ ", buffer "+buffer+
+ ", offset "+bufferOffset+
+ ", vboUsage "+vboUsage+
+ ", vboName "+vboName+
+ "]";
+ }
+
+ public static final Class getBufferClass(int dataType) {
+ switch(dataType) {
+ case GL.GL_BYTE:
+ case GL.GL_UNSIGNED_BYTE:
+ return ByteBuffer.class;
+ case GL.GL_SHORT:
+ case GL.GL_UNSIGNED_SHORT:
+ return ShortBuffer.class;
+ case GL2ES1.GL_FIXED:
+ return IntBuffer.class;
+ case GL.GL_FLOAT:
+ return FloatBuffer.class;
+ default:
+ throw new GLException("Given OpenGL data type not supported: "+dataType);
+ }
+ }
+
+ public void setName(String newName) {
+ location = -1;
+ name = newName;
+ }
+
+ public void setVBOUsage(boolean vboUsage) {
+ this.vboUsage=vboUsage;
+ }
+
+ public void setVBOName(int vboName) {
+ this.vboName=vboName;
+ setVBOUsage(vboName>0);
+ }
+
+ protected void init(String name, int index, int comps, int dataType, boolean normalized, int stride, Buffer data,
+ boolean isVertexAttribute,
+ int vboName, long bufferOffset)
+ throws GLException
+ {
+ this.isVertexAttribute = isVertexAttribute;
+ this.index = index;
+ this.location = -1;
+ // We can't have any dependence on the FixedFuncUtil class here for build bootstrapping reasons
+ this.name = (null==name)?FixedFuncPipeline.getPredefinedArrayIndexName(index):name;
+ if(null==this.name) {
+ throw new GLException("Not a valid GL array index: "+index);
+ }
+ this.dataType = dataType;
+ this.clazz = getBufferClass(dataType);
+ switch(dataType) {
+ case GL.GL_BYTE:
+ case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_SHORT:
+ case GL.GL_UNSIGNED_SHORT:
+ case GL2ES1.GL_FIXED:
+ this.normalized = normalized;
+ break;
+ default:
+ this.normalized = false;
+ }
+
+ int bpc = getComponentSize();
+ if(0<stride && stride<comps*bpc) {
+ throw new GLException("stride ("+stride+") lower than component bytes, "+comps+" * "+bpc);
+ }
+ if(0<stride && stride%bpc!=0) {
+ throw new GLException("stride ("+stride+") not a multiple of bpc "+bpc);
+ }
+ this.buffer = data;
+ this.components = comps;
+ this.stride=stride;
+ this.strideB=(0==stride)?comps*bpc:stride;
+ this.strideL=(0==stride)?comps:strideB/bpc;
+ this.vboName=vboName;
+ this.vboUsage=vboName>0;
+ this.bufferOffset=bufferOffset;
+ }
+
+ protected GLArrayDataWrapper() { }
+
+ protected int index;
+ protected int location;
+ protected String name;
+ protected int components;
+ protected int dataType;
+ protected boolean normalized;
+ protected int stride; // user given stride
+ protected int strideB; // stride in bytes
+ protected int strideL; // stride in logical components
+ protected Class clazz;
+ protected Buffer buffer;
+ protected boolean isVertexAttribute;
+
+ protected long bufferOffset;
+ protected int vboName;
+ protected boolean vboUsage;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java b/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java
new file mode 100644
index 000000000..9443ad6ed
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/GLArrayHandler.java
@@ -0,0 +1,11 @@
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+
+public interface GLArrayHandler {
+
+ public void enableBuffer(GL gl, boolean enable);
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java
new file mode 100644
index 000000000..f1e2502be
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/GLFixedArrayHandler.java
@@ -0,0 +1,65 @@
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.*;
+import com.sun.opengl.util.*;
+import java.nio.*;
+
+public class GLFixedArrayHandler implements GLArrayHandler {
+ private GLArrayDataEditable ad;
+
+ public GLFixedArrayHandler(GLArrayDataEditable ad) {
+ this.ad = ad;
+ }
+
+ protected final void passArrayPointer(GLPointerFunc gl) {
+ switch(ad.getIndex()) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ gl.glVertexPointer(ad);
+ break;
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ gl.glNormalPointer(ad);
+ break;
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ gl.glColorPointer(ad);
+ break;
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ gl.glTexCoordPointer(ad);
+ break;
+ default:
+ throw new GLException("invalid glArrayIndex: "+ad.getIndex()+":\n\t"+ad);
+ }
+ }
+
+ public void enableBuffer(GL gl, boolean enable) {
+ GLPointerFunc glp = gl.getGL2ES1();
+ if(enable) {
+ glp.glEnableClientState(ad.getIndex());
+
+ Buffer buffer = ad.getBuffer();
+
+ if(ad.isVBO()) {
+ // always bind and refresh the VBO mgr,
+ // in case more than one gl*Pointer objects are in use
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, ad.getVBOName());
+ if(!ad.isBufferWritten()) {
+ if(null!=buffer) {
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit() * ad.getComponentSize(), buffer, ad.getBufferUsage());
+ }
+ ad.setBufferWritten(true);
+ }
+ passArrayPointer(glp);
+ } else if(null!=buffer) {
+ passArrayPointer(glp);
+ ad.setBufferWritten(true);
+ }
+ } else {
+ if(ad.isVBO()) {
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ }
+ glp.glDisableClientState(ad.getIndex());
+ }
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/Gamma.java b/src/jogl/classes/com/sun/opengl/util/Gamma.java
new file mode 100755
index 000000000..da0d7bd96
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/Gamma.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util;
+
+import javax.media.opengl.*;
+import com.sun.opengl.impl.*;
+
+/** Provides control over the primary display's gamma, brightness and
+ contrast controls via the hardware gamma ramp tables. Not
+ supported on all platforms or graphics hardware. <P>
+
+ Thanks to the LWJGL project for illustrating how to access gamma
+ control on the various platforms.
+*/
+
+public class Gamma {
+ private Gamma() {}
+
+ /**
+ * Sets the gamma, brightness, and contrast of the current main
+ * display. This functionality is not available on all platforms and
+ * graphics hardware. Returns true if the settings were successfully
+ * changed, false if not. This method may return false for some
+ * values of the incoming arguments even on hardware which does
+ * support the underlying functionality. <P>
+ *
+ * If this method returns true, the display settings will
+ * automatically be reset to their original values upon JVM exit
+ * (assuming the JVM does not crash); if the user wishes to change
+ * the display settings back to normal ahead of time, use {@link
+ * #resetDisplayGamma resetDisplayGamma}(). It is recommended to
+ * call {@link #resetDisplayGamma resetDisplayGamma} before calling
+ * e.g. <code>System.exit()</code> from the application rather than
+ * rely on the shutdown hook functionality due to inevitable race
+ * conditions and unspecified behavior during JVM teardown. <P>
+ *
+ * This method may be called multiple times during the application's
+ * execution, but calling {@link #resetDisplayGamma
+ * resetDisplayGamma} will only reset the settings to the values
+ * before the first call to this method. <P>
+ *
+ * @param gamma The gamma value, typically > 1.0 (default values
+ * vary, but typically roughly 1.0)
+ * @param brightness The brightness value between -1.0 and 1.0,
+ * inclusive (default values vary, but typically 0)
+ * @param contrast The contrast, greater than 0.0 (default values
+ * vary, but typically 1)
+ * @return true if gamma settings were successfully changed, false
+ * if not
+ * @throws IllegalArgumentException if any of the parameters were
+ * out-of-bounds
+ */
+ public static boolean setDisplayGamma(GL gl, float gamma, float brightness, float contrast) throws IllegalArgumentException {
+ return GLDrawableFactoryImpl.getFactoryImpl(gl.getContext().getGLDrawable().getGLProfile()).setDisplayGamma(gamma, brightness, contrast);
+ }
+
+ /**
+ * Resets the gamma, brightness and contrast values for the primary
+ * display to their original values before {@link #setDisplayGamma
+ * setDisplayGamma} was called the first time. {@link
+ * #setDisplayGamma setDisplayGamma} must be called before calling
+ * this method or an unspecified exception will be thrown. While it
+ * is not explicitly required that this method be called before
+ * exiting, calling it is recommended because of the inevitable
+ * unspecified behavior during JVM teardown.
+ */
+ public static void resetDisplayGamma(GL gl) {
+ GLDrawableFactoryImpl.getFactoryImpl(gl.getContext().getGLDrawable().getGLProfile()).resetDisplayGamma();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java b/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java
new file mode 100644
index 000000000..65c676f4a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/ImmModeSink.java
@@ -0,0 +1,974 @@
+
+package com.sun.opengl.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;
+
+public class ImmModeSink {
+
+ public static final boolean DEBUG_BEGIN_END = false;
+ public static final boolean DEBUG_DRAW = false;
+
+ // public static final int GL_QUADS = 0x0007; // Needs data manipulation
+ public static final int GL_QUAD_STRIP = 0x0008;
+ public static final int GL_POLYGON = 0x0009;
+
+ /**
+ * Uses a GL2ES1, or ES2 fixed function emulation immediate mode sink
+ */
+ public static ImmModeSink createFixed(GL gl, int glBufferUsage, int initialSize,
+ int vComps, int vDataType,
+ int cComps, int cDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType) {
+ return new ImmModeSink(gl, glBufferUsage, initialSize,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, false);
+ }
+
+ /**
+ * Uses a GL2ES2 GLSL shader immediate mode sink.
+ * To issue the draw() command,
+ * 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()
+ */
+ public static ImmModeSink createGLSL(GL gl, int glBufferUsage, int initialSize,
+ int vComps, int vDataType,
+ int cComps, int cDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType) {
+ return new ImmModeSink(gl, glBufferUsage, initialSize,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, true);
+ }
+
+ public static boolean usesVBO() { return vboUsage; }
+
+ public static void setVBOUsage(boolean v) { vboUsage = v; }
+
+ public void destroy(GL gl) {
+ destroyList(gl);
+
+ vboSet.destroy(gl);
+ }
+
+ public void reset() {
+ reset(null);
+ }
+
+ public void reset(GL gl) {
+ destroyList(gl);
+ vboSet.reset(gl);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer("ImmModeSink[");
+ sb.append(",\n\tVBO list: "+vboSetList.size()+" [");
+ for(Iterator i=vboSetList.iterator(); i.hasNext() ; ) {
+ sb.append("\n\t");
+ sb.append( (VBOSet)i.next() );
+ }
+ if(vboSetList.size()>0) {
+ sb.append("\n\t],\nVBO current: NOP]");
+ } else {
+ sb.append("\n\t],\nVBO current: \n");
+ sb.append(vboSet);
+ sb.append("\n]");
+ }
+ return sb.toString();
+ }
+
+ public void draw(GL gl, boolean disableBufferAfterDraw) {
+ if(DEBUG_DRAW) {
+ Exception e = new Exception("ImmModeSink.draw(disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
+ e.printStackTrace();
+ }
+ int n=0;
+ for(Iterator i=vboSetList.iterator(); i.hasNext() ; n++) {
+ ((VBOSet)i.next()).draw(gl, null, disableBufferAfterDraw, n);
+ }
+ }
+
+ public void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw) {
+ if(DEBUG_DRAW) {
+ Exception e = new Exception("ImmModeSink.draw(disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
+ e.printStackTrace();
+ }
+ int n=0;
+ for(Iterator i=vboSetList.iterator(); i.hasNext() ; n++) {
+ ((VBOSet)i.next()).draw(gl, indices, disableBufferAfterDraw, n);
+ }
+ }
+
+ public void glBegin(int mode) {
+ if(DEBUG_BEGIN_END) {
+ Exception e = new Exception("ImmModeSink.glBegin("+vboSet.mode+"):\n\t"+this);
+ e.printStackTrace();
+ }
+ vboSet.modeOrig = mode;
+ switch(mode) {
+ // Needs data manipulation ..
+ //case GL_QUADS:
+ // mode=GL.GL_LINES;
+ // break;
+ case GL_QUAD_STRIP:
+ mode=GL.GL_TRIANGLE_STRIP;
+ break;
+ case GL_POLYGON:
+ mode=GL.GL_LINES;
+ break;
+ }
+ vboSet.mode = mode;
+ vboSet.checkSeal(false);
+ }
+
+ public final void glEnd(GL gl) {
+ glEnd(gl, null, true);
+ }
+
+ public void glEnd(GL gl, boolean immediateDraw) {
+ glEnd(gl, null, immediateDraw);
+ }
+
+ public final void glEnd(GL gl, Buffer indices) {
+ glEnd(gl, indices, true);
+ }
+
+ private void glEnd(GL gl, Buffer indices, boolean immediateDraw) {
+ if(DEBUG_BEGIN_END) {
+ Exception e = new Exception("ImmModeSink START glEnd(immediate: "+immediateDraw+"):\n\t"+this);
+ e.printStackTrace();
+ }
+ if(immediateDraw) {
+ vboSet.seal(gl, true);
+ vboSet.draw(gl, indices, true, -1);
+ reset(gl);
+ } else {
+ vboSet.seal(gl, true);
+ vboSet.enableBuffer(gl, false);
+ vboSetList.add(vboSet);
+ vboSet = vboSet.regenerate();
+ }
+ }
+
+ public void glVertexv(Buffer v) {
+ vboSet.glVertexv(v);
+ }
+ public void glNormalv(Buffer v) {
+ vboSet.glNormalv(v);
+ }
+ public void glColorv(Buffer v) {
+ vboSet.glColorv(v);
+ }
+ public void glTexCoordv(Buffer v) {
+ vboSet.glTexCoordv(v);
+ }
+
+ public final void glVertex2f(float x, float y) {
+ vboSet.glVertex2f(x,y);
+ }
+
+ public final void glVertex3f(float x, float y, float z) {
+ vboSet.glVertex3f(x,y,z);
+ }
+
+ public final void glNormal3f(float x, float y, float z) {
+ vboSet.glNormal3f(x,y,z);
+ }
+
+ public final void glColor3f(float x, float y, float z) {
+ vboSet.glColor3f(x,y,z);
+ }
+
+ public final void glColor4f(float x, float y, float z, float a) {
+ vboSet.glColor4f(x,y,z, a);
+ }
+
+ public final void glTexCoord2f(float x, float y) {
+ vboSet.glTexCoord2f(x,y);
+ }
+
+ public final void glTexCoord3f(float x, float y, float z) {
+ vboSet.glTexCoord3f(x,y,z);
+ }
+
+ public final void glVertex2s(short x, short y) {
+ vboSet.glVertex2s(x,y);
+ }
+
+ public final void glVertex3s(short x, short y, short z) {
+ vboSet.glVertex3s(x,y,z);
+ }
+
+ public final void glNormal3s(short x, short y, short z) {
+ vboSet.glNormal3s(x,y,z);
+ }
+
+ public final void glColor3s(short x, short y, short z) {
+ vboSet.glColor3s(x,y,z);
+ }
+
+ public final void glColor4s(short x, short y, short z, short a) {
+ vboSet.glColor4s(x,y,z,a);
+ }
+
+ public final void glTexCoord2s(short x, short y) {
+ vboSet.glTexCoord2s(x,y);
+ }
+
+ public final void glTexCoord3s(short x, short y, short z) {
+ vboSet.glTexCoord3s(x,y,z);
+ }
+
+ public final void glVertex2b(byte x, byte y) {
+ vboSet.glVertex2b(x,y);
+ }
+
+ public final void glVertex3b(byte x, byte y, byte z) {
+ vboSet.glVertex3b(x,y,z);
+ }
+
+ public final void glNormal3b(byte x, byte y, byte z) {
+ vboSet.glNormal3b(x,y,z);
+ }
+
+ public final void glColor3b(byte x, byte y, byte z) {
+ vboSet.glColor3b(x,y,z);
+ }
+
+ public final void glColor4b(byte x, byte y, byte z, byte a) {
+ vboSet.glColor4b(x,y,z,a);
+ }
+
+ public final void glTexCoord2b(byte x, byte y) {
+ vboSet.glTexCoord2b(x,y);
+ }
+
+ public final void glTexCoord3b(byte x, byte y, byte z) {
+ vboSet.glTexCoord3b(x,y,z);
+ }
+
+ protected ImmModeSink(GL gl, int glBufferUsage, int initialSize,
+ int vComps, int vDataType,
+ int cComps, int cDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType, boolean useGLSL) {
+ if(useGLSL && !gl.hasGLSL()) {
+ throw new GLException("ImmModeSink GLSL usage not supported: "+gl);
+ }
+ vboSet = new VBOSet(gl, glBufferUsage, initialSize,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, useGLSL);
+ this.vboSetList = new ArrayList();
+ }
+
+ private void destroyList(GL gl) {
+ for(Iterator i=vboSetList.iterator(); i.hasNext() ; ) {
+ ((VBOSet)i.next()).destroy(gl);
+ }
+ vboSetList.clear();
+ }
+
+ private VBOSet vboSet;
+ private ArrayList vboSetList;
+ private static boolean vboUsage = true;
+
+ protected static class VBOSet {
+ protected VBOSet (GL gl, int glBufferUsage, int initialSize,
+ int vComps, int vDataType,
+ int cComps, int cDataType,
+ int nComps, int nDataType,
+ int tComps, int tDataType, boolean useGLSL) {
+ this.gl=gl;
+ this.glBufferUsage=glBufferUsage;
+ this.initialSize=initialSize;
+ this.vDataType=vDataType;
+ this.vComps=vComps;
+ this.cDataType=cDataType;
+ this.cComps=cComps;
+ this.nDataType=nDataType;
+ this.nComps=nComps;
+ this.tDataType=tDataType;
+ this.tComps=tComps;
+ this.useGLSL=useGLSL;
+
+ allocateBuffer(initialSize);
+ rewind();
+
+ this.sealed=false;
+ this.sealedGL=false;
+ this.mode = -1;
+ this.modeOrig = -1;
+ this.bufferEnabled=false;
+ this.bufferWritten=false;
+ }
+
+ protected final VBOSet regenerate() {
+ return new VBOSet(gl, glBufferUsage, initialSize,
+ vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType, useGLSL);
+ }
+
+ protected void checkSeal(boolean test) throws GLException {
+ if(mode<0) {
+ throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this);
+ }
+ if(sealed!=test) {
+ if(test) {
+ throw new GLException("Not Sealed yet, call glEnd() first:\n\t"+this);
+ } else {
+ throw new GLException("Already Sealed, can't modify VBO after glEnd():\n\t"+this);
+ }
+ }
+ }
+
+ protected void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw, int i)
+ {
+ if(DEBUG_DRAW) {
+ Exception e = new Exception("ImmModeSink.draw["+i+"](disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
+ e.printStackTrace();
+ }
+ enableBuffer(gl, true);
+
+ if (buffer!=null) {
+ GL2ES1 glf = gl.getGL2ES1();
+
+ if(null==indices) {
+ glf.glDrawArrays(mode, 0, count);
+ } else {
+ Class clazz = indices.getClass();
+ int type=-1;
+ if(NWReflection.instanceOf(clazz, ByteBuffer.class.getName())) {
+ type = GL.GL_UNSIGNED_BYTE;
+ } else if(NWReflection.instanceOf(clazz, ShortBuffer.class.getName())) {
+ type = GL.GL_UNSIGNED_SHORT;
+ }
+ if(0>type) {
+ throw new GLException("Given Buffer Class not supported: "+clazz+", should be ubyte or ushort:\n\t"+this);
+ }
+ glf.glDrawElements(mode, indices.remaining(), type, indices);
+ // GL2: gl.glDrawRangeElements(mode, 0, indices.remaining()-1, indices.remaining(), type, indices);
+ }
+ }
+
+ if(disableBufferAfterDraw) {
+ enableBuffer(gl, false);
+ }
+ }
+
+ public void glVertexv(Buffer v) {
+ checkSeal(false);
+ BufferUtil.put(vertexArray, v);
+ }
+ public void glNormalv(Buffer v) {
+ checkSeal(false);
+ BufferUtil.put(normalArray, v);
+ }
+ public void glColorv(Buffer v) {
+ checkSeal(false);
+ BufferUtil.put(colorArray, v);
+ }
+ public void glTexCoordv(Buffer v) {
+ checkSeal(false);
+ BufferUtil.put(textCoordArray, v);
+ }
+
+ public void glVertex2b(byte x, byte y) {
+ checkSeal(false);
+ growBufferIfNecessary(VERTEX, 2);
+ if(vComps>0)
+ BufferUtil.putb(vertexArray, x);
+ if(vComps>1)
+ BufferUtil.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);
+ if(vComps>1)
+ BufferUtil.putb(vertexArray, y);
+ if(vComps>2)
+ BufferUtil.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);
+ if(vComps>1)
+ BufferUtil.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);
+ if(vComps>1)
+ BufferUtil.puts(vertexArray, y);
+ if(vComps>2)
+ BufferUtil.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);
+ if(vComps>1)
+ BufferUtil.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);
+ if(vComps>1)
+ BufferUtil.putf(vertexArray, y);
+ if(vComps>2)
+ BufferUtil.putf(vertexArray, z);
+ padding(VERTEX, vComps-3);
+ }
+
+ public void glNormal3b(byte x, byte y, byte z) {
+ checkSeal(false);
+ growBufferIfNecessary(NORMAL, 3);
+ if(nComps>0)
+ BufferUtil.putb(normalArray, x);
+ if(nComps>1)
+ BufferUtil.putb(normalArray, y);
+ if(nComps>2)
+ BufferUtil.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);
+ if(nComps>1)
+ BufferUtil.puts(normalArray, y);
+ if(nComps>2)
+ BufferUtil.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);
+ if(nComps>1)
+ BufferUtil.putf(normalArray, y);
+ if(nComps>2)
+ BufferUtil.putf(normalArray, z);
+ padding(NORMAL, nComps-3);
+ }
+
+ public void glColor3b(byte r, byte g, byte b) {
+ checkSeal(false);
+ growBufferIfNecessary(COLOR, 3);
+ if(cComps>0)
+ BufferUtil.putb(colorArray, r);
+ if(cComps>1)
+ BufferUtil.putb(colorArray, g);
+ if(cComps>2)
+ BufferUtil.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);
+ if(cComps>1)
+ BufferUtil.putb(colorArray, g);
+ if(cComps>2)
+ BufferUtil.putb(colorArray, b);
+ if(cComps>3)
+ BufferUtil.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);
+ if(cComps>1)
+ BufferUtil.puts(colorArray, g);
+ if(cComps>2)
+ BufferUtil.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);
+ if(cComps>1)
+ BufferUtil.puts(colorArray, g);
+ if(cComps>2)
+ BufferUtil.puts(colorArray, b);
+ if(cComps>3)
+ BufferUtil.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);
+ if(cComps>1)
+ BufferUtil.putf(colorArray, g);
+ if(cComps>2)
+ BufferUtil.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);
+ if(cComps>1)
+ BufferUtil.putf(colorArray, g);
+ if(cComps>2)
+ BufferUtil.putf(colorArray, b);
+ if(cComps>3)
+ BufferUtil.putf(colorArray, a);
+ padding(COLOR, cComps-4);
+ }
+
+ public void glTexCoord2b(byte x, byte y) {
+ checkSeal(false);
+ growBufferIfNecessary(TEXTCOORD, 2);
+ if(tComps>0)
+ BufferUtil.putb(textCoordArray, x);
+ if(tComps>1)
+ BufferUtil.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);
+ if(tComps>1)
+ BufferUtil.putb(textCoordArray, y);
+ if(tComps>2)
+ BufferUtil.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);
+ if(tComps>1)
+ BufferUtil.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);
+ if(tComps>1)
+ BufferUtil.puts(textCoordArray, y);
+ if(tComps>2)
+ BufferUtil.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);
+ if(tComps>1)
+ BufferUtil.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);
+ if(tComps>1)
+ BufferUtil.putf(textCoordArray, y);
+ if(tComps>2)
+ BufferUtil.putf(textCoordArray, z);
+ padding(TEXTCOORD, tComps-3);
+ }
+
+ public void rewind() {
+ if(null!=vertexArray) {
+ vertexArray.rewind();
+ }
+ if(null!=colorArray) {
+ colorArray.rewind();
+ }
+ if(null!=normalArray) {
+ normalArray.rewind();
+ }
+ if(null!=textCoordArray) {
+ textCoordArray.rewind();
+ }
+ }
+
+ public void destroy(GL gl) {
+ reset(gl);
+
+ vertexArray=null; colorArray=null; normalArray=null; textCoordArray=null;
+ vArrayData=null; cArrayData=null; nArrayData=null; tArrayData=null;
+ buffer=null;
+ bSize=0; count=0;
+ }
+
+ public void reset(GL gl) {
+ enableBuffer(gl, false);
+ reset();
+ }
+
+ public void reset() {
+ if(buffer!=null) {
+ buffer.clear();
+ }
+ rewind();
+
+ this.mode = -1;
+ this.modeOrig = -1;
+ this.sealed=false;
+ this.bufferEnabled=false;
+ this.bufferWritten=false;
+ }
+
+ public void seal(GL glObj, boolean seal)
+ {
+ seal(seal);
+ if(sealedGL==seal) return;
+ sealedGL = seal;
+ GL gl = glObj.getGL();
+ if(seal) {
+ if(vboUsage && vboName==0) {
+ int[] tmp = new int[1];
+ gl.glGenBuffers(1, tmp, 0);
+ vboName = tmp[0];
+ }
+ if(null!=vArrayData)
+ vArrayData.setVBOName(vboName);
+ if(null!=cArrayData)
+ cArrayData.setVBOName(vboName);
+ if(null!=nArrayData)
+ nArrayData.setVBOName(vboName);
+ if(null!=tArrayData)
+ tArrayData.setVBOName(vboName);
+ enableBuffer(gl, true);
+ } else {
+ enableBuffer(gl, false);
+ }
+ }
+
+ public void seal(boolean seal)
+ {
+ if(sealed==seal) return;
+ sealed = seal;
+ if(seal) {
+ bufferWritten=false;
+ }
+ }
+
+ public void enableBuffer(GL gl, boolean enable) {
+ /* if(enableBufferAlways && enable) {
+ bufferEnabled = false;
+ } */
+ if( bufferEnabled != enable && count>0 ) {
+ if(enable) {
+ checkSeal(true);
+ }
+ if(useGLSL) {
+ enableBufferGLSL(gl, enable);
+ } else {
+ enableBufferFixed(gl, enable);
+ }
+ bufferEnabled = enable;
+ }
+ }
+
+ public void enableBufferFixed(GL gl, boolean enable) {
+ GL2ES1 glf = gl.getGL2ES1();
+
+ if(enable) {
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName);
+
+ if(!bufferWritten) {
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit(), buffer, GL.GL_STATIC_DRAW);
+ bufferWritten=true;
+ }
+
+ if(vComps>0) {
+ glf.glEnableClientState(glf.GL_VERTEX_ARRAY);
+ glf.glVertexPointer(vArrayData);
+ }
+ if(cComps>0) {
+ glf.glEnableClientState(glf.GL_COLOR_ARRAY);
+ glf.glColorPointer(cArrayData);
+ }
+ if(nComps>0) {
+ glf.glEnableClientState(glf.GL_NORMAL_ARRAY);
+ glf.glNormalPointer(nArrayData);
+ }
+ if(tComps>0) {
+ glf.glEnableClientState(glf.GL_TEXTURE_COORD_ARRAY);
+ glf.glTexCoordPointer(tArrayData);
+ }
+
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ } else {
+ if(vComps>0) {
+ glf.glDisableClientState(glf.GL_VERTEX_ARRAY);
+ }
+ if(cComps>0) {
+ glf.glDisableClientState(glf.GL_COLOR_ARRAY);
+ }
+ if(nComps>0) {
+ glf.glDisableClientState(glf.GL_NORMAL_ARRAY);
+ }
+ if(tComps>0) {
+ glf.glDisableClientState(glf.GL_TEXTURE_COORD_ARRAY);
+ }
+ }
+ }
+
+ 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();
+ if(null==st) {
+ throw new GLException("No ShaderState current");
+ }
+
+ if(enable) {
+ glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, vboName);
+
+ if(!bufferWritten) {
+ glsl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit(), buffer, GL.GL_STATIC_DRAW);
+ bufferWritten=true;
+ }
+
+ if(vComps>0) {
+ st.glEnableVertexAttribArray(glsl, vArrayData.getName());
+ st.glVertexAttribPointer(glsl, vArrayData);
+ }
+ if(cComps>0) {
+ st.glEnableVertexAttribArray(glsl, cArrayData.getName());
+ st.glVertexAttribPointer(glsl, cArrayData);
+ }
+ if(nComps>0) {
+ st.glEnableVertexAttribArray(glsl, nArrayData.getName());
+ st.glVertexAttribPointer(glsl, nArrayData);
+ }
+ if(tComps>0) {
+ st.glEnableVertexAttribArray(glsl, tArrayData.getName());
+ st.glVertexAttribPointer(glsl, tArrayData);
+ }
+
+ glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ } else {
+ if(vComps>0) {
+ st.glDisableVertexAttribArray(glsl, vArrayData.getName());
+ }
+ if(cComps>0) {
+ st.glDisableVertexAttribArray(glsl, cArrayData.getName());
+ }
+ if(nComps>0) {
+ st.glDisableVertexAttribArray(glsl, nArrayData.getName());
+ }
+ if(tComps>0) {
+ st.glDisableVertexAttribArray(glsl, tArrayData.getName());
+ }
+ }
+ }
+
+ public String toString() {
+ return "VBOSet[mode "+mode+
+ ", modeOrig "+modeOrig+
+ ", sealed "+sealed+
+ ", bufferEnabled "+bufferEnabled+
+ ", bufferWritten "+bufferWritten+
+ ",\n\t"+vArrayData+
+ ",\n\t"+cArrayData+
+ ",\n\t"+nArrayData+
+ ",\n\t"+tArrayData+
+ "]";
+ }
+
+ // 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);
+
+ count = elements;
+ bSize = count * ( vWidth + cWidth + nWidth + tWidth ) ;
+
+ buffer = BufferUtil.newByteBuffer(bSize);
+
+ int pos = 0;
+ int size= count * vWidth ;
+ if(size>0) {
+ vertexArray = BufferUtil.sliceGLBuffer(buffer, pos, size, vDataType);
+ } else {
+ vertexArray = null;
+ }
+ vOffset = pos;
+ pos+=size;
+
+ size= count * cWidth ;
+ if(size>0) {
+ colorArray = BufferUtil.sliceGLBuffer(buffer, pos, size, cDataType);
+ } else {
+ colorArray = null;
+ }
+ cOffset = pos;
+ pos+=size;
+
+ size= count * nWidth ;
+ if(size>0) {
+ normalArray = BufferUtil.sliceGLBuffer(buffer, pos, size, nDataType);
+ } else {
+ normalArray = null;
+ }
+ nOffset = pos;
+ pos+=size;
+
+ size= count * tWidth ;
+ if(size>0) {
+ textCoordArray = BufferUtil.sliceGLBuffer(buffer, pos, size, tDataType);
+ } else {
+ textCoordArray = null;
+ }
+ tOffset = pos;
+ pos+=size;
+
+ buffer.position(pos);
+ buffer.flip();
+
+ if(vComps>0) {
+ vArrayData = GLArrayDataWrapper.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, vComps, vDataType, false,
+ 0, vertexArray, 0, vOffset);
+ } else {
+ vArrayData = null;
+ }
+ if(cComps>0) {
+ cArrayData = GLArrayDataWrapper.createFixed(gl, GLPointerFunc.GL_COLOR_ARRAY, cComps, cDataType, false,
+ 0, colorArray, 0, cOffset);
+ } else {
+ cArrayData = null;
+ }
+ if(nComps>0) {
+ nArrayData = GLArrayDataWrapper.createFixed(gl, GLPointerFunc.GL_NORMAL_ARRAY, nComps, nDataType, false,
+ 0, normalArray, 0, nOffset);
+ } else {
+ nArrayData = null;
+ }
+ if(tComps>0) {
+ tArrayData = GLArrayDataWrapper.createFixed(gl, GLPointerFunc.GL_TEXTURE_COORD_ARRAY, tComps, tDataType, false,
+ 0, textCoordArray, 0, tOffset);
+ } else {
+ tArrayData = null;
+ }
+
+ }
+
+ protected final boolean growBufferIfNecessary(int type, int spare) {
+ if(buffer==null || count < spare) {
+ growBuffer(type, initialSize);
+ return true;
+ }
+ return false;
+ }
+
+ protected final void growBuffer(int type, int additional) {
+ if(sealed || 0==additional) return;
+
+ // save olde values ..
+ Buffer _vertexArray=vertexArray, _colorArray=colorArray, _normalArray=normalArray, _textCoordArray=textCoordArray;
+ ByteBuffer _buffer = buffer;
+
+ allocateBuffer(count+additional);
+
+ if(null!=_vertexArray) {
+ _vertexArray.flip();
+ BufferUtil.put(vertexArray, _vertexArray);
+ }
+ if(null!=_colorArray) {
+ _colorArray.flip();
+ BufferUtil.put(colorArray, _colorArray);
+ }
+ if(null!=_normalArray) {
+ _normalArray.flip();
+ BufferUtil.put(normalArray, _normalArray);
+ }
+ if(null!=_textCoordArray) {
+ _textCoordArray.flip();
+ BufferUtil.put(textCoordArray, _textCoordArray);
+ }
+ }
+
+ protected void padding(int type, int fill) {
+ if ( sealed ) return;
+
+ Buffer dest = null;
+
+ switch (type) {
+ case VERTEX:
+ dest = vertexArray;
+ break;
+ case COLOR:
+ dest = colorArray;
+ break;
+ case NORMAL:
+ dest = normalArray;
+ break;
+ case TEXTCOORD:
+ dest = textCoordArray;
+ break;
+ }
+
+ if ( null==dest ) return;
+
+ while((fill--)>0) {
+ BufferUtil.putb(dest, (byte)0);
+ }
+ }
+
+ protected int mode, modeOrig;
+ protected int glBufferUsage, initialSize;
+
+ protected ByteBuffer buffer;
+ protected int bSize, count, vboName;
+
+ public static final int VERTEX = 0;
+ public static final int COLOR = 1;
+ public static final int NORMAL = 2;
+ public static final int TEXTCOORD = 3;
+
+ protected int vOffset, cOffset, nOffset, tOffset;
+ protected int vComps, cComps, nComps, tComps;
+ protected int vDataType, cDataType, nDataType, tDataType;
+ protected Buffer vertexArray, colorArray, normalArray, textCoordArray;
+ protected GLArrayDataWrapper vArrayData, cArrayData, nArrayData, tArrayData;
+
+ protected boolean sealed, sealedGL, useGLSL;
+ protected boolean bufferEnabled, bufferWritten;
+ protected GL gl;
+ }
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/Locator.java b/src/jogl/classes/com/sun/opengl/util/Locator.java
new file mode 100644
index 000000000..06cd50ce8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/Locator.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.opengl.util;
+
+import java.util.*;
+import java.nio.*;
+import java.io.*;
+import java.net.*;
+
+/** Utilities for dealing with resources. */
+
+public class Locator {
+ private Locator() {}
+
+ /**
+ * Locates the resource using 'getResource(String path, ClassLoader cl)',
+ * with this context ClassLoader and the path as is,
+ * as well with the context's package name path plus the path.
+ *
+ * @see #getResource(String, ClassLoader)
+ */
+ public static URL getResource(Class context, String path) {
+ ClassLoader contextCL = (null!=context)?context.getClassLoader():null;
+ URL url = getResource(path, contextCL);
+ if (url == null && null!=context) {
+ // Try again by scoping the path within the class's package
+ String className = context.getName().replace('.', '/');
+ int lastSlash = className.lastIndexOf('/');
+ if (lastSlash >= 0) {
+ String tmpPath = className.substring(0, lastSlash + 1) + path;
+ url = getResource(tmpPath, contextCL);
+ }
+ }
+ return url;
+ }
+
+ /**
+ * Locates the resource using the ClassLoader's facility,
+ * the absolute URL and absolute file.
+ *
+ * @see ClassLoader#getResource(String)
+ * @see ClassLoader#getSystemResource(String)
+ * @see URL#URL(String)
+ * @see File#File(String)
+ */
+ public static URL getResource(String path, ClassLoader cl) {
+ URL url = null;
+ if (cl != null) {
+ url = cl.getResource(path);
+ } else {
+ url = ClassLoader.getSystemResource(path);
+ }
+ if(!urlExists(url)) {
+ url = null;
+ try {
+ url = new URL(path);
+ } catch (MalformedURLException e) { }
+ }
+ if(!urlExists(url)) {
+ url = null;
+ try {
+ File file = new File(path);
+ if(file.exists()) {
+ url = file.toURL();
+ }
+ } catch (MalformedURLException e) {}
+ }
+ return url;
+ }
+
+ /**
+ * Generates a path for the 'relativeFile' relative to the 'absoluteFileLocation'
+ */
+ public static String getRelativeOf(String absoluteFileLocation, String relativeFile) {
+ File file = new File(absoluteFileLocation);
+ file = file.getParentFile();
+ while (file != null && relativeFile.startsWith("../")) {
+ file = file.getParentFile();
+ relativeFile = relativeFile.substring(3);
+ }
+ if (file != null) {
+ String res = new File(file, relativeFile).getPath();
+ // Handle things on Windows
+ return res.replace('\\', '/');
+ } else {
+ return relativeFile;
+ }
+ }
+
+ /**
+ * Returns true, if the url exists,
+ * trying to open a connection.
+ */
+ public static boolean urlExists(URL url) {
+ boolean v = false;
+ if(null!=url) {
+ try {
+ URLConnection uc = url.openConnection();
+ v = true;
+ } catch (IOException ioe) { }
+ }
+ return v;
+ }
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java b/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java
new file mode 100755
index 000000000..4211e893b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/PMVMatrix.java
@@ -0,0 +1,685 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.opengl.util;
+
+import com.sun.opengl.impl.ProjectFloat;
+
+import java.nio.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
+public class PMVMatrix implements GLMatrixFunc {
+
+ public PMVMatrix() {
+ projectFloat = new ProjectFloat();
+
+ matrixIdent = BufferUtil.newFloatBuffer(1*16);
+ projectFloat.gluMakeIdentityf(matrixIdent);
+ matrixIdent.rewind();
+
+ // T Texture
+ // P Projection
+ // Mv ModelView
+ // Mvi Modelview-Inverse
+ // Mvit Modelview-Inverse-Transpose
+ // Pmv P * Mv
+ matrixTPMvMvitPmv = BufferUtil.newFloatBuffer(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
+ matrixPMvMvi = slice(matrixTPMvMvitPmv, 1*16, 3*16); // grouping P + Mv + Mvi
+ matrixPMv = slice(matrixTPMvMvitPmv, 1*16, 2*16); // grouping P + Mv
+ matrixP = slice(matrixTPMvMvitPmv, 1*16, 1*16); // P
+ matrixMv = slice(matrixTPMvMvitPmv, 2*16, 1*16); // Mv
+ matrixMvi = slice(matrixTPMvMvitPmv, 3*16, 1*16); // Mvi
+ matrixMvit = slice(matrixTPMvMvitPmv, 4*16, 1*16); // Mvit
+ matrixPmv = slice(matrixTPMvMvitPmv, 5*16, 1*16); // Pmv
+ matrixTPMvMvitPmv.rewind();
+
+ matrixMvit3 = BufferUtil.newFloatBuffer(3*3);
+
+ localBuf = BufferUtil.newFloatBuffer(6*16);
+
+ matrixMult=slice(localBuf, 0*16, 16);
+
+ matrixTrans=slice(localBuf, 1*16, 16);
+ projectFloat.gluMakeIdentityf(matrixTrans);
+
+ matrixRot=slice(localBuf, 2*16, 16);
+ projectFloat.gluMakeIdentityf(matrixRot);
+
+ matrixScale=slice(localBuf, 3*16, 16);
+ projectFloat.gluMakeIdentityf(matrixScale);
+
+ matrixOrtho=slice(localBuf, 4*16, 16);
+ projectFloat.gluMakeIdentityf(matrixOrtho);
+
+ matrixFrustum=slice(localBuf, 5*16, 16);
+ projectFloat.gluMakeZero(matrixFrustum);
+
+ vec3f=new float[3];
+
+ matrixPStack = new ArrayList();
+ matrixMvStack= new ArrayList();
+
+ // default values and mode
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glMatrixMode(GL.GL_TEXTURE);
+ glLoadIdentity();
+ setDirty();
+ }
+
+ public void destroy() {
+ if(null!=projectFloat) {
+ projectFloat.destroy(); projectFloat=null;
+ }
+
+ if(null!=matrixIdent) {
+ matrixIdent.clear(); matrixIdent=null;
+ }
+ if(null!=matrixTPMvMvitPmv) {
+ matrixTPMvMvitPmv.clear(); matrixTPMvMvitPmv=null;
+ }
+ if(null!=matrixMvit3) {
+ matrixMvit3.clear(); matrixMvit3=null;
+ }
+ if(null!=localBuf) {
+ localBuf.clear(); localBuf=null;
+ }
+
+ if(null!=matrixPStack) {
+ matrixPStack.clear(); matrixPStack=null;
+ }
+ vec3f=null;
+ if(null!=matrixMvStack) {
+ matrixMvStack.clear(); matrixMvStack=null;
+ }
+ if(null!=matrixPStack) {
+ matrixPStack.clear(); matrixPStack=null;
+ }
+ if(null!=matrixTStack) {
+ matrixTStack.clear(); matrixTStack=null;
+ }
+
+ matrixTPMvMvitPmv=null; matrixPMvMvit=null; matrixPMvMvitPmv=null; matrixPMvMvi=null; matrixPMv=null;
+ matrixP=null; matrixT=null; matrixMv=null; matrixMvi=null; matrixMvit=null; matrixPmv=null;
+ matrixMult=null; matrixTrans=null; matrixRot=null; matrixScale=null; matrixOrtho=null; matrixFrustum=null;
+ }
+
+ private static FloatBuffer slice(FloatBuffer buf, int pos, int len) {
+ buf.position(pos);
+ buf.limit(pos + len);
+ return buf.slice();
+ }
+
+ public static final boolean isMatrixModeName(final int matrixModeName) {
+ switch(matrixModeName) {
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ return true;
+ }
+ return false;
+ }
+
+ public static final int matrixModeName2MatrixGetName(final int matrixModeName) {
+ switch(matrixModeName) {
+ case GL_MODELVIEW:
+ return GL_MODELVIEW_MATRIX;
+ case GL_PROJECTION:
+ return GL_PROJECTION_MATRIX;
+ case GL.GL_TEXTURE:
+ return GL_TEXTURE_MATRIX;
+ default:
+ throw new GLException("unsupported matrixName: "+matrixModeName);
+ }
+ }
+
+ public static final boolean isMatrixGetName(final int matrixGetName) {
+ switch(matrixGetName) {
+ case GL_MATRIX_MODE:
+ case GL_MODELVIEW_MATRIX:
+ case GL_PROJECTION_MATRIX:
+ case GL_TEXTURE_MATRIX:
+ return true;
+ }
+ return false;
+ }
+
+ public static final int matrixGetName2MatrixModeName(final int matrixGetName) {
+ switch(matrixGetName) {
+ case GL_MODELVIEW_MATRIX:
+ return GL_MODELVIEW;
+ case GL_PROJECTION_MATRIX:
+ return GL_PROJECTION;
+ case GL_TEXTURE_MATRIX:
+ return GL.GL_TEXTURE;
+ default:
+ throw new GLException("unsupported matrixGetName: "+matrixGetName);
+ }
+ }
+
+ public void setDirty() {
+ modified = DIRTY_MODELVIEW | DIRTY_PROJECTION | DIRTY_TEXTURE ;
+ matrixMode = GL_MODELVIEW;
+ }
+
+ public int getDirtyBits() {
+ return modified;
+ }
+
+ public boolean isDirty(final int matrixName) {
+ boolean res;
+ switch(matrixName) {
+ case GL_MODELVIEW:
+ res = (modified&DIRTY_MODELVIEW)!=0 ;
+ break;
+ case GL_PROJECTION:
+ res = (modified&DIRTY_PROJECTION)!=0 ;
+ break;
+ case GL.GL_TEXTURE:
+ res = (modified&DIRTY_TEXTURE)!=0 ;
+ break;
+ default:
+ throw new GLException("unsupported matrixName: "+matrixName);
+ }
+ return res;
+ }
+
+ public boolean isDirty() {
+ return modified!=0;
+ }
+
+ public boolean update() {
+ // if(0==modified) return false;
+
+ // int res = modified;
+ int res = DIRTY_MODELVIEW | DIRTY_PROJECTION ;
+ if( (res&DIRTY_MODELVIEW)!=0 ) {
+ setMviMvit();
+ }
+ if( (res&DIRTY_MODELVIEW)!=0 || (res&DIRTY_PROJECTION)!=0 ) {
+ glMultMatrixf(matrixP, matrixMv, matrixPmv);
+ }
+ modified=0;
+ return res!=0;
+ }
+
+ public final int glGetMatrixMode() {
+ return matrixMode;
+ }
+
+ public final FloatBuffer glGetTMatrixf() {
+ return matrixT;
+ }
+
+ public final FloatBuffer glGetPMatrixf() {
+ return matrixP;
+ }
+
+ public final FloatBuffer glGetMvMatrixf() {
+ return matrixMv;
+ }
+
+ public final FloatBuffer glGetPMvMvitPmvMatrixf() {
+ return matrixPMvMvitPmv;
+ }
+
+ public final FloatBuffer glGetPMvMvitMatrixf() {
+ return matrixPMvMvit;
+ }
+
+ public final FloatBuffer glGetPMvMviMatrixf() {
+ return matrixPMvMvi;
+ }
+
+ public final FloatBuffer glGetPMvMatrixf() {
+ return matrixPMv;
+ }
+
+ public final FloatBuffer glGetMviMatrixf() {
+ return matrixMvi;
+ }
+
+ public final FloatBuffer glGetPmvMatrixf() {
+ return matrixPmv;
+ }
+
+ public final FloatBuffer glGetNormalMatrixf() {
+ return matrixMvit3;
+ }
+
+ /*
+ * @return the current matrix
+ */
+ public final FloatBuffer glGetMatrixf() {
+ return glGetMatrixf(matrixMode);
+ }
+
+ /**
+ * @param pname GL_MODELVIEW, GL_PROJECTION or GL.GL_TEXTURE
+ * @return the given matrix
+ */
+ public final FloatBuffer glGetMatrixf(final int matrixName) {
+ if(matrixName==GL_MODELVIEW) {
+ return matrixMv;
+ } else if(matrixName==GL_PROJECTION) {
+ return matrixP;
+ } else if(matrixName==GL.GL_TEXTURE) {
+ return matrixT;
+ } else {
+ throw new GLException("unsupported matrixName: "+matrixName);
+ }
+ }
+
+ public final void gluPerspective(final float fovy, final float aspect, final float zNear, final float zFar) {
+ float top=(float)Math.tan(fovy*((float)Math.PI)/360.0f)*zNear;
+ float bottom=-1.0f*top;
+ float left=aspect*bottom;
+ float right=aspect*top;
+ glFrustumf(left, right, bottom, top, zNear, zFar);
+ }
+
+ public static final void glMultMatrixf(final FloatBuffer a, final FloatBuffer b, FloatBuffer p) {
+ for (int i = 0; i < 4; i++) {
+ final float ai0=a.get(i+0*4), ai1=a.get(i+1*4), ai2=a.get(i+2*4), ai3=a.get(i+3*4);
+ p.put(i+0*4 , ai0 * b.get(0+0*4) + ai1 * b.get(1+0*4) + ai2 * b.get(2+0*4) + ai3 * b.get(3+0*4) );
+ p.put(i+1*4 , ai0 * b.get(0+1*4) + ai1 * b.get(1+1*4) + ai2 * b.get(2+1*4) + ai3 * b.get(3+1*4) );
+ p.put(i+2*4 , ai0 * b.get(0+2*4) + ai1 * b.get(1+2*4) + ai2 * b.get(2+2*4) + ai3 * b.get(3+2*4) );
+ p.put(i+3*4 , ai0 * b.get(0+3*4) + ai1 * b.get(1+3*4) + ai2 * b.get(2+3*4) + ai3 * b.get(3+3*4) );
+ }
+ }
+ public static final void glMultMatrixf(final FloatBuffer a, final float[] b, int b_off, FloatBuffer p) {
+ for (int i = 0; i < 4; i++) {
+ final float ai0=a.get(i+0*4), ai1=a.get(i+1*4), ai2=a.get(i+2*4), ai3=a.get(i+3*4);
+ p.put(i+0*4 , ai0 * b[b_off+0+0*4] + ai1 * b[b_off+1+0*4] + ai2 * b[b_off+2+0*4] + ai3 * b[b_off+3+0*4] );
+ p.put(i+1*4 , ai0 * b[b_off+0+1*4] + ai1 * b[b_off+1+1*4] + ai2 * b[b_off+2+1*4] + ai3 * b[b_off+3+1*4] );
+ p.put(i+2*4 , ai0 * b[b_off+0+2*4] + ai1 * b[b_off+1+2*4] + ai2 * b[b_off+2+2*4] + ai3 * b[b_off+3+2*4] );
+ p.put(i+3*4 , ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] );
+ }
+ }
+
+ //
+ // MatrixIf
+ //
+
+ public void glMatrixMode(final int matrixName) {
+ switch(matrixName) {
+ case GL_MODELVIEW:
+ case GL_PROJECTION:
+ case GL.GL_TEXTURE:
+ break;
+ default:
+ throw new GLException("unsupported matrixName: "+matrixName);
+ }
+ matrixMode = matrixName;
+ }
+
+ public void glGetFloatv(int matrixGetName, FloatBuffer params) {
+ int pos = params.position();
+ if(matrixGetName==GL_MATRIX_MODE) {
+ params.put((float)matrixMode);
+ } else {
+ FloatBuffer matrix = glGetMatrixf(matrixGetName2MatrixModeName(matrixGetName));
+ params.put(matrix);
+ matrix.rewind();
+ }
+ params.position(pos);
+ }
+ public void glGetFloatv(int matrixGetName, float[] params, int params_offset) {
+ if(matrixGetName==GL_MATRIX_MODE) {
+ params[params_offset]=(float)matrixMode;
+ } else {
+ FloatBuffer matrix = glGetMatrixf(matrixGetName2MatrixModeName(matrixGetName));
+ matrix.get(params, params_offset, 16);
+ matrix.rewind();
+ }
+ }
+ public void glGetIntegerv(int pname, IntBuffer params) {
+ int pos = params.position();
+ if(pname==GL_MATRIX_MODE) {
+ params.put(matrixMode);
+ } else {
+ throw new GLException("unsupported pname: "+pname);
+ }
+ params.position(pos);
+ }
+ public void glGetIntegerv(int pname, int[] params, int params_offset) {
+ if(pname==GL_MATRIX_MODE) {
+ params[params_offset]=matrixMode;
+ } else {
+ throw new GLException("unsupported pname: "+pname);
+ }
+ }
+
+ public final void glLoadMatrixf(final float[] values, final int offset) {
+ int len = values.length-offset;
+ if(matrixMode==GL_MODELVIEW) {
+ matrixMv.clear();
+ matrixMv.put(values, offset, len);
+ matrixMv.rewind();
+ modified |= DIRTY_MODELVIEW ;
+ } else if(matrixMode==GL_PROJECTION) {
+ matrixP.clear();
+ matrixP.put(values, offset, len);
+ matrixP.rewind();
+ modified |= DIRTY_PROJECTION ;
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ matrixT.clear();
+ matrixT.put(values, offset, len);
+ matrixT.rewind();
+ modified |= DIRTY_TEXTURE ;
+ }
+ }
+
+ public final void glLoadMatrixf(java.nio.FloatBuffer m) {
+ int spos = m.position();
+ if(matrixMode==GL_MODELVIEW) {
+ matrixMv.clear();
+ matrixMv.put(m);
+ matrixMv.rewind();
+ modified |= DIRTY_MODELVIEW ;
+ } else if(matrixMode==GL_PROJECTION) {
+ matrixP.clear();
+ matrixP.put(m);
+ matrixP.rewind();
+ modified |= DIRTY_PROJECTION ;
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ matrixT.clear();
+ matrixT.put(m);
+ matrixT.rewind();
+ modified |= DIRTY_TEXTURE ;
+ }
+ m.position(spos);
+ }
+
+ public final void glPopMatrix() {
+ float[] stackEntry=null;
+ if(matrixMode==GL_MODELVIEW) {
+ stackEntry = (float[])matrixMvStack.remove(0);
+ } else if(matrixMode==GL_PROJECTION) {
+ stackEntry = (float[])matrixPStack.remove(0);
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ stackEntry = (float[])matrixTStack.remove(0);
+ }
+ glLoadMatrixf(stackEntry, 0);
+ }
+
+ public final void glPushMatrix() {
+ float[] stackEntry = new float[1*16];
+ if(matrixMode==GL_MODELVIEW) {
+ matrixMv.get(stackEntry);
+ matrixMv.rewind();
+ matrixMvStack.add(0, stackEntry);
+ } else if(matrixMode==GL_PROJECTION) {
+ matrixP.get(stackEntry);
+ matrixP.rewind();
+ matrixPStack.add(0, stackEntry);
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ matrixT.get(stackEntry);
+ matrixT.rewind();
+ matrixTStack.add(0, stackEntry);
+ }
+ }
+
+ public final void glLoadIdentity() {
+ if(matrixMode==GL_MODELVIEW) {
+ matrixMv.clear();
+ matrixMv.put(matrixIdent);
+ matrixMv.rewind();
+ matrixIdent.rewind();
+ modified |= DIRTY_MODELVIEW ;
+ } else if(matrixMode==GL_PROJECTION) {
+ matrixP.clear();
+ matrixP.put(matrixIdent);
+ matrixP.rewind();
+ matrixIdent.rewind();
+ modified |= DIRTY_PROJECTION ;
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ matrixT.clear();
+ matrixT.put(matrixIdent);
+ matrixT.rewind();
+ matrixIdent.rewind();
+ modified |= DIRTY_TEXTURE ;
+ }
+ }
+
+ public final void glMultMatrixf(final FloatBuffer m) {
+ if(matrixMode==GL_MODELVIEW) {
+ glMultMatrixf(matrixMv, m, matrixMult);
+ matrixMv.clear();
+ matrixMv.put(matrixMult);
+ matrixMv.rewind();
+ modified |= DIRTY_MODELVIEW ;
+ } else if(matrixMode==GL_PROJECTION) {
+ glMultMatrixf(matrixP, m, matrixMult);
+ matrixP.clear();
+ matrixP.put(matrixMult);
+ matrixP.rewind();
+ modified |= DIRTY_PROJECTION ;
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ glMultMatrixf(matrixT, m, matrixMult);
+ matrixT.clear();
+ matrixT.put(matrixMult);
+ matrixT.rewind();
+ modified |= DIRTY_TEXTURE ;
+ }
+ matrixMult.rewind();
+ }
+
+ public void glMultMatrixf(float[] m, int m_offset) {
+ if(matrixMode==GL_MODELVIEW) {
+ glMultMatrixf(matrixMv, m, m_offset, matrixMult);
+ matrixMv.clear();
+ matrixMv.put(matrixMult);
+ matrixMv.rewind();
+ modified |= DIRTY_MODELVIEW ;
+ } else if(matrixMode==GL_PROJECTION) {
+ glMultMatrixf(matrixP, m, m_offset, matrixMult);
+ matrixP.clear();
+ matrixP.put(matrixMult);
+ matrixP.rewind();
+ modified |= DIRTY_PROJECTION ;
+ } else if(matrixMode==GL.GL_TEXTURE) {
+ glMultMatrixf(matrixT, m, m_offset, matrixMult);
+ matrixT.clear();
+ matrixT.put(matrixMult);
+ matrixT.rewind();
+ modified |= DIRTY_TEXTURE ;
+ }
+ matrixMult.rewind();
+ }
+
+ public final void glTranslatef(final float x, final float y, final float z) {
+ // Translation matrix:
+ // 1 0 0 x
+ // 0 1 0 y
+ // 0 0 1 z
+ // 0 0 0 1
+ matrixTrans.put(0+4*3, x);
+ matrixTrans.put(1+4*3, y);
+ matrixTrans.put(2+4*3, z);
+ glMultMatrixf(matrixTrans);
+ }
+
+ public final void glRotatef(final float angdeg, float x, float y, float z) {
+ float angrad = angdeg * (float) Math.PI / 180;
+ float c = (float)Math.cos(angrad);
+ float ic= 1.0f - c;
+ float s = (float)Math.sin(angrad);
+
+ vec3f[0]=x; vec3f[1]=y; vec3f[2]=z;
+ projectFloat.normalize(vec3f);
+ x = vec3f[0]; y = vec3f[1]; z = vec3f[2];
+
+ // Rotation matrix:
+ // xx(1−c)+c xy(1−c)+zs xz(1−c)-ys 0
+ // xy(1−c)-zs yy(1−c)+c yz(1−c)+xs 0
+ // xz(1−c)+ys yz(1−c)-xs zz(1−c)+c 0
+ // 0 0 0 1
+ float xy = x*y;
+ float xz = x*z;
+ float xs = x*s;
+ float ys = y*s;
+ float yz = y*z;
+ float zs = z*s;
+ matrixRot.put(0*4+0, x*x*ic+c);
+ matrixRot.put(0*4+1, xy*ic+zs);
+ matrixRot.put(0*4+2, xz*ic-ys);
+
+ matrixRot.put(1*4+0, xy*ic-zs);
+ matrixRot.put(1*4+1, y*y*ic+c);
+ matrixRot.put(1*4+2, yz*ic+xs);
+
+ matrixRot.put(2*4+0, xz*ic+ys);
+ matrixRot.put(2*4+1, yz*ic-xs);
+ matrixRot.put(2*4+2, z*z*ic+c);
+
+ glMultMatrixf(matrixRot);
+ }
+
+ public final void glScalef(final float x, final float y, final float z) {
+ // Scale matrix:
+ // x 0 0 0
+ // 0 y 0 0
+ // 0 0 z 0
+ // 0 0 0 1
+ matrixScale.put(0+4*0, x);
+ matrixScale.put(1+4*1, y);
+ matrixScale.put(2+4*2, z);
+
+ glMultMatrixf(matrixScale);
+ }
+
+ public final void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
+ // Ortho matrix:
+ // 2/dx 0 0 tx
+ // 0 2/dy 0 ty
+ // 0 0 2/dz tz
+ // 0 0 0 1
+ float dx=right-left;
+ float dy=top-bottom;
+ float dz=zFar-zNear;
+ float tx=-1.0f*(right+left)/dx;
+ float ty=-1.0f*(top+bottom)/dy;
+ float tz=-1.0f*(zFar+zNear)/dz;
+
+ matrixOrtho.put(0+4*0, 2.0f/dx);
+ matrixOrtho.put(1+4*1, 2.0f/dy);
+ matrixOrtho.put(2+4*2, -2.0f/dz);
+ matrixOrtho.put(0+4*3, tx);
+ matrixOrtho.put(1+4*3, ty);
+ matrixOrtho.put(2+4*3, tz);
+
+ glMultMatrixf(matrixOrtho);
+ }
+
+ public final void glFrustumf(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
+ if(zNear<=0.0f||zFar<0.0f) {
+ throw new GLException("GL_INVALID_VALUE: zNear and zFar must be positive, and zNear>0");
+ }
+ if(left==right || top==bottom) {
+ throw new GLException("GL_INVALID_VALUE: top,bottom and left,right must not be equal");
+ }
+ // Frustum matrix:
+ // 2*zNear/dx 0 A 0
+ // 0 2*zNear/dy B 0
+ // 0 0 C D
+ // 0 0 −1 0
+ float zNear2 = 2.0f*zNear;
+ float dx=right-left;
+ float dy=top-bottom;
+ float dz=zFar-zNear;
+ float A=(right+left)/dx;
+ float B=(top+bottom)/dy;
+ float C=-1.0f*(zFar+zNear)/dz;
+ float D=-2.0f*(zFar*zNear)/dz;
+
+ matrixFrustum.put(0+4*0, zNear2/dx);
+ matrixFrustum.put(1+4*1, zNear2/dy);
+ matrixFrustum.put(2+4*2, C);
+
+ matrixFrustum.put(0+4*2, A);
+ matrixFrustum.put(1+4*2, B);
+
+ matrixFrustum.put(2+4*3, D);
+ matrixFrustum.put(3+4*2, -1.0f);
+
+ glMultMatrixf(matrixFrustum);
+ }
+
+ //
+ // private
+ //
+
+ private final void setMviMvit() {
+ if(!projectFloat.gluInvertMatrixf(matrixMv, matrixMvi)) {
+ throw new GLException("Invalid source Mv matrix, can't compute inverse");
+ }
+
+ // transpose matrix
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
+ matrixMvit.put(j+i*4, matrixMvi.get(i+j*4));
+ }
+ }
+
+ // fetch 3x3
+ for (int i = 0; i < 3; i++) {
+ for (int j = 0; j < 3; j++) {
+ matrixMvit3.put(i+j*3, matrixMvit.get(i+j*4));
+ }
+ }
+ }
+
+ protected FloatBuffer matrixIdent;
+ protected FloatBuffer matrixTPMvMvitPmv, matrixPMvMvit, matrixPMvMvitPmv, matrixPMvMvi, matrixPMv, matrixP, matrixT, matrixMv, matrixMvi, matrixMvit, matrixPmv;
+ protected FloatBuffer matrixMvit3;
+ protected FloatBuffer localBuf, matrixMult, matrixTrans, matrixRot, matrixScale, matrixOrtho, matrixFrustum;
+ protected float[] vec3f;
+ protected List/*FloatBuffer*/ matrixTStack, matrixPStack, matrixMvStack;
+ protected int matrixMode = GL_MODELVIEW;
+ protected int modified = 0;
+ protected ProjectFloat projectFloat;
+
+ public static final int DIRTY_MODELVIEW = 1 << 0;
+ public static final int DIRTY_PROJECTION = 1 << 1;
+ public static final int DIRTY_TEXTURE = 1 << 2;
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/StreamUtil.java b/src/jogl/classes/com/sun/opengl/util/StreamUtil.java
new file mode 100755
index 000000000..8ad731743
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/StreamUtil.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util;
+
+import java.io.*;
+import java.nio.*;
+
+/** Utilities for dealing with streams. */
+
+public class StreamUtil {
+ private StreamUtil() {}
+
+ public static byte[] readAll2Array(InputStream stream) throws IOException {
+ BytesRead bytesRead = readAllImpl(stream);
+ byte[] data = bytesRead.data;
+ if (bytesRead.payloadLen != data.length) {
+ data = new byte[bytesRead.payloadLen];
+ System.arraycopy(bytesRead.data, 0, data, 0, bytesRead.payloadLen);
+ }
+ return data;
+ }
+
+ public static ByteBuffer readAll2Buffer(InputStream stream) throws IOException {
+ BytesRead bytesRead = readAllImpl(stream);
+ return BufferUtil.newByteBuffer(bytesRead.data, 0, bytesRead.payloadLen);
+ }
+
+ private static BytesRead readAllImpl(InputStream stream) throws IOException {
+ // FIXME: Shall we do this here ?
+ if( !(stream instanceof BufferedInputStream) ) {
+ stream = new BufferedInputStream(stream);
+ }
+ int avail = stream.available();
+ byte[] data = new byte[avail];
+ int numRead = 0;
+ int pos = 0;
+ do {
+ if (pos + avail > data.length) {
+ byte[] newData = new byte[pos + avail];
+ System.arraycopy(data, 0, newData, 0, pos);
+ data = newData;
+ }
+ numRead = stream.read(data, pos, avail);
+ if (numRead >= 0) {
+ pos += numRead;
+ }
+ avail = stream.available();
+ } while (avail > 0 && numRead >= 0);
+
+ return new BytesRead(pos, data);
+ }
+
+ private static class BytesRead {
+ BytesRead(int payloadLen, byte[] data) {
+ this.payloadLen=payloadLen;
+ this.data=data;
+ }
+ int payloadLen;
+ byte[] data;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/TGAWriter.java b/src/jogl/classes/com/sun/opengl/util/TGAWriter.java
new file mode 100755
index 000000000..c5b1041a0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/TGAWriter.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.util;
+
+import java.io.*;
+import java.nio.*;
+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>
+ */
+
+public class TGAWriter {
+ private static final int TARGA_HEADER_SIZE = 18;
+
+ private FileChannel ch;
+ private ByteBuffer buf;
+
+ /** Constructor for the TGAWriter. */
+ public TGAWriter() {
+ }
+
+ /**
+ * Opens the specified Targa file for writing, overwriting any
+ * existing file, and sets up the header of the file expecting the
+ * data to be filled in before closing it.
+ *
+ * @param file the file to write containing the screenshot
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ * @param alpha whether the alpha channel should be saved. If true,
+ * requires GL_EXT_abgr extension to be present.
+ *
+ * @throws IOException if an I/O error occurred while writing the
+ * file
+ */
+ public void open(File file,
+ int width,
+ int height,
+ boolean alpha) throws IOException {
+ RandomAccessFile out = new RandomAccessFile(file, "rw");
+ ch = out.getChannel();
+ int pixelSize = (alpha ? 32 : 24);
+ int numChannels = (alpha ? 4 : 3);
+
+ int fileLength = TARGA_HEADER_SIZE + width * height * numChannels;
+ out.setLength(fileLength);
+ MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, fileLength);
+
+ // write the TARGA header
+ image.put(0, (byte) 0).put(1, (byte) 0);
+ image.put(2, (byte) 2); // uncompressed type
+ image.put(12, (byte) (width & 0xFF)); // width
+ image.put(13, (byte) (width >> 8)); // width
+ image.put(14, (byte) (height & 0xFF)); // height
+ image.put(15, (byte) (height >> 8)); // height
+ image.put(16, (byte) pixelSize); // pixel size
+
+ // go to image data position
+ image.position(TARGA_HEADER_SIZE);
+ // jogl needs a sliced buffer
+ buf = image.slice();
+ }
+
+ /**
+ * Returns the ByteBuffer corresponding to the data for the image.
+ * This must be filled in with data in either BGR or BGRA format
+ * depending on whether an alpha channel was specified during
+ * open().
+ */
+ public ByteBuffer getImageData() {
+ return buf;
+ }
+
+ public void close() throws IOException {
+ // close the file channel
+ ch.close();
+ buf = null;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java
new file mode 100755
index 000000000..534ab444d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/awt/ImageUtil.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.awt;
+
+import java.awt.*;
+import java.awt.image.*;
+
+/** Utilities for dealing with images. */
+
+public class ImageUtil {
+ private ImageUtil() {}
+
+ /** Flips the supplied BufferedImage vertically. This is often a
+ necessary conversion step to display a Java2D image correctly
+ with OpenGL and vice versa. */
+ public static void flipImageVertically(BufferedImage image) {
+ WritableRaster raster = image.getRaster();
+ Object scanline1 = null;
+ Object scanline2 = null;
+
+ for (int i = 0; i < image.getHeight() / 2; i++) {
+ scanline1 = raster.getDataElements(0, i, image.getWidth(), 1, scanline1);
+ scanline2 = raster.getDataElements(0, image.getHeight() - i - 1, image.getWidth(), 1, scanline2);
+ raster.setDataElements(0, i, image.getWidth(), 1, scanline2);
+ raster.setDataElements(0, image.getHeight() - i - 1, image.getWidth(), 1, scanline1);
+ }
+ }
+
+ /**
+ * Creates a <code>BufferedImage</code> with a pixel format compatible with the graphics
+ * environment. The returned image can thus benefit from hardware accelerated operations
+ * in Java2D API.
+ *
+ * @param width The width of the image to be created
+ * @param height The height of the image to be created
+ *
+ * @return A instance of <code>BufferedImage</code> with a type compatible with the graphics card.
+ */
+ public static BufferedImage createCompatibleImage(int width, int height) {
+ GraphicsConfiguration configuration =
+ GraphicsEnvironment.getLocalGraphicsEnvironment().
+ getDefaultScreenDevice().getDefaultConfiguration();
+ return configuration.createCompatibleImage(width, height);
+ }
+
+ /**
+ * Creates a thumbnail from an image. A thumbnail is a scaled down version of the original picture.
+ * This method will retain the width to height ratio of the original picture and return a new
+ * instance of <code>BufferedImage</code>. The original picture is not modified.
+ *
+ * @param image The original image to sample down
+ * @param thumbWidth The width of the thumbnail to be created
+ *
+ * @throws IllegalArgumentException If thumbWidth is greater than image.getWidth()
+ *
+ * @return A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()
+ */
+ public static BufferedImage createThumbnail(BufferedImage image, int thumbWidth) {
+ // Thanks to Romain Guy for this utility
+ if (thumbWidth > image.getWidth()) {
+ throw new IllegalArgumentException("Thumbnail width must be greater than image width");
+ }
+
+ if (thumbWidth == image.getWidth()) {
+ return image;
+ }
+
+ float ratio = (float) image.getWidth() / (float) image.getHeight();
+ int width = image.getWidth();
+ BufferedImage thumb = image;
+
+ do {
+ width /= 2;
+ if (width < thumbWidth) {
+ width = thumbWidth;
+ }
+
+ BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
+ Graphics2D g2 = temp.createGraphics();
+ g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+ RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+ g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);
+ g2.dispose();
+ thumb = temp;
+ } while (width != thumbWidth);
+
+ return thumb;
+ }
+
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/awt/Overlay.java b/src/jogl/classes/com/sun/opengl/util/awt/Overlay.java
new file mode 100755
index 000000000..5a54a7161
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/awt/Overlay.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.awt;
+
+import java.awt.Graphics2D;
+
+import javax.media.opengl.*;
+import com.sun.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
+ an OpenGL scene while still maintaining reasonably good
+ efficiency. */
+
+public class Overlay {
+ private GLDrawable drawable;
+ private TextureRenderer renderer;
+ private boolean contentsLost;
+
+ /** Creates a new Java 2D overlay on top of the specified
+ GLDrawable. */
+ public Overlay(GLDrawable drawable) {
+ this.drawable = drawable;
+ }
+
+ /** Creates a {@link java.awt.Graphics2D Graphics2D} instance for
+ rendering into the overlay. The returned object should be
+ disposed of using the normal {@link java.awt.Graphics#dispose()
+ Graphics.dispose()} method once it is no longer being used.
+
+ @return a new {@link java.awt.Graphics2D Graphics2D} object for
+ rendering into the backing store of this renderer
+ */
+ public Graphics2D createGraphics() {
+ // Validate the size of the renderer against the current size of
+ // the drawable
+ validateRenderer();
+ return renderer.createGraphics();
+ }
+
+ /** Indicates whether the Java 2D contents of the overlay were lost
+ since the last time {@link #createGraphics} was called. This
+ method should be called immediately after calling {@link
+ #createGraphics} to see whether the entire contents of the
+ overlay need to be redrawn or just the region the application is
+ interested in updating.
+
+ @return whether the contents of the overlay were lost since the
+ last render
+ */
+ public boolean contentsLost() {
+ return contentsLost;
+ }
+
+ /** Marks the given region of the overlay as dirty. This region, and
+ any previously set dirty regions, will be automatically
+ synchronized with the underlying Texture during the next {@link
+ #draw draw} or {@link #drawAll drawAll} operation, at which
+ point the dirty region will be cleared. It is not necessary for
+ an OpenGL context to be current when this method is called.
+
+ @param x the x coordinate (in Java 2D coordinates -- relative to
+ upper left) of the region to update
+ @param y the y coordinate (in Java 2D coordinates -- relative to
+ upper left) of the region to update
+ @param width the width of the region to update
+ @param height the height of the region to update
+
+ @throws GLException If an OpenGL context is not current when this method is called */
+ public void markDirty(int x, int y, int width, int height) {
+ renderer.markDirty(x, y, width, height);
+ }
+
+ /** Draws the entire contents of the overlay on top of the OpenGL
+ drawable. This is a convenience method which encapsulates all
+ portions of the rendering process; if this method is used,
+ {@link #beginRendering}, {@link #endRendering}, etc. should not
+ be used. This method should be called while the OpenGL context
+ for the drawable is current, and after your OpenGL scene has
+ been rendered.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void drawAll() throws GLException {
+ beginRendering();
+ draw(0, 0, drawable.getWidth(), drawable.getHeight());
+ endRendering();
+ }
+
+ /** Begins the OpenGL rendering process for the overlay. This is
+ separated out so advanced applications can render independent
+ pieces of the overlay to different portions of the drawable.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void beginRendering() throws GLException {
+ renderer.beginOrthoRendering(drawable.getWidth(), drawable.getHeight());
+ }
+
+ /** Ends the OpenGL rendering process for the overlay. This is
+ separated out so advanced applications can render independent
+ pieces of the overlay to different portions of the drawable.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void endRendering() throws GLException {
+ renderer.endOrthoRendering();
+ }
+
+ /** Draws the specified sub-rectangle of the overlay on top of the
+ OpenGL drawable. {@link #beginRendering} and {@link
+ #endRendering} must be used in conjunction with this method to
+ achieve proper rendering results. This method should be called
+ while the OpenGL context for the drawable is current, and after
+ your OpenGL scene has been rendered.
+
+ @param x the lower-left x coordinate (relative to the lower left
+ of the overlay) of the rectangle to draw
+ @param y the lower-left y coordinate (relative to the lower left
+ of the overlay) of the rectangle to draw
+ @param width the width of the rectangle to draw
+ @param height the height of the rectangle to draw
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void draw(int x, int y, int width, int height) throws GLException {
+ draw(x, y, x, y, width, height);
+ }
+
+ /** Draws the specified sub-rectangle of the overlay at the
+ specified x and y coordinate on top of the OpenGL drawable.
+ {@link #beginRendering} and {@link #endRendering} must be used
+ in conjunction with this method to achieve proper rendering
+ results. This method should be called while the OpenGL context
+ for the drawable is current, and after your OpenGL scene has
+ been rendered.
+
+ @param screenx the on-screen x coordinate at which to draw the rectangle
+ @param screeny the on-screen y coordinate (relative to lower left) at
+ which to draw the rectangle
+ @param overlayx the x coordinate of the pixel in the overlay of
+ the lower left portion of the rectangle to draw
+ @param overlayy the y coordinate of the pixel in the overlay
+ (relative to lower left) of the lower left portion of the
+ rectangle to draw
+ @param width the width of the rectangle to draw
+ @param height the height of the rectangle to draw
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void draw(int screenx, int screeny,
+ int overlayx, int overlayy,
+ int width, int height) throws GLException {
+ renderer.drawOrthoRect(screenx, screeny,
+ overlayx, overlayy,
+ width, height);
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void validateRenderer() {
+ if (renderer == null) {
+ renderer = new TextureRenderer(drawable.getWidth(),
+ drawable.getHeight(),
+ true);
+ contentsLost = true;
+ } else if (renderer.getWidth() != drawable.getWidth() ||
+ renderer.getHeight() != drawable.getHeight()) {
+ renderer.setSize(drawable.getWidth(), drawable.getHeight());
+ contentsLost = true;
+ } else {
+ contentsLost = false;
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/sun/opengl/util/awt/Screenshot.java
new file mode 100755
index 000000000..55099445a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/awt/Screenshot.java
@@ -0,0 +1,432 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.util.awt;
+
+import java.awt.image.*;
+import java.io.*;
+import java.nio.*;
+import java.nio.channels.*;
+import javax.imageio.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import javax.media.opengl.glu.gl2.*;
+
+import com.sun.opengl.util.*;
+
+/** Utilities for taking screenshots of OpenGL applications. */
+
+public class Screenshot {
+ private Screenshot() {}
+
+ /**
+ * Takes a fast screenshot of the current OpenGL drawable to a Targa
+ * file. Requires the OpenGL context for the desired drawable to be
+ * current. Takes the screenshot from the last assigned read buffer,
+ * or the OpenGL default read buffer if none has been specified by
+ * the user (GL_FRONT for single-buffered configurations and GL_BACK
+ * for double-buffered configurations). This is the fastest
+ * mechanism for taking a screenshot of an application. Contributed
+ * by Carsten Weisse of Bytonic Software (http://bytonic.de/). <p>
+ *
+ * No alpha channel is written with this variant.
+ *
+ * @param file the file to write containing the screenshot
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ * @throws IOException if an I/O error occurred while writing the
+ * file
+ */
+ public static void writeToTargaFile(File file,
+ int width,
+ int height) throws GLException, IOException {
+ writeToTargaFile(file, width, height, false);
+ }
+
+ /**
+ * Takes a fast screenshot of the current OpenGL drawable to a Targa
+ * file. Requires the OpenGL context for the desired drawable to be
+ * current. Takes the screenshot from the last assigned read buffer,
+ * or the OpenGL default read buffer if none has been specified by
+ * the user (GL_FRONT for single-buffered configurations and GL_BACK
+ * for double-buffered configurations). This is the fastest
+ * mechanism for taking a screenshot of an application. Contributed
+ * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
+ *
+ * @param file the file to write containing the screenshot
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ * @param alpha whether the alpha channel should be saved. If true,
+ * requires GL_EXT_abgr extension to be present.
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ * @throws IOException if an I/O error occurred while writing the
+ * file
+ */
+ public static void writeToTargaFile(File file,
+ int width,
+ int height,
+ boolean alpha) throws GLException, IOException {
+ writeToTargaFile(file, 0, 0, width, height, alpha);
+ }
+
+ /**
+ * Takes a fast screenshot of the current OpenGL drawable to a Targa
+ * file. Requires the OpenGL context for the desired drawable to be
+ * current. Takes the screenshot from the last assigned read buffer,
+ * or the OpenGL default read buffer if none has been specified by
+ * the user (GL_FRONT for single-buffered configurations and GL_BACK
+ * for double-buffered configurations). This is the fastest
+ * mechanism for taking a screenshot of an application. Contributed
+ * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
+ *
+ * @param file the file to write containing the screenshot
+ * @param x the starting x coordinate of the screenshot, measured from the lower-left
+ * @param y the starting y coordinate of the screenshot, measured from the lower-left
+ * @param width the width of the desired screenshot area
+ * @param height the height of the desired screenshot area
+ * @param alpha whether the alpha channel should be saved. If true,
+ * requires GL_EXT_abgr extension to be present.
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ * @throws IOException if an I/O error occurred while writing the
+ * file
+ */
+ public static void writeToTargaFile(File file,
+ int x,
+ int y,
+ int width,
+ int height,
+ boolean alpha) throws GLException, IOException {
+ if (alpha) {
+ checkExtABGR();
+ }
+
+ TGAWriter writer = new TGAWriter();
+ writer.open(file, width, height, alpha);
+ ByteBuffer bgr = writer.getImageData();
+
+ GL2 gl = GLUgl2.getCurrentGL2();
+
+ // Set up pixel storage modes
+ PixelStorageModes psm = new PixelStorageModes();
+ psm.save(gl);
+
+ int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2.GL_BGR);
+
+ // read the BGR values into the image buffer
+ gl.glReadPixels(x, y, width, height, readbackType,
+ GL2.GL_UNSIGNED_BYTE, bgr);
+
+ // Restore pixel storage modes
+ psm.restore(gl);
+
+ // close the file
+ writer.close();
+ }
+
+ /**
+ * Takes a screenshot of the current OpenGL drawable to a
+ * BufferedImage. Requires the OpenGL context for the desired
+ * drawable to be current. Takes the screenshot from the last
+ * assigned read buffer, or the OpenGL default read buffer if none
+ * has been specified by the user (GL_FRONT for single-buffered
+ * configurations and GL_BACK for double-buffered configurations).
+ * Note that the scanlines of the resulting image are flipped
+ * vertically in order to correctly match the OpenGL contents, which
+ * takes time and is therefore not as fast as the Targa screenshot
+ * function. <P>
+ *
+ * No alpha channel is read back with this variant.
+ *
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ */
+ public static BufferedImage readToBufferedImage(int width,
+ int height) throws GLException {
+ return readToBufferedImage(width, height, false);
+ }
+
+ /**
+ * Takes a screenshot of the current OpenGL drawable to a
+ * BufferedImage. Requires the OpenGL context for the desired
+ * drawable to be current. Takes the screenshot from the last
+ * assigned read buffer, or the OpenGL default read buffer if none
+ * has been specified by the user (GL_FRONT for single-buffered
+ * configurations and GL_BACK for double-buffered configurations).
+ * Note that the scanlines of the resulting image are flipped
+ * vertically in order to correctly match the OpenGL contents, which
+ * takes time and is therefore not as fast as the Targa screenshot
+ * function.
+ *
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ * @param alpha whether the alpha channel should be read back. If
+ * true, requires GL_EXT_abgr extension to be present.
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ */
+ public static BufferedImage readToBufferedImage(int width,
+ int height,
+ boolean alpha) throws GLException {
+ return readToBufferedImage(0, 0, width, height, alpha);
+ }
+
+ /**
+ * Takes a screenshot of the current OpenGL drawable to a
+ * BufferedImage. Requires the OpenGL context for the desired
+ * drawable to be current. Takes the screenshot from the last
+ * assigned read buffer, or the OpenGL default read buffer if none
+ * has been specified by the user (GL_FRONT for single-buffered
+ * configurations and GL_BACK for double-buffered configurations).
+ * Note that the scanlines of the resulting image are flipped
+ * vertically in order to correctly match the OpenGL contents, which
+ * takes time and is therefore not as fast as the Targa screenshot
+ * function.
+ *
+ * @param x the starting x coordinate of the screenshot, measured from the lower-left
+ * @param y the starting y coordinate of the screenshot, measured from the lower-left
+ * @param width the width of the desired screenshot area
+ * @param height the height of the desired screenshot area
+ * @param alpha whether the alpha channel should be read back. If
+ * true, requires GL_EXT_abgr extension to be present.
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ */
+ public static BufferedImage readToBufferedImage(int x,
+ int y,
+ int width,
+ int height,
+ boolean alpha) throws GLException {
+ int bufImgType = (alpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);
+ int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2.GL_BGR);
+
+ if (alpha) {
+ checkExtABGR();
+ }
+
+ // Allocate necessary storage
+ BufferedImage image = new BufferedImage(width, height, bufImgType);
+
+ GL2 gl = GLUgl2.getCurrentGL2();
+
+ // Set up pixel storage modes
+ PixelStorageModes psm = new PixelStorageModes();
+ psm.save(gl);
+
+ // read the BGR values into the image
+ gl.glReadPixels(x, y, width, height, readbackType,
+ GL2.GL_UNSIGNED_BYTE,
+ ByteBuffer.wrap(((DataBufferByte) image.getRaster().getDataBuffer()).getData()));
+
+ // Restore pixel storage modes
+ psm.restore(gl);
+
+ // Must flip BufferedImage vertically for correct results
+ ImageUtil.flipImageVertically(image);
+ return image;
+ }
+
+ /**
+ * Takes a screenshot of the current OpenGL drawable to the
+ * specified file on disk using the ImageIO package. Requires the
+ * OpenGL context for the desired drawable to be current. Takes the
+ * screenshot from the last assigned read buffer, or the OpenGL
+ * default read buffer if none has been specified by the user
+ * (GL_FRONT for single-buffered configurations and GL_BACK for
+ * double-buffered configurations). This is not the fastest
+ * mechanism for taking a screenshot but may be more convenient than
+ * others for getting images for consumption by other packages. The
+ * file format is inferred from the suffix of the given file. <P>
+ *
+ * No alpha channel is saved with this variant.
+ *
+ * @param file the file to write containing the screenshot
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ *
+ * @throws IOException if an I/O error occurred or if the file could
+ * not be written to disk due to the requested file format being
+ * unsupported by ImageIO
+ */
+ public static void writeToFile(File file,
+ int width,
+ int height) throws IOException, GLException {
+ writeToFile(file, width, height, false);
+ }
+
+ /**
+ * Takes a screenshot of the current OpenGL drawable to the
+ * specified file on disk using the ImageIO package. Requires the
+ * OpenGL context for the desired drawable to be current. Takes the
+ * screenshot from the last assigned read buffer, or the OpenGL
+ * default read buffer if none has been specified by the user
+ * (GL_FRONT for single-buffered configurations and GL_BACK for
+ * double-buffered configurations). This is not the fastest
+ * mechanism for taking a screenshot but may be more convenient than
+ * others for getting images for consumption by other packages. The
+ * file format is inferred from the suffix of the given file. <P>
+ *
+ * Note that some file formats, in particular JPEG, can not handle
+ * an alpha channel properly. If the "alpha" argument is specified
+ * as true for such a file format it will be silently ignored.
+ *
+ * @param file the file to write containing the screenshot
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ * @param alpha whether an alpha channel should be saved. If true,
+ * requires GL_EXT_abgr extension to be present.
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ *
+ * @throws IOException if an I/O error occurred or if the file could
+ * not be written to disk due to the requested file format being
+ * unsupported by ImageIO
+ */
+ public static void writeToFile(File file,
+ int width,
+ int height,
+ boolean alpha) throws IOException, GLException {
+ writeToFile(file, 0, 0, width, height, alpha);
+ }
+
+ /**
+ * Takes a screenshot of the current OpenGL drawable to the
+ * specified file on disk using the ImageIO package. Requires the
+ * OpenGL context for the desired drawable to be current. Takes the
+ * screenshot from the last assigned read buffer, or the OpenGL
+ * default read buffer if none has been specified by the user
+ * (GL_FRONT for single-buffered configurations and GL_BACK for
+ * double-buffered configurations). This is not the fastest
+ * mechanism for taking a screenshot but may be more convenient than
+ * others for getting images for consumption by other packages. The
+ * file format is inferred from the suffix of the given file. <P>
+ *
+ * Note that some file formats, in particular JPEG, can not handle
+ * an alpha channel properly. If the "alpha" argument is specified
+ * as true for such a file format it will be silently ignored.
+ *
+ * @param file the file to write containing the screenshot
+ * @param x the starting x coordinate of the screenshot, measured from the lower-left
+ * @param y the starting y coordinate of the screenshot, measured from the lower-left
+ * @param width the width of the current drawable
+ * @param height the height of the current drawable
+ * @param alpha whether an alpha channel should be saved. If true,
+ * requires GL_EXT_abgr extension to be present.
+ *
+ * @throws GLException if an OpenGL context was not current or
+ * another OpenGL-related error occurred
+ *
+ * @throws IOException if an I/O error occurred or if the file could
+ * not be written to disk due to the requested file format being
+ * unsupported by ImageIO
+ */
+ public static void writeToFile(File file,
+ int x,
+ int y,
+ int width,
+ int height,
+ boolean alpha) throws IOException, GLException {
+ String fileSuffix = FileUtil.getFileSuffix(file);
+ if (alpha && (fileSuffix.equals("jpg") || fileSuffix.equals("jpeg"))) {
+ // JPEGs can't deal properly with alpha channels
+ alpha = false;
+ }
+
+ BufferedImage image = readToBufferedImage(x, y, width, height, alpha);
+ if (!ImageIO.write(image, fileSuffix, file)) {
+ throw new IOException("Unsupported file format " + fileSuffix);
+ }
+ }
+
+ private static int glGetInteger(GL2 gl, int pname, int[] tmp) {
+ gl.glGetIntegerv(pname, tmp, 0);
+ return tmp[0];
+ }
+
+ private static void checkExtABGR() {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ if (!gl.isExtensionAvailable("GL_EXT_abgr")) {
+ throw new IllegalArgumentException("Saving alpha channel requires GL_EXT_abgr");
+ }
+ }
+
+ static class PixelStorageModes {
+ int packAlignment;
+ int packRowLength;
+ int packSkipRows;
+ int packSkipPixels;
+ int packSwapBytes;
+ int[] tmp = new int[1];
+
+ void save(GL2 gl) {
+ packAlignment = glGetInteger(gl, GL2.GL_PACK_ALIGNMENT, tmp);
+ packRowLength = glGetInteger(gl, GL2.GL_PACK_ROW_LENGTH, tmp);
+ packSkipRows = glGetInteger(gl, GL2.GL_PACK_SKIP_ROWS, tmp);
+ packSkipPixels = glGetInteger(gl, GL2.GL_PACK_SKIP_PIXELS, tmp);
+ packSwapBytes = glGetInteger(gl, GL2.GL_PACK_SWAP_BYTES, tmp);
+
+ gl.glPixelStorei(GL2.GL_PACK_ALIGNMENT, 1);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
+ }
+
+ void restore(GL2 gl) {
+ gl.glPixelStorei(GL2.GL_PACK_ALIGNMENT, packAlignment);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java
new file mode 100755
index 000000000..059ead63d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/awt/TextRenderer.java
@@ -0,0 +1,1951 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+package com.sun.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 java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+
+// For debugging purposes
+import java.awt.EventQueue;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.RenderingHints;
+import java.awt.event.*;
+import java.awt.font.*;
+import java.awt.geom.*;
+
+import java.nio.*;
+
+import java.text.*;
+
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import javax.media.opengl.glu.gl2.*;
+import javax.media.opengl.awt.*;
+
+
+/** Renders bitmapped Java 2D text into an OpenGL window with high
+ performance, full Unicode support, and a simple API. Performs
+ appropriate caching of text rendering results in an OpenGL texture
+ internally to avoid repeated font rasterization. The caching is
+ completely automatic, does not require any user intervention, and
+ has no visible controls in the public API. <P>
+
+ Using the {@link TextRenderer TextRenderer} is simple. Add a
+ "<code>TextRenderer renderer;</code>" field to your {@link
+ javax.media.opengl.GLEventListener GLEventListener}. In your {@link
+ javax.media.opengl.GLEventListener#init init} method, add:
+
+ <PRE>
+ renderer = new TextRenderer(new Font("SansSerif", Font.BOLD, 36));
+ </PRE>
+
+ <P> In the {@link javax.media.opengl.GLEventListener#display display} method of your
+ {@link javax.media.opengl.GLEventListener GLEventListener}, add:
+ <PRE>
+ renderer.beginRendering(drawable.getWidth(), drawable.getHeight());
+ // optionally set the color
+ renderer.setColor(1.0f, 0.2f, 0.2f, 0.8f);
+ renderer.draw("Text to draw", xPosition, yPosition);
+ // ... more draw commands, color changes, etc.
+ renderer.endRendering();
+ </PRE>
+
+ Unless you are sharing textures and display lists between OpenGL
+ contexts, you do not need to call the {@link #dispose dispose}
+ method of the TextRenderer; the OpenGL resources it uses
+ internally will be cleaned up automatically when the OpenGL
+ context is destroyed. <P>
+
+ <b>Note</b> that the TextRenderer may cause the vertex and texture
+ coordinate array buffer bindings to change, or to be unbound. This
+ is important to note if you are using Vertex Buffer Objects (VBOs)
+ in your application. <P>
+
+ Internally, the renderer uses a rectangle packing algorithm to
+ 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
+ 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
+ results every few hundred rendering cycles, where a rendering
+ cycle is defined as a pair of calls to {@link #beginRendering
+ beginRendering} / {@link #endRendering endRendering}.
+
+ @author John Burkey
+ @author Kenneth Russell
+*/
+public class TextRenderer {
+ private static final boolean DEBUG = Debug.debug("TextRenderer");
+
+ // These are occasionally useful for more in-depth debugging
+ private static final boolean DISABLE_GLYPH_CACHE = false;
+ private static final boolean DRAW_BBOXES = false;
+
+ static final int kSize = 256;
+
+ // Every certain number of render cycles, flush the strings which
+ // haven't been used recently
+ private static final int CYCLES_PER_FLUSH = 100;
+
+ // The amount of vertical dead space on the backing store before we
+ // force a compaction
+ private static final float MAX_VERTICAL_FRAGMENTATION = 0.7f;
+ static final int kQuadsPerBuffer = 100;
+ static final int kCoordsPerVertVerts = 3;
+ static final int kCoordsPerVertTex = 2;
+ static final int kVertsPerQuad = 4;
+ static final int kTotalBufferSizeVerts = kQuadsPerBuffer * kVertsPerQuad;
+ static final int kTotalBufferSizeCoordsVerts = kQuadsPerBuffer * kVertsPerQuad * kCoordsPerVertVerts;
+ static final int kTotalBufferSizeCoordsTex = kQuadsPerBuffer * kVertsPerQuad * kCoordsPerVertTex;
+ static final int kTotalBufferSizeBytesVerts = kTotalBufferSizeCoordsVerts * 4;
+ static final int kTotalBufferSizeBytesTex = kTotalBufferSizeCoordsTex * 4;
+ static final int kSizeInBytes_OneVertices_VertexData = kCoordsPerVertVerts * 4;
+ static final int kSizeInBytes_OneVertices_TexData = kCoordsPerVertTex * 4;
+ private Font font;
+ private boolean antialiased;
+ private boolean useFractionalMetrics;
+
+ // Whether we're attempting to use automatic mipmap generation support
+ private boolean mipmap;
+ private RectanglePacker packer;
+ private boolean haveMaxSize;
+ private RenderDelegate renderDelegate;
+ private TextureRenderer cachedBackingStore;
+ private Graphics2D cachedGraphics;
+ private FontRenderContext cachedFontRenderContext;
+ private Map /*<String,Rect>*/ stringLocations = new HashMap /*<String,Rect>*/();
+ private GlyphProducer mGlyphProducer;
+
+ private int numRenderCycles;
+
+ // Need to keep track of whether we're in a beginRendering() /
+ // endRendering() cycle so we can re-enter the exact same state if
+ // we have to reallocate the backing store
+ private boolean inBeginEndPair;
+ private boolean isOrthoMode;
+ private int beginRenderingWidth;
+ private int beginRenderingHeight;
+ private boolean beginRenderingDepthTestDisabled;
+
+ // For resetting the color after disposal of the old backing store
+ private boolean haveCachedColor;
+ private float cachedR;
+ private float cachedG;
+ private float cachedB;
+ private float cachedA;
+ private Color cachedColor;
+ private boolean needToResetColor;
+
+ // For debugging only
+ private Frame dbgFrame;
+
+ // Debugging purposes only
+ private boolean debugged;
+ Pipelined_QuadRenderer mPipelinedQuadRenderer;
+
+ //emzic: added boolean flag
+ private boolean useVertexArrays = true;
+
+ //emzic: added boolean flag
+ private boolean isExtensionAvailable_GL_VERSION_1_5;
+ private boolean checkFor_isExtensionAvailable_GL_VERSION_1_5;
+
+ // Whether GL_LINEAR filtering is enabled for the backing store
+ private boolean smoothing = true;
+
+ /** Creates a new TextRenderer with the given font, using no
+ antialiasing or fractional metrics, and the default
+ RenderDelegate. Equivalent to <code>TextRenderer(font, false,
+ false)</code>.
+
+ @param font the font to render with
+ */
+ public TextRenderer(Font font) {
+ this(font, false, false, null, false);
+ }
+
+ /** Creates a new TextRenderer with the given font, using no
+ antialiasing or fractional metrics, and the default
+ RenderDelegate. If <CODE>mipmap</CODE> is true, attempts to use
+ OpenGL's automatic mipmap generation for better smoothing when
+ rendering the TextureRenderer's contents at a distance.
+ Equivalent to <code>TextRenderer(font, false, false)</code>.
+
+ @param font the font to render with
+ @param mipmap whether to attempt use of automatic mipmap generation
+ */
+ public TextRenderer(Font font, boolean mipmap) {
+ this(font, false, false, null, mipmap);
+ }
+
+ /** Creates a new TextRenderer with the given Font, specified font
+ properties, and default RenderDelegate. The
+ <code>antialiased</code> and <code>useFractionalMetrics</code>
+ flags provide control over the same properties at the Java 2D
+ level. No mipmap support is requested. Equivalent to
+ <code>TextRenderer(font, antialiased, useFractionalMetrics,
+ null)</code>.
+
+ @param font the font to render with
+ @param antialiased whether to use antialiased fonts
+ @param useFractionalMetrics whether to use fractional font
+ metrics at the Java 2D level
+ */
+ public TextRenderer(Font font, boolean antialiased,
+ boolean useFractionalMetrics) {
+ this(font, antialiased, useFractionalMetrics, null, false);
+ }
+
+ /** Creates a new TextRenderer with the given Font, specified font
+ properties, and given RenderDelegate. The
+ <code>antialiased</code> and <code>useFractionalMetrics</code>
+ flags provide control over the same properties at the Java 2D
+ level. The <code>renderDelegate</code> provides more control
+ over the text rendered. No mipmap support is requested.
+
+ @param font the font to render with
+ @param antialiased whether to use antialiased fonts
+ @param useFractionalMetrics whether to use fractional font
+ metrics at the Java 2D level
+ @param renderDelegate the render delegate to use to draw the
+ text's bitmap, or null to use the default one
+ */
+ public TextRenderer(Font font, boolean antialiased,
+ boolean useFractionalMetrics, RenderDelegate renderDelegate) {
+ this(font, antialiased, useFractionalMetrics, renderDelegate, false);
+ }
+
+ /** Creates a new TextRenderer with the given Font, specified font
+ properties, and given RenderDelegate. The
+ <code>antialiased</code> and <code>useFractionalMetrics</code>
+ flags provide control over the same properties at the Java 2D
+ level. The <code>renderDelegate</code> provides more control
+ over the text rendered. If <CODE>mipmap</CODE> is true, attempts
+ to use OpenGL's automatic mipmap generation for better smoothing
+ when rendering the TextureRenderer's contents at a distance.
+
+ @param font the font to render with
+ @param antialiased whether to use antialiased fonts
+ @param useFractionalMetrics whether to use fractional font
+ metrics at the Java 2D level
+ @param renderDelegate the render delegate to use to draw the
+ text's bitmap, or null to use the default one
+ @param mipmap whether to attempt use of automatic mipmap generation
+ */
+ public TextRenderer(Font font, boolean antialiased,
+ boolean useFractionalMetrics, RenderDelegate renderDelegate,
+ boolean mipmap) {
+ this.font = font;
+ this.antialiased = antialiased;
+ this.useFractionalMetrics = useFractionalMetrics;
+ this.mipmap = mipmap;
+
+ // FIXME: consider adjusting the size based on font size
+ // (it will already automatically resize if necessary)
+ packer = new RectanglePacker(new Manager(), kSize, kSize);
+
+ if (renderDelegate == null) {
+ renderDelegate = new DefaultRenderDelegate();
+ }
+
+ this.renderDelegate = renderDelegate;
+
+ mGlyphProducer = new GlyphProducer(font.getNumGlyphs());
+ }
+
+ /** Returns the bounding rectangle of the given String, assuming it
+ was rendered at the origin. See {@link #getBounds(CharSequence)
+ getBounds(CharSequence)}. */
+ public Rectangle2D getBounds(String str) {
+ return getBounds((CharSequence) str);
+ }
+
+ /** Returns the bounding rectangle of the given CharSequence,
+ assuming it was rendered at the origin. The coordinate system of
+ the returned rectangle is Java 2D's, with increasing Y
+ coordinates in the downward direction. The relative coordinate
+ (0, 0) in the returned rectangle corresponds to the baseline of
+ the leftmost character of the rendered string, in similar
+ fashion to the results returned by, for example, {@link
+ java.awt.font.GlyphVector#getVisualBounds}. Most applications
+ will use only the width and height of the returned Rectangle for
+ the purposes of centering or justifying the String. It is not
+ specified which Java 2D bounds ({@link
+ java.awt.font.GlyphVector#getVisualBounds getVisualBounds},
+ {@link java.awt.font.GlyphVector#getPixelBounds getPixelBounds},
+ etc.) the returned bounds correspond to, although every effort
+ is made to ensure an accurate bound. */
+ public Rectangle2D getBounds(CharSequence str) {
+ // FIXME: this should be more optimized and use the glyph cache
+ Rect r = null;
+
+ if ((r = (Rect) stringLocations.get(str)) != null) {
+ TextData data = (TextData) r.getUserData();
+
+ // Reconstitute the Java 2D results based on the cached values
+ return new Rectangle2D.Double(-data.origin().x, -data.origin().y,
+ r.w(), r.h());
+ }
+
+ // Must return a Rectangle compatible with the layout algorithm --
+ // must be idempotent
+ return normalize(renderDelegate.getBounds(str, font,
+ getFontRenderContext()));
+ }
+
+ /** Returns the Font this renderer is using. */
+ public Font getFont() {
+ return font;
+ }
+
+ /** Returns a FontRenderContext which can be used for external
+ text-related size computations. This object should be considered
+ transient and may become invalidated between {@link
+ #beginRendering beginRendering} / {@link #endRendering
+ endRendering} pairs. */
+ public FontRenderContext getFontRenderContext() {
+ if (cachedFontRenderContext == null) {
+ cachedFontRenderContext = getGraphics2D().getFontRenderContext();
+ }
+
+ return cachedFontRenderContext;
+ }
+
+ /** Begins rendering with this {@link TextRenderer TextRenderer}
+ into the current OpenGL drawable, pushing the projection and
+ modelview matrices and some state bits and setting up a
+ two-dimensional orthographic projection with (0, 0) as the
+ lower-left coordinate and (width, height) as the upper-right
+ coordinate. Binds and enables the internal OpenGL texture
+ object, sets the texture environment mode to GL_MODULATE, and
+ changes the current color to the last color set with this
+ TextRenderer via {@link #setColor setColor}. This method
+ disables the depth test and is equivalent to
+ beginRendering(width, height, true).
+
+ @param width the width of the current on-screen OpenGL drawable
+ @param height the height of the current on-screen OpenGL drawable
+ @throws javax.media.opengl.GLException If an OpenGL context is not current when this method is called
+ */
+ public void beginRendering(int width, int height) throws GLException {
+ beginRendering(width, height, true);
+ }
+
+ /** Begins rendering with this {@link TextRenderer TextRenderer}
+ into the current OpenGL drawable, pushing the projection and
+ modelview matrices and some state bits and setting up a
+ two-dimensional orthographic projection with (0, 0) as the
+ lower-left coordinate and (width, height) as the upper-right
+ coordinate. Binds and enables the internal OpenGL texture
+ object, sets the texture environment mode to GL_MODULATE, and
+ changes the current color to the last color set with this
+ TextRenderer via {@link #setColor setColor}. Disables the depth
+ test if the disableDepthTest argument is true.
+
+ @param width the width of the current on-screen OpenGL drawable
+ @param height the height of the current on-screen OpenGL drawable
+ @param disableDepthTest whether to disable the depth test
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void beginRendering(int width, int height, boolean disableDepthTest)
+ throws GLException {
+ beginRendering(true, width, height, disableDepthTest);
+ }
+
+ /** Begins rendering of 2D text in 3D with this {@link TextRenderer
+ TextRenderer} into the current OpenGL drawable. Assumes the end
+ user is responsible for setting up the modelview and projection
+ matrices, and will render text using the {@link #draw3D draw3D}
+ method. This method pushes some OpenGL state bits, binds and
+ enables the internal OpenGL texture object, sets the texture
+ environment mode to GL_MODULATE, and changes the current color
+ to the last color set with this TextRenderer via {@link
+ #setColor setColor}.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void begin3DRendering() throws GLException {
+ beginRendering(false, 0, 0, false);
+ }
+
+ /** Changes the current color of this TextRenderer to the supplied
+ one. The default color is opaque white.
+
+ @param color the new color to use for rendering text
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void setColor(Color color) throws GLException {
+ boolean noNeedForFlush = (haveCachedColor && (cachedColor != null) &&
+ color.equals(cachedColor));
+
+ if (!noNeedForFlush) {
+ flushGlyphPipeline();
+ }
+
+ getBackingStore().setColor(color);
+ haveCachedColor = true;
+ cachedColor = color;
+ }
+
+ /** Changes the current color of this TextRenderer to the supplied
+ 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
+ premultiplied colors are used internally. The default color is
+ opaque white.
+
+ @param r the red component of the new color
+ @param g the green component of the new color
+ @param b the blue component of the new color
+ @param a the alpha component of the new color, 0.0f = completely
+ transparent, 1.0f = completely opaque
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void setColor(float r, float g, float b, float a)
+ throws GLException {
+ boolean noNeedForFlush = (haveCachedColor && (cachedColor == null) &&
+ (r == cachedR) && (g == cachedG) && (b == cachedB) &&
+ (a == cachedA));
+
+ if (!noNeedForFlush) {
+ flushGlyphPipeline();
+ }
+
+ getBackingStore().setColor(r, g, b, a);
+ haveCachedColor = true;
+ cachedR = r;
+ cachedG = g;
+ cachedB = b;
+ cachedA = a;
+ cachedColor = null;
+ }
+
+ /** Draws the supplied CharSequence at the desired location using
+ the renderer's current color. The baseline of the leftmost
+ character is at position (x, y) specified in OpenGL coordinates,
+ where the origin is at the lower-left of the drawable and the Y
+ coordinate increases in the upward direction.
+
+ @param str the string to draw
+ @param x the x coordinate at which to draw
+ @param y the y coordinate at which to draw
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void draw(CharSequence str, int x, int y) throws GLException {
+ draw3D(str, x, y, 0, 1);
+ }
+
+ /** Draws the supplied String at the desired location using the
+ renderer's current color. See {@link #draw(CharSequence, int,
+ int) draw(CharSequence, int, int)}. */
+ public void draw(String str, int x, int y) throws GLException {
+ draw3D(str, x, y, 0, 1);
+ }
+
+ /** Draws the supplied CharSequence at the desired 3D location using
+ the renderer's current color. The baseline of the leftmost
+ character is placed at position (x, y, z) in the current
+ coordinate system.
+
+ @param str the string to draw
+ @param x the x coordinate at which to draw
+ @param y the y coordinate at which to draw
+ @param z the z coordinate at which to draw
+ @param scaleFactor a uniform scale factor applied to the width and height of the drawn rectangle
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void draw3D(CharSequence str, float x, float y, float z,
+ float scaleFactor) {
+ internal_draw3D(str, x, y, z, scaleFactor);
+ }
+
+ /** Draws the supplied String at the desired 3D location using the
+ renderer's current color. See {@link #draw3D(CharSequence,
+ float, float, float, float) draw3D(CharSequence, float, float,
+ float, float)}. */
+ public void draw3D(String str, float x, float y, float z, float scaleFactor) {
+ internal_draw3D(str, x, y, z, scaleFactor);
+ }
+
+ /** Returns the pixel width of the given character. */
+ public float getCharWidth(char inChar) {
+ return mGlyphProducer.getGlyphPixelWidth(inChar);
+ }
+
+ /** Causes the TextRenderer to flush any internal caches it may be
+ maintaining and draw its rendering results to the screen. This
+ should be called after each call to draw() if you are setting
+ OpenGL state such as the modelview matrix between calls to
+ draw(). */
+ public void flush() {
+ flushGlyphPipeline();
+ }
+
+ /** Ends a render cycle with this {@link TextRenderer TextRenderer}.
+ Restores the projection and modelview matrices as well as
+ several OpenGL state bits. Should be paired with {@link
+ #beginRendering beginRendering}.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void endRendering() throws GLException {
+ endRendering(true);
+ }
+
+ /** Ends a 3D render cycle with this {@link TextRenderer TextRenderer}.
+ Restores several OpenGL state bits. Should be paired with {@link
+ #begin3DRendering begin3DRendering}.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void end3DRendering() throws GLException {
+ endRendering(false);
+ }
+
+ /** Disposes of all resources this TextRenderer is using. It is not
+ valid to use the TextRenderer after this method is called.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void dispose() throws GLException {
+ packer.dispose();
+ packer = null;
+ cachedBackingStore = null;
+ cachedGraphics = null;
+ cachedFontRenderContext = null;
+
+ if (dbgFrame != null) {
+ dbgFrame.dispose();
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static Rectangle2D preNormalize(Rectangle2D src) {
+ // Need to round to integer coordinates
+ // Also give ourselves a little slop around the reported
+ // bounds of glyphs because it looks like neither the visual
+ // nor the pixel bounds works perfectly well
+ int minX = (int) Math.floor(src.getMinX()) - 1;
+ int minY = (int) Math.floor(src.getMinY()) - 1;
+ int maxX = (int) Math.ceil(src.getMaxX()) + 1;
+ int maxY = (int) Math.ceil(src.getMaxY()) + 1;
+ return new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY);
+ }
+
+
+ private Rectangle2D normalize(Rectangle2D src) {
+ // Give ourselves a boundary around each entity on the backing
+ // store in order to prevent bleeding of nearby Strings due to
+ // the fact that we use linear filtering
+
+ // NOTE that this boundary is quite heuristic and is related
+ // to how far away in 3D we may view the text --
+ // heuristically, 1.5% of the font's height
+ int boundary = (int) Math.max(1, 0.015 * font.getSize());
+
+ return new Rectangle2D.Double((int) Math.floor(src.getMinX() - boundary),
+ (int) Math.floor(src.getMinY() - boundary),
+ (int) Math.ceil(src.getWidth() + 2 * boundary),
+ (int) Math.ceil(src.getHeight()) + 2 * boundary);
+ }
+
+ private TextureRenderer getBackingStore() {
+ TextureRenderer renderer = (TextureRenderer) packer.getBackingStore();
+
+ if (renderer != cachedBackingStore) {
+ // Backing store changed since last time; discard any cached Graphics2D
+ if (cachedGraphics != null) {
+ cachedGraphics.dispose();
+ cachedGraphics = null;
+ cachedFontRenderContext = null;
+ }
+
+ cachedBackingStore = renderer;
+ }
+
+ return cachedBackingStore;
+ }
+
+ private Graphics2D getGraphics2D() {
+ TextureRenderer renderer = getBackingStore();
+
+ if (cachedGraphics == null) {
+ cachedGraphics = renderer.createGraphics();
+
+ // Set up composite, font and rendering hints
+ cachedGraphics.setComposite(AlphaComposite.Src);
+ cachedGraphics.setColor(Color.WHITE);
+ cachedGraphics.setFont(font);
+ cachedGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+ (antialiased ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON
+ : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
+ cachedGraphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+ (useFractionalMetrics
+ ? RenderingHints.VALUE_FRACTIONALMETRICS_ON
+ : RenderingHints.VALUE_FRACTIONALMETRICS_OFF));
+ }
+
+ return cachedGraphics;
+ }
+
+ private void beginRendering(boolean ortho, int width, int height,
+ boolean disableDepthTestForOrtho) {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+
+ if (DEBUG && !debugged) {
+ debug(gl);
+ }
+
+ inBeginEndPair = true;
+ isOrthoMode = ortho;
+ beginRenderingWidth = width;
+ beginRenderingHeight = height;
+ beginRenderingDepthTestDisabled = disableDepthTestForOrtho;
+
+ if (ortho) {
+ getBackingStore().beginOrthoRendering(width, height,
+ disableDepthTestForOrtho);
+ } else {
+ getBackingStore().begin3DRendering();
+ }
+
+ // Push client attrib bits used by the pipelined quad renderer
+ gl.glPushClientAttrib((int) GL2.GL_ALL_CLIENT_ATTRIB_BITS);
+
+ if (!haveMaxSize) {
+ // Query OpenGL for the maximum texture size and set it in the
+ // RectanglePacker to keep it from expanding too large
+ int[] sz = new int[1];
+ gl.glGetIntegerv(GL2.GL_MAX_TEXTURE_SIZE, sz, 0);
+ packer.setMaxSize(sz[0], sz[0]);
+ haveMaxSize = true;
+ }
+
+ if (needToResetColor && haveCachedColor) {
+ if (cachedColor == null) {
+ getBackingStore().setColor(cachedR, cachedG, cachedB, cachedA);
+ } else {
+ getBackingStore().setColor(cachedColor);
+ }
+
+ needToResetColor = false;
+ }
+
+ // Disable future attempts to use mipmapping if TextureRenderer
+ // doesn't support it
+ if (mipmap && !getBackingStore().isUsingAutoMipmapGeneration()) {
+ if (DEBUG) {
+ System.err.println("Disabled mipmapping in TextRenderer");
+ }
+
+ mipmap = false;
+ }
+ }
+
+ /**
+ * emzic: here the call to glBindBuffer crashes on certain graphicscard/driver combinations
+ * this is why the ugly try-catch block has been added, which falls back to the old textrenderer
+ *
+ * @param ortho
+ * @throws GLException
+ */
+ private void endRendering(boolean ortho) throws GLException {
+ flushGlyphPipeline();
+
+ inBeginEndPair = false;
+
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+
+ // Pop client attrib bits used by the pipelined quad renderer
+ gl.glPopClientAttrib();
+
+ // The OpenGL spec is unclear about whether this changes the
+ // buffer bindings, so preemptively zero out the GL_ARRAY_BUFFER
+ // binding
+ if (is15Available(gl)) {
+ try {
+ gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
+ } catch (Exception e) {
+ isExtensionAvailable_GL_VERSION_1_5 = false;
+ }
+ }
+
+ if (ortho) {
+ getBackingStore().endOrthoRendering();
+ } else {
+ getBackingStore().end3DRendering();
+ }
+
+ if (++numRenderCycles >= CYCLES_PER_FLUSH) {
+ numRenderCycles = 0;
+
+ if (DEBUG) {
+ System.err.println("Clearing unused entries in endRendering()");
+ }
+
+ clearUnusedEntries();
+ }
+ }
+
+ private void clearUnusedEntries() {
+ final java.util.List deadRects = new ArrayList /*<Rect>*/();
+
+ // Iterate through the contents of the backing store, removing
+ // text strings that haven't been used recently
+ packer.visit(new RectVisitor() {
+ public void visit(Rect rect) {
+ TextData data = (TextData) rect.getUserData();
+
+ if (data.used()) {
+ data.clearUsed();
+ } else {
+ deadRects.add(rect);
+ }
+ }
+ });
+
+ for (Iterator iter = deadRects.iterator(); iter.hasNext();) {
+ Rect r = (Rect) iter.next();
+ packer.remove(r);
+ stringLocations.remove(((TextData) r.getUserData()).string());
+
+ int unicodeToClearFromCache = ((TextData) r.getUserData()).unicodeID;
+
+ if (unicodeToClearFromCache > 0) {
+ mGlyphProducer.clearCacheEntry(unicodeToClearFromCache);
+ }
+
+ // if (DEBUG) {
+ // Graphics2D g = getGraphics2D();
+ // g.setComposite(AlphaComposite.Clear);
+ // g.fillRect(r.x(), r.y(), r.w(), r.h());
+ // g.setComposite(AlphaComposite.Src);
+ // }
+ }
+
+ // If we removed dead rectangles this cycle, try to do a compaction
+ float frag = packer.verticalFragmentationRatio();
+
+ if (!deadRects.isEmpty() && (frag > MAX_VERTICAL_FRAGMENTATION)) {
+ if (DEBUG) {
+ System.err.println(
+ "Compacting TextRenderer backing store due to vertical fragmentation " +
+ frag);
+ }
+
+ packer.compact();
+ }
+
+ if (DEBUG) {
+ getBackingStore().markDirty(0, 0, getBackingStore().getWidth(),
+ getBackingStore().getHeight());
+ }
+ }
+
+ private void internal_draw3D(CharSequence str, float x, float y, float z,
+ float scaleFactor) {
+ List/*<Glyph>*/ glyphs = mGlyphProducer.getGlyphs(str);
+ for (Iterator iter = glyphs.iterator(); iter.hasNext(); ) {
+ Glyph glyph = (Glyph) iter.next();
+ float advance = glyph.draw3D(x, y, z, scaleFactor);
+ x += advance * scaleFactor;
+ }
+ }
+
+ private void flushGlyphPipeline() {
+ if (mPipelinedQuadRenderer != null) {
+ mPipelinedQuadRenderer.draw();
+ }
+ }
+
+ private void draw3D_ROBUST(CharSequence str, float x, float y, float z,
+ float scaleFactor) {
+ String curStr;
+ if (str instanceof String) {
+ curStr = (String) str;
+ } else {
+ curStr = str.toString();
+ }
+
+ // Look up the string on the backing store
+ Rect rect = (Rect) stringLocations.get(curStr);
+
+ if (rect == null) {
+ // Rasterize this string and place it on the backing store
+ Graphics2D g = getGraphics2D();
+ Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(curStr, font, getFontRenderContext()));
+ Rectangle2D bbox = normalize(origBBox);
+ Point origin = new Point((int) -bbox.getMinX(),
+ (int) -bbox.getMinY());
+ rect = new Rect(0, 0, (int) bbox.getWidth(),
+ (int) bbox.getHeight(),
+ new TextData(curStr, origin, origBBox, -1));
+
+ packer.add(rect);
+ stringLocations.put(curStr, rect);
+
+ // Re-fetch the Graphics2D in case the addition of the rectangle
+ // caused the old backing store to be thrown away
+ g = getGraphics2D();
+
+ // OK, should now have an (x, y) for this rectangle; rasterize
+ // the String
+ int strx = rect.x() + origin.x;
+ int stry = rect.y() + origin.y;
+
+ // Clear out the area we're going to draw into
+ g.setComposite(AlphaComposite.Clear);
+ g.fillRect(rect.x(), rect.y(), rect.w(), rect.h());
+ g.setComposite(AlphaComposite.Src);
+
+ // Draw the string
+ renderDelegate.draw(g, curStr, strx, stry);
+
+ if (DRAW_BBOXES) {
+ TextData data = (TextData) rect.getUserData();
+ // Draw a bounding box on the backing store
+ g.drawRect(strx - data.origOriginX(),
+ stry - data.origOriginY(),
+ (int) data.origRect().getWidth(),
+ (int) data.origRect().getHeight());
+ g.drawRect(strx - data.origin().x,
+ stry - data.origin().y,
+ rect.w(),
+ rect.h());
+ }
+
+ // Mark this region of the TextureRenderer as dirty
+ getBackingStore().markDirty(rect.x(), rect.y(), rect.w(),
+ rect.h());
+ }
+
+ // OK, now draw the portion of the backing store to the screen
+ TextureRenderer renderer = getBackingStore();
+
+ // NOTE that the rectangles managed by the packer have their
+ // origin at the upper-left but the TextureRenderer's origin is
+ // at its lower left!!!
+ TextData data = (TextData) rect.getUserData();
+ data.markUsed();
+
+ Rectangle2D origRect = data.origRect();
+
+ // Align the leftmost point of the baseline to the (x, y, z) coordinate requested
+ renderer.draw3DRect(x - (scaleFactor * data.origOriginX()),
+ y - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY())), z,
+ rect.x() + (data.origin().x - data.origOriginX()),
+ renderer.getHeight() - rect.y() - (int) origRect.getHeight() -
+ (data.origin().y - data.origOriginY()),
+ (int) origRect.getWidth(), (int) origRect.getHeight(), scaleFactor);
+ }
+
+ //----------------------------------------------------------------------
+ // Debugging functionality
+ //
+ private void debug(GL gl) {
+ dbgFrame = new Frame("TextRenderer Debug Output");
+
+ GLCanvas dbgCanvas = new GLCanvas(new GLCapabilities(gl.getGLProfile()), null,
+ GLContext.getCurrent(), null);
+ dbgCanvas.addGLEventListener(new DebugListener(gl, dbgFrame));
+ dbgFrame.add(dbgCanvas);
+
+ final FPSAnimator anim = new FPSAnimator(dbgCanvas, 10);
+ dbgFrame.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ // Run this on another thread than the AWT event queue to
+ // make sure the call to Animator.stop() completes before
+ // exiting
+ new Thread(new Runnable() {
+ public void run() {
+ anim.stop();
+ }
+ }).start();
+ }
+ });
+ dbgFrame.setSize(kSize, kSize);
+ dbgFrame.setVisible(true);
+ anim.start();
+ debugged = true;
+ }
+
+ /** Class supporting more full control over the process of rendering
+ the bitmapped text. Allows customization of whether the backing
+ store text bitmap is full-color or intensity only, the size of
+ each individual rendered text rectangle, and the contents of
+ each individual rendered text string. The default implementation
+ of this interface uses an intensity-only texture, a
+ closely-cropped rectangle around the text, and renders text
+ using the color white, which is modulated by the set color
+ during the rendering process. */
+ public static interface RenderDelegate {
+ /** Indicates whether the backing store of this TextRenderer
+ should be intensity-only (the default) or full-color. */
+ public boolean intensityOnly();
+
+ /** Computes the bounds of the given String relative to the
+ origin. */
+ public Rectangle2D getBounds(String str, Font font,
+ FontRenderContext frc);
+
+ /** Computes the bounds of the given character sequence relative
+ to the origin. */
+ public Rectangle2D getBounds(CharSequence str, Font font,
+ FontRenderContext frc);
+
+ /** Computes the bounds of the given GlyphVector, already
+ assumed to have been created for a particular Font,
+ relative to the origin. */
+ public Rectangle2D getBounds(GlyphVector gv, FontRenderContext frc);
+
+ /** Render the passed character sequence at the designated
+ location using the supplied Graphics2D instance. The
+ surrounding region will already have been cleared to the RGB
+ color (0, 0, 0) with zero alpha. The initial drawing context
+ of the passed Graphics2D will be set to use
+ AlphaComposite.Src, the color white, the Font specified in the
+ TextRenderer's constructor, and the rendering hints specified
+ in the TextRenderer constructor. Changes made by the end user
+ may be visible in successive calls to this method, but are not
+ guaranteed to be preserved. Implementors of this method
+ should reset the Graphics2D's state to that desired each time
+ this method is called, in particular those states which are
+ not the defaults. */
+ public void draw(Graphics2D graphics, String str, int x, int y);
+
+ /** Render the passed GlyphVector at the designated location using
+ the supplied Graphics2D instance. The surrounding region will
+ already have been cleared to the RGB color (0, 0, 0) with zero
+ alpha. The initial drawing context of the passed Graphics2D
+ will be set to use AlphaComposite.Src, the color white, the
+ Font specified in the TextRenderer's constructor, and the
+ rendering hints specified in the TextRenderer constructor.
+ Changes made by the end user may be visible in successive
+ calls to this method, but are not guaranteed to be preserved.
+ Implementors of this method should reset the Graphics2D's
+ state to that desired each time this method is called, in
+ particular those states which are not the defaults. */
+ public void drawGlyphVector(Graphics2D graphics, GlyphVector str,
+ int x, int y);
+ }
+
+ private static class CharSequenceIterator implements CharacterIterator {
+ CharSequence mSequence;
+ int mLength;
+ int mCurrentIndex;
+
+ CharSequenceIterator() {
+ }
+
+ CharSequenceIterator(CharSequence sequence) {
+ initFromCharSequence(sequence);
+ }
+
+ public void initFromCharSequence(CharSequence sequence) {
+ mSequence = sequence;
+ mLength = mSequence.length();
+ mCurrentIndex = 0;
+ }
+
+ public char last() {
+ mCurrentIndex = Math.max(0, mLength - 1);
+
+ return current();
+ }
+
+ public char current() {
+ if ((mLength == 0) || (mCurrentIndex >= mLength)) {
+ return CharacterIterator.DONE;
+ }
+
+ return mSequence.charAt(mCurrentIndex);
+ }
+
+ public char next() {
+ mCurrentIndex++;
+
+ return current();
+ }
+
+ public char previous() {
+ mCurrentIndex = Math.max(mCurrentIndex - 1, 0);
+
+ return current();
+ }
+
+ public char setIndex(int position) {
+ mCurrentIndex = position;
+
+ return current();
+ }
+
+ public int getBeginIndex() {
+ return 0;
+ }
+
+ public int getEndIndex() {
+ return mLength;
+ }
+
+ public int getIndex() {
+ return mCurrentIndex;
+ }
+
+ public Object clone() {
+ CharSequenceIterator iter = new CharSequenceIterator(mSequence);
+ iter.mCurrentIndex = mCurrentIndex;
+
+ return iter;
+ }
+
+ public char first() {
+ if (mLength == 0) {
+ return CharacterIterator.DONE;
+ }
+
+ mCurrentIndex = 0;
+
+ return current();
+ }
+ }
+
+ // Data associated with each rectangle of text
+ static class TextData {
+ // Back-pointer to String this TextData describes, if it
+ // represents a String rather than a single glyph
+ private String str;
+
+ // If this TextData represents a single glyph, this is its
+ // unicode ID
+ int unicodeID;
+
+ // The following must be defined and used VERY precisely. This is
+ // the offset from the upper-left corner of this rectangle (Java
+ // 2D coordinate system) at which the string must be rasterized in
+ // order to fit within the rectangle -- the leftmost point of the
+ // baseline.
+ private Point origin;
+
+ // This represents the pre-normalized rectangle, which fits
+ // within the rectangle on the backing store. We keep a
+ // one-pixel border around entries on the backing store to
+ // prevent bleeding of adjacent letters when using GL_LINEAR
+ // filtering for rendering. The origin of this rectangle is
+ // equivalent to the origin above.
+ private Rectangle2D origRect;
+
+ private boolean used; // Whether this text was used recently
+
+ TextData(String str, Point origin, Rectangle2D origRect, int unicodeID) {
+ this.str = str;
+ this.origin = origin;
+ this.origRect = origRect;
+ this.unicodeID = unicodeID;
+ }
+
+ String string() {
+ return str;
+ }
+
+ Point origin() {
+ return origin;
+ }
+
+ // The following three methods are used to locate the glyph
+ // within the expanded rectangle coming from normalize()
+ int origOriginX() {
+ return (int) -origRect.getMinX();
+ }
+
+ int origOriginY() {
+ return (int) -origRect.getMinY();
+ }
+
+ Rectangle2D origRect() {
+ return origRect;
+ }
+
+ boolean used() {
+ return used;
+ }
+
+ void markUsed() {
+ used = true;
+ }
+
+ void clearUsed() {
+ used = false;
+ }
+ }
+
+ class Manager implements BackingStoreManager {
+ private Graphics2D g;
+
+ public Object allocateBackingStore(int w, int h) {
+ // FIXME: should consider checking Font's attributes to see
+ // whether we're likely to need to support a full RGBA backing
+ // store (i.e., non-default Paint, foreground color, etc.), but
+ // for now, let's just be more efficient
+ TextureRenderer renderer;
+
+ if (renderDelegate.intensityOnly()) {
+ renderer = TextureRenderer.createAlphaOnlyRenderer(w, h, mipmap);
+ } else {
+ renderer = new TextureRenderer(w, h, true, mipmap);
+ }
+ renderer.setSmoothing(smoothing);
+
+ if (DEBUG) {
+ System.err.println(" TextRenderer allocating backing store " +
+ w + " x " + h);
+ }
+
+ return renderer;
+ }
+
+ public void deleteBackingStore(Object backingStore) {
+ ((TextureRenderer) backingStore).dispose();
+ }
+
+ public boolean preExpand(Rect cause, int attemptNumber) {
+ // Only try this one time; clear out potentially obsolete entries
+ // NOTE: this heuristic and the fact that it clears the used bit
+ // of all entries seems to cause cycling of entries in some
+ // situations, where the backing store becomes small compared to
+ // the amount of text on the screen (see the TextFlow demo) and
+ // the entries continually cycle in and out of the backing
+ // store, decreasing performance. If we added a little age
+ // information to the entries, and only cleared out entries
+ // above a certain age, this behavior would be eliminated.
+ // However, it seems the system usually stabilizes itself, so
+ // for now we'll just keep things simple. Note that if we don't
+ // clear the used bit here, the backing store tends to increase
+ // very quickly to its maximum size, at least with the TextFlow
+ // demo when the text is being continually re-laid out.
+ if (attemptNumber == 0) {
+ if (DEBUG) {
+ System.err.println(
+ "Clearing unused entries in preExpand(): attempt number " +
+ attemptNumber);
+ }
+
+ if (inBeginEndPair) {
+ // Draw any outstanding glyphs
+ flush();
+ }
+
+ clearUnusedEntries();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean additionFailed(Rect cause, int attemptNumber) {
+ // Heavy hammer -- might consider doing something different
+ packer.clear();
+ stringLocations.clear();
+ mGlyphProducer.clearAllCacheEntries();
+
+ if (DEBUG) {
+ System.err.println(
+ " *** Cleared all text because addition failed ***");
+ }
+
+ if (attemptNumber == 0) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public boolean canCompact() {
+ return true;
+ }
+
+ public void beginMovement(Object oldBackingStore, Object newBackingStore) {
+ // Exit the begin / end pair if necessary
+ if (inBeginEndPair) {
+ // Draw any outstanding glyphs
+ flush();
+
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+
+ // Pop client attrib bits used by the pipelined quad renderer
+ gl.glPopClientAttrib();
+
+ // The OpenGL spec is unclear about whether this changes the
+ // buffer bindings, so preemptively zero out the GL_ARRAY_BUFFER
+ // binding
+ if (is15Available(gl)) {
+ try {
+ gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
+ } catch (Exception e) {
+ isExtensionAvailable_GL_VERSION_1_5 = false;
+ }
+ }
+
+ if (isOrthoMode) {
+ ((TextureRenderer) oldBackingStore).endOrthoRendering();
+ } else {
+ ((TextureRenderer) oldBackingStore).end3DRendering();
+ }
+ }
+
+ TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+ g = newRenderer.createGraphics();
+ }
+
+ public void move(Object oldBackingStore, Rect oldLocation,
+ Object newBackingStore, Rect newLocation) {
+ TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore;
+ TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+
+ if (oldRenderer == newRenderer) {
+ // Movement on the same backing store -- easy case
+ g.copyArea(oldLocation.x(), oldLocation.y(), oldLocation.w(),
+ oldLocation.h(), newLocation.x() - oldLocation.x(),
+ newLocation.y() - oldLocation.y());
+ } else {
+ // Need to draw from the old renderer's image into the new one
+ Image img = oldRenderer.getImage();
+ g.drawImage(img, newLocation.x(), newLocation.y(),
+ newLocation.x() + newLocation.w(),
+ newLocation.y() + newLocation.h(), oldLocation.x(),
+ oldLocation.y(), oldLocation.x() + oldLocation.w(),
+ oldLocation.y() + oldLocation.h(), null);
+ }
+ }
+
+ public void endMovement(Object oldBackingStore, Object newBackingStore) {
+ g.dispose();
+
+ // Sync the whole surface
+ TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+ newRenderer.markDirty(0, 0, newRenderer.getWidth(),
+ newRenderer.getHeight());
+
+ // Re-enter the begin / end pair if necessary
+ if (inBeginEndPair) {
+ if (isOrthoMode) {
+ ((TextureRenderer) newBackingStore).beginOrthoRendering(beginRenderingWidth,
+ beginRenderingHeight, beginRenderingDepthTestDisabled);
+ } else {
+ ((TextureRenderer) newBackingStore).begin3DRendering();
+ }
+
+ // Push client attrib bits used by the pipelined quad renderer
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ gl.glPushClientAttrib((int) GL2.GL_ALL_CLIENT_ATTRIB_BITS);
+
+ if (haveCachedColor) {
+ if (cachedColor == null) {
+ ((TextureRenderer) newBackingStore).setColor(cachedR,
+ cachedG, cachedB, cachedA);
+ } else {
+ ((TextureRenderer) newBackingStore).setColor(cachedColor);
+ }
+ }
+ } else {
+ needToResetColor = true;
+ }
+ }
+ }
+
+ public static class DefaultRenderDelegate implements RenderDelegate {
+ public boolean intensityOnly() {
+ return true;
+ }
+
+ public Rectangle2D getBounds(CharSequence str, Font font,
+ FontRenderContext frc) {
+ return getBounds(font.createGlyphVector(frc,
+ new CharSequenceIterator(str)),
+ frc);
+ }
+
+ public Rectangle2D getBounds(String str, Font font,
+ FontRenderContext frc) {
+ return getBounds(font.createGlyphVector(frc, str), frc);
+ }
+
+ public Rectangle2D getBounds(GlyphVector gv, FontRenderContext frc) {
+ return gv.getVisualBounds();
+ }
+
+ public void drawGlyphVector(Graphics2D graphics, GlyphVector str,
+ int x, int y) {
+ graphics.drawGlyphVector(str, x, y);
+ }
+
+ public void draw(Graphics2D graphics, String str, int x, int y) {
+ graphics.drawString(str, x, y);
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Glyph-by-glyph rendering support
+ //
+
+ // A temporary to prevent excessive garbage creation
+ private char[] singleUnicode = new char[1];
+
+ /** A Glyph represents either a single unicode glyph or a
+ substring of characters to be drawn. The reason for the dual
+ behavior is so that we can take in a sequence of unicode
+ characters and partition them into runs of individual glyphs,
+ but if we encounter complex text and/or unicode sequences we
+ don't understand, we can render them using the
+ string-by-string method. <P>
+
+ Glyphs need to be able to re-upload themselves to the backing
+ store on demand as we go along in the render sequence.
+ */
+
+ class Glyph {
+ // If this Glyph represents an individual unicode glyph, this
+ // is its unicode ID. If it represents a String, this is -1.
+ private int unicodeID;
+ // If the above field isn't -1, then these fields are used.
+ // The glyph code in the font
+ private int glyphCode;
+ // The GlyphProducer which created us
+ private GlyphProducer producer;
+ // The advance of this glyph
+ private float advance;
+ // The GlyphVector for this single character; this is passed
+ // in during construction but cleared during the upload
+ // process
+ private GlyphVector singleUnicodeGlyphVector;
+ // The rectangle of this glyph on the backing store, or null
+ // if it has been cleared due to space pressure
+ private Rect glyphRectForTextureMapping;
+ // If this Glyph represents a String, this is the sequence of
+ // characters
+ private String str;
+ // Whether we need a valid advance when rendering this string
+ // (i.e., whether it has other single glyphs coming after it)
+ private boolean needAdvance;
+
+ // Creates a Glyph representing an individual Unicode character
+ public Glyph(int unicodeID,
+ int glyphCode,
+ float advance,
+ GlyphVector singleUnicodeGlyphVector,
+ GlyphProducer producer) {
+ this.unicodeID = unicodeID;
+ this.glyphCode = glyphCode;
+ this.advance = advance;
+ this.singleUnicodeGlyphVector = singleUnicodeGlyphVector;
+ this.producer = producer;
+ }
+
+ // Creates a Glyph representing a sequence of characters, with
+ // an indication of whether additional single glyphs are being
+ // rendered after it
+ public Glyph(String str, boolean needAdvance) {
+ this.str = str;
+ this.needAdvance = needAdvance;
+ }
+
+ /** Returns this glyph's unicode ID */
+ public int getUnicodeID() {
+ return unicodeID;
+ }
+
+ /** Returns this glyph's (font-specific) glyph code */
+ public int getGlyphCode() {
+ return glyphCode;
+ }
+
+ /** Returns the advance for this glyph */
+ public float getAdvance() {
+ return advance;
+ }
+
+ /** Draws this glyph and returns the (x) advance for this glyph */
+ public float draw3D(float inX, float inY, float z, float scaleFactor) {
+ if (str != null) {
+ draw3D_ROBUST(str, inX, inY, z, scaleFactor);
+ if (!needAdvance) {
+ return 0;
+ }
+ // Compute and return the advance for this string
+ GlyphVector gv = font.createGlyphVector(getFontRenderContext(), str);
+ float totalAdvance = 0;
+ for (int i = 0; i < gv.getNumGlyphs(); i++) {
+ totalAdvance += gv.getGlyphMetrics(i).getAdvance();
+ }
+ return totalAdvance;
+ }
+
+ // This is the code path taken for individual glyphs
+ if (glyphRectForTextureMapping == null) {
+ upload();
+ }
+
+ try {
+ if (mPipelinedQuadRenderer == null) {
+ mPipelinedQuadRenderer = new Pipelined_QuadRenderer();
+ }
+
+ TextureRenderer renderer = getBackingStore();
+ // Handles case where NPOT texture is used for backing store
+ TextureCoords wholeImageTexCoords = renderer.getTexture().getImageTexCoords();
+ float xScale = wholeImageTexCoords.right();
+ float yScale = wholeImageTexCoords.bottom();
+
+ Rect rect = glyphRectForTextureMapping;
+ TextData data = (TextData) rect.getUserData();
+ data.markUsed();
+
+ Rectangle2D origRect = data.origRect();
+
+ float x = inX - (scaleFactor * data.origOriginX());
+ float y = inY - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY()));
+
+ int texturex = rect.x() + (data.origin().x - data.origOriginX());
+ int texturey = renderer.getHeight() - rect.y() - (int) origRect.getHeight() -
+ (data.origin().y - data.origOriginY());
+ int width = (int) origRect.getWidth();
+ int height = (int) origRect.getHeight();
+
+ float tx1 = xScale * (float) texturex / (float) renderer.getWidth();
+ float ty1 = yScale * (1.0f -
+ ((float) texturey / (float) renderer.getHeight()));
+ float tx2 = xScale * (float) (texturex + width) / (float) renderer.getWidth();
+ float ty2 = yScale * (1.0f -
+ ((float) (texturey + height) / (float) renderer.getHeight()));
+
+ mPipelinedQuadRenderer.glTexCoord2f(tx1, ty1);
+ mPipelinedQuadRenderer.glVertex3f(x, y, z);
+ mPipelinedQuadRenderer.glTexCoord2f(tx2, ty1);
+ mPipelinedQuadRenderer.glVertex3f(x + (width * scaleFactor), y,
+ z);
+ mPipelinedQuadRenderer.glTexCoord2f(tx2, ty2);
+ mPipelinedQuadRenderer.glVertex3f(x + (width * scaleFactor),
+ y + (height * scaleFactor), z);
+ mPipelinedQuadRenderer.glTexCoord2f(tx1, ty2);
+ mPipelinedQuadRenderer.glVertex3f(x,
+ y + (height * scaleFactor), z);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return advance;
+ }
+
+ /** Notifies this glyph that it's been cleared out of the cache */
+ public void clear() {
+ glyphRectForTextureMapping = null;
+ }
+
+ private void upload() {
+ GlyphVector gv = getGlyphVector();
+ Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(gv, getFontRenderContext()));
+ Rectangle2D bbox = normalize(origBBox);
+ Point origin = new Point((int) -bbox.getMinX(),
+ (int) -bbox.getMinY());
+ Rect rect = new Rect(0, 0, (int) bbox.getWidth(),
+ (int) bbox.getHeight(),
+ new TextData(null, origin, origBBox, unicodeID));
+ packer.add(rect);
+ glyphRectForTextureMapping = rect;
+ Graphics2D g = getGraphics2D();
+ // OK, should now have an (x, y) for this rectangle; rasterize
+ // the glyph
+ int strx = rect.x() + origin.x;
+ int stry = rect.y() + origin.y;
+
+ // Clear out the area we're going to draw into
+ g.setComposite(AlphaComposite.Clear);
+ g.fillRect(rect.x(), rect.y(), rect.w(), rect.h());
+ g.setComposite(AlphaComposite.Src);
+
+ // Draw the string
+ renderDelegate.drawGlyphVector(g, gv, strx, stry);
+
+ if (DRAW_BBOXES) {
+ TextData data = (TextData) rect.getUserData();
+ // Draw a bounding box on the backing store
+ g.drawRect(strx - data.origOriginX(),
+ stry - data.origOriginY(),
+ (int) data.origRect().getWidth(),
+ (int) data.origRect().getHeight());
+ g.drawRect(strx - data.origin().x,
+ stry - data.origin().y,
+ rect.w(),
+ rect.h());
+ }
+
+ // Mark this region of the TextureRenderer as dirty
+ getBackingStore().markDirty(rect.x(), rect.y(), rect.w(),
+ rect.h());
+ // Re-register ourselves with our producer
+ producer.register(this);
+ }
+
+ private GlyphVector getGlyphVector() {
+ GlyphVector gv = singleUnicodeGlyphVector;
+ if (gv != null) {
+ singleUnicodeGlyphVector = null; // Don't need this anymore
+ return gv;
+ }
+ singleUnicode[0] = (char) unicodeID;
+ return font.createGlyphVector(getFontRenderContext(), singleUnicode);
+ }
+ }
+
+ class GlyphProducer {
+ final int undefined = -2;
+ FontRenderContext fontRenderContext;
+ List/*<Glyph>*/ glyphsOutput = new ArrayList/*<Glyph>*/();
+ // The mapping from unicode character to font-specific glyph ID
+ int[] unicodes2Glyphs;
+ // The mapping from glyph ID to Glyph
+ Glyph[] glyphCache;
+ // We re-use this for each incoming string
+ CharSequenceIterator iter = new CharSequenceIterator();
+
+ GlyphProducer(int fontLengthInGlyphs) {
+ unicodes2Glyphs = new int[512];
+ glyphCache = new Glyph[fontLengthInGlyphs];
+ clearAllCacheEntries();
+ }
+
+ public List/*<Glyph>*/ getGlyphs(CharSequence inString) {
+ glyphsOutput.clear();
+ iter.initFromCharSequence(inString);
+ GlyphVector fullRunGlyphVector = font.createGlyphVector(getFontRenderContext(),
+ iter);
+ boolean complex = (fullRunGlyphVector.getLayoutFlags() != 0);
+ if (complex || DISABLE_GLYPH_CACHE) {
+ // Punt to the robust version of the renderer
+ glyphsOutput.add(new Glyph(inString.toString(), false));
+ return glyphsOutput;
+ }
+
+ int lengthInGlyphs = fullRunGlyphVector.getNumGlyphs();
+ int i = 0;
+ while (i < lengthInGlyphs) {
+ Glyph glyph = getGlyph(inString, fullRunGlyphVector, i);
+ if (glyph != null) {
+ glyphsOutput.add(glyph);
+ i++;
+ } else {
+ // Assemble a run of characters that don't fit in
+ // the cache
+ StringBuffer buf = new StringBuffer();
+ while (i < lengthInGlyphs &&
+ getGlyph(inString, fullRunGlyphVector, i) == null) {
+ buf.append(inString.charAt(i++));
+ }
+ glyphsOutput.add(new Glyph(buf.toString(),
+ // Any more glyphs after this run?
+ i < lengthInGlyphs));
+ }
+ }
+ return glyphsOutput;
+ }
+
+ public void clearCacheEntry(int unicodeID) {
+ int glyphID = unicodes2Glyphs[unicodeID];
+ if (glyphID != undefined) {
+ Glyph glyph = glyphCache[glyphID];
+ if (glyph != null) {
+ glyph.clear();
+ }
+ glyphCache[glyphID] = null;
+ }
+ unicodes2Glyphs[unicodeID] = undefined;
+ }
+
+ public void clearAllCacheEntries() {
+ for (int i = 0; i < unicodes2Glyphs.length; i++) {
+ clearCacheEntry(i);
+ }
+ }
+
+ public void register(Glyph glyph) {
+ unicodes2Glyphs[glyph.getUnicodeID()] = glyph.getGlyphCode();
+ glyphCache[glyph.getGlyphCode()] = glyph;
+ }
+
+ public float getGlyphPixelWidth(char unicodeID) {
+ Glyph glyph = getGlyph(unicodeID);
+ if (glyph != null) {
+ return glyph.getAdvance();
+ }
+
+ // Have to do this the hard / uncached way
+ singleUnicode[0] = unicodeID;
+ GlyphVector gv = font.createGlyphVector(fontRenderContext,
+ singleUnicode);
+ return gv.getGlyphMetrics(0).getAdvance();
+ }
+
+ // Returns a glyph object for this single glyph. Returns null
+ // if the unicode or glyph ID would be out of bounds of the
+ // glyph cache.
+ private Glyph getGlyph(CharSequence inString,
+ GlyphVector fullRunGlyphVector,
+ int index) {
+ char unicodeID = inString.charAt(index);
+
+ if (unicodeID >= unicodes2Glyphs.length) {
+ return null;
+ }
+
+ int glyphID = unicodes2Glyphs[unicodeID];
+ if (glyphID != undefined) {
+ return glyphCache[glyphID];
+ }
+
+ // Must fabricate the glyph
+ singleUnicode[0] = unicodeID;
+ GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
+ return getGlyph(unicodeID, gv, fullRunGlyphVector.getGlyphMetrics(index));
+ }
+
+ // It's unclear whether this variant might produce less
+ // optimal results than if we can see the entire GlyphVector
+ // for the incoming string
+ private Glyph getGlyph(int unicodeID) {
+ if (unicodeID >= unicodes2Glyphs.length) {
+ return null;
+ }
+
+ int glyphID = unicodes2Glyphs[unicodeID];
+ if (glyphID != undefined) {
+ return glyphCache[glyphID];
+ }
+ singleUnicode[0] = (char) unicodeID;
+ GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
+ return getGlyph(unicodeID, gv, gv.getGlyphMetrics(0));
+ }
+
+ private Glyph getGlyph(int unicodeID,
+ GlyphVector singleUnicodeGlyphVector,
+ GlyphMetrics metrics) {
+ int glyphCode = singleUnicodeGlyphVector.getGlyphCode(0);
+ // Have seen huge glyph codes (65536) coming out of some fonts in some Unicode situations
+ if (glyphCode >= glyphCache.length) {
+ return null;
+ }
+ Glyph glyph = new Glyph(unicodeID,
+ glyphCode,
+ metrics.getAdvance(),
+ singleUnicodeGlyphVector,
+ this);
+ register(glyph);
+ return glyph;
+ }
+ }
+
+ class Pipelined_QuadRenderer {
+ int mOutstandingGlyphsVerticesPipeline = 0;
+ FloatBuffer mTexCoords;
+ FloatBuffer mVertCoords;
+ boolean usingVBOs;
+ int mVBO_For_ResuableTileVertices;
+ int mVBO_For_ResuableTileTexCoords;
+
+ Pipelined_QuadRenderer() {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ mVertCoords = BufferUtil.newFloatBuffer(kTotalBufferSizeCoordsVerts);
+ mTexCoords = BufferUtil.newFloatBuffer(kTotalBufferSizeCoordsTex);
+
+ usingVBOs = is15Available(gl);
+
+ if (usingVBOs) {
+ try {
+ int[] vbos = new int[2];
+ gl.glGenBuffers(2, IntBuffer.wrap(vbos));
+
+ mVBO_For_ResuableTileVertices = vbos[0];
+ mVBO_For_ResuableTileTexCoords = vbos[1];
+
+ gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ mVBO_For_ResuableTileVertices);
+ gl.glBufferData(GL2.GL_ARRAY_BUFFER, kTotalBufferSizeBytesVerts,
+ null, GL2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
+
+ gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ mVBO_For_ResuableTileTexCoords);
+ gl.glBufferData(GL2.GL_ARRAY_BUFFER, kTotalBufferSizeBytesTex,
+ null, GL2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
+ } catch (Exception e) {
+ isExtensionAvailable_GL_VERSION_1_5 = false;
+ usingVBOs = false;
+ }
+ }
+ }
+
+ public void glTexCoord2f(float v, float v1) {
+ mTexCoords.put(v);
+ mTexCoords.put(v1);
+ }
+
+ public void glVertex3f(float inX, float inY, float inZ) {
+ mVertCoords.put(inX);
+ mVertCoords.put(inY);
+ mVertCoords.put(inZ);
+
+ mOutstandingGlyphsVerticesPipeline++;
+
+ if (mOutstandingGlyphsVerticesPipeline >= kTotalBufferSizeVerts) {
+ this.draw();
+ }
+ }
+
+ private void draw() {
+ if (useVertexArrays) {
+ drawVertexArrays();
+ } else {
+ drawIMMEDIATE();
+ }
+ }
+
+ private void drawVertexArrays() {
+ if (mOutstandingGlyphsVerticesPipeline > 0) {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+
+ TextureRenderer renderer = getBackingStore();
+ Texture texture = renderer.getTexture(); // triggers texture uploads. Maybe this should be more obvious?
+
+ mVertCoords.rewind();
+ mTexCoords.rewind();
+
+ gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
+
+ if (usingVBOs) {
+ gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ mVBO_For_ResuableTileVertices);
+ gl.glBufferSubData(GL2.GL_ARRAY_BUFFER, 0,
+ mOutstandingGlyphsVerticesPipeline * kSizeInBytes_OneVertices_VertexData,
+ mVertCoords); // upload only the new stuff
+ gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
+ } else {
+ gl.glVertexPointer(3, GL2.GL_FLOAT, 0, mVertCoords);
+ }
+
+ gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
+
+ if (usingVBOs) {
+ gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+ mVBO_For_ResuableTileTexCoords);
+ gl.glBufferSubData(GL2.GL_ARRAY_BUFFER, 0,
+ mOutstandingGlyphsVerticesPipeline * kSizeInBytes_OneVertices_TexData,
+ mTexCoords); // upload only the new stuff
+ gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, 0);
+ } else {
+ gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, mTexCoords);
+ }
+
+ gl.glDrawArrays(GL2.GL_QUADS, 0,
+ mOutstandingGlyphsVerticesPipeline);
+
+ mVertCoords.rewind();
+ mTexCoords.rewind();
+ mOutstandingGlyphsVerticesPipeline = 0;
+ }
+ }
+
+ private void drawIMMEDIATE() {
+ if (mOutstandingGlyphsVerticesPipeline > 0) {
+ TextureRenderer renderer = getBackingStore();
+ Texture texture = renderer.getTexture(); // triggers texture uploads. Maybe this should be more obvious?
+
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ gl.glBegin(GL2.GL_QUADS);
+
+ try {
+ int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
+ mVertCoords.rewind();
+ mTexCoords.rewind();
+
+ for (int i = 0; i < numberOfQuads; i++) {
+ gl.glTexCoord2f(mTexCoords.get(), mTexCoords.get());
+ gl.glVertex3f(mVertCoords.get(), mVertCoords.get(),
+ mVertCoords.get());
+
+ gl.glTexCoord2f(mTexCoords.get(), mTexCoords.get());
+ gl.glVertex3f(mVertCoords.get(), mVertCoords.get(),
+ mVertCoords.get());
+
+ gl.glTexCoord2f(mTexCoords.get(), mTexCoords.get());
+ gl.glVertex3f(mVertCoords.get(), mVertCoords.get(),
+ mVertCoords.get());
+
+ gl.glTexCoord2f(mTexCoords.get(), mTexCoords.get());
+ gl.glVertex3f(mVertCoords.get(), mVertCoords.get(),
+ mVertCoords.get());
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ gl.glEnd();
+ mVertCoords.rewind();
+ mTexCoords.rewind();
+ mOutstandingGlyphsVerticesPipeline = 0;
+ }
+ }
+ }
+ }
+
+ class DebugListener implements GLEventListener {
+ private GLU glu;
+ private Frame frame;
+
+ DebugListener(GL gl, Frame frame) {
+ this.glu = GLU.createGLU(gl);
+ this.frame = frame;
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ gl.glClear(GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_COLOR_BUFFER_BIT);
+
+ if (packer == null) {
+ return;
+ }
+
+ TextureRenderer rend = getBackingStore();
+ final int w = rend.getWidth();
+ final int h = rend.getHeight();
+ rend.beginOrthoRendering(w, h);
+ rend.drawOrthoRect(0, 0);
+ rend.endOrthoRendering();
+
+ if ((frame.getWidth() != w) || (frame.getHeight() != h)) {
+ EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ frame.setSize(w, h);
+ }
+ });
+ }
+ }
+
+ public void dispose(GLAutoDrawable drawable) {
+ glu.destroy();
+ glu=null;
+ frame=null;
+ }
+
+ // Unused methods
+ public void init(GLAutoDrawable drawable) {
+ }
+
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width,
+ int height) {
+ }
+
+ public void displayChanged(GLAutoDrawable drawable,
+ boolean modeChanged, boolean deviceChanged) {
+ }
+ }
+
+ /**
+ * Sets whether vertex arrays are being used internally for
+ * rendering, or whether text is rendered using the OpenGL
+ * immediate mode commands. This is provided as a concession for
+ * certain graphics cards which have poor vertex array
+ * performance. Defaults to true.
+ */
+ public void setUseVertexArrays(boolean useVertexArrays) {
+ this.useVertexArrays = useVertexArrays;
+ }
+
+ /**
+ * Indicates whether vertex arrays are being used internally for
+ * rendering, or whether text is rendered using the OpenGL
+ * immediate mode commands. Defaults to true.
+ */
+ public boolean getUseVertexArrays() {
+ return useVertexArrays;
+ }
+
+ /**
+ * Sets whether smoothing (i.e., GL_LINEAR filtering) is enabled
+ * in the backing TextureRenderer of this TextRenderer. A few
+ * graphics cards do not behave well when this is enabled,
+ * resulting in fuzzy text. Defaults to true.
+ */
+ public void setSmoothing(boolean smoothing) {
+ this.smoothing = smoothing;
+ getBackingStore().setSmoothing(smoothing);
+ }
+
+ /**
+ * Indicates whether smoothing is enabled in the backing
+ * TextureRenderer of this TextRenderer. A few graphics cards do
+ * not behave well when this is enabled, resulting in fuzzy text.
+ * Defaults to true.
+ */
+ public boolean getSmoothing() {
+ return smoothing;
+ }
+
+ private boolean is15Available(GL gl) {
+ if (!checkFor_isExtensionAvailable_GL_VERSION_1_5) {
+ isExtensionAvailable_GL_VERSION_1_5 = gl.isExtensionAvailable("GL_VERSION_1_5");
+ checkFor_isExtensionAvailable_GL_VERSION_1_5 = true;
+ }
+ return isExtensionAvailable_GL_VERSION_1_5;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java
new file mode 100755
index 000000000..1f6393d39
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/awt/TextureRenderer.java
@@ -0,0 +1,699 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.awt;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.image.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import javax.media.opengl.glu.gl2.*;
+import com.sun.opengl.util.texture.*;
+import com.sun.opengl.util.texture.spi.*;
+import com.sun.opengl.util.texture.awt.*;
+
+/** Provides the ability to render into an OpenGL {@link
+ com.sun.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
+ texture can then be mapped on to a polygon for display. */
+
+public class TextureRenderer {
+ // For now, we supply only a BufferedImage back-end for this
+ // renderer. In theory we could use the Java 2D/JOGL bridge to fully
+ // accelerate the rendering paths, but there are restrictions on
+ // what work can be done where; for example, Graphics2D-related work
+ // must not be done on the Queue Flusher Thread, but JOGL's
+ // OpenGL-related work must be. This implies that the user's code
+ // would need to be split up into multiple callbacks run from the
+ // appropriate threads, which would be somewhat unfortunate.
+
+ // Whether we have an alpha channel in the (RGB/A) backing store
+ private boolean alpha;
+
+ // Whether we're using only a GL_INTENSITY backing store
+ private boolean intensity;
+
+ // Whether we're attempting to use automatic mipmap generation support
+ private boolean mipmap;
+
+ // Whether smoothing is enabled for the OpenGL texture (switching
+ // between GL_LINEAR and GL_NEAREST filtering)
+ private boolean smoothing = true;
+ private boolean smoothingChanged;
+
+ // The backing store itself
+ private BufferedImage image;
+
+ private Texture texture;
+ private AWTTextureData textureData;
+ private boolean mustReallocateTexture;
+ private Rectangle dirtyRegion;
+
+ private GLUgl2 glu = new GLUgl2();
+
+ // Current color
+ private float r = 1.0f;
+ private float g = 1.0f;
+ private float b = 1.0f;
+ private float a = 1.0f;
+
+ /** Creates a new renderer with backing store of the specified width
+ and height. If <CODE>alpha</CODE> is true, allocates an alpha
+ channel in the backing store image. No mipmap support is
+ requested.
+
+ @param width the width of the texture to render into
+ @param height the height of the texture to render into
+ @param alpha whether to allocate an alpha channel for the texture
+ */
+ public TextureRenderer(int width, int height, boolean alpha) {
+ this(width, height, alpha, false);
+ }
+
+ /** Creates a new renderer with backing store of the specified width
+ and height. If <CODE>alpha</CODE> is true, allocates an alpha channel in the
+ backing store image. If <CODE>mipmap</CODE> is true, attempts to use OpenGL's
+ automatic mipmap generation for better smoothing when rendering
+ the TextureRenderer's contents at a distance.
+
+ @param width the width of the texture to render into
+ @param height the height of the texture to render into
+ @param alpha whether to allocate an alpha channel for the texture
+ @param mipmap whether to attempt use of automatic mipmap generation
+ */
+ public TextureRenderer(int width, int height, boolean alpha, boolean mipmap) {
+ this(width, height, alpha, false, mipmap);
+ }
+
+ // Internal constructor to avoid confusion since alpha only makes
+ // sense when intensity is not set
+ private TextureRenderer(int width, int height, boolean alpha, boolean intensity, boolean mipmap) {
+ this.alpha = alpha;
+ this.intensity = intensity;
+ this.mipmap = mipmap;
+ init(width, height);
+ }
+
+ /** Creates a new renderer with a special kind of backing store
+ which acts only as an alpha channel. No mipmap support is
+ requested. Internally, this associates a GL_INTENSITY OpenGL
+ texture with the backing store. */
+ public static TextureRenderer createAlphaOnlyRenderer(int width, int height) {
+ return createAlphaOnlyRenderer(width, height, false);
+ }
+
+ /** Creates a new renderer with a special kind of backing store
+ which acts only as an alpha channel. If <CODE>mipmap</CODE> is
+ true, attempts to use OpenGL's automatic mipmap generation for
+ better smoothing when rendering the TextureRenderer's contents
+ at a distance. Internally, this associates a GL_INTENSITY OpenGL
+ texture with the backing store. */
+ public static TextureRenderer createAlphaOnlyRenderer(int width, int height, boolean mipmap) {
+ return new TextureRenderer(width, height, false, true, mipmap);
+ }
+
+ /** Returns the width of the backing store of this renderer.
+
+ @return the width of the backing store of this renderer
+ */
+ public int getWidth() {
+ return image.getWidth();
+ }
+
+ /** Returns the height of the backing store of this renderer.
+
+ @return the height of the backing store of this renderer
+ */
+ public int getHeight() {
+ return image.getHeight();
+ }
+
+ /** Returns the size of the backing store of this renderer in a
+ newly-allocated {@link java.awt.Dimension Dimension} object.
+
+ @return the size of the backing store of this renderer
+ */
+ public Dimension getSize() {
+ return getSize(null);
+ }
+
+ /** Returns the size of the backing store of this renderer. Uses the
+ {@link java.awt.Dimension Dimension} object if one is supplied,
+ or allocates a new one if null is passed.
+
+ @param d a {@link java.awt.Dimension Dimension} object in which
+ to store the results, or null to allocate a new one
+
+ @return the size of the backing store of this renderer
+ */
+ public Dimension getSize(Dimension d) {
+ if (d == null)
+ d = new Dimension();
+ d.setSize(image.getWidth(), image.getHeight());
+ return d;
+ }
+
+ /** Sets the size of the backing store of this renderer. This may
+ cause the OpenGL texture object associated with this renderer to
+ be invalidated; it is not recommended to cache this texture
+ object outside this class but to instead call {@link #getTexture
+ getTexture} when it is needed.
+
+ @param width the new width of the backing store of this renderer
+ @param height the new height of the backing store of this renderer
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void setSize(int width, int height) throws GLException {
+ init(width, height);
+ }
+
+ /** Sets the size of the backing store of this renderer. This may
+ cause the OpenGL texture object associated with this renderer to
+ be invalidated.
+
+ @param d the new size of the backing store of this renderer
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void setSize(Dimension d) throws GLException {
+ setSize(d.width, d.height);
+ }
+
+ /** Sets whether smoothing is enabled for the OpenGL texture; if so,
+ uses GL_LINEAR interpolation for the minification and
+ magnification filters. Defaults to true. Changes to this setting
+ will not take effect until the next call to {@link
+ #beginOrthoRendering beginOrthoRendering}.
+
+ @param smoothing whether smoothing is enabled for the OpenGL texture
+ */
+ public void setSmoothing(boolean smoothing) {
+ this.smoothing = smoothing;
+ smoothingChanged = true;
+ }
+
+ /** Returns whether smoothing is enabled for the OpenGL texture; see
+ {@link #setSmoothing setSmoothing}. Defaults to true.
+
+ @return whether smoothing is enabled for the OpenGL texture
+ */
+ public boolean getSmoothing() {
+ return smoothing;
+ }
+
+ /** Creates a {@link java.awt.Graphics2D Graphics2D} instance for
+ rendering to the backing store of this renderer. The returned
+ object should be disposed of using the normal {@link
+ java.awt.Graphics#dispose() Graphics.dispose()} method once it
+ is no longer being used.
+
+ @return a new {@link java.awt.Graphics2D Graphics2D} object for
+ rendering into the backing store of this renderer
+ */
+ public Graphics2D createGraphics() {
+ return image.createGraphics();
+ }
+
+ /** Returns the underlying Java 2D {@link java.awt.Image Image}
+ being rendered into. */
+ public Image getImage() {
+ return image;
+ }
+
+ /** Marks the given region of the TextureRenderer as dirty. This
+ region, and any previously set dirty regions, will be
+ automatically synchronized with the underlying Texture during
+ the next {@link #getTexture getTexture} operation, at which
+ point the dirty region will be cleared. It is not necessary for
+ an OpenGL context to be current when this method is called.
+
+ @param x the x coordinate (in Java 2D coordinates -- relative to
+ upper left) of the region to update
+ @param y the y coordinate (in Java 2D coordinates -- relative to
+ upper left) of the region to update
+ @param width the width of the region to update
+ @param height the height of the region to update
+ */
+ public void markDirty(int x, int y, int width, int height) {
+ Rectangle curRegion = new Rectangle(x, y, width, height);
+ if (dirtyRegion == null) {
+ dirtyRegion = curRegion;
+ } else {
+ dirtyRegion.add(curRegion);
+ }
+ }
+
+ /** Returns the underlying OpenGL Texture object associated with
+ this renderer, synchronizing any dirty regions of the
+ TextureRenderer with the underlying OpenGL texture.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public Texture getTexture() throws GLException {
+ if (dirtyRegion != null) {
+ sync(dirtyRegion.x, dirtyRegion.y, dirtyRegion.width, dirtyRegion.height);
+ dirtyRegion = null;
+ }
+
+ ensureTexture();
+ return texture;
+ }
+
+ /** Disposes all resources associated with this renderer. It is not
+ valid to use this renderer after calling this method.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void dispose() throws GLException {
+ if (texture != null) {
+ texture.dispose();
+ texture = null;
+ }
+ if (image != null) {
+ image.flush();
+ image = null;
+ }
+ }
+
+ /** Convenience method which assists in rendering portions of the
+ OpenGL texture to the screen, if the application intends to draw
+ them as a flat overlay on to the screen. Pushes OpenGL state
+ bits (GL_ENABLE_BIT, GL_DEPTH_BUFFER_BIT and GL_TRANSFORM_BIT);
+ disables the depth test, back-face culling, and lighting;
+ enables the texture in this renderer; and sets up the viewing
+ matrices for orthographic rendering where the coordinates go
+ from (0, 0) at the lower left to (width, height) at the upper
+ right. Equivalent to beginOrthoRendering(width, height, true).
+ {@link #endOrthoRendering} must be used in conjunction with this
+ method to restore all OpenGL states.
+
+ @param width the width of the current on-screen OpenGL drawable
+ @param height the height of the current on-screen OpenGL drawable
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void beginOrthoRendering(int width, int height) throws GLException {
+ beginOrthoRendering(width, height, true);
+ }
+
+ /** Convenience method which assists in rendering portions of the
+ OpenGL texture to the screen, if the application intends to draw
+ them as a flat overlay on to the screen. Pushes OpenGL state
+ bits (GL_ENABLE_BIT, GL_DEPTH_BUFFER_BIT and GL_TRANSFORM_BIT);
+ disables the depth test (if the "disableDepthTest" argument is
+ true), back-face culling, and lighting; enables the texture in
+ this renderer; and sets up the viewing matrices for orthographic
+ rendering where the coordinates go from (0, 0) at the lower left
+ to (width, height) at the upper right. {@link
+ #endOrthoRendering} must be used in conjunction with this method
+ to restore all OpenGL states.
+
+ @param width the width of the current on-screen OpenGL drawable
+ @param height the height of the current on-screen OpenGL drawable
+ @param disableDepthTest whether the depth test should be disabled
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void beginOrthoRendering(int width, int height, boolean disableDepthTest) throws GLException {
+ beginRendering(true, width, height, disableDepthTest);
+ }
+
+ /** Convenience method which assists in rendering portions of the
+ OpenGL texture to the screen as 2D quads in 3D space. Pushes
+ OpenGL state (GL_ENABLE_BIT); disables lighting; and enables the
+ texture in this renderer. Unlike {@link #beginOrthoRendering
+ beginOrthoRendering}, does not modify the depth test, back-face
+ culling, lighting, or the modelview or projection matrices. The
+ user is responsible for setting up the view matrices for correct
+ results of {@link #draw3DRect draw3DRect}. {@link
+ #end3DRendering} must be used in conjunction with this method to
+ restore all OpenGL states.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void begin3DRendering() throws GLException {
+ beginRendering(false, 0, 0, false);
+ }
+
+ /** Changes the color of the polygons, and therefore the drawn
+ images, this TextureRenderer produces. Use of this method is
+ optional. The TextureRenderer uses the GL_MODULATE texture
+ environment mode, which causes the portions of the rendered
+ texture to be multiplied by the color of the rendered
+ polygons. The polygon color can be varied to achieve effects
+ like tinting of the overall output or fading in and out by
+ changing the alpha of the color. <P>
+
+ 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
+ premultiplied colors are used internally. The default color is
+ opaque white.
+
+ @param r the red component of the new color
+ @param g the green component of the new color
+ @param b the blue component of the new color
+ @param a the alpha component of the new color, 0.0f = completely
+ transparent, 1.0f = completely opaque
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void setColor(float r, float g, float b, float a) throws GLException {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ this.r = r * a;
+ this.g = g * a;
+ this.b = b * a;
+ this.a = a;
+
+ gl.glColor4f(this.r, this.g, this.b, this.a);
+ }
+
+ private float[] compArray;
+ /** Changes the current color of this TextureRenderer to the
+ supplied one. The default color is opaque white. See {@link
+ #setColor(float,float,float,float) setColor} for more details.
+
+ @param color the new color to use for rendering
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void setColor(Color color) throws GLException {
+ // Get color's RGBA components as floats in the range [0,1].
+ if (compArray == null) {
+ compArray = new float[4];
+ }
+ color.getRGBComponents(compArray);
+ setColor(compArray[0], compArray[1], compArray[2], compArray[3]);
+ }
+
+ /** Draws an orthographically projected rectangle containing all of
+ the underlying texture to the specified location on the
+ screen. All (x, y) coordinates are specified relative to the
+ lower left corner of either the texture image or the current
+ OpenGL drawable. This method is equivalent to
+ <code>drawOrthoRect(screenx, screeny, 0, 0, getWidth(),
+ getHeight());</code>.
+
+ @param screenx the on-screen x coordinate at which to draw the rectangle
+ @param screeny the on-screen y coordinate (relative to lower left) at
+ which to draw the rectangle
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void drawOrthoRect(int screenx, int screeny) throws GLException {
+ drawOrthoRect(screenx, screeny, 0, 0, getWidth(), getHeight());
+ }
+
+ /** Draws an orthographically projected rectangle of the underlying
+ texture to the specified location on the screen. All (x, y)
+ coordinates are specified relative to the lower left corner of
+ either the texture image or the current OpenGL drawable.
+
+ @param screenx the on-screen x coordinate at which to draw the rectangle
+ @param screeny the on-screen y coordinate (relative to lower left) at
+ which to draw the rectangle
+ @param texturex the x coordinate of the pixel in the texture of
+ the lower left portion of the rectangle to draw
+ @param texturey the y coordinate of the pixel in the texture
+ (relative to lower left) of the lower left portion of the
+ rectangle to draw
+ @param width the width of the rectangle to draw
+ @param height the height of the rectangle to draw
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void drawOrthoRect(int screenx, int screeny,
+ int texturex, int texturey,
+ int width, int height) throws GLException {
+ draw3DRect(screenx, screeny, 0, texturex, texturey, width, height, 1);
+ }
+
+ /** Draws a rectangle of the underlying texture to the specified 3D
+ location. In the current coordinate system, the lower left
+ corner of the rectangle is placed at (x, y, z), and the upper
+ right corner is placed at (x + width * scaleFactor, y + height *
+ scaleFactor, z). The lower left corner of the sub-rectangle of
+ the texture is (texturex, texturey) and the upper right corner
+ is (texturex + width, texturey + height). For back-face culling
+ purposes, the rectangle is drawn with counterclockwise
+ orientation of the vertices when viewed from the front.
+
+ @param x the x coordinate at which to draw the rectangle
+ @param y the y coordinate at which to draw the rectangle
+ @param z the z coordinate at which to draw the rectangle
+ @param texturex the x coordinate of the pixel in the texture of
+ the lower left portion of the rectangle to draw
+ @param texturey the y coordinate of the pixel in the texture
+ (relative to lower left) of the lower left portion of the
+ rectangle to draw
+ @param width the width in texels of the rectangle to draw
+ @param height the height in texels of the rectangle to draw
+ @param scaleFactor the scale factor to apply (multiplicatively)
+ to the size of the drawn rectangle
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void draw3DRect(float x, float y, float z,
+ int texturex, int texturey,
+ int width, int height,
+ float scaleFactor) throws GLException {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ Texture texture = getTexture();
+ TextureCoords coords = texture.getSubImageTexCoords(texturex, texturey,
+ texturex + width,
+ texturey + height);
+ gl.glBegin(GL2.GL_QUADS);
+ gl.glTexCoord2f(coords.left(), coords.bottom());
+ gl.glVertex3f(x, y, z);
+ gl.glTexCoord2f(coords.right(), coords.bottom());
+ gl.glVertex3f(x + width * scaleFactor, y, z);
+ gl.glTexCoord2f(coords.right(), coords.top());
+ gl.glVertex3f(x + width * scaleFactor, y + height * scaleFactor, z);
+ gl.glTexCoord2f(coords.left(), coords.top());
+ gl.glVertex3f(x, y + height * scaleFactor, z);
+ gl.glEnd();
+ }
+
+ /** Convenience method which assists in rendering portions of the
+ OpenGL texture to the screen, if the application intends to draw
+ them as a flat overlay on to the screen. Must be used if {@link
+ #beginOrthoRendering} is used to set up the rendering stage for
+ this overlay.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void endOrthoRendering() throws GLException {
+ endRendering(true);
+ }
+
+ /** Convenience method which assists in rendering portions of the
+ OpenGL texture to the screen as 2D quads in 3D space. Must be
+ used if {@link #begin3DRendering} is used to set up the
+ rendering stage for this overlay.
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ public void end3DRendering() throws GLException {
+ endRendering(false);
+ }
+
+ /** Indicates whether automatic mipmap generation is in use for this
+ TextureRenderer. The result of this method may change from true
+ to false if it is discovered during allocation of the
+ TextureRenderer's backing store that automatic mipmap generation
+ is not supported at the OpenGL level. */
+ public boolean isUsingAutoMipmapGeneration() {
+ return mipmap;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void beginRendering(boolean ortho, int width, int height, boolean disableDepthTestForOrtho) {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ int attribBits =
+ GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL2.GL_COLOR_BUFFER_BIT |
+ (ortho ? (GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
+ gl.glPushAttrib(attribBits);
+ gl.glDisable(GL2.GL_LIGHTING);
+ if (ortho) {
+ if (disableDepthTestForOrtho) {
+ gl.glDisable(GL2.GL_DEPTH_TEST);
+ }
+ gl.glDisable(GL2.GL_CULL_FACE);
+ gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glPushMatrix();
+ gl.glLoadIdentity();
+ glu.gluOrtho2D(0, width, 0, height);
+ gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glPushMatrix();
+ gl.glLoadIdentity();
+ gl.glMatrixMode(GL2.GL_TEXTURE);
+ gl.glPushMatrix();
+ gl.glLoadIdentity();
+ }
+ gl.glEnable(GL2.GL_BLEND);
+ gl.glBlendFunc(GL2.GL_ONE, GL2.GL_ONE_MINUS_SRC_ALPHA);
+ Texture texture = getTexture();
+ texture.enable();
+ texture.bind();
+ gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
+ // Change polygon color to last saved
+ gl.glColor4f(r, g, b, a);
+ if (smoothingChanged) {
+ smoothingChanged = false;
+ if (smoothing) {
+ texture.setTexParameteri(GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
+ if (mipmap) {
+ texture.setTexParameteri(GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR_MIPMAP_LINEAR);
+ } else {
+ texture.setTexParameteri(GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
+ }
+ } else {
+ texture.setTexParameteri(GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
+ texture.setTexParameteri(GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
+ }
+ }
+ }
+
+ private void endRendering(boolean ortho) {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ Texture texture = getTexture();
+ texture.disable();
+ if (ortho) {
+ gl.glMatrixMode(GL2.GL_PROJECTION);
+ gl.glPopMatrix();
+ gl.glMatrixMode(GL2.GL_MODELVIEW);
+ gl.glPopMatrix();
+ gl.glMatrixMode(GL2.GL_TEXTURE);
+ gl.glPopMatrix();
+ }
+ gl.glPopAttrib();
+ }
+
+ private void init(int width, int height) {
+ GL2 gl = GLContext.getCurrentGL().getGL2();
+ // Discard previous BufferedImage if any
+ if (image != null) {
+ image.flush();
+ image = null;
+ }
+
+ // Infer the internal format if not an intensity texture
+ int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
+ int imageType =
+ (intensity ? BufferedImage.TYPE_BYTE_GRAY :
+ (alpha ? BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB));
+ image = new BufferedImage(width, height, imageType);
+ // Always realllocate the TextureData associated with this
+ // 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);
+ // For now, always reallocate the underlying OpenGL texture when
+ // the backing store size changes
+ mustReallocateTexture = true;
+ }
+
+ /** Synchronizes the specified region of the backing store down to
+ the underlying OpenGL texture. If {@link #markDirty markDirty}
+ is used instead to indicate the regions that are out of sync,
+ this method does not need to be called.
+
+ @param x the x coordinate (in Java 2D coordinates -- relative to
+ upper left) of the region to update
+ @param y the y coordinate (in Java 2D coordinates -- relative to
+ upper left) of the region to update
+ @param width the width of the region to update
+ @param height the height of the region to update
+
+ @throws GLException If an OpenGL context is not current when this method is called
+ */
+ private void sync(int x, int y, int width, int height) throws GLException {
+ // Force allocation if necessary
+ boolean canSkipUpdate = ensureTexture();
+
+ if (!canSkipUpdate) {
+ // Update specified region.
+ // NOTE that because BufferedImage-based TextureDatas now don't
+ // do anything to their contents, the coordinate systems for
+ // OpenGL and Java 2D actually line up correctly for
+ // updateSubImage calls, so we don't need to do any argument
+ // conversion here (i.e., flipping the Y coordinate).
+ texture.updateSubImage(textureData, 0, x, y, x, y, width, height);
+ }
+ }
+
+ // Returns true if the texture was newly allocated, false if not
+ private boolean ensureTexture() {
+ if (mustReallocateTexture) {
+ if (texture != null) {
+ texture.dispose();
+ texture = null;
+ }
+ mustReallocateTexture = false;
+ }
+
+ if (texture == null) {
+ texture = TextureIO.newTexture(textureData);
+ if (mipmap && !texture.isUsingAutoMipmapGeneration()) {
+ // Only try this once
+ texture.dispose();
+ mipmap = false;
+ textureData.setMipmap(false);
+ texture = TextureIO.newTexture(textureData);
+ }
+
+ if (!smoothing) {
+ // The TextureIO classes default to GL_LINEAR filtering
+ texture.setTexParameteri(GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
+ texture.setTexParameteri(GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
+ }
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java b/src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java
new file mode 100644
index 000000000..9738be60a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/BitmapCharRec.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+class BitmapCharRec {
+ public int width;
+ public int height;
+ public float xorig;
+ public float yorig;
+ public float advance;
+ public byte[] bitmap;
+
+ public BitmapCharRec(int width,
+ int height,
+ float xorig,
+ float yorig,
+ float advance,
+ byte[] bitmap) {
+ this.width = width;
+ this.height = height;
+ this.xorig = xorig;
+ this.yorig = yorig;
+ this.advance = advance;
+ this.bitmap = bitmap;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java b/src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java
new file mode 100644
index 000000000..d110c262b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/BitmapFontRec.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+class BitmapFontRec {
+ public String name;
+ public int num_chars;
+ public int first;
+ public BitmapCharRec[] ch;
+
+ public BitmapFontRec(String name,
+ int num_chars,
+ int first,
+ BitmapCharRec[] ch) {
+ this.name = name;
+ this.num_chars = num_chars;
+ this.first = first;
+ this.ch = ch;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java b/src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java
new file mode 100644
index 000000000..e87354dbf
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/CoordRec.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+class CoordRec {
+ public float x;
+ public float y;
+
+ public CoordRec(float x, float y) {
+ this.x = x;
+ this.y = y;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java
new file mode 100644
index 000000000..5a1f7d12d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUT.java
@@ -0,0 +1,1342 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import javax.media.opengl.glu.gl2.*;
+
+/** Subset of the routines provided by the GLUT interface. Note the
+ signatures of many of the methods are necessarily different than
+ the corresponding C version. A GLUT object must only be used from
+ one particular thread at a time. <P>
+
+ Copyright (c) Mark J. Kilgard, 1994, 1997. <P>
+
+ (c) Copyright 1993, Silicon Graphics, Inc. <P>
+
+ ALL RIGHTS RESERVED <P>
+
+ Permission to use, copy, modify, and distribute this software
+ for any purpose and without fee is hereby granted, provided
+ that the above copyright notice appear in all copies and that
+ both the copyright notice and this permission notice appear in
+ supporting documentation, and that the name of Silicon
+ Graphics, Inc. not be used in advertising or publicity
+ pertaining to distribution of the software without specific,
+ written prior permission. <P>
+
+ THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU
+ "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR
+ OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
+ EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE
+ ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
+ CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
+ INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE,
+ SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR
+ NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY
+ OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR
+ PERFORMANCE OF THIS SOFTWARE. <P>
+
+ US Government Users Restricted Rights <P>
+
+ Use, duplication, or disclosure by the Government is subject to
+ restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ (c)(1)(ii) of the Rights in Technical Data and Computer
+ Software clause at DFARS 252.227-7013 and/or in similar or
+ successor clauses in the FAR or the DOD or NASA FAR
+ Supplement. Unpublished-- rights reserved under the copyright
+ laws of the United States. Contractor/manufacturer is Silicon
+ Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA
+ 94039-7311. <P>
+
+ OpenGL(TM) is a trademark of Silicon Graphics, Inc. <P>
+*/
+
+public class GLUT {
+ public static final int STROKE_ROMAN = 0;
+ public static final int STROKE_MONO_ROMAN = 1;
+ public static final int BITMAP_9_BY_15 = 2;
+ public static final int BITMAP_8_BY_13 = 3;
+ public static final int BITMAP_TIMES_ROMAN_10 = 4;
+ public static final int BITMAP_TIMES_ROMAN_24 = 5;
+ public static final int BITMAP_HELVETICA_10 = 6;
+ public static final int BITMAP_HELVETICA_12 = 7;
+ public static final int BITMAP_HELVETICA_18 = 8;
+
+ private GLUgl2 glu = new GLUgl2();
+
+ //----------------------------------------------------------------------
+ // Shapes
+ //
+
+ public void glutWireSphere(double radius, int slices, int stacks) {
+ quadObjInit(glu);
+ glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
+ glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
+ /* If we ever changed/used the texture or orientation state
+ of quadObj, we'd need to change it to the defaults here
+ with gluQuadricTexture and/or gluQuadricOrientation. */
+ glu.gluSphere(quadObj, radius, slices, stacks);
+ }
+
+ public void glutSolidSphere(double radius, int slices, int stacks) {
+ quadObjInit(glu);
+ glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
+ glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
+ /* If we ever changed/used the texture or orientation state
+ of quadObj, we'd need to change it to the defaults here
+ with gluQuadricTexture and/or gluQuadricOrientation. */
+ glu.gluSphere(quadObj, radius, slices, stacks);
+ }
+
+ public void glutWireCone(double base, double height,
+ int slices, int stacks) {
+ quadObjInit(glu);
+ glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
+ glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
+ /* If we ever changed/used the texture or orientation state
+ of quadObj, we'd need to change it to the defaults here
+ with gluQuadricTexture and/or gluQuadricOrientation. */
+ glu.gluCylinder(quadObj, base, 0.0, height, slices, stacks);
+ }
+
+ public void glutSolidCone(double base, double height,
+ int slices, int stacks) {
+ quadObjInit(glu);
+ glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
+ glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
+ /* If we ever changed/used the texture or orientation state
+ of quadObj, we'd need to change it to the defaults here
+ with gluQuadricTexture and/or gluQuadricOrientation. */
+ glu.gluCylinder(quadObj, base, 0.0, height, slices, stacks);
+ }
+
+ public void glutWireCylinder(double radius, double height, int slices, int stacks) {
+ quadObjInit(glu);
+ glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
+ glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
+ /* If we ever changed/used the texture or orientation state
+ of quadObj, we'd need to change it to the defaults here
+ with gluQuadricTexture and/or gluQuadricOrientation. */
+ glu.gluCylinder(quadObj, radius, radius, height, slices, stacks);
+ }
+
+ public void glutSolidCylinder(double radius, double height, int slices, int stacks) {
+ GL2 gl = GLUgl2.getCurrentGL2();
+
+ // Prepare table of points for drawing end caps
+ double [] x = new double[slices];
+ double [] y = new double[slices];
+ double angleDelta = Math.PI * 2 / slices;
+ double angle = 0;
+ for (int i = 0 ; i < slices ; i ++) {
+ angle = i * angleDelta;
+ x[i] = Math.cos(angle) * radius;
+ y[i] = Math.sin(angle) * radius;
+ }
+
+ // Draw bottom cap
+ gl.glBegin(GL2.GL_TRIANGLE_FAN);
+ gl.glNormal3d(0,0,-1);
+ gl.glVertex3d(0,0,0);
+ for (int i = 0 ; i < slices ; i ++) {
+ gl.glVertex3d(x[i], y[i], 0);
+ }
+ gl.glVertex3d(x[0], y[0], 0);
+ gl.glEnd();
+
+ // Draw top cap
+ gl.glBegin(GL2.GL_TRIANGLE_FAN);
+ gl.glNormal3d(0,0,1);
+ gl.glVertex3d(0,0,height);
+ for (int i = 0 ; i < slices ; i ++) {
+ gl.glVertex3d(x[i], y[i], height);
+ }
+ gl.glVertex3d(x[0], y[0], height);
+ gl.glEnd();
+
+ // Draw walls
+ quadObjInit(glu);
+ glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
+ glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
+ /* If we ever changed/used the texture or orientation state
+ of quadObj, we'd need to change it to the defaults here
+ with gluQuadricTexture and/or gluQuadricOrientation. */
+ glu.gluCylinder(quadObj, radius, radius, height, slices, stacks);
+ }
+
+ public void glutWireCube(float size) {
+ drawBox(GLUgl2.getCurrentGL2(), size, GL2.GL_LINE_LOOP);
+ }
+
+ public void glutSolidCube(float size) {
+ drawBox(GLUgl2.getCurrentGL2(), size, GL2.GL_QUADS);
+ }
+
+ public void glutWireTorus(double innerRadius, double outerRadius,
+ int nsides, int rings) {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ gl.glPushAttrib(GL2.GL_POLYGON_BIT);
+ gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+ doughnut(gl, innerRadius, outerRadius, nsides, rings);
+ gl.glPopAttrib();
+ }
+
+ public void glutSolidTorus(double innerRadius, double outerRadius,
+ int nsides, int rings) {
+ doughnut(GLUgl2.getCurrentGL2(), innerRadius, outerRadius, nsides, rings);
+ }
+
+ public void glutWireDodecahedron() {
+ dodecahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ }
+
+ public void glutSolidDodecahedron() {
+ dodecahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLE_FAN);
+ }
+
+ public void glutWireOctahedron() {
+ octahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ }
+
+ public void glutSolidOctahedron() {
+ octahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+ }
+
+ public void glutWireIcosahedron() {
+ icosahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ }
+
+ public void glutSolidIcosahedron() {
+ icosahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+ }
+
+ public void glutWireTetrahedron() {
+ tetrahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+ }
+
+ public void glutSolidTetrahedron() {
+ tetrahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+ }
+
+/**
+ * Renders the teapot as a solid shape of the specified size. The teapot is
+ * created in a way that replicates the C GLUT implementation.
+ *
+ * @param scale
+ * the factor by which to scale the teapot
+ */
+ public void glutSolidTeapot(double scale) {
+ glutSolidTeapot(scale, true);
+ }
+
+ /**
+ * Renders the teapot as a solid shape of the specified size. The teapot can
+ * either be created in a way that is backward-compatible with the standard
+ * C glut library (i.e. broken), or in a more pleasing way (i.e. with
+ * surfaces whose front-faces point outwards and standing on the z=0 plane,
+ * instead of the y=-1 plane). Both surface normals and texture coordinates
+ * for the teapot are generated. The teapot is generated with OpenGL
+ * evaluators.
+ *
+ * @param scale
+ * the factor by which to scale the teapot
+ * @param cStyle
+ * whether to create the teapot in exactly the same way as in the C
+ * implementation of GLUT
+ */
+ public void glutSolidTeapot(double scale, boolean cStyle) {
+ teapot(GLUgl2.getCurrentGL2(), 14, scale, GL2.GL_FILL, cStyle);
+ }
+
+ /**
+ * Renders the teapot as a wireframe shape of the specified size. The teapot
+ * is created in a way that replicates the C GLUT implementation.
+ *
+ * @param scale
+ * the factor by which to scale the teapot
+ */
+ public void glutWireTeapot(double scale) {
+ glutWireTeapot(scale, true);
+ }
+
+ /**
+ * Renders the teapot as a wireframe shape of the specified size. The teapot
+ * can either be created in a way that is backward-compatible with the
+ * standard C glut library (i.e. broken), or in a more pleasing way (i.e.
+ * with surfaces whose front-faces point outwards and standing on the z=0
+ * plane, instead of the y=-1 plane). Both surface normals and texture
+ * coordinates for the teapot are generated. The teapot is generated with
+ * OpenGL evaluators.
+ *
+ * @param scale
+ * the factor by which to scale the teapot
+ * @param cStyle
+ * whether to create the teapot in exactly the same way as in the C
+ * implementation of GLUT
+ */
+ public void glutWireTeapot(double scale, boolean cStyle) {
+ teapot(GLUgl2.getCurrentGL2(), 10, scale, GL2.GL_LINE, cStyle);
+ }
+
+ //----------------------------------------------------------------------
+ // Fonts
+ //
+
+ public void glutBitmapCharacter(int font, char character) {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ int[] swapbytes = new int[1];
+ int[] lsbfirst = new int[1];
+ int[] rowlength = new int[1];
+ int[] skiprows = new int[1];
+ int[] skippixels = new int[1];
+ int[] alignment = new int[1];
+ beginBitmap(gl,
+ swapbytes,
+ lsbfirst,
+ rowlength,
+ skiprows,
+ skippixels,
+ alignment);
+ bitmapCharacterImpl(gl, font, character);
+ endBitmap(gl,
+ swapbytes,
+ lsbfirst,
+ rowlength,
+ skiprows,
+ skippixels,
+ alignment);
+ }
+
+ public void glutBitmapString (int font, String string) {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ int[] swapbytes = new int[1];
+ int[] lsbfirst = new int[1];
+ int[] rowlength = new int[1];
+ int[] skiprows = new int[1];
+ int[] skippixels = new int[1];
+ int[] alignment = new int[1];
+ beginBitmap(gl,
+ swapbytes,
+ lsbfirst,
+ rowlength,
+ skiprows,
+ skippixels,
+ alignment);
+ int len = string.length();
+ for (int i = 0; i < len; i++) {
+ bitmapCharacterImpl(gl, font, string.charAt(i));
+ }
+ endBitmap(gl,
+ swapbytes,
+ lsbfirst,
+ rowlength,
+ skiprows,
+ skippixels,
+ alignment);
+ }
+
+ public int glutBitmapWidth (int font, char character) {
+ BitmapFontRec fontinfo = getBitmapFont(font);
+ int c = character & 0xFFFF;
+ if (c < fontinfo.first || c >= fontinfo.first + fontinfo.num_chars)
+ return 0;
+ BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+ if (ch != null)
+ return (int) ch.advance;
+ else
+ return 0;
+ }
+
+ public void glutStrokeCharacter(int font, char character) {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ StrokeFontRec fontinfo = getStrokeFont(font);
+ int c = character & 0xFFFF;
+ if (c < 0 || c >= fontinfo.num_chars)
+ return;
+ StrokeCharRec ch = fontinfo.ch[c];
+ if (ch != null) {
+ for (int i = 0; i < ch.num_strokes; i++) {
+ StrokeRec stroke = ch.stroke[i];
+ gl.glBegin(GL2.GL_LINE_STRIP);
+ for (int j = 0; j < stroke.num_coords; j++) {
+ CoordRec coord = stroke.coord[j];
+ gl.glVertex2f(coord.x, coord.y);
+ }
+ gl.glEnd();
+ }
+ gl.glTranslatef(ch.right, 0.0f, 0.0f);
+ }
+ }
+
+ public void glutStrokeString(int font, String string) {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ StrokeFontRec fontinfo = getStrokeFont(font);
+ int len = string.length();
+ for (int pos = 0; pos < len; pos++) {
+ int c = string.charAt(pos) & 0xFFFF;
+ if (c < 0 || c >= fontinfo.num_chars)
+ continue;
+ StrokeCharRec ch = fontinfo.ch[c];
+ if (ch != null) {
+ for (int i = 0; i < ch.num_strokes; i++) {
+ StrokeRec stroke = ch.stroke[i];
+ gl.glBegin(GL2.GL_LINE_STRIP);
+ for (int j = 0; j < stroke.num_coords; j++) {
+ CoordRec coord = stroke.coord[j];
+ gl.glVertex2f(coord.x, coord.y);
+ }
+ gl.glEnd();
+ }
+ gl.glTranslatef(ch.right, 0.0f, 0.0f);
+ }
+ }
+ }
+
+ public int glutStrokeWidth (int font, char character) {
+ return (int) glutStrokeWidthf(font, character);
+ }
+
+ public float glutStrokeWidthf (int font, char character) {
+ StrokeFontRec fontinfo = getStrokeFont(font);
+ int c = character & 0xFFFF;
+ if (c < 0 || c >= fontinfo.num_chars)
+ return 0;
+ StrokeCharRec ch = fontinfo.ch[c];
+ if (ch != null)
+ return ch.right;
+ else
+ return 0;
+ }
+
+ public int glutBitmapLength (int font, String string) {
+ BitmapFontRec fontinfo = getBitmapFont(font);
+ int length = 0;
+ int len = string.length();
+ for (int pos = 0; pos < len; pos++) {
+ int c = string.charAt(pos) & 0xFFFF;
+ if (c >= fontinfo.first && c < fontinfo.first + fontinfo.num_chars) {
+ BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+ if (ch != null)
+ length += ch.advance;
+ }
+ }
+ return length;
+ }
+
+ public int glutStrokeLength (int font, String string) {
+ return (int) glutStrokeLengthf(font, string);
+ }
+
+ public float glutStrokeLengthf (int font, String string) {
+ StrokeFontRec fontinfo = getStrokeFont(font);
+ float length = 0;
+ int len = string.length();
+ for (int i = 0; i < len; i++) {
+ char c = string.charAt(i);
+ if (c >= 0 && c < fontinfo.num_chars) {
+ StrokeCharRec ch = fontinfo.ch[c];
+ if (ch != null)
+ length += ch.right;
+ }
+ }
+ return length;
+ }
+
+ /**
+ This function draws a wireframe dodecahedron whose
+ facets are rhombic and
+ whose vertices are at unit radius.
+ No facet lies normal to any coordinate axes.
+ The polyhedron is centered at the origin.
+ */
+ public void glutWireRhombicDodecahedron() {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ for( int i = 0; i < 12; i++ ) {
+ gl.glBegin( GL2.GL_LINE_LOOP );
+ gl.glNormal3dv( rdod_n[ i ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 0 ] ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 1 ] ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 2 ] ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 3 ] ],0 );
+ gl.glEnd( );
+ }
+ }
+
+ /**
+ This function draws a solid-shaded dodecahedron
+ whose facets are rhombic and
+ whose vertices are at unit radius.
+ No facet lies normal to any coordinate axes.
+ The polyhedron is centered at the origin.
+ */
+ public void glutSolidRhombicDodecahedron() {
+ GL2 gl = GLUgl2.getCurrentGL2();
+ gl.glBegin( GL2.GL_QUADS );
+ for( int i = 0; i < 12; i++ ) {
+ gl.glNormal3dv( rdod_n[ i ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 0 ] ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 1 ] ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 2 ] ],0 );
+ gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 3 ] ],0 );
+ }
+ gl.glEnd( );
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ //----------------------------------------------------------------------
+ // Shape implementation
+ //
+
+ private GLUquadric quadObj;
+ private void quadObjInit(GLUgl2 glu) {
+ if (quadObj == null) {
+ quadObj = glu.gluNewQuadric();
+ }
+ if (quadObj == null) {
+ throw new GLException("Out of memory");
+ }
+ }
+
+ private static void doughnut(GL2 gl, double r, double R, int nsides, int rings) {
+ int i, j;
+ float theta, phi, theta1;
+ float cosTheta, sinTheta;
+ float cosTheta1, sinTheta1;
+ float ringDelta, sideDelta;
+
+ ringDelta = (float) (2.0 * Math.PI / rings);
+ sideDelta = (float) (2.0 * Math.PI / nsides);
+
+ theta = 0.0f;
+ cosTheta = 1.0f;
+ sinTheta = 0.0f;
+ for (i = rings - 1; i >= 0; i--) {
+ theta1 = theta + ringDelta;
+ cosTheta1 = (float) Math.cos(theta1);
+ sinTheta1 = (float) Math.sin(theta1);
+ gl.glBegin(GL2.GL_QUAD_STRIP);
+ phi = 0.0f;
+ for (j = nsides; j >= 0; j--) {
+ float cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = (float) Math.cos(phi);
+ sinPhi = (float) Math.sin(phi);
+ dist = (float) (R + r * cosPhi);
+
+ gl.glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ gl.glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, (float) r * sinPhi);
+ gl.glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ gl.glVertex3f(cosTheta * dist, -sinTheta * dist, (float) r * sinPhi);
+ }
+ gl.glEnd();
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+ }
+
+ private static float[][] boxVertices;
+ private static final float[][] boxNormals = {
+ {-1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f},
+ {1.0f, 0.0f, 0.0f},
+ {0.0f, -1.0f, 0.0f},
+ {0.0f, 0.0f, 1.0f},
+ {0.0f, 0.0f, -1.0f}
+ };
+ private static final int[][] boxFaces = {
+ {0, 1, 2, 3},
+ {3, 2, 6, 7},
+ {7, 6, 5, 4},
+ {4, 5, 1, 0},
+ {5, 6, 2, 1},
+ {7, 4, 0, 3}
+ };
+ private void drawBox(GL2 gl, float size, int type) {
+ if (boxVertices == null) {
+ float[][] v = new float[8][];
+ for (int i = 0; i < 8; i++) {
+ v[i] = new float[3];
+ }
+ v[0][0] = v[1][0] = v[2][0] = v[3][0] = -0.5f;
+ v[4][0] = v[5][0] = v[6][0] = v[7][0] = 0.5f;
+ v[0][1] = v[1][1] = v[4][1] = v[5][1] = -0.5f;
+ v[2][1] = v[3][1] = v[6][1] = v[7][1] = 0.5f;
+ v[0][2] = v[3][2] = v[4][2] = v[7][2] = -0.5f;
+ v[1][2] = v[2][2] = v[5][2] = v[6][2] = 0.5f;
+ boxVertices = v;
+ }
+ float[][] v = boxVertices;
+ float[][] n = boxNormals;
+ int[][] faces = boxFaces;
+ for (int i = 5; i >= 0; i--) {
+ gl.glBegin(type);
+ gl.glNormal3fv(n[i], 0);
+ float[] vt = v[faces[i][0]];
+ gl.glVertex3f(vt[0] * size, vt[1] * size, vt[2] * size);
+ vt = v[faces[i][1]];
+ gl.glVertex3f(vt[0] * size, vt[1] * size, vt[2] * size);
+ vt = v[faces[i][2]];
+ gl.glVertex3f(vt[0] * size, vt[1] * size, vt[2] * size);
+ vt = v[faces[i][3]];
+ gl.glVertex3f(vt[0] * size, vt[1] * size, vt[2] * size);
+ gl.glEnd();
+ }
+ }
+
+ private float[][] dodec;
+
+ private void initDodecahedron() {
+ dodec = new float[20][];
+ for (int i = 0; i < dodec.length; i++) {
+ dodec[i] = new float[3];
+ }
+
+ float alpha, beta;
+
+ alpha = (float) Math.sqrt(2.0f / (3.0f + Math.sqrt(5.0)));
+ beta = 1.0f + (float) Math.sqrt(6.0 / (3.0 + Math.sqrt(5.0)) -
+ 2.0 + 2.0 * Math.sqrt(2.0 / (3.0 + Math.sqrt(5.0))));
+ dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta;
+ dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta;
+ dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1;
+ dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1;
+ dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1;
+ dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1;
+ dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1;
+ dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1;
+ dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1;
+ dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1;
+ dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0;
+ dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0;
+ dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0;
+ dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0;
+ dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta;
+ dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta;
+ dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha;
+ dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha;
+ dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha;
+ dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
+ }
+
+ private static void diff3(float[] a, float[] b, float[] c) {
+ c[0] = a[0] - b[0];
+ c[1] = a[1] - b[1];
+ c[2] = a[2] - b[2];
+ }
+
+ private static void crossprod(float[] v1, float[] v2, float[] prod) {
+ float[] p = new float[3]; /* in case prod == v1 or v2 */
+
+ p[0] = v1[1] * v2[2] - v2[1] * v1[2];
+ p[1] = v1[2] * v2[0] - v2[2] * v1[0];
+ p[2] = v1[0] * v2[1] - v2[0] * v1[1];
+ prod[0] = p[0];
+ prod[1] = p[1];
+ prod[2] = p[2];
+ }
+
+ private static void normalize(float[] v) {
+ float d;
+
+ d = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+ if (d == 0.0) {
+ v[0] = d = 1.0f;
+ }
+ d = 1 / d;
+ v[0] *= d;
+ v[1] *= d;
+ v[2] *= d;
+ }
+
+ private void pentagon(GL2 gl, int a, int b, int c, int d, int e, int shadeType) {
+ float[] n0 = new float[3];
+ float[] d1 = new float[3];
+ float[] d2 = new float[3];
+
+ diff3(dodec[a], dodec[b], d1);
+ diff3(dodec[b], dodec[c], d2);
+ crossprod(d1, d2, n0);
+ normalize(n0);
+
+ gl.glBegin(shadeType);
+ gl.glNormal3fv(n0, 0);
+ gl.glVertex3fv(dodec[a], 0);
+ gl.glVertex3fv(dodec[b], 0);
+ gl.glVertex3fv(dodec[c], 0);
+ gl.glVertex3fv(dodec[d], 0);
+ gl.glVertex3fv(dodec[e], 0);
+ gl.glEnd();
+ }
+
+ private void dodecahedron(GL2 gl, int type) {
+ if (dodec == null) {
+ initDodecahedron();
+ }
+ pentagon(gl, 0, 1, 9, 16, 5, type);
+ pentagon(gl, 1, 0, 3, 18, 7, type);
+ pentagon(gl, 1, 7, 11, 10, 9, type);
+ pentagon(gl, 11, 7, 18, 19, 6, type);
+ pentagon(gl, 8, 17, 16, 9, 10, type);
+ pentagon(gl, 2, 14, 15, 6, 19, type);
+ pentagon(gl, 2, 13, 12, 4, 14, type);
+ pentagon(gl, 2, 19, 18, 3, 13, type);
+ pentagon(gl, 3, 0, 5, 12, 13, type);
+ pentagon(gl, 6, 15, 8, 10, 11, type);
+ pentagon(gl, 4, 17, 8, 15, 14, type);
+ pentagon(gl, 4, 12, 5, 16, 17, type);
+ }
+
+ private static void recorditem(GL2 gl, float[] n1, float[] n2, float[] n3, int shadeType) {
+ float[] q0 = new float[3];
+ float[] q1 = new float[3];
+
+ diff3(n1, n2, q0);
+ diff3(n2, n3, q1);
+ crossprod(q0, q1, q1);
+ normalize(q1);
+
+ gl.glBegin(shadeType);
+ gl.glNormal3fv(q1, 0);
+ gl.glVertex3fv(n1, 0);
+ gl.glVertex3fv(n2, 0);
+ gl.glVertex3fv(n3, 0);
+ gl.glEnd();
+ }
+
+ private static void subdivide(GL2 gl, float[] v0, float[] v1, float[] v2, int shadeType) {
+ int depth;
+ float[] w0 = new float[3];
+ float[] w1 = new float[3];
+ float[] w2 = new float[3];
+ float l;
+ int i, j, k, n;
+
+ depth = 1;
+ for (i = 0; i < depth; i++) {
+ for (j = 0; i + j < depth; j++) {
+ k = depth - i - j;
+ for (n = 0; n < 3; n++) {
+ w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth;
+ w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n])
+ / depth;
+ w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n])
+ / depth;
+ }
+ l = (float) Math.sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]);
+ w0[0] /= l;
+ w0[1] /= l;
+ w0[2] /= l;
+ l = (float) Math.sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]);
+ w1[0] /= l;
+ w1[1] /= l;
+ w1[2] /= l;
+ l = (float) Math.sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]);
+ w2[0] /= l;
+ w2[1] /= l;
+ w2[2] /= l;
+ recorditem(gl, w1, w0, w2, shadeType);
+ }
+ }
+ }
+
+ private static void drawtriangle(GL2 gl, int i, float[][] data, int[][] ndx, int shadeType) {
+ float[] x0 = data[ndx[i][0]];
+ float[] x1 = data[ndx[i][1]];
+ float[] x2 = data[ndx[i][2]];
+ subdivide(gl, x0, x1, x2, shadeType);
+ }
+
+ /* octahedron data: The octahedron produced is centered at the
+ origin and has radius 1.0 */
+ private static final float[][] odata =
+ {
+ {1.0f, 0.0f, 0.0f},
+ {-1.0f, 0.0f, 0.0f},
+ {0.0f, 1.0f, 0.0f},
+ {0.0f, -1.0f, 0.0f},
+ {0.0f, 0.0f, 1.0f},
+ {0.0f, 0.0f, -1.0f}
+ };
+
+ private static final int[][] ondex =
+ {
+ {0, 4, 2},
+ {1, 2, 4},
+ {0, 3, 4},
+ {1, 4, 3},
+ {0, 2, 5},
+ {1, 5, 2},
+ {0, 5, 3},
+ {1, 3, 5}
+ };
+
+ private static void octahedron(GL2 gl, int shadeType) {
+ int i;
+
+ for (i = 7; i >= 0; i--) {
+ drawtriangle(gl, i, odata, ondex, shadeType);
+ }
+ }
+
+ /* icosahedron data: These numbers are rigged to make an
+ icosahedron of radius 1.0 */
+
+ private static final float X = .525731112119133606f;
+ private static final float Z = .850650808352039932f;
+
+ private static final float[][] idata =
+ {
+ {-X, 0, Z},
+ {X, 0, Z},
+ {-X, 0, -Z},
+ {X, 0, -Z},
+ {0, Z, X},
+ {0, Z, -X},
+ {0, -Z, X},
+ {0, -Z, -X},
+ {Z, X, 0},
+ {-Z, X, 0},
+ {Z, -X, 0},
+ {-Z, -X, 0}
+ };
+
+ private static final int[][] index =
+ {
+ {0, 4, 1},
+ {0, 9, 4},
+ {9, 5, 4},
+ {4, 5, 8},
+ {4, 8, 1},
+ {8, 10, 1},
+ {8, 3, 10},
+ {5, 3, 8},
+ {5, 2, 3},
+ {2, 7, 3},
+ {7, 10, 3},
+ {7, 6, 10},
+ {7, 11, 6},
+ {11, 0, 6},
+ {0, 1, 6},
+ {6, 1, 10},
+ {9, 0, 11},
+ {9, 11, 2},
+ {9, 2, 5},
+ {7, 2, 11},
+ };
+
+ private static void icosahedron(GL2 gl, int shadeType) {
+ int i;
+
+ for (i = 19; i >= 0; i--) {
+ drawtriangle(gl, i, idata, index, shadeType);
+ }
+ }
+
+ /* rhombic dodecahedron data: */
+
+ private static final double rdod_r[][] =
+ {
+ { 0.0, 0.0, 1.0 },
+ { 0.707106781187, 0.000000000000, 0.5 },
+ { 0.000000000000, 0.707106781187, 0.5 },
+ { -0.707106781187, 0.000000000000, 0.5 },
+ { 0.000000000000, -0.707106781187, 0.5 },
+ { 0.707106781187, 0.707106781187, 0.0 },
+ { -0.707106781187, 0.707106781187, 0.0 },
+ { -0.707106781187, -0.707106781187, 0.0 },
+ { 0.707106781187, -0.707106781187, 0.0 },
+ { 0.707106781187, 0.000000000000, -0.5 },
+ { 0.000000000000, 0.707106781187, -0.5 },
+ { -0.707106781187, 0.000000000000, -0.5 },
+ { 0.000000000000, -0.707106781187, -0.5 },
+ { 0.0, 0.0, -1.0 }
+ };
+
+ private static final int rdod_v[][] =
+ {
+ { 0, 1, 5, 2 },
+ { 0, 2, 6, 3 },
+ { 0, 3, 7, 4 },
+ { 0, 4, 8, 1 },
+ { 5, 10, 6, 2 },
+ { 6, 11, 7, 3 },
+ { 7, 12, 8, 4 },
+ { 8, 9, 5, 1 },
+ { 5, 9, 13, 10 },
+ { 6, 10, 13, 11 },
+ { 7, 11, 13, 12 },
+ { 8, 12, 13, 9 }
+ };
+
+ private static final double rdod_n[][] =
+ {
+ { 0.353553390594, 0.353553390594, 0.5 },
+ { -0.353553390594, 0.353553390594, 0.5 },
+ { -0.353553390594, -0.353553390594, 0.5 },
+ { 0.353553390594, -0.353553390594, 0.5 },
+ { 0.000000000000, 1.000000000000, 0.0 },
+ { -1.000000000000, 0.000000000000, 0.0 },
+ { 0.000000000000, -1.000000000000, 0.0 },
+ { 1.000000000000, 0.000000000000, 0.0 },
+ { 0.353553390594, 0.353553390594, -0.5 },
+ { -0.353553390594, 0.353553390594, -0.5 },
+ { -0.353553390594, -0.353553390594, -0.5 },
+ { 0.353553390594, -0.353553390594, -0.5 }
+ };
+
+ /* tetrahedron data: */
+
+ private static final float T = 1.73205080756887729f;
+
+ private static final float[][] tdata =
+ {
+ {T, T, T},
+ {T, -T, -T},
+ {-T, T, -T},
+ {-T, -T, T}
+ };
+
+ private static final int[][] tndex =
+ {
+ {0, 1, 3},
+ {2, 1, 0},
+ {3, 2, 0},
+ {1, 2, 3}
+ };
+
+ private static final void tetrahedron(GL2 gl, int shadeType) {
+ for (int i = 3; i >= 0; i--)
+ drawtriangle(gl, i, tdata, tndex, shadeType);
+ }
+
+ // Teapot implementation (a modified port of glut_teapot.c)
+ //
+ // Rim, body, lid, and bottom data must be reflected in x and
+ // y; handle and spout data across the y axis only.
+ private static final int[][] teapotPatchData = {
+ /* rim */
+ {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+ /* body */
+ {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27},
+ {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40},
+ /* lid */
+ {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, 101, 0, 1, 2, 3,},
+ {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117},
+ /* bottom */
+ {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, 125, 120, 40, 39, 38, 37},
+ /* handle */
+ {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56},
+ {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 28, 65, 66, 67},
+ /* spout */
+ {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83},
+ {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}
+ };
+ private static final float[][] teapotCPData = {
+ {0.2f, 0f, 2.7f},
+ {0.2f, -0.112f, 2.7f},
+ {0.112f, -0.2f, 2.7f},
+ {0f, -0.2f, 2.7f},
+ {1.3375f, 0f, 2.53125f},
+ {1.3375f, -0.749f, 2.53125f},
+ {0.749f, -1.3375f, 2.53125f},
+ {0f, -1.3375f, 2.53125f},
+ {1.4375f, 0f, 2.53125f},
+ {1.4375f, -0.805f, 2.53125f},
+ {0.805f, -1.4375f, 2.53125f},
+ {0f, -1.4375f, 2.53125f},
+ {1.5f, 0f, 2.4f},
+ {1.5f, -0.84f, 2.4f},
+ {0.84f, -1.5f, 2.4f},
+ {0f, -1.5f, 2.4f},
+ {1.75f, 0f, 1.875f},
+ {1.75f, -0.98f, 1.875f},
+ {0.98f, -1.75f, 1.875f},
+ {0f, -1.75f, 1.875f},
+ {2f, 0f, 1.35f},
+ {2f, -1.12f, 1.35f},
+ {1.12f, -2f, 1.35f},
+ {0f, -2f, 1.35f},
+ {2f, 0f, 0.9f},
+ {2f, -1.12f, 0.9f},
+ {1.12f, -2f, 0.9f},
+ {0f, -2f, 0.9f},
+ {-2f, 0f, 0.9f},
+ {2f, 0f, 0.45f},
+ {2f, -1.12f, 0.45f},
+ {1.12f, -2f, 0.45f},
+ {0f, -2f, 0.45f},
+ {1.5f, 0f, 0.225f},
+ {1.5f, -0.84f, 0.225f},
+ {0.84f, -1.5f, 0.225f},
+ {0f, -1.5f, 0.225f},
+ {1.5f, 0f, 0.15f},
+ {1.5f, -0.84f, 0.15f},
+ {0.84f, -1.5f, 0.15f},
+ {0f, -1.5f, 0.15f},
+ {-1.6f, 0f, 2.025f},
+ {-1.6f, -0.3f, 2.025f},
+ {-1.5f, -0.3f, 2.25f},
+ {-1.5f, 0f, 2.25f},
+ {-2.3f, 0f, 2.025f},
+ {-2.3f, -0.3f, 2.025f},
+ {-2.5f, -0.3f, 2.25f},
+ {-2.5f, 0f, 2.25f},
+ {-2.7f, 0f, 2.025f},
+ {-2.7f, -0.3f, 2.025f},
+ {-3f, -0.3f, 2.25f},
+ {-3f, 0f, 2.25f},
+ {-2.7f, 0f, 1.8f},
+ {-2.7f, -0.3f, 1.8f},
+ {-3f, -0.3f, 1.8f},
+ {-3f, 0f, 1.8f},
+ {-2.7f, 0f, 1.575f},
+ {-2.7f, -0.3f, 1.575f},
+ {-3f, -0.3f, 1.35f},
+ {-3f, 0f, 1.35f},
+ {-2.5f, 0f, 1.125f},
+ {-2.5f, -0.3f, 1.125f},
+ {-2.65f, -0.3f, 0.9375f},
+ {-2.65f, 0f, 0.9375f},
+ {-2f, -0.3f, 0.9f},
+ {-1.9f, -0.3f, 0.6f},
+ {-1.9f, 0f, 0.6f},
+ {1.7f, 0f, 1.425f},
+ {1.7f, -0.66f, 1.425f},
+ {1.7f, -0.66f, 0.6f},
+ {1.7f, 0f, 0.6f},
+ {2.6f, 0f, 1.425f},
+ {2.6f, -0.66f, 1.425f},
+ {3.1f, -0.66f, 0.825f},
+ {3.1f, 0f, 0.825f},
+ {2.3f, 0f, 2.1f},
+ {2.3f, -0.25f, 2.1f},
+ {2.4f, -0.25f, 2.025f},
+ {2.4f, 0f, 2.025f},
+ {2.7f, 0f, 2.4f},
+ {2.7f, -0.25f, 2.4f},
+ {3.3f, -0.25f, 2.4f},
+ {3.3f, 0f, 2.4f},
+ {2.8f, 0f, 2.475f},
+ {2.8f, -0.25f, 2.475f},
+ {3.525f, -0.25f, 2.49375f},
+ {3.525f, 0f, 2.49375f},
+ {2.9f, 0f, 2.475f},
+ {2.9f, -0.15f, 2.475f},
+ {3.45f, -0.15f, 2.5125f},
+ {3.45f, 0f, 2.5125f},
+ {2.8f, 0f, 2.4f},
+ {2.8f, -0.15f, 2.4f},
+ {3.2f, -0.15f, 2.4f},
+ {3.2f, 0f, 2.4f},
+ {0f, 0f, 3.15f},
+ {0.8f, 0f, 3.15f},
+ {0.8f, -0.45f, 3.15f},
+ {0.45f, -0.8f, 3.15f},
+ {0f, -0.8f, 3.15f},
+ {0f, 0f, 2.85f},
+ {1.4f, 0f, 2.4f},
+ {1.4f, -0.784f, 2.4f},
+ {0.784f, -1.4f, 2.4f},
+ {0f, -1.4f, 2.4f},
+ {0.4f, 0f, 2.55f},
+ {0.4f, -0.224f, 2.55f},
+ {0.224f, -0.4f, 2.55f},
+ {0f, -0.4f, 2.55f},
+ {1.3f, 0f, 2.55f},
+ {1.3f, -0.728f, 2.55f},
+ {0.728f, -1.3f, 2.55f},
+ {0f, -1.3f, 2.55f},
+ {1.3f, 0f, 2.4f},
+ {1.3f, -0.728f, 2.4f},
+ {0.728f, -1.3f, 2.4f},
+ {0f, -1.3f, 2.4f},
+ {0f, 0f, 0f},
+ {1.425f, -0.798f, 0f},
+ {1.5f, 0f, 0.075f},
+ {1.425f, 0f, 0f},
+ {0.798f, -1.425f, 0f},
+ {0f, -1.5f, 0.075f},
+ {0f, -1.425f, 0f},
+ {1.5f, -0.84f, 0.075f},
+ {0.84f, -1.5f, 0.075f}
+ };
+ // Since GL2.glMap2f expects a packed array of floats, we must convert
+ // from a 3-dimensional array to a 1-dimensional array
+ private static final float[] teapotTex = {
+ 0, 0, 1, 0, 0, 1, 1, 1
+ };
+
+ private static void teapot(GL2 gl,
+ int grid,
+ double scale,
+ int type,
+ boolean backCompatible)
+ {
+ // As mentioned above, GL2.glMap2f expects a packed array of floats
+ float[] p = new float[4*4*3];
+ float[] q = new float[4*4*3];
+ float[] r = new float[4*4*3];
+ float[] s = new float[4*4*3];
+ int i, j, k, l;
+
+ gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_EVAL_BIT | GL2.GL_POLYGON_BIT);
+ gl.glEnable(GL2.GL_AUTO_NORMAL);
+ gl.glEnable(GL2.GL_NORMALIZE);
+ gl.glEnable(GL2.GL_MAP2_VERTEX_3);
+ gl.glEnable(GL2.GL_MAP2_TEXTURE_COORD_2);
+ gl.glPushMatrix();
+ if (!backCompatible) {
+ // The time has come to have the teapot no longer be inside out
+ gl.glFrontFace(GL2.GL_CW);
+ gl.glScaled(0.5*scale, 0.5*scale, 0.5*scale);
+ } else {
+ // We want the teapot in it's backward compatible position and
+ // orientation
+ gl.glRotatef(270.0f, 1, 0, 0);
+ gl.glScalef((float)(0.5 * scale),
+ (float)(0.5 * scale),
+ (float)(0.5 * scale));
+ gl.glTranslatef(0.0f, 0.0f, -1.5f);
+ }
+ for (i = 0; i < 10; i++) {
+ for (j = 0; j < 4; j++) {
+ for (k = 0; k < 4; k++) {
+ for (l = 0; l < 3; l++) {
+ p[(j*4+k)*3+l] = teapotCPData[teapotPatchData[i][j * 4 + k]][l];
+ q[(j*4+k)*3+l] =
+ teapotCPData[teapotPatchData[i][j * 4 + (3 - k)]][l];
+ if (l == 1)
+ q[(j*4+k)*3+l] *= -1.0;
+ if (i < 6) {
+ r[(j*4+k)*3+l] =
+ teapotCPData[teapotPatchData[i][j * 4 + (3 - k)]][l];
+ if (l == 0)
+ r[(j*4+k)*3+l] *= -1.0;
+ s[(j*4+k)*3+l] = teapotCPData[teapotPatchData[i][j * 4 + k]][l];
+ if (l == 0)
+ s[(j*4+k)*3+l] *= -1.0;
+ if (l == 1)
+ s[(j*4+k)*3+l] *= -1.0;
+ }
+ }
+ }
+ }
+ gl.glMap2f(GL2.GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, teapotTex, 0);
+ gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, p, 0);
+ gl.glMapGrid2f(grid, 0.0f, 1.0f, grid, 0.0f, 1.0f);
+ evaluateTeapotMesh(gl, grid, type, i, !backCompatible);
+ gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, q, 0);
+ evaluateTeapotMesh(gl, grid, type, i, !backCompatible);
+ if (i < 6) {
+ gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, r, 0);
+ evaluateTeapotMesh(gl, grid, type, i, !backCompatible);
+ gl.glMap2f(GL2.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, s, 0);
+ evaluateTeapotMesh(gl, grid, type, i, !backCompatible);
+ }
+ }
+ gl.glPopMatrix();
+ gl.glPopAttrib();
+ }
+
+ private static void evaluateTeapotMesh(GL2 gl,
+ int grid,
+ int type,
+ int partNum,
+ boolean repairSingularities)
+ {
+ if (repairSingularities && (partNum == 5 || partNum == 3)) {
+ // Instead of using evaluators that give bad results at singularities,
+ // evaluate by hand
+ gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, type);
+ for (int nv = 0; nv < grid; nv++) {
+ if (nv == 0) {
+ // Draw a small triangle-fan to fill the hole
+ gl.glDisable(GL2.GL_AUTO_NORMAL);
+ gl.glNormal3f(0, 0, partNum == 3 ? 1 : -1);
+ gl.glBegin(GL2.GL_TRIANGLE_FAN);
+ {
+ gl.glEvalCoord2f(0, 0);
+ // Note that we draw in clock-wise order to match the evaluator
+ // method
+ for (int nu = 0; nu <= grid; nu++)
+ {
+ gl.glEvalCoord2f(nu / (float)grid, (1f / grid) / (float)grid);
+ }
+ }
+ gl.glEnd();
+ gl.glEnable(GL2.GL_AUTO_NORMAL);
+ }
+ // Draw the rest of the piece as an evaluated quad-strip
+ gl.glBegin(GL2.GL_QUAD_STRIP);
+ {
+ // Note that we draw in clock-wise order to match the evaluator method
+ for (int nu = grid; nu >= 0; nu--) {
+ gl.glEvalCoord2f(nu / (float)grid, (nv + 1) / (float)grid);
+ gl.glEvalCoord2f(nu / (float)grid, Math.max(nv, 1f / grid)
+ / (float)grid);
+ }
+ }
+ gl.glEnd();
+ }
+ } else {
+ gl.glEvalMesh2(type, 0, grid, 0, grid);
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Font implementation
+ //
+
+ private static void bitmapCharacterImpl(GL2 gl, int font, char cin) {
+ BitmapFontRec fontinfo = getBitmapFont(font);
+ int c = cin & 0xFFFF;
+ if (c < fontinfo.first ||
+ c >= fontinfo.first + fontinfo.num_chars)
+ return;
+ BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+ if (ch != null) {
+ gl.glBitmap(ch.width, ch.height, ch.xorig, ch.yorig,
+ ch.advance, 0, ch.bitmap, 0);
+ }
+ }
+
+ private static final BitmapFontRec[] bitmapFonts = new BitmapFontRec[9];
+ private static final StrokeFontRec[] strokeFonts = new StrokeFontRec[9];
+
+ private static BitmapFontRec getBitmapFont(int font) {
+ BitmapFontRec rec = bitmapFonts[font];
+ if (rec == null) {
+ switch (font) {
+ case BITMAP_9_BY_15:
+ rec = GLUTBitmap9x15.glutBitmap9By15;
+ break;
+ case BITMAP_8_BY_13:
+ rec = GLUTBitmap8x13.glutBitmap8By13;
+ break;
+ case BITMAP_TIMES_ROMAN_10:
+ rec = GLUTBitmapTimesRoman10.glutBitmapTimesRoman10;
+ break;
+ case BITMAP_TIMES_ROMAN_24:
+ rec = GLUTBitmapTimesRoman24.glutBitmapTimesRoman24;
+ break;
+ case BITMAP_HELVETICA_10:
+ rec = GLUTBitmapHelvetica10.glutBitmapHelvetica10;
+ break;
+ case BITMAP_HELVETICA_12:
+ rec = GLUTBitmapHelvetica12.glutBitmapHelvetica12;
+ break;
+ case BITMAP_HELVETICA_18:
+ rec = GLUTBitmapHelvetica18.glutBitmapHelvetica18;
+ break;
+ default:
+ throw new GLException("Unknown bitmap font number " + font);
+ }
+ bitmapFonts[font] = rec;
+ }
+ return rec;
+ }
+
+ private static StrokeFontRec getStrokeFont(int font) {
+ StrokeFontRec rec = strokeFonts[font];
+ if (rec == null) {
+ switch (font) {
+ case STROKE_ROMAN:
+ rec = GLUTStrokeRoman.glutStrokeRoman;
+ break;
+ case STROKE_MONO_ROMAN:
+ rec = GLUTStrokeMonoRoman.glutStrokeMonoRoman;
+ break;
+ default:
+ throw new GLException("Unknown stroke font number " + font);
+ }
+ }
+ return rec;
+ }
+
+ private static void beginBitmap(GL2 gl,
+ int[] swapbytes,
+ int[] lsbfirst,
+ int[] rowlength,
+ int[] skiprows,
+ int[] skippixels,
+ int[] alignment) {
+ gl.glGetIntegerv(GL2.GL_UNPACK_SWAP_BYTES, swapbytes, 0);
+ gl.glGetIntegerv(GL2.GL_UNPACK_LSB_FIRST, lsbfirst, 0);
+ gl.glGetIntegerv(GL2.GL_UNPACK_ROW_LENGTH, rowlength, 0);
+ gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_ROWS, skiprows, 0);
+ gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_PIXELS, skippixels, 0);
+ gl.glGetIntegerv(GL2.GL_UNPACK_ALIGNMENT, alignment, 0);
+ /* Little endian machines (DEC Alpha for example) could
+ benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
+ instead of GL_FALSE, but this would require changing the
+ generated bitmaps too. */
+ gl.glPixelStorei(GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE);
+ gl.glPixelStorei(GL2.GL_UNPACK_LSB_FIRST, GL2.GL_FALSE);
+ gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, 0);
+ gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, 1);
+ }
+
+ private static void endBitmap(GL2 gl,
+ int[] swapbytes,
+ int[] lsbfirst,
+ int[] rowlength,
+ int[] skiprows,
+ int[] skippixels,
+ int[] alignment) {
+ /* Restore saved modes. */
+ gl.glPixelStorei(GL2.GL_UNPACK_SWAP_BYTES, swapbytes[0]);
+ gl.glPixelStorei(GL2.GL_UNPACK_LSB_FIRST, lsbfirst[0]);
+ gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, rowlength[0]);
+ gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, skiprows[0]);
+ gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, skippixels[0]);
+ gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, alignment[0]);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java
new file mode 100644
index 000000000..b6e5c425a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap8x13.java
@@ -0,0 +1,2078 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmap8x13 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+
+static final BitmapCharRec ch0 = new BitmapCharRec(0,0,0,0,8,null);
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,8,null);
+
+static final BitmapCharRec ch127 = new BitmapCharRec(0,0,0,0,8,null);
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,8,null);
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(6,12,-1,2,8,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xb8,(byte) 0xc4,(byte) 0x84,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(6,10,-1,2,8,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(6,12,-1,2,8,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(6,10,-1,0,8,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(6,10,-1,0,8,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(6,10,-1,0,8,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(6,10,-1,0,8,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0x80,(byte) 0x78,(byte) 0xc4,(byte) 0xa4,(byte) 0x94,(byte) 0x8c,(byte) 0x78,(byte) 0x4,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(6,8,-1,1,8,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x0,(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(5,7,-1,-1,8,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(6,10,-1,0,8,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(6,10,-1,0,8,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(6,10,-1,0,8,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(6,10,-1,0,8,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(6,10,-1,0,8,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(6,10,-1,0,8,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x8,(byte) 0x50,(byte) 0x30,(byte) 0x48,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(6,10,-1,0,8,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x50,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(5,10,-1,0,8,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(5,10,-1,0,8,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(5,10,-1,0,8,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(5,10,-1,0,8,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0xfc,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(6,10,-1,0,8,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0xfc,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(6,10,-1,0,8,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0xfc,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(6,10,-1,0,8,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0xfc,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(6,10,-1,0,8,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0x20,(byte) 0x10,(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(6,8,-1,2,8,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0x6c,(byte) 0x92,(byte) 0x90,(byte) 0x7c,(byte) 0x12,(byte) 0x6c,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(7,6,0,0,8,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,(byte) 0x0,(byte) 0x30,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(6,10,-1,0,8,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(6,10,-1,0,8,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(6,10,-1,0,8,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(6,10,-1,0,8,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(6,10,-1,0,8,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(6,10,-1,0,8,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0x80,(byte) 0xb8,(byte) 0xc4,(byte) 0x84,(byte) 0x84,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(6,9,-1,1,8,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,(byte) 0x80,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(6,9,-1,0,8,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x50,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(5,10,-1,0,8,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(6,10,-1,0,8,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(6,10,-1,0,8,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(6,10,-1,0,8,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(6,10,-1,0,8,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0x80,(byte) 0x78,(byte) 0xc4,(byte) 0xa4,(byte) 0xa4,(byte) 0xa4,(byte) 0x94,(byte) 0x94,(byte) 0x8c,(byte) 0x78,(byte) 0x4,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(6,11,-1,1,8,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x30,(byte) 0x48,(byte) 0x84,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(6,6,-1,-1,8,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(7,10,0,0,8,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(7,10,0,0,8,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x24,(byte) 0x18,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(7,10,0,0,8,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(7,10,0,0,8,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x8,(byte) 0x10,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(7,10,0,0,8,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0x82,(byte) 0x86,(byte) 0x8a,(byte) 0x92,(byte) 0xa2,(byte) 0xc2,(byte) 0x82,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(7,10,0,0,8,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0xfc,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xe2,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(7,9,0,0,8,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x50,(byte) 0x50,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(5,10,-1,0,8,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(5,10,-1,0,8,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(5,10,-1,0,8,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(5,10,-1,0,8,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(6,10,-1,0,8,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(6,10,-1,0,8,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(6,10,-1,0,8,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(6,10,-1,0,8,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x20,(byte) 0x10,(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(6,11,-1,2,8,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0x9e,(byte) 0x90,(byte) 0x90,(byte) 0xf0,(byte) 0x9c,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x6e,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(7,9,0,0,8,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x30,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(6,10,-1,0,8,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x0,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(6,10,-1,0,8,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(6,10,-1,0,8,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x0,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(6,10,-1,0,8,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(6,10,-1,0,8,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(6,10,-1,0,8,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(6,9,-1,0,8,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x6,(byte) 0x1a,(byte) 0x12,(byte) 0xa,(byte) 0x66,(byte) 0x92,(byte) 0x10,(byte) 0x20,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(7,10,0,0,8,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x1e,(byte) 0x10,(byte) 0xc,(byte) 0x2,(byte) 0xf2,(byte) 0x4c,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(7,10,0,0,8,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x6,(byte) 0x1a,(byte) 0x12,(byte) 0xa,(byte) 0xe6,(byte) 0x42,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(7,10,0,0,8,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0x90,(byte) 0x48,(byte) 0x24,(byte) 0x12,(byte) 0x24,(byte) 0x48,(byte) 0x90,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(7,7,0,-1,8,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xf0,(byte) 0x0,(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(4,6,-1,-3,8,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(3,6,-1,-4,8,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(2,2,-3,2,8,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(2,1,-3,-4,8,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x68,(byte) 0xe8,(byte) 0xe8,(byte) 0xe8,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(6,9,-1,0,8,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0x80,(byte) 0xb4,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(6,7,-1,1,8,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(2,2,-3,-8,8,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x10,(byte) 0x20,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(4,6,-1,-4,8,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x60,(byte) 0x10,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(4,6,-1,-4,8,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(5,7,-1,-1,8,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(4,4,-2,-5,8,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(6,1,-1,-8,8,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0x38,(byte) 0x44,(byte) 0xaa,(byte) 0xb2,(byte) 0xaa,(byte) 0xaa,(byte) 0x92,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(7,9,0,-1,8,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(6,1,-1,-4,8,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(6,4,-1,-1,8,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x12,(byte) 0x24,(byte) 0x48,(byte) 0x90,(byte) 0x48,(byte) 0x24,(byte) 0x12,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(7,7,0,-1,8,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x78,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x70,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(5,7,-1,-2,8,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x92,(byte) 0xaa,(byte) 0xa2,(byte) 0xaa,(byte) 0x92,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(7,9,0,-1,8,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xd8,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(5,1,-1,-8,8,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x10,(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x80,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(4,10,-2,0,8,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(1,9,-3,0,8,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x7c,(byte) 0x10,(byte) 0x7c,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(7,9,0,0,8,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0x84,(byte) 0x78,(byte) 0x48,(byte) 0x48,(byte) 0x78,(byte) 0x84,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(6,6,-1,-1,8,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0xdc,(byte) 0x62,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x70,(byte) 0x20,(byte) 0x22,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(7,9,0,0,8,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x20,(byte) 0x70,(byte) 0xa8,(byte) 0xa0,(byte) 0xa0,(byte) 0xa8,(byte) 0x70,(byte) 0x20,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(5,8,-1,-1,8,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(1,9,-3,0,8,ch161data);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0x90,(byte) 0xa8,(byte) 0x48,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(5,3,-1,-6,8,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0xe0,(byte) 0x10,(byte) 0x10,(byte) 0x20,(byte) 0x18,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(5,9,-1,0,8,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(1,9,-3,0,8,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0x38,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x38,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(5,9,-2,0,8,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xfc,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(6,6,-1,0,8,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(6,8,-1,2,8,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x30,(byte) 0x48,(byte) 0x84,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(6,6,-1,0,8,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x44,(byte) 0xaa,(byte) 0x92,(byte) 0x92,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(7,6,0,0,8,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x20,(byte) 0x50,(byte) 0x50,(byte) 0x88,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(5,6,-1,0,8,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(6,6,-1,0,8,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xf8,(byte) 0x40,(byte) 0x40,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(6,8,-1,0,8,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x18,(byte) 0x60,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(6,6,-1,0,8,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x44,(byte) 0xb8,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(6,6,-1,0,8,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x8c,(byte) 0x74,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(6,8,-1,2,8,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xb8,(byte) 0xc4,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(6,8,-1,2,8,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(6,6,-1,0,8,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(6,6,-1,0,8,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0x82,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0xec,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(7,6,0,0,8,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x60,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(5,9,-1,0,8,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0x84,(byte) 0x88,(byte) 0x90,(byte) 0xe0,(byte) 0x90,(byte) 0x88,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(6,9,-1,0,8,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x18,(byte) 0x0,(byte) 0x8,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(5,10,-1,2,8,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x60,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(5,8,-1,0,8,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(6,9,-1,0,8,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x78,(byte) 0x80,(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x74,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(6,8,-1,2,8,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xf8,(byte) 0x40,(byte) 0x40,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(6,9,-1,0,8,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0xfc,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(6,6,-1,0,8,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x8c,(byte) 0x74,(byte) 0x4,(byte) 0x4,(byte) 0x4,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(6,9,-1,0,8,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(6,6,-1,0,8,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0xb8,(byte) 0xc4,(byte) 0x84,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(6,9,-1,0,8,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x7c,(byte) 0x4,(byte) 0x78,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(6,6,-1,0,8,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0x10,(byte) 0x60,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(4,3,-2,-6,8,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xfe,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(7,1,0,1,8,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0x88,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(5,3,-1,-6,8,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xf0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(4,9,-1,0,8,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x2,(byte) 0x2,(byte) 0x4,(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(7,9,0,0,8,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(4,9,-2,0,8,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(6,9,-1,0,8,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(7,9,0,0,8,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(7,9,0,0,8,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x44,(byte) 0xaa,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(7,9,0,0,8,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(7,9,0,0,8,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(6,9,-1,0,8,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(7,9,0,0,8,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x4,(byte) 0x78,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(6,9,-1,0,8,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0x84,(byte) 0x88,(byte) 0x90,(byte) 0xa0,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(6,9,-1,0,8,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0x4,(byte) 0x78,(byte) 0x94,(byte) 0xa4,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(6,10,-1,1,8,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(6,9,-1,0,8,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(6,9,-1,0,8,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x8c,(byte) 0x94,(byte) 0xa4,(byte) 0xc4,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(6,9,-1,0,8,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x92,(byte) 0x92,(byte) 0xaa,(byte) 0xc6,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(7,9,0,0,8,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(6,9,-1,0,8,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0x84,(byte) 0x88,(byte) 0x90,(byte) 0xa0,(byte) 0xc0,(byte) 0xa0,(byte) 0x90,(byte) 0x88,(byte) 0x84,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(6,9,-1,0,8,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(6,9,-1,0,8,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(5,9,-1,0,8,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(6,9,-1,0,8,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x9c,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(6,9,-1,0,8,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(6,9,-1,0,8,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(6,9,-1,0,8,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xfc,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(7,9,0,0,8,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(6,9,-1,0,8,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xfc,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x7c,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(7,9,0,0,8,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(6,9,-1,0,8,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x78,(byte) 0x80,(byte) 0x94,(byte) 0xac,(byte) 0xa4,(byte) 0x9c,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(6,9,-1,0,8,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(6,9,-1,0,8,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(5,9,-1,0,8,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xfc,(byte) 0x0,(byte) 0x0,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(6,4,-1,-2,8,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(5,9,-2,0,8,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0x80,(byte) 0x60,(byte) 0x70,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x70,(byte) 0x20,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(4,8,-1,1,8,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x0,(byte) 0x0,(byte) 0x40,(byte) 0xe0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(3,8,-2,1,8,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0x70,(byte) 0x8,(byte) 0x4,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(6,9,-1,0,8,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(6,9,-1,0,8,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(6,9,-1,0,8,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0xc4,(byte) 0xb8,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x38,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(6,9,-1,0,8,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x4,(byte) 0xc4,(byte) 0xb8,(byte) 0x80,(byte) 0x80,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(6,9,-1,0,8,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x8,(byte) 0x8,(byte) 0xfc,(byte) 0x88,(byte) 0x88,(byte) 0x48,(byte) 0x28,(byte) 0x18,(byte) 0x8,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(6,9,-1,0,8,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x4,(byte) 0x38,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(6,9,-1,0,8,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x40,(byte) 0x30,(byte) 0x8,(byte) 0x4,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(6,9,-1,0,8,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xa0,(byte) 0x60,(byte) 0x20,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(5,9,-1,0,8,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x30,(byte) 0x48,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(6,9,-1,0,8,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0x2,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(7,9,0,0,8,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0x40,(byte) 0xe0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(3,3,-2,1,8,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(6,1,-1,-4,8,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0x80,(byte) 0x60,(byte) 0x70,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(4,3,-1,1,8,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(5,5,-1,-2,8,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0x48,(byte) 0x30,(byte) 0xfc,(byte) 0x30,(byte) 0x48,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(6,5,-1,-2,8,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(3,9,-2,0,8,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(3,9,-3,0,8,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0x80,(byte) 0x60,(byte) 0x70,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(4,3,-1,-6,8,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x94,(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(6,7,-1,0,8,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x88,(byte) 0x54,(byte) 0x48,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x48,(byte) 0xa4,(byte) 0x44,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(6,9,-1,0,8,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x20,(byte) 0xf0,(byte) 0x28,(byte) 0x70,(byte) 0xa0,(byte) 0x78,(byte) 0x20,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(5,7,-1,-1,8,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x48,(byte) 0x48,(byte) 0xfc,(byte) 0x48,(byte) 0xfc,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(6,7,-1,-1,8,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0x90,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(4,3,-2,-6,8,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(1,9,-3,0,8,ch33data);
+
+/* char: 0x1f */
+
+static final byte[] ch31data = {
+(byte) 0x80,
+};
+
+static final BitmapCharRec ch31 = new BitmapCharRec(1,1,-3,-3,8,ch31data);
+
+/* char: 0x1e */
+
+static final byte[] ch30data = {
+(byte) 0xdc,(byte) 0x62,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x70,(byte) 0x20,(byte) 0x22,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch30 = new BitmapCharRec(7,9,0,0,8,ch30data);
+
+/* char: 0x1d */
+
+static final byte[] ch29data = {
+(byte) 0x80,(byte) 0x40,(byte) 0xfe,(byte) 0x10,(byte) 0xfe,(byte) 0x4,(byte) 0x2,
+};
+
+static final BitmapCharRec ch29 = new BitmapCharRec(7,7,0,0,8,ch29data);
+
+/* char: 0x1c */
+
+static final byte[] ch28data = {
+(byte) 0x88,(byte) 0x48,(byte) 0x48,(byte) 0x48,(byte) 0x48,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch28 = new BitmapCharRec(6,6,-1,0,8,ch28data);
+
+/* char: 0x1b */
+
+static final byte[] ch27data = {
+(byte) 0xfe,(byte) 0x80,(byte) 0x20,(byte) 0x8,(byte) 0x2,(byte) 0x8,(byte) 0x20,(byte) 0x80,
+};
+
+static final BitmapCharRec ch27 = new BitmapCharRec(7,8,0,0,8,ch27data);
+
+/* char: 0x1a */
+
+static final byte[] ch26data = {
+(byte) 0xfe,(byte) 0x2,(byte) 0x8,(byte) 0x20,(byte) 0x80,(byte) 0x20,(byte) 0x8,(byte) 0x2,
+};
+
+static final BitmapCharRec ch26 = new BitmapCharRec(7,8,0,0,8,ch26data);
+
+/* char: 0x19 */
+
+static final byte[] ch25data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch25 = new BitmapCharRec(1,13,-3,2,8,ch25data);
+
+/* char: 0x18 */
+
+static final byte[] ch24data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xff,
+};
+
+static final BitmapCharRec ch24 = new BitmapCharRec(8,6,0,2,8,ch24data);
+
+/* char: 0x17 */
+
+static final byte[] ch23data = {
+(byte) 0xff,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch23 = new BitmapCharRec(8,8,0,-3,8,ch23data);
+
+/* char: 0x16 */
+
+static final byte[] ch22data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xf0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch22 = new BitmapCharRec(4,13,0,2,8,ch22data);
+
+/* char: 0x15 */
+
+static final byte[] ch21data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch21 = new BitmapCharRec(5,13,-3,2,8,ch21data);
+
+/* char: 0x14 */
+
+static final byte[] ch20data = {
+(byte) 0xff,
+};
+
+static final BitmapCharRec ch20 = new BitmapCharRec(8,1,0,1,8,ch20data);
+
+/* char: 0x13 */
+
+static final byte[] ch19data = {
+(byte) 0xff,
+};
+
+static final BitmapCharRec ch19 = new BitmapCharRec(8,1,0,-1,8,ch19data);
+
+/* char: 0x12 */
+
+static final byte[] ch18data = {
+(byte) 0xff,
+};
+
+static final BitmapCharRec ch18 = new BitmapCharRec(8,1,0,-3,8,ch18data);
+
+/* char: 0x11 */
+
+static final byte[] ch17data = {
+(byte) 0xff,
+};
+
+static final BitmapCharRec ch17 = new BitmapCharRec(8,1,0,-5,8,ch17data);
+
+/* char: 0x10 */
+
+static final byte[] ch16data = {
+(byte) 0xff,
+};
+
+static final BitmapCharRec ch16 = new BitmapCharRec(8,1,0,-7,8,ch16data);
+
+/* char: 0xf */
+
+static final byte[] ch15data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xff,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch15 = new BitmapCharRec(8,13,0,2,8,ch15data);
+
+/* char: 0xe */
+
+static final byte[] ch14data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch14 = new BitmapCharRec(5,8,-3,-3,8,ch14data);
+
+/* char: 0xd */
+
+static final byte[] ch13data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch13 = new BitmapCharRec(5,6,-3,2,8,ch13data);
+
+/* char: 0xc */
+
+static final byte[] ch12data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch12 = new BitmapCharRec(4,6,0,2,8,ch12data);
+
+/* char: 0xb */
+
+static final byte[] ch11data = {
+(byte) 0xf0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch11 = new BitmapCharRec(4,8,0,-3,8,ch11data);
+
+/* char: 0xa */
+
+static final byte[] ch10data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x3e,(byte) 0x20,(byte) 0x50,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch10 = new BitmapCharRec(7,9,0,2,8,ch10data);
+
+/* char: 0x9 */
+
+static final byte[] ch9data = {
+(byte) 0x3e,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x88,(byte) 0x98,(byte) 0xa8,(byte) 0xc8,(byte) 0x88,
+};
+
+static final BitmapCharRec ch9 = new BitmapCharRec(7,9,0,2,8,ch9data);
+
+/* char: 0x8 */
+
+static final byte[] ch8data = {
+(byte) 0xfe,(byte) 0x10,(byte) 0x10,(byte) 0xfe,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch8 = new BitmapCharRec(7,6,0,0,8,ch8data);
+
+/* char: 0x7 */
+
+static final byte[] ch7data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch7 = new BitmapCharRec(5,4,-1,-5,8,ch7data);
+
+/* char: 0x6 */
+
+static final byte[] ch6data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x3c,(byte) 0x20,(byte) 0x3e,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch6 = new BitmapCharRec(7,9,0,2,8,ch6data);
+
+/* char: 0x5 */
+
+static final byte[] ch5data = {
+(byte) 0x22,(byte) 0x22,(byte) 0x3c,(byte) 0x22,(byte) 0x3c,(byte) 0x78,(byte) 0x80,(byte) 0x80,(byte) 0x78,
+};
+
+static final BitmapCharRec ch5 = new BitmapCharRec(7,9,0,2,8,ch5data);
+
+/* char: 0x4 */
+
+static final byte[] ch4data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x1c,(byte) 0x10,(byte) 0x9e,(byte) 0x80,(byte) 0xe0,(byte) 0x80,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch4 = new BitmapCharRec(7,9,0,2,8,ch4data);
+
+/* char: 0x3 */
+
+static final byte[] ch3data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x3e,(byte) 0x88,(byte) 0x88,(byte) 0xf8,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch3 = new BitmapCharRec(7,9,0,2,8,ch3data);
+
+/* char: 0x2 */
+
+static final byte[] ch2data = {
+(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,
+};
+
+static final BitmapCharRec ch2 = new BitmapCharRec(8,12,0,2,8,ch2data);
+
+/* char: 0x1 */
+
+static final byte[] ch1data = {
+(byte) 0x10,(byte) 0x38,(byte) 0x7c,(byte) 0xfe,(byte) 0x7c,(byte) 0x38,(byte) 0x10,
+};
+
+static final BitmapCharRec ch1 = new BitmapCharRec(7,7,0,-1,8,ch1data);
+
+static final BitmapCharRec[] chars = {
+ch0,
+ch1,
+ch2,
+ch3,
+ch4,
+ch5,
+ch6,
+ch7,
+ch8,
+ch9,
+ch10,
+ch11,
+ch12,
+ch13,
+ch14,
+ch15,
+ch16,
+ch17,
+ch18,
+ch19,
+ch20,
+ch21,
+ch22,
+ch23,
+ch24,
+ch25,
+ch26,
+ch27,
+ch28,
+ch29,
+ch30,
+ch31,
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+ch127,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmap8By13 = new BitmapFontRec("-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1",
+ 256,
+ 0,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java
new file mode 100644
index 000000000..bba9a8fc5
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmap9x15.java
@@ -0,0 +1,2079 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmap9x15 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+static final BitmapCharRec ch0 = new BitmapCharRec(0,0,0,0,9,null);
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,9,null);
+
+static final BitmapCharRec ch127 = new BitmapCharRec(0,0,0,0,9,null);
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,9,null);
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(6,14,-1,3,9,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xbc,(byte) 0xc2,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(7,12,-1,3,9,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(6,14,-1,3,9,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x7a,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(7,11,-1,0,9,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x7a,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(7,11,-1,0,9,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x7a,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(7,11,-1,0,9,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x7a,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(7,11,-1,0,9,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0x80,(byte) 0x7c,(byte) 0xa2,(byte) 0xa2,(byte) 0x92,(byte) 0x8a,(byte) 0x8a,(byte) 0x7c,(byte) 0x2,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(7,9,-1,1,9,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x10,(byte) 0x38,(byte) 0x10,(byte) 0x0,(byte) 0xfe,(byte) 0x0,(byte) 0x10,(byte) 0x38,(byte) 0x10,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(7,9,-1,0,9,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(7,11,-1,0,9,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(7,11,-1,0,9,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(7,11,-1,0,9,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(7,11,-1,0,9,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(7,11,-1,0,9,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(7,11,-1,0,9,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x8,(byte) 0x50,(byte) 0x30,(byte) 0x48,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(7,11,-1,0,9,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x50,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(5,11,-2,0,9,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(5,11,-2,0,9,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x60,(byte) 0x10,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(5,11,-2,0,9,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x40,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(5,11,-2,0,9,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x7c,(byte) 0x80,(byte) 0x80,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(7,11,-1,0,9,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x7c,(byte) 0x80,(byte) 0x80,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(7,11,-1,0,9,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x7c,(byte) 0x80,(byte) 0x80,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(7,11,-1,0,9,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x7c,(byte) 0x80,(byte) 0x80,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(7,11,-1,0,9,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0x30,(byte) 0x48,(byte) 0x18,(byte) 0x7c,(byte) 0x82,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(7,10,-1,3,9,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0x6e,(byte) 0x92,(byte) 0x90,(byte) 0x7c,(byte) 0x12,(byte) 0x92,(byte) 0x6c,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(7,7,-1,0,9,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,(byte) 0x0,(byte) 0x18,(byte) 0x24,(byte) 0x18,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(7,11,-1,0,9,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(7,11,-1,0,9,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(7,11,-1,0,9,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(7,11,-1,0,9,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(7,11,-1,0,9,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,(byte) 0x0,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(7,11,-1,0,9,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0x80,(byte) 0xbc,(byte) 0xc2,(byte) 0x82,(byte) 0x82,(byte) 0xfc,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(7,9,-1,1,9,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfc,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(7,10,-1,0,9,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(7,11,-1,0,9,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(7,11,-1,0,9,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(7,11,-1,0,9,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(7,11,-1,0,9,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(7,11,-1,0,9,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0x80,(byte) 0x7c,(byte) 0xc2,(byte) 0xa2,(byte) 0xa2,(byte) 0x92,(byte) 0x92,(byte) 0x8a,(byte) 0x8a,(byte) 0x86,(byte) 0x7c,(byte) 0x2,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(7,12,-1,1,9,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0x82,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(7,7,-1,-1,9,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(7,11,-1,0,9,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(7,11,-1,0,9,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(7,11,-1,0,9,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(7,11,-1,0,9,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(7,11,-1,0,9,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0x82,(byte) 0x86,(byte) 0x8a,(byte) 0x92,(byte) 0x92,(byte) 0xa2,(byte) 0xc2,(byte) 0x82,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(7,11,-1,0,9,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0xfc,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xf2,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(7,10,-1,0,9,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x50,(byte) 0x50,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(5,11,-2,0,9,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(5,11,-2,0,9,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x60,(byte) 0x10,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(5,11,-2,0,9,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x0,(byte) 0x30,(byte) 0x40,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(5,11,-2,0,9,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xfe,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x78,(byte) 0x40,(byte) 0x40,(byte) 0xfe,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(7,11,-1,0,9,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xfe,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x78,(byte) 0x40,(byte) 0x40,(byte) 0xfe,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(7,11,-1,0,9,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xfe,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x78,(byte) 0x40,(byte) 0x40,(byte) 0xfe,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(7,11,-1,0,9,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xfe,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x78,(byte) 0x40,(byte) 0x40,(byte) 0xfe,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(7,11,-1,0,9,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x30,(byte) 0x48,(byte) 0x18,(byte) 0x7c,(byte) 0x82,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(7,13,-1,3,9,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0x9e,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xfc,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x6e,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(7,10,-1,0,9,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x10,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(7,11,-1,0,9,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x0,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(7,11,-1,0,9,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(7,11,-1,0,9,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x0,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(7,11,-1,0,9,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x0,(byte) 0x30,(byte) 0x8,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(7,11,-1,0,9,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x0,(byte) 0x18,(byte) 0x20,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(7,11,-1,0,9,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x10,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(7,10,-1,0,9,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x6,(byte) 0x1a,(byte) 0x12,(byte) 0xa,(byte) 0x66,(byte) 0x92,(byte) 0x10,(byte) 0x20,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(7,10,-1,0,9,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x1e,(byte) 0x10,(byte) 0xc,(byte) 0x2,(byte) 0xf2,(byte) 0x4c,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(7,10,-1,0,9,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x6,(byte) 0x1a,(byte) 0x12,(byte) 0xa,(byte) 0xe6,(byte) 0x42,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(7,10,-1,0,9,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0x90,(byte) 0x48,(byte) 0x24,(byte) 0x12,(byte) 0x12,(byte) 0x24,(byte) 0x48,(byte) 0x90,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(7,8,-1,-1,9,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(5,6,-1,-5,9,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(3,6,-1,-4,9,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x30,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(4,3,-2,3,9,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(2,2,-4,-4,9,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0xa,(byte) 0xa,(byte) 0xa,(byte) 0xa,(byte) 0xa,(byte) 0x7a,(byte) 0x8a,(byte) 0x8a,(byte) 0x8a,(byte) 0x7e,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(7,10,-1,0,9,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xba,(byte) 0xc6,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(7,9,-1,2,9,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0xc0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(3,2,-3,-9,9,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x10,(byte) 0x20,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(4,6,-1,-4,9,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x60,(byte) 0x10,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(4,6,-1,-4,9,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xfe,(byte) 0x0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xfe,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(7,9,-1,-1,9,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(4,4,-3,-6,9,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(6,1,-1,-9,9,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0xa5,(byte) 0xa9,(byte) 0xbd,(byte) 0xa5,(byte) 0xb9,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(8,9,0,-1,9,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(6,1,-1,-4,9,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(6,4,-1,-2,9,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x12,(byte) 0x24,(byte) 0x48,(byte) 0x90,(byte) 0x90,(byte) 0x48,(byte) 0x24,(byte) 0x12,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(7,8,-1,-1,9,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x78,(byte) 0x90,(byte) 0x70,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(5,7,-3,-3,9,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x99,(byte) 0xa5,(byte) 0xa1,(byte) 0xa5,(byte) 0x99,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(8,9,0,-1,9,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xa0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(3,2,-3,-9,9,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(5,11,-2,1,9,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(1,11,-4,1,9,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x7c,(byte) 0x10,(byte) 0x7c,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(7,10,-1,0,9,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x7c,(byte) 0x82,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(7,6,-1,-3,9,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0x5c,(byte) 0xa2,(byte) 0x60,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x22,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(7,10,-1,0,9,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x40,(byte) 0x78,(byte) 0xa4,(byte) 0xa0,(byte) 0x90,(byte) 0x94,(byte) 0x78,(byte) 0x8,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(6,8,-1,0,9,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(1,11,-4,0,9,ch161data);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0x8c,(byte) 0x92,(byte) 0x62,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(7,3,-1,-7,9,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0xe0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x20,(byte) 0x18,(byte) 0x18,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(5,12,-1,1,9,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(1,12,-4,1,9,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0x38,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0xc0,(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x38,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(5,12,-3,1,9,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xfe,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(7,7,-1,0,9,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(6,10,-1,3,9,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0x82,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(7,7,-1,0,9,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x44,(byte) 0xaa,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(7,7,-1,0,9,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(7,7,-1,0,9,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x7a,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(7,7,-1,0,9,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x1c,(byte) 0x22,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xfc,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(7,9,-1,0,9,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x2,(byte) 0x7c,(byte) 0x80,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(7,7,-1,0,9,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x42,(byte) 0x62,(byte) 0x9c,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(7,7,-1,0,9,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x2,(byte) 0x2,(byte) 0x2,(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x86,(byte) 0x7a,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(7,10,-1,3,9,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xbc,(byte) 0xc2,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(7,10,-1,3,9,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(7,7,-1,0,9,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(7,7,-1,0,9,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0x82,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0xec,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(7,7,-1,0,9,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(5,10,-2,0,9,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0x82,(byte) 0x8c,(byte) 0xb0,(byte) 0xc0,(byte) 0xb0,(byte) 0x8c,(byte) 0x82,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(7,10,-1,0,9,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x1c,(byte) 0x0,(byte) 0x0,(byte) 0xc,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(6,13,-1,3,9,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(5,10,-2,0,9,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(7,10,-1,0,9,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x80,(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x7a,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(7,10,-1,3,9,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x22,(byte) 0x22,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(7,10,-1,0,9,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x7c,(byte) 0x80,(byte) 0x80,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(7,7,-1,0,9,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x86,(byte) 0x7a,(byte) 0x2,(byte) 0x2,(byte) 0x2,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(7,10,-1,0,9,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(7,7,-1,0,9,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0xbc,(byte) 0xc2,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(7,10,-1,0,9,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x7e,(byte) 0x2,(byte) 0x2,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(7,7,-1,0,9,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(4,4,-3,-6,9,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xff,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(8,1,0,1,9,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0x82,(byte) 0x44,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(7,4,-1,-6,9,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xf0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(4,12,-2,1,9,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x2,(byte) 0x4,(byte) 0x4,(byte) 0x8,(byte) 0x10,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(7,10,-1,0,9,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(4,12,-3,1,9,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xfe,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(7,10,-1,0,9,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(7,10,-1,0,9,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(7,10,-1,0,9,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x44,(byte) 0xaa,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(7,10,-1,0,9,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(7,10,-1,0,9,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(7,10,-1,0,9,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(7,10,-1,0,9,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x2,(byte) 0xc,(byte) 0x70,(byte) 0x80,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(7,10,-1,0,9,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x84,(byte) 0x88,(byte) 0x90,(byte) 0xfc,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(7,10,-1,0,9,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0x6,(byte) 0x8,(byte) 0x7c,(byte) 0x92,(byte) 0xa2,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(7,12,-1,2,9,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(7,10,-1,0,9,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(7,10,-1,0,9,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x86,(byte) 0x8a,(byte) 0x92,(byte) 0xa2,(byte) 0xc2,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(7,10,-1,0,9,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x92,(byte) 0x92,(byte) 0xaa,(byte) 0xaa,(byte) 0xc6,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(7,10,-1,0,9,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xfe,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(7,10,-1,0,9,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0x82,(byte) 0x84,(byte) 0x88,(byte) 0x90,(byte) 0xa0,(byte) 0xe0,(byte) 0x90,(byte) 0x88,(byte) 0x84,(byte) 0x82,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(7,10,-1,0,9,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0x1e,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(7,10,-1,0,9,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(5,10,-2,0,9,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(7,10,-1,0,9,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x8e,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(7,10,-1,0,9,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x78,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(7,10,-1,0,9,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xfe,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x78,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(7,10,-1,0,9,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xfc,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(7,10,-1,0,9,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(7,10,-1,0,9,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xfc,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0x7c,(byte) 0x42,(byte) 0x42,(byte) 0x42,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(7,10,-1,0,9,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(7,10,-1,0,9,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x7c,(byte) 0x80,(byte) 0x80,(byte) 0x9a,(byte) 0xa6,(byte) 0xa2,(byte) 0x9e,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(7,10,-1,0,9,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(7,10,-1,0,9,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(5,10,-2,0,9,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xfe,(byte) 0x0,(byte) 0x0,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(7,4,-1,-2,9,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(5,10,-2,0,9,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(2,10,-4,3,9,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(2,7,-4,0,9,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0x78,(byte) 0x4,(byte) 0x2,(byte) 0x2,(byte) 0x7a,(byte) 0x86,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(7,10,-1,0,9,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,(byte) 0x44,(byte) 0x82,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(7,10,-1,0,9,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0x2,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(7,10,-1,0,9,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xc2,(byte) 0xbc,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(7,10,-1,0,9,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x2,(byte) 0x2,(byte) 0x2,(byte) 0xc2,(byte) 0xbc,(byte) 0x80,(byte) 0x80,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(7,10,-1,0,9,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0xfe,(byte) 0x84,(byte) 0x44,(byte) 0x24,(byte) 0x14,(byte) 0xc,(byte) 0x4,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(7,10,-1,0,9,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0x7c,(byte) 0x82,(byte) 0x2,(byte) 0x2,(byte) 0x2,(byte) 0x1c,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(7,10,-1,0,9,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xfe,(byte) 0x80,(byte) 0x40,(byte) 0x30,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0x82,(byte) 0x82,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(7,10,-1,0,9,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0xfe,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x90,(byte) 0x50,(byte) 0x30,(byte) 0x10,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(7,10,-1,0,9,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(7,10,-1,0,9,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x4,(byte) 0x2,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(7,10,-1,0,9,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(2,2,-4,0,9,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xfe,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(7,1,-1,-4,9,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(2,5,-4,3,9,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xfe,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(7,7,-1,-1,9,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0x10,(byte) 0x92,(byte) 0x54,(byte) 0x38,(byte) 0x54,(byte) 0x92,(byte) 0x10,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(7,7,-1,-1,9,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(3,12,-3,1,9,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(3,12,-3,1,9,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x30,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(4,4,-3,-6,9,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x62,(byte) 0x94,(byte) 0x88,(byte) 0x94,(byte) 0x62,(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(7,10,-1,0,9,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x84,(byte) 0x4a,(byte) 0x4a,(byte) 0x24,(byte) 0x10,(byte) 0x10,(byte) 0x48,(byte) 0xa4,(byte) 0xa4,(byte) 0x42,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(7,10,-1,0,9,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x10,(byte) 0x7c,(byte) 0x92,(byte) 0x12,(byte) 0x12,(byte) 0x14,(byte) 0x38,(byte) 0x50,(byte) 0x90,(byte) 0x92,(byte) 0x7c,(byte) 0x10,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(7,12,-1,1,9,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x48,(byte) 0x48,(byte) 0xfc,(byte) 0x48,(byte) 0x48,(byte) 0xfc,(byte) 0x48,(byte) 0x48,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(6,8,-1,-1,9,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0x90,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(4,3,-3,-7,9,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(1,11,-4,0,9,ch33data);
+
+/* char: 0x1f */
+
+static final byte[] ch31data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch31 = new BitmapCharRec(2,2,-4,-2,9,ch31data);
+
+/* char: 0x1e */
+
+static final byte[] ch30data = {
+(byte) 0x5c,(byte) 0xa2,(byte) 0x60,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x22,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch30 = new BitmapCharRec(7,10,-1,0,9,ch30data);
+
+/* char: 0x1d */
+
+static final byte[] ch29data = {
+(byte) 0x80,(byte) 0x40,(byte) 0xfe,(byte) 0x10,(byte) 0xfe,(byte) 0x4,(byte) 0x2,
+};
+
+static final BitmapCharRec ch29 = new BitmapCharRec(7,7,-1,0,9,ch29data);
+
+/* char: 0x1c */
+
+static final byte[] ch28data = {
+(byte) 0x44,(byte) 0x24,(byte) 0x24,(byte) 0x24,(byte) 0x24,(byte) 0x24,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch28 = new BitmapCharRec(7,7,-1,0,9,ch28data);
+
+/* char: 0x1b */
+
+static final byte[] ch27data = {
+(byte) 0xfe,(byte) 0x0,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch27 = new BitmapCharRec(7,12,-1,2,9,ch27data);
+
+/* char: 0x1a */
+
+static final byte[] ch26data = {
+(byte) 0xfc,(byte) 0x0,(byte) 0x4,(byte) 0x8,(byte) 0x10,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,
+};
+
+static final BitmapCharRec ch26 = new BitmapCharRec(6,12,-2,2,9,ch26data);
+
+/* char: 0x19 */
+
+static final byte[] ch25data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch25 = new BitmapCharRec(1,15,-4,3,9,ch25data);
+
+/* char: 0x18 */
+
+static final byte[] ch24data = {
+(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch24 = new BitmapCharRec(9,7,0,3,9,ch24data);
+
+/* char: 0x17 */
+
+static final byte[] ch23data = {
+(byte) 0xff,(byte) 0x80,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,
+(byte) 0x8,(byte) 0x0,
+};
+
+static final BitmapCharRec ch23 = new BitmapCharRec(9,9,0,-3,9,ch23data);
+
+/* char: 0x16 */
+
+static final byte[] ch22data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0xf8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,
+};
+
+static final BitmapCharRec ch22 = new BitmapCharRec(5,15,0,3,9,ch22data);
+
+/* char: 0x15 */
+
+static final byte[] ch21data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch21 = new BitmapCharRec(5,15,-4,3,9,ch21data);
+
+/* char: 0x14 */
+
+static final byte[] ch20data = {
+(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch20 = new BitmapCharRec(9,1,0,1,9,ch20data);
+
+/* char: 0x13 */
+
+static final byte[] ch19data = {
+(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch19 = new BitmapCharRec(9,1,0,-1,9,ch19data);
+
+/* char: 0x12 */
+
+static final byte[] ch18data = {
+(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch18 = new BitmapCharRec(9,1,0,-3,9,ch18data);
+
+/* char: 0x11 */
+
+static final byte[] ch17data = {
+(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch17 = new BitmapCharRec(9,1,0,-5,9,ch17data);
+
+/* char: 0x10 */
+
+static final byte[] ch16data = {
+(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch16 = new BitmapCharRec(9,1,0,-7,9,ch16data);
+
+/* char: 0xf */
+
+static final byte[] ch15data = {
+(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0x8,(byte) 0x0,
+(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,
+};
+
+static final BitmapCharRec ch15 = new BitmapCharRec(9,15,0,3,9,ch15data);
+
+/* char: 0xe */
+
+static final byte[] ch14data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch14 = new BitmapCharRec(5,9,-4,-3,9,ch14data);
+
+/* char: 0xd */
+
+static final byte[] ch13data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch13 = new BitmapCharRec(5,7,-4,3,9,ch13data);
+
+/* char: 0xc */
+
+static final byte[] ch12data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch12 = new BitmapCharRec(5,7,0,3,9,ch12data);
+
+/* char: 0xb */
+
+static final byte[] ch11data = {
+(byte) 0xf8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,
+};
+
+static final BitmapCharRec ch11 = new BitmapCharRec(5,9,0,-3,9,ch11data);
+
+/* char: 0xa */
+
+static final byte[] ch10data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x3e,(byte) 0x0,(byte) 0x20,(byte) 0x50,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch10 = new BitmapCharRec(7,10,-1,2,9,ch10data);
+
+/* char: 0x9 */
+
+static final byte[] ch9data = {
+(byte) 0x3e,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x88,(byte) 0x98,(byte) 0xa8,(byte) 0xc8,(byte) 0x88,
+};
+
+static final BitmapCharRec ch9 = new BitmapCharRec(7,10,-1,2,9,ch9data);
+
+/* char: 0x8 */
+
+static final byte[] ch8data = {
+(byte) 0xfe,(byte) 0x10,(byte) 0x10,(byte) 0xfe,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch8 = new BitmapCharRec(7,6,-1,0,9,ch8data);
+
+/* char: 0x7 */
+
+static final byte[] ch7data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch7 = new BitmapCharRec(5,4,-2,-6,9,ch7data);
+
+/* char: 0x6 */
+
+static final byte[] ch6data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x3c,(byte) 0x20,(byte) 0x3e,(byte) 0x0,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch6 = new BitmapCharRec(7,10,-1,2,9,ch6data);
+
+/* char: 0x5 */
+
+static final byte[] ch5data = {
+(byte) 0x22,(byte) 0x22,(byte) 0x3c,(byte) 0x22,(byte) 0x3c,(byte) 0x0,(byte) 0x78,(byte) 0x80,(byte) 0x80,(byte) 0x78,
+};
+
+static final BitmapCharRec ch5 = new BitmapCharRec(7,10,-1,2,9,ch5data);
+
+/* char: 0x4 */
+
+static final byte[] ch4data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x1c,(byte) 0x10,(byte) 0x1e,(byte) 0x80,(byte) 0x80,(byte) 0xe0,(byte) 0x80,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch4 = new BitmapCharRec(7,10,-1,2,9,ch4data);
+
+/* char: 0x3 */
+
+static final byte[] ch3data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x3e,(byte) 0x0,(byte) 0x88,(byte) 0x88,(byte) 0xf8,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch3 = new BitmapCharRec(7,10,-1,2,9,ch3data);
+
+/* char: 0x2 */
+
+static final byte[] ch2data = {
+(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,(byte) 0x55,(byte) 0xaa,
+};
+
+static final BitmapCharRec ch2 = new BitmapCharRec(8,14,0,3,9,ch2data);
+
+/* char: 0x1 */
+
+static final byte[] ch1data = {
+(byte) 0x10,(byte) 0x38,(byte) 0x7c,(byte) 0xfe,(byte) 0x7c,(byte) 0x38,(byte) 0x10,
+};
+
+static final BitmapCharRec ch1 = new BitmapCharRec(7,7,-1,0,9,ch1data);
+
+static final BitmapCharRec[] chars = {
+ch0,
+ch1,
+ch2,
+ch3,
+ch4,
+ch5,
+ch6,
+ch7,
+ch8,
+ch9,
+ch10,
+ch11,
+ch12,
+ch13,
+ch14,
+ch15,
+ch16,
+ch17,
+ch18,
+ch19,
+ch20,
+ch21,
+ch22,
+ch23,
+ch24,
+ch25,
+ch26,
+ch27,
+ch28,
+ch29,
+ch30,
+ch31,
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+ch127,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmap9By15 = new BitmapFontRec("-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1",
+ 256,
+ 0,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java
new file mode 100644
index 000000000..cca045ffa
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica10.java
@@ -0,0 +1,1798 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmapHelvetica10 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x60,(byte) 0xa0,(byte) 0xa0,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(4,10,0,2,5,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xb0,(byte) 0xc8,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(5,10,0,2,6,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x60,(byte) 0xa0,(byte) 0xa0,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(4,11,0,2,5,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(4,8,0,0,5,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(4,9,0,0,5,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(4,9,0,0,5,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(4,9,0,0,5,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0x70,(byte) 0x88,(byte) 0xc8,(byte) 0xa8,(byte) 0x98,(byte) 0x74,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(6,6,0,0,6,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x20,(byte) 0x0,(byte) 0xf8,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(5,5,0,-1,6,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(5,8,0,0,6,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(5,9,0,0,6,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(5,9,0,0,6,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(5,9,0,0,6,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(5,9,0,0,6,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(4,9,0,0,5,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x90,(byte) 0x60,(byte) 0x50,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(5,9,0,0,6,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(3,8,0,0,2,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(3,9,1,0,2,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(2,9,0,0,2,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(2,9,1,0,2,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0xf0,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(4,8,0,0,5,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0xf0,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(4,9,0,0,5,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0xf0,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(4,9,0,0,5,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0xf0,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(4,9,0,0,5,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0x60,(byte) 0x20,(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0x80,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(4,8,0,2,5,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0x6c,(byte) 0x92,(byte) 0x90,(byte) 0x7e,(byte) 0x12,(byte) 0xec,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(7,6,0,0,8,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,(byte) 0x20,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(5,9,0,0,5,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(5,8,0,0,5,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(5,9,0,0,5,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(5,9,0,0,5,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(5,9,0,0,5,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(5,9,0,0,5,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0xa0,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xa0,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(4,8,0,0,5,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x88,(byte) 0x88,(byte) 0xf0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(5,8,-1,0,7,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(7,11,0,0,7,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x48,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(6,10,-1,0,8,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(6,11,-1,0,8,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(6,11,-1,0,8,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(6,11,-1,0,8,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0x80,(byte) 0x78,(byte) 0xc4,(byte) 0xa4,(byte) 0xa4,(byte) 0x94,(byte) 0x94,(byte) 0x8c,(byte) 0x78,(byte) 0x4,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(6,10,-1,1,8,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0x88,(byte) 0x50,(byte) 0x20,(byte) 0x50,(byte) 0x88,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(5,5,0,-1,6,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x48,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(6,10,-1,0,8,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(6,11,-1,0,8,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(6,11,-1,0,8,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(6,11,-1,0,8,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(6,11,-1,0,8,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0x8c,(byte) 0x8c,(byte) 0x94,(byte) 0x94,(byte) 0xa4,(byte) 0xa4,(byte) 0xc4,(byte) 0xc4,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(6,11,-1,0,8,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0x78,(byte) 0x44,(byte) 0x42,(byte) 0x42,(byte) 0xf2,(byte) 0x42,(byte) 0x44,(byte) 0x78,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(7,8,0,0,8,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(3,10,0,0,3,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(3,11,0,0,3,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(2,11,-1,0,3,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(2,11,0,0,3,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(5,10,-1,0,7,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(5,11,-1,0,7,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(5,11,-1,0,7,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(5,11,-1,0,7,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x30,(byte) 0x10,(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(6,10,-1,2,8,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0x8f,(byte) 0x80,(byte) 0x88,(byte) 0x0,(byte) 0x78,(byte) 0x0,(byte) 0x48,(byte) 0x0,(byte) 0x2f,(byte) 0x80,(byte) 0x28,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x1f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(9,8,0,0,10,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(7,11,0,0,7,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x28,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(7,10,0,0,7,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(7,11,0,0,7,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(7,11,0,0,7,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(7,11,0,0,7,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(7,11,0,0,7,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(4,8,-1,2,6,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x21,(byte) 0x0,(byte) 0x17,(byte) 0x80,(byte) 0x13,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0xc8,(byte) 0x0,(byte) 0x24,(byte) 0x0,(byte) 0x44,(byte) 0x0,(byte) 0xe2,(byte) 0x0,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(9,8,0,0,9,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x27,(byte) 0x12,(byte) 0x15,(byte) 0xb,(byte) 0x48,(byte) 0x44,(byte) 0xc4,(byte) 0x42,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(8,8,0,0,9,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x21,(byte) 0x0,(byte) 0x17,(byte) 0x80,(byte) 0x13,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x48,(byte) 0x0,(byte) 0x44,(byte) 0x0,(byte) 0xc4,(byte) 0x0,(byte) 0x42,(byte) 0x0,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(9,8,0,0,9,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0xa0,(byte) 0x50,(byte) 0x28,(byte) 0x50,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(5,5,0,0,6,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xe0,(byte) 0xa0,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(3,5,0,-3,4,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(2,4,0,-3,3,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(2,2,0,2,3,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(2,1,0,-3,3,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x68,(byte) 0xe8,(byte) 0xe8,(byte) 0xe8,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(6,10,0,2,6,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(4,8,0,2,5,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(2,2,0,-6,3,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(3,4,0,-3,3,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0xa0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(3,4,0,-3,3,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(5,7,0,0,6,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(4,4,0,-3,4,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xe0,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(3,1,0,-7,3,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0x38,(byte) 0x44,(byte) 0xaa,(byte) 0xb2,(byte) 0xba,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(7,7,-1,0,9,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xe0,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(3,1,0,-3,4,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x8,(byte) 0x8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(5,3,-1,-2,7,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x28,(byte) 0x50,(byte) 0xa0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(5,5,0,0,6,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x20,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(3,5,0,-3,4,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x9a,(byte) 0xa2,(byte) 0x9a,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(7,7,-1,0,9,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xa0,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(3,1,0,-7,3,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x18,(byte) 0x70,(byte) 0xc8,(byte) 0x98,(byte) 0x70,(byte) 0xc0,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(5,10,0,2,6,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(1,10,-1,2,3,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0xf8,(byte) 0x50,(byte) 0x50,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(5,8,0,0,6,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0x90,(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x90,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(4,6,0,-1,5,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0xb0,(byte) 0x48,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(5,8,0,0,6,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x40,(byte) 0x70,(byte) 0xa8,(byte) 0xa0,(byte) 0xa0,(byte) 0xa8,(byte) 0x70,(byte) 0x10,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(5,8,0,1,6,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(1,8,-1,2,3,ch161data);
+
+/* char: 0xa0 */
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,3,null);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0x98,(byte) 0x64,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(6,2,0,-3,7,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(3,10,0,2,3,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(1,10,-1,2,3,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(3,10,0,2,3,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(4,6,0,0,5,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x60,(byte) 0xa0,(byte) 0xa0,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(4,8,0,2,5,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x50,(byte) 0x20,(byte) 0x50,(byte) 0x88,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(5,6,0,0,6,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x28,(byte) 0x28,(byte) 0x54,(byte) 0x54,(byte) 0x92,(byte) 0x92,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(7,6,0,0,8,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x50,(byte) 0x50,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(5,6,0,0,6,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(4,6,0,0,5,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x60,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x40,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(3,8,0,0,4,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x10,(byte) 0x60,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(4,6,0,0,5,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(3,6,0,0,4,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x98,(byte) 0x68,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(5,8,0,2,6,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xb0,(byte) 0xc8,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(5,8,0,2,6,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(5,6,0,0,6,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(5,6,0,0,6,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0xec,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(7,6,0,0,8,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(1,8,0,0,2,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0x90,(byte) 0x90,(byte) 0xa0,(byte) 0xc0,(byte) 0xa0,(byte) 0x90,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(4,8,0,0,5,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(1,9,0,1,2,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(1,8,0,0,2,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(5,8,0,0,6,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0x70,(byte) 0x8,(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x98,(byte) 0x68,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(5,8,0,2,6,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x30,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(4,8,0,0,4,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0xf0,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(4,6,0,0,5,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x98,(byte) 0x68,(byte) 0x8,(byte) 0x8,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(5,8,0,0,6,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x80,(byte) 0x80,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(4,6,0,0,5,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0xb0,(byte) 0xc8,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(5,8,0,0,6,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(5,6,0,0,5,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(2,3,0,-5,3,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(6,1,0,2,6,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0x88,(byte) 0x50,(byte) 0x50,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(5,5,0,-3,6,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xc0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(2,10,0,2,3,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(3,8,0,0,3,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xc0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(2,10,-1,2,3,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(5,8,-1,0,7,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x82,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(7,8,0,0,7,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x50,(byte) 0x50,(byte) 0x20,(byte) 0x50,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(5,8,-1,0,7,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x49,(byte) 0x0,(byte) 0x49,(byte) 0x0,(byte) 0x88,(byte) 0x80,(byte) 0x88,(byte) 0x80,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(9,8,0,0,9,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(7,8,0,0,7,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(6,8,-1,0,8,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(5,8,0,0,5,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x8,(byte) 0x70,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(5,8,-1,0,7,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xf0,(byte) 0x88,(byte) 0x88,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(5,8,-1,0,7,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0x2,(byte) 0x7c,(byte) 0x8c,(byte) 0x94,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(7,9,-1,1,8,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x88,(byte) 0x88,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(5,8,-1,0,7,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(6,8,-1,0,8,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0x8c,(byte) 0x8c,(byte) 0x94,(byte) 0x94,(byte) 0xa4,(byte) 0xa4,(byte) 0xc4,(byte) 0xc4,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(6,8,-1,0,8,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0xaa,(byte) 0xaa,(byte) 0xc6,(byte) 0xc6,(byte) 0x82,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(7,8,-1,0,9,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(4,8,-1,0,6,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0xa0,(byte) 0x90,(byte) 0x88,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(5,8,-1,0,7,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(4,8,0,0,5,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(1,8,-1,0,3,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xfc,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(6,8,-1,0,8,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0x74,(byte) 0x8c,(byte) 0x84,(byte) 0x8c,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(6,8,-1,0,8,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(5,8,-1,0,6,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(5,8,-1,0,7,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xf0,(byte) 0x88,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x88,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(6,8,-1,0,8,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(6,8,-1,0,8,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xf0,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xf0,(byte) 0x88,(byte) 0x88,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(5,8,-1,0,7,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(7,8,0,0,7,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x40,(byte) 0x0,(byte) 0x9b,(byte) 0x0,(byte) 0xa4,(byte) 0x80,(byte) 0xa4,(byte) 0x80,(byte) 0xa2,(byte) 0x40,(byte) 0x92,(byte) 0x40,(byte) 0x4d,(byte) 0x40,
+(byte) 0x20,(byte) 0x80,(byte) 0x1f,(byte) 0x0,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(10,10,0,2,11,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(4,8,-1,0,6,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(3,5,-1,-1,6,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xf0,(byte) 0x0,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(4,3,0,-2,5,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x80,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(3,5,-1,-1,6,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(2,8,0,2,3,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(1,6,-1,0,3,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(5,8,0,0,6,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(5,8,0,0,6,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(5,8,0,0,6,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(5,8,0,0,6,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(5,8,0,0,6,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x10,(byte) 0x10,(byte) 0xf8,(byte) 0x90,(byte) 0x50,(byte) 0x50,(byte) 0x30,(byte) 0x10,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(5,8,0,0,6,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(5,8,0,0,6,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x40,(byte) 0x30,(byte) 0x8,(byte) 0x8,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(5,8,0,0,6,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(2,8,-1,0,6,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(5,8,0,0,6,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(3,8,0,0,3,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0x80,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(1,1,-1,0,3,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xf8,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(5,1,-1,-3,7,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(2,3,0,2,3,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(5,5,0,-1,6,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0xa0,(byte) 0x40,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(3,3,0,-5,4,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(3,10,-1,2,4,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(3,10,0,2,4,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(2,3,-1,-5,3,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x64,(byte) 0x98,(byte) 0x98,(byte) 0xa4,(byte) 0x60,(byte) 0x50,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(6,8,-1,0,8,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x26,(byte) 0x29,(byte) 0x16,(byte) 0x10,(byte) 0x8,(byte) 0x68,(byte) 0x94,(byte) 0x64,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(8,8,0,0,9,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x20,(byte) 0x70,(byte) 0xa8,(byte) 0x28,(byte) 0x70,(byte) 0xa0,(byte) 0xa8,(byte) 0x70,(byte) 0x20,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(5,9,0,1,6,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x50,(byte) 0x50,(byte) 0xf8,(byte) 0x28,(byte) 0x7c,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(6,7,0,0,6,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0xa0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(3,2,-1,-6,4,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(1,8,-1,0,3,ch33data);
+
+/* char: 0x20 ' ' */
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,3,null);
+
+static final BitmapCharRec[] chars = {
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmapHelvetica10 = new BitmapFontRec("-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1",
+ 224,
+ 32,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java
new file mode 100644
index 000000000..b73c82fa9
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica12.java
@@ -0,0 +1,1808 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmapHelvetica12 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x30,(byte) 0x50,(byte) 0x50,(byte) 0x48,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(5,12,-1,3,7,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xb0,(byte) 0xc8,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(5,12,-1,3,7,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x50,(byte) 0x50,(byte) 0x90,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(5,13,-1,3,7,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(5,9,-1,0,7,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(5,10,-1,0,7,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(5,10,-1,0,7,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(5,10,-1,0,7,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0xb8,(byte) 0x44,(byte) 0x64,(byte) 0x54,(byte) 0x4c,(byte) 0x44,(byte) 0x3a,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(7,7,0,0,7,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x20,(byte) 0x0,(byte) 0xf8,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(5,5,-1,-1,7,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(5,9,-1,0,7,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(5,10,-1,0,7,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(5,10,-1,0,7,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(5,10,-1,0,7,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(5,10,-1,0,7,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(5,10,-1,0,7,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x50,(byte) 0x30,(byte) 0x68,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(5,10,-1,0,7,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(3,9,0,0,3,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(3,10,0,0,3,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(2,10,-1,0,3,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(2,10,0,0,3,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0xf8,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(5,9,-1,0,7,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0xf8,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(5,10,-1,0,7,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0xf8,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(5,10,-1,0,7,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0xf8,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(5,10,-1,0,7,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0x60,(byte) 0x10,(byte) 0x20,(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(5,10,-1,3,7,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0x77,(byte) 0x0,(byte) 0x88,(byte) 0x80,(byte) 0x88,(byte) 0x0,(byte) 0x7f,(byte) 0x80,(byte) 0x8,(byte) 0x80,(byte) 0x88,(byte) 0x80,(byte) 0x77,(byte) 0x0,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(9,7,-1,0,11,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,(byte) 0x30,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(6,10,-1,0,7,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(6,9,-1,0,7,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(6,10,-1,0,7,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(6,10,-1,0,7,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(6,10,-1,0,7,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(6,10,-1,0,7,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0xb0,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xb0,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(5,9,-1,0,7,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(6,9,-1,0,8,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(7,12,-1,0,9,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x48,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(6,11,-1,0,8,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(6,12,-1,0,8,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(6,12,-1,0,8,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(6,12,-1,0,8,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x5e,(byte) 0x0,(byte) 0x21,(byte) 0x0,(byte) 0x50,(byte) 0x80,(byte) 0x48,(byte) 0x80,(byte) 0x44,(byte) 0x80,(byte) 0x44,(byte) 0x80,(byte) 0x42,(byte) 0x80,
+(byte) 0x21,(byte) 0x0,(byte) 0x1e,(byte) 0x80,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(10,11,0,1,10,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0x88,(byte) 0x50,(byte) 0x20,(byte) 0x50,(byte) 0x88,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(5,5,-1,-1,7,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,(byte) 0x0,(byte) 0x24,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(8,11,-1,0,10,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(8,12,-1,0,10,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,(byte) 0x0,(byte) 0x14,(byte) 0x8,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(8,12,-1,0,10,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,(byte) 0x0,(byte) 0x8,(byte) 0x4,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(8,12,-1,0,10,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,(byte) 0x0,(byte) 0x8,(byte) 0x10,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(8,12,-1,0,10,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0x82,(byte) 0x86,(byte) 0x8a,(byte) 0x8a,(byte) 0x92,(byte) 0xa2,(byte) 0xa2,(byte) 0xc2,(byte) 0x82,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(7,12,-1,0,9,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0x7c,(byte) 0x42,(byte) 0x41,(byte) 0x41,(byte) 0xf1,(byte) 0x41,(byte) 0x41,(byte) 0x42,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(8,9,0,0,9,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(3,11,0,0,3,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(3,12,0,0,3,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(2,12,-1,0,3,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(2,12,0,0,3,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x28,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(6,11,-1,0,8,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(6,12,-1,0,8,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(6,12,-1,0,8,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(6,12,-1,0,8,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x30,(byte) 0x8,(byte) 0x8,(byte) 0x3c,(byte) 0x42,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(7,12,-1,3,9,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0x8f,(byte) 0x80,(byte) 0x88,(byte) 0x0,(byte) 0x88,(byte) 0x0,(byte) 0x78,(byte) 0x0,(byte) 0x4f,(byte) 0x80,(byte) 0x48,(byte) 0x0,(byte) 0x28,(byte) 0x0,(byte) 0x28,(byte) 0x0,
+(byte) 0x1f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(9,9,-1,0,11,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(7,12,-1,0,9,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x28,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(7,11,-1,0,9,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(7,12,-1,0,9,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(7,12,-1,0,9,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(7,12,-1,0,9,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(7,12,-1,0,9,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(5,9,-1,3,7,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x21,(byte) 0x0,(byte) 0x17,(byte) 0x80,(byte) 0x15,(byte) 0x0,(byte) 0xb,(byte) 0x0,(byte) 0xc9,(byte) 0x0,(byte) 0x24,(byte) 0x0,(byte) 0x44,(byte) 0x0,(byte) 0x22,(byte) 0x0,
+(byte) 0xe1,(byte) 0x0,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(9,9,0,0,10,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x47,(byte) 0x80,(byte) 0x22,(byte) 0x0,(byte) 0x11,(byte) 0x0,(byte) 0x14,(byte) 0x80,(byte) 0x4b,(byte) 0x0,(byte) 0x48,(byte) 0x0,(byte) 0x44,(byte) 0x0,(byte) 0xc2,(byte) 0x0,
+(byte) 0x41,(byte) 0x0,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(9,9,0,0,10,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x41,(byte) 0x0,(byte) 0x27,(byte) 0x80,(byte) 0x15,(byte) 0x0,(byte) 0x13,(byte) 0x0,(byte) 0x49,(byte) 0x0,(byte) 0x44,(byte) 0x0,(byte) 0x44,(byte) 0x0,(byte) 0xc2,(byte) 0x0,
+(byte) 0x41,(byte) 0x0,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(9,9,0,0,10,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0xa0,(byte) 0x50,(byte) 0x28,(byte) 0x50,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(5,5,-1,-1,7,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xe0,(byte) 0xa0,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(3,5,-1,-4,5,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(2,5,-1,-3,4,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(3,4,0,3,3,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0x80,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(1,1,-1,-3,3,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x68,(byte) 0xe8,(byte) 0xe8,(byte) 0xe8,(byte) 0x68,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(6,12,0,3,7,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xe8,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(5,10,-1,3,7,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(2,2,0,-8,2,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0x20,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(3,5,0,-3,4,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xf0,(byte) 0x40,(byte) 0x20,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(4,5,0,-3,4,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(5,7,-1,0,7,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(4,4,0,-4,5,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xf0,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(4,1,0,-8,4,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x41,(byte) 0x0,(byte) 0x94,(byte) 0x80,(byte) 0x94,(byte) 0x80,(byte) 0x98,(byte) 0x80,(byte) 0x94,(byte) 0x80,(byte) 0x9c,(byte) 0x80,(byte) 0x41,(byte) 0x0,
+(byte) 0x3e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(9,9,-1,0,11,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xf0,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(4,1,0,-3,5,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x4,(byte) 0x4,(byte) 0x4,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(6,4,-1,-2,8,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x28,(byte) 0x50,(byte) 0xa0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(5,5,-1,-1,7,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x20,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(3,5,-1,-4,5,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x41,(byte) 0x0,(byte) 0x9c,(byte) 0x80,(byte) 0xa2,(byte) 0x80,(byte) 0xa0,(byte) 0x80,(byte) 0xa2,(byte) 0x80,(byte) 0x9c,(byte) 0x80,(byte) 0x41,(byte) 0x0,
+(byte) 0x3e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(9,9,-1,0,11,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xa0,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(3,1,0,-8,3,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x30,(byte) 0x48,(byte) 0x88,(byte) 0x88,(byte) 0x90,(byte) 0x60,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(5,12,0,3,6,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(1,11,-1,2,3,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x50,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(5,9,-1,0,7,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0x84,(byte) 0x78,(byte) 0x48,(byte) 0x48,(byte) 0x78,(byte) 0x84,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(6,6,0,-1,7,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0xb0,(byte) 0x48,(byte) 0x20,(byte) 0x20,(byte) 0xf0,(byte) 0x40,(byte) 0x40,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(5,9,-1,0,7,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x40,(byte) 0x70,(byte) 0xc8,(byte) 0xa0,(byte) 0xa0,(byte) 0xa0,(byte) 0xa8,(byte) 0x70,(byte) 0x10,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(5,9,-1,1,7,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(1,10,-1,3,3,ch161data);
+
+/* char: 0xa0 */
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,4,null);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0x98,(byte) 0x64,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(6,2,0,-3,7,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(4,12,0,3,4,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(1,12,-1,3,3,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0x30,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x30,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(4,12,0,3,4,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xf0,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(4,7,-1,0,6,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x50,(byte) 0x50,(byte) 0x90,(byte) 0x88,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(5,10,-1,3,7,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x48,(byte) 0x30,(byte) 0x30,(byte) 0x48,(byte) 0x84,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(6,7,0,0,6,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x49,(byte) 0x0,(byte) 0x49,(byte) 0x0,(byte) 0x88,(byte) 0x80,(byte) 0x88,(byte) 0x80,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(9,7,0,0,9,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x50,(byte) 0x50,(byte) 0x88,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(5,7,-1,0,7,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(5,7,-1,0,7,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x60,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x40,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(3,9,0,0,3,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x10,(byte) 0x60,(byte) 0x80,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(4,7,-1,0,6,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(3,7,-1,0,4,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x98,(byte) 0x68,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(5,10,-1,3,7,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xb0,(byte) 0xc8,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(5,10,-1,3,7,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(5,7,-1,0,7,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(5,7,-1,0,7,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0xda,(byte) 0xa4,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(7,7,-1,0,9,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(1,9,-1,0,3,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0x88,(byte) 0x90,(byte) 0xa0,(byte) 0xc0,(byte) 0xc0,(byte) 0xa0,(byte) 0x90,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(5,9,-1,0,6,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(2,12,0,3,3,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(1,9,-1,0,3,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(5,9,-1,0,7,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x98,(byte) 0x68,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(5,10,-1,3,7,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x30,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(4,9,0,0,3,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0xf8,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(5,7,-1,0,7,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x68,(byte) 0x98,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x98,(byte) 0x68,(byte) 0x8,(byte) 0x8,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(5,9,-1,0,7,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(5,7,-1,0,7,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0xb0,(byte) 0xc8,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(5,9,-1,0,7,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0x74,(byte) 0x88,(byte) 0x88,(byte) 0x78,(byte) 0x8,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(6,7,-1,0,7,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0xc0,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(2,3,0,-6,3,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xfe,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(7,1,0,2,7,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0x88,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(5,3,0,-5,6,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xc0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(2,12,0,3,3,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(4,9,0,0,4,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xc0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(2,12,-1,3,3,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xfe,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x4,(byte) 0x2,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(7,9,-1,0,9,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(7,9,-1,0,9,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0x82,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x82,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(7,9,-1,0,9,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x49,(byte) 0x0,(byte) 0x88,(byte) 0x80,(byte) 0x88,(byte) 0x80,
+(byte) 0x88,(byte) 0x80,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(9,9,-1,0,11,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(7,9,-1,0,9,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x84,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(6,9,-1,0,8,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(7,9,0,0,7,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0x78,(byte) 0x84,(byte) 0x84,(byte) 0x4,(byte) 0x18,(byte) 0x60,(byte) 0x80,(byte) 0x84,(byte) 0x78,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(6,9,-1,0,8,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0x88,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(6,9,-1,0,8,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0x3d,(byte) 0x42,(byte) 0x85,(byte) 0x89,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(8,9,-1,0,10,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(6,9,-1,0,8,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x81,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(8,9,-1,0,10,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0x82,(byte) 0x86,(byte) 0x8a,(byte) 0x8a,(byte) 0x92,(byte) 0xa2,(byte) 0xa2,(byte) 0xc2,(byte) 0x82,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(7,9,-1,0,9,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0x88,(byte) 0x80,(byte) 0x88,(byte) 0x80,(byte) 0x94,(byte) 0x80,(byte) 0x94,(byte) 0x80,(byte) 0xa2,(byte) 0x80,(byte) 0xa2,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,
+(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(9,9,-1,0,11,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(5,9,-1,0,7,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0x82,(byte) 0x84,(byte) 0x88,(byte) 0x90,(byte) 0xe0,(byte) 0xa0,(byte) 0x90,(byte) 0x88,(byte) 0x84,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(7,9,-1,0,8,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,(byte) 0x8,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(5,9,-1,0,7,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(1,9,-1,0,3,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0xfe,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(7,9,-1,0,9,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0x3a,(byte) 0x46,(byte) 0x82,(byte) 0x82,(byte) 0x8e,(byte) 0x80,(byte) 0x80,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(7,9,-1,0,9,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(6,9,-1,0,8,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(6,9,-1,0,8,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xf8,(byte) 0x84,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x84,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(7,9,-1,0,9,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0x3c,(byte) 0x42,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(7,9,-1,0,9,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(6,9,-1,0,8,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0x28,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(7,9,-1,0,9,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x40,(byte) 0x0,(byte) 0x9b,(byte) 0x0,(byte) 0xa6,(byte) 0x80,(byte) 0xa2,(byte) 0x40,(byte) 0xa2,(byte) 0x40,(byte) 0x92,(byte) 0x40,(byte) 0x4d,(byte) 0x40,
+(byte) 0x60,(byte) 0x80,(byte) 0x1f,(byte) 0x0,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(10,10,-1,1,12,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x20,(byte) 0x0,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(5,9,-1,0,7,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(6,5,-1,-1,7,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(5,3,-1,-2,7,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0xc,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(6,5,0,-1,7,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(2,8,0,2,3,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(1,6,-1,0,3,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0x78,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(5,9,-1,0,7,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(5,9,-1,0,7,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x10,(byte) 0x8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(5,9,-1,0,7,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0xc8,(byte) 0xb0,(byte) 0x80,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(5,9,-1,0,7,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0xf0,(byte) 0x80,(byte) 0x80,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(5,9,-1,0,7,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x8,(byte) 0x8,(byte) 0xfc,(byte) 0x88,(byte) 0x48,(byte) 0x28,(byte) 0x28,(byte) 0x18,(byte) 0x8,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(6,9,0,0,7,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x8,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(5,9,-1,0,7,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xf8,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x8,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(5,9,-1,0,7,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xe0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(3,9,-1,0,7,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x88,(byte) 0x70,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(5,9,-1,0,7,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x10,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(4,9,0,0,4,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0x80,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(1,1,-1,0,3,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xf8,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(5,1,-1,-3,8,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(2,3,-1,2,4,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(5,5,-1,-1,7,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0xa0,(byte) 0x40,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(3,3,-1,-6,5,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(3,12,0,3,4,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(3,12,-1,3,4,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0x80,(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(2,3,-1,-6,3,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x72,(byte) 0x8c,(byte) 0x84,(byte) 0x8a,(byte) 0x50,(byte) 0x30,(byte) 0x48,(byte) 0x48,(byte) 0x30,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(7,9,-1,0,9,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x23,(byte) 0x0,(byte) 0x14,(byte) 0x80,(byte) 0x14,(byte) 0x80,(byte) 0x13,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x68,(byte) 0x0,(byte) 0x94,(byte) 0x0,(byte) 0x94,(byte) 0x0,
+(byte) 0x62,(byte) 0x0,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(9,9,-1,0,11,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x20,(byte) 0x70,(byte) 0xa8,(byte) 0xa8,(byte) 0x28,(byte) 0x70,(byte) 0xa0,(byte) 0xa8,(byte) 0x70,(byte) 0x20,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(5,10,-1,1,7,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x50,(byte) 0x50,(byte) 0x50,(byte) 0xfc,(byte) 0x28,(byte) 0xfc,(byte) 0x28,(byte) 0x28,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(6,8,0,0,7,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0xa0,(byte) 0xa0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(3,3,-1,-6,5,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(1,9,-1,0,3,ch33data);
+
+/* char: 0x20 ' ' */
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,4,null);
+
+static final BitmapCharRec[] chars = {
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmapHelvetica12 = new BitmapFontRec("-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1",
+ 224,
+ 32,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java
new file mode 100644
index 000000000..cf34a6d25
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapHelvetica18.java
@@ -0,0 +1,1917 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmapHelvetica18 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0x70,(byte) 0x70,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x3c,(byte) 0x24,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x0,(byte) 0x66,
+(byte) 0x66,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(8,17,-1,4,10,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xde,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xe3,(byte) 0x0,(byte) 0xc1,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xe3,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xde,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(9,18,-1,4,11,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0x70,(byte) 0x70,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x3c,(byte) 0x24,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x0,(byte) 0x18,
+(byte) 0xc,(byte) 0x6,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(8,18,-1,4,10,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x73,(byte) 0xfb,(byte) 0xc7,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x0,(byte) 0x66,(byte) 0x66,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(8,13,-1,0,10,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x73,(byte) 0xfb,(byte) 0xc7,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x0,(byte) 0x66,(byte) 0x3c,(byte) 0x18,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(8,14,-1,0,10,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x73,(byte) 0xfb,(byte) 0xc7,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x6,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(8,14,-1,0,10,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x73,(byte) 0xfb,(byte) 0xc7,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x30,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(8,14,-1,0,10,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0xce,(byte) 0x0,(byte) 0x7f,(byte) 0x80,(byte) 0x31,(byte) 0x80,(byte) 0x78,(byte) 0xc0,(byte) 0x6c,(byte) 0xc0,(byte) 0x66,(byte) 0xc0,(byte) 0x63,(byte) 0xc0,(byte) 0x31,(byte) 0x80,
+(byte) 0x3f,(byte) 0xc0,(byte) 0xe,(byte) 0x60,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(11,10,0,0,11,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x0,(byte) 0xff,(byte) 0xff,(byte) 0x0,(byte) 0x18,(byte) 0x18,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(8,8,-1,-1,10,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x36,(byte) 0x0,(byte) 0x36,(byte) 0x0,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(9,13,-1,0,11,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x26,(byte) 0x0,(byte) 0x2d,(byte) 0x0,(byte) 0x19,(byte) 0x0,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(9,14,-1,0,11,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(9,14,-1,0,11,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(9,14,-1,0,11,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(9,14,-1,0,11,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xe3,(byte) 0xdf,(byte) 0xce,(byte) 0x0,(byte) 0x4c,(byte) 0x5a,(byte) 0x32,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(8,14,-1,0,10,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x4c,(byte) 0x0,(byte) 0x38,(byte) 0x0,(byte) 0x36,(byte) 0x0,(byte) 0x60,(byte) 0x0,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(9,14,-1,0,11,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x0,(byte) 0xd8,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(5,13,0,0,4,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0xcc,(byte) 0x78,(byte) 0x30,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(6,14,1,0,4,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x0,(byte) 0xc0,(byte) 0x60,(byte) 0x30,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(4,14,0,0,4,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x0,(byte) 0x30,(byte) 0x60,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(4,14,0,0,4,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x3c,(byte) 0x7f,(byte) 0xe3,(byte) 0xc0,(byte) 0xc0,(byte) 0xff,(byte) 0xc3,(byte) 0xc3,(byte) 0x7e,(byte) 0x3c,(byte) 0x0,(byte) 0x36,(byte) 0x36,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(8,13,-1,0,10,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x3c,(byte) 0x7f,(byte) 0xe3,(byte) 0xc0,(byte) 0xc0,(byte) 0xff,(byte) 0xc3,(byte) 0xc3,(byte) 0x7e,(byte) 0x3c,(byte) 0x0,(byte) 0x66,(byte) 0x3c,(byte) 0x18,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(8,14,-1,0,10,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x3c,(byte) 0x7f,(byte) 0xe3,(byte) 0xc0,(byte) 0xc0,(byte) 0xff,(byte) 0xc3,(byte) 0xc3,(byte) 0x7e,(byte) 0x3c,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x6,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(8,14,-1,0,10,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x3c,(byte) 0x7f,(byte) 0xe3,(byte) 0xc0,(byte) 0xc0,(byte) 0xff,(byte) 0xc3,(byte) 0xc3,(byte) 0x7e,(byte) 0x3c,(byte) 0x0,(byte) 0x18,(byte) 0x30,(byte) 0x60,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(8,14,-1,0,10,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0x78,(byte) 0x6c,(byte) 0xc,(byte) 0x38,(byte) 0x3e,(byte) 0x7f,(byte) 0x63,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x63,(byte) 0x7f,(byte) 0x3e,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(8,14,-1,4,10,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0x75,(byte) 0xe0,(byte) 0xef,(byte) 0xf8,(byte) 0xc7,(byte) 0x18,(byte) 0xc6,(byte) 0x0,(byte) 0xe6,(byte) 0x0,(byte) 0x7f,(byte) 0xf8,(byte) 0xe,(byte) 0x18,(byte) 0xc6,(byte) 0x18,
+(byte) 0xef,(byte) 0xf0,(byte) 0x7d,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(13,10,-1,0,15,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,(byte) 0x38,(byte) 0x6c,(byte) 0x6c,(byte) 0x38,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(7,14,-1,0,9,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,(byte) 0x0,(byte) 0x6c,(byte) 0x6c,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(7,13,-1,0,9,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,(byte) 0x0,(byte) 0x4c,(byte) 0x5a,(byte) 0x32,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(7,14,-1,0,9,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,(byte) 0x0,(byte) 0x66,(byte) 0x3c,(byte) 0x18,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(7,14,-1,0,9,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,(byte) 0x0,(byte) 0x30,(byte) 0x18,(byte) 0xc,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(7,14,-1,0,9,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,(byte) 0x0,(byte) 0x18,(byte) 0x30,(byte) 0x60,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(7,14,-1,0,9,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0xdc,(byte) 0xde,(byte) 0xc6,(byte) 0xc6,(byte) 0xc6,(byte) 0xc6,(byte) 0xdc,(byte) 0xdc,(byte) 0xc6,(byte) 0xc6,(byte) 0xc6,(byte) 0xc6,(byte) 0x7c,(byte) 0x38,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(7,14,-1,0,9,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xc1,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc1,(byte) 0xc0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(10,14,-1,0,12,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(12,18,-1,0,14,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x1f,(byte) 0x0,(byte) 0x7f,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0x19,(byte) 0x80,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(11,17,-1,0,13,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x1f,(byte) 0x0,(byte) 0x7f,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(11,18,-1,0,13,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x1f,(byte) 0x0,(byte) 0x7f,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(11,18,-1,0,13,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x1f,(byte) 0x0,(byte) 0x7f,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0x0,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(11,18,-1,0,13,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0xc7,(byte) 0xc0,(byte) 0xff,(byte) 0xf0,(byte) 0x78,(byte) 0x38,(byte) 0x38,(byte) 0x18,(byte) 0x6c,(byte) 0x1c,(byte) 0x6e,(byte) 0xc,(byte) 0x67,(byte) 0xc,(byte) 0x63,(byte) 0x8c,
+(byte) 0x61,(byte) 0xcc,(byte) 0x70,(byte) 0xdc,(byte) 0x30,(byte) 0x78,(byte) 0x38,(byte) 0x38,(byte) 0x1f,(byte) 0xfc,(byte) 0x7,(byte) 0xcc,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(14,14,0,0,15,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x33,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x61,(byte) 0x80,
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(10,9,0,0,10,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x38,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0xd,(byte) 0x80,
+(byte) 0xd,(byte) 0x80,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(13,17,-1,0,15,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x38,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x9,(byte) 0x80,
+(byte) 0xb,(byte) 0x40,(byte) 0x6,(byte) 0x40,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(13,18,-1,0,15,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x38,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0xc,(byte) 0xc0,
+(byte) 0x7,(byte) 0x80,(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(13,18,-1,0,15,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x38,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x3,(byte) 0x0,
+(byte) 0x1,(byte) 0x80,(byte) 0x0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(13,18,-1,0,15,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x38,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x3,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(13,18,-1,0,15,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe0,(byte) 0xc1,(byte) 0xe0,(byte) 0xc1,(byte) 0xe0,(byte) 0xc3,(byte) 0x60,(byte) 0xc6,(byte) 0x60,(byte) 0xc6,(byte) 0x60,(byte) 0xcc,(byte) 0x60,
+(byte) 0xcc,(byte) 0x60,(byte) 0xd8,(byte) 0x60,(byte) 0xd8,(byte) 0x60,(byte) 0xf0,(byte) 0x60,(byte) 0xe0,(byte) 0x60,(byte) 0xe0,(byte) 0x60,(byte) 0x0,(byte) 0x0,(byte) 0x13,(byte) 0x0,
+(byte) 0x16,(byte) 0x80,(byte) 0xc,(byte) 0x80,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(11,18,-1,0,13,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0x7f,(byte) 0x80,(byte) 0x7f,(byte) 0xc0,(byte) 0x60,(byte) 0xe0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x30,(byte) 0x60,(byte) 0x30,(byte) 0xfc,(byte) 0x30,(byte) 0xfc,(byte) 0x30,
+(byte) 0x60,(byte) 0x30,(byte) 0x60,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xe0,(byte) 0x7f,(byte) 0xc0,(byte) 0x7f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(12,14,0,0,13,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0xcc,
+(byte) 0xcc,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(6,17,0,0,6,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0xcc,
+(byte) 0x78,(byte) 0x30,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(6,18,0,0,6,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,
+(byte) 0x60,(byte) 0x30,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(4,18,-2,0,6,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0x30,
+(byte) 0x60,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(4,18,0,0,6,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+(byte) 0x33,(byte) 0x0,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(9,17,-1,0,11,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+(byte) 0x1e,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(9,18,-1,0,11,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(9,18,-1,0,11,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+(byte) 0x18,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(9,18,-1,0,11,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x1b,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,
+(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xe0,(byte) 0x0,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,
+(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(12,18,-1,4,14,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0xc1,(byte) 0xff,(byte) 0xc1,(byte) 0xff,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x7f,(byte) 0x80,(byte) 0x3f,(byte) 0x80,(byte) 0x31,(byte) 0xfe,(byte) 0x31,(byte) 0xfe,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xd,(byte) 0x80,(byte) 0xd,(byte) 0x80,(byte) 0x7,(byte) 0xff,(byte) 0x7,(byte) 0xff,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(16,14,-1,0,18,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(12,18,0,0,12,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0x19,(byte) 0x80,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(12,17,0,0,12,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x13,(byte) 0x0,
+(byte) 0x16,(byte) 0x80,(byte) 0xc,(byte) 0x80,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(12,18,0,0,12,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(12,18,0,0,12,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(12,18,0,0,12,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0x0,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(12,18,0,0,12,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0x7c,(byte) 0xfe,(byte) 0xc6,(byte) 0xc6,(byte) 0xe0,(byte) 0x70,(byte) 0x38,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x0,(byte) 0x0,(byte) 0x18,(byte) 0x18,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(7,14,-1,4,10,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xc,(byte) 0xfc,(byte) 0x6,(byte) 0xd8,(byte) 0x6,(byte) 0x78,(byte) 0x73,(byte) 0x38,(byte) 0xf9,(byte) 0x18,(byte) 0x99,(byte) 0x88,
+(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x98,(byte) 0x60,(byte) 0xf8,(byte) 0x30,(byte) 0x70,(byte) 0x30,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(14,13,0,0,15,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x30,(byte) 0xf8,(byte) 0x30,(byte) 0xf8,(byte) 0x18,(byte) 0x60,(byte) 0xc,(byte) 0x30,(byte) 0xc,(byte) 0x18,(byte) 0x66,(byte) 0x98,(byte) 0x62,(byte) 0xf8,(byte) 0x63,(byte) 0x70,
+(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xe0,(byte) 0xc0,(byte) 0xe0,(byte) 0x60,(byte) 0x60,(byte) 0x60,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(13,13,-1,0,15,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x19,(byte) 0xf8,(byte) 0xd,(byte) 0xb0,(byte) 0xc,(byte) 0xf0,(byte) 0x66,(byte) 0x70,(byte) 0x62,(byte) 0x30,(byte) 0x63,(byte) 0x10,
+(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xe0,(byte) 0xc0,(byte) 0xe0,(byte) 0x60,(byte) 0x60,(byte) 0x60,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(13,13,-1,0,15,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0x90,(byte) 0xd8,(byte) 0x6c,(byte) 0x36,(byte) 0x36,(byte) 0x6c,(byte) 0xd8,(byte) 0x90,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(7,8,-1,-1,9,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x70,(byte) 0xd8,(byte) 0x88,(byte) 0x88,(byte) 0xd8,(byte) 0x70,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(5,8,-1,-6,7,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xe0,(byte) 0xe0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(3,8,-1,-5,6,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0xf0,(byte) 0xd8,(byte) 0x18,(byte) 0x70,(byte) 0x60,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(5,5,0,4,5,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(2,2,-1,-4,4,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x12,(byte) 0x32,(byte) 0x72,(byte) 0xf2,(byte) 0xf2,(byte) 0xf2,(byte) 0xf2,
+(byte) 0x72,(byte) 0x3f,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(8,18,-1,4,10,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xdb,(byte) 0xff,(byte) 0xe7,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(8,14,-1,4,10,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0x30,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(4,3,0,-11,4,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0x70,(byte) 0xf8,(byte) 0x98,(byte) 0x30,(byte) 0x30,(byte) 0x98,(byte) 0xf8,(byte) 0x70,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(5,8,0,-5,6,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xf8,(byte) 0xf8,(byte) 0x60,(byte) 0x30,(byte) 0x18,(byte) 0x98,(byte) 0xf8,(byte) 0x70,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(5,8,0,-5,6,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xff,(byte) 0xff,(byte) 0x0,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xff,(byte) 0xff,(byte) 0x18,(byte) 0x18,(byte) 0x18,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(8,11,-1,0,10,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x70,(byte) 0xd8,(byte) 0x88,(byte) 0xd8,(byte) 0x70,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(5,5,-1,-8,7,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xf8,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(5,1,0,-12,5,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x30,(byte) 0x60,(byte) 0x40,(byte) 0x10,(byte) 0x48,(byte) 0x50,(byte) 0x88,(byte) 0x88,(byte) 0x89,(byte) 0x8,(byte) 0x8f,(byte) 0x88,(byte) 0x88,(byte) 0x48,
+(byte) 0x88,(byte) 0x48,(byte) 0x4f,(byte) 0x90,(byte) 0x40,(byte) 0x10,(byte) 0x30,(byte) 0x60,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(13,13,-1,0,14,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xf8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(5,2,-1,-4,7,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(9,5,-1,-3,11,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x12,(byte) 0x36,(byte) 0x6c,(byte) 0xd8,(byte) 0xd8,(byte) 0x6c,(byte) 0x36,(byte) 0x12,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(7,8,-1,-1,9,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x68,(byte) 0xd8,(byte) 0x48,(byte) 0x38,(byte) 0xc8,(byte) 0x70,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(5,8,-1,-6,7,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x30,(byte) 0x60,(byte) 0x40,(byte) 0x10,(byte) 0x47,(byte) 0x10,(byte) 0x88,(byte) 0x88,(byte) 0x90,(byte) 0x8,(byte) 0x90,(byte) 0x8,(byte) 0x90,(byte) 0x8,
+(byte) 0x88,(byte) 0x88,(byte) 0x47,(byte) 0x10,(byte) 0x40,(byte) 0x10,(byte) 0x30,(byte) 0x60,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(13,13,-1,0,15,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xd8,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(5,2,0,-11,6,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0x3c,(byte) 0x7e,(byte) 0xc3,(byte) 0xc3,(byte) 0x7,(byte) 0xe,(byte) 0x3e,(byte) 0x73,(byte) 0xe3,(byte) 0xc3,(byte) 0xc7,(byte) 0x6e,(byte) 0x7c,(byte) 0xf0,(byte) 0xc3,(byte) 0xc3,
+(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(8,18,-1,4,10,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(2,17,-1,3,4,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xff,(byte) 0x18,(byte) 0xff,(byte) 0x3c,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(8,13,-1,0,10,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0xc3,(byte) 0xff,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0xff,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(8,7,-1,-3,10,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0xdf,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0x60,(byte) 0x80,(byte) 0x30,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x7e,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+(byte) 0x60,(byte) 0x0,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x3f,(byte) 0x0,(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(9,13,0,0,10,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x3e,(byte) 0x7f,(byte) 0x6b,(byte) 0xc8,(byte) 0xc8,(byte) 0xc8,(byte) 0xc8,(byte) 0x6b,(byte) 0x7f,(byte) 0x3e,(byte) 0x4,(byte) 0x4,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(8,14,-1,2,10,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(2,14,-2,4,6,ch161data);
+
+/* char: 0xa0 */
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,5,null);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0xcc,(byte) 0x7e,(byte) 0x33,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(8,3,-1,-4,10,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x18,(byte) 0xc,(byte) 0x18,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0x60,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(6,18,0,4,6,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(2,18,-1,4,4,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0xc,(byte) 0x18,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0x18,(byte) 0xc,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(6,18,0,4,6,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xfe,(byte) 0xfe,(byte) 0xc0,(byte) 0x60,(byte) 0x30,(byte) 0x18,(byte) 0xc,(byte) 0x6,(byte) 0xfe,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(7,10,-1,0,9,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0x70,(byte) 0x70,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x3c,(byte) 0x24,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(8,14,-1,4,10,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0xc3,(byte) 0xe7,(byte) 0x66,(byte) 0x3c,(byte) 0x18,(byte) 0x18,(byte) 0x3c,(byte) 0x66,(byte) 0xe7,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(8,10,-1,0,10,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0x39,(byte) 0xc0,(byte) 0x29,(byte) 0x40,(byte) 0x69,(byte) 0x60,(byte) 0x66,(byte) 0x60,(byte) 0x66,(byte) 0x60,(byte) 0xc6,(byte) 0x30,
+(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(12,10,-1,0,14,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x3c,(byte) 0x24,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(8,10,-1,0,10,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x73,(byte) 0xfb,(byte) 0xc7,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(8,10,-1,0,10,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x18,(byte) 0x38,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0xfc,(byte) 0xfc,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(6,13,0,0,6,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0x78,(byte) 0xfc,(byte) 0xc6,(byte) 0x6,(byte) 0x3e,(byte) 0xfc,(byte) 0xc0,(byte) 0xc6,(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(7,10,-1,0,9,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xe0,(byte) 0xd8,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(5,10,-1,0,6,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x3d,(byte) 0x80,(byte) 0x7f,(byte) 0x80,(byte) 0x63,(byte) 0x80,(byte) 0xc1,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x80,(byte) 0x7f,(byte) 0x80,(byte) 0x3d,(byte) 0x80,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(9,14,-1,4,11,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xde,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xe3,(byte) 0x0,(byte) 0xc1,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xe3,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xde,(byte) 0x0,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(9,14,-1,4,11,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x0,
+(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(9,10,-1,0,11,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xe3,(byte) 0xdf,(byte) 0xce,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(8,10,-1,0,10,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,(byte) 0xc6,(byte) 0x30,(byte) 0xe7,(byte) 0x30,
+(byte) 0xde,(byte) 0xf0,(byte) 0xcc,(byte) 0x60,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(12,10,-1,0,14,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(2,14,-1,0,4,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0xc7,(byte) 0xc6,(byte) 0xce,(byte) 0xcc,(byte) 0xd8,(byte) 0xf8,(byte) 0xf0,(byte) 0xd8,(byte) 0xcc,(byte) 0xc6,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(8,14,-1,0,9,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0xe0,(byte) 0xf0,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0x0,
+(byte) 0x30,(byte) 0x30,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(4,18,1,4,4,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(2,14,-1,0,4,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xe3,(byte) 0xdf,(byte) 0xce,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(8,14,-1,0,10,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0x1c,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x3d,(byte) 0x80,(byte) 0x7f,(byte) 0x80,(byte) 0x63,(byte) 0x80,(byte) 0xc1,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x7f,(byte) 0x80,(byte) 0x3d,(byte) 0x80,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(9,14,-1,4,11,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0xfc,(byte) 0xfc,(byte) 0x30,(byte) 0x30,(byte) 0x3c,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(6,14,0,0,6,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x3c,(byte) 0x7f,(byte) 0xe3,(byte) 0xc0,(byte) 0xc0,(byte) 0xff,(byte) 0xc3,(byte) 0xc3,(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(8,10,-1,0,10,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x3d,(byte) 0x80,(byte) 0x7f,(byte) 0x80,(byte) 0x63,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x63,(byte) 0x80,
+(byte) 0x7f,(byte) 0x80,(byte) 0x3d,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(9,14,-1,0,11,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x3e,(byte) 0x7f,(byte) 0x63,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x63,(byte) 0x7f,(byte) 0x3e,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(8,10,-1,0,10,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0xde,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xe3,(byte) 0x0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xe3,(byte) 0x0,
+(byte) 0xff,(byte) 0x0,(byte) 0xde,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(9,14,-1,0,11,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0x76,(byte) 0xee,(byte) 0xc6,(byte) 0xc6,(byte) 0xe6,(byte) 0x7e,(byte) 0xe,(byte) 0xc6,(byte) 0xee,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(7,10,-1,0,9,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x80,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(2,5,-1,-9,4,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(10,2,0,4,10,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0x82,(byte) 0xc6,(byte) 0x6c,(byte) 0x38,(byte) 0x10,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(7,5,-1,-8,9,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xf0,(byte) 0xf0,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0xf0,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(4,18,0,4,5,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x10,(byte) 0x10,(byte) 0x30,(byte) 0x30,(byte) 0x20,(byte) 0x20,(byte) 0x60,(byte) 0x60,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(5,14,0,0,5,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xf0,(byte) 0xf0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xf0,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(4,18,-1,4,5,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x0,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(10,14,-1,0,12,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x19,(byte) 0x80,
+(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(12,14,-1,0,14,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0xe0,(byte) 0xe0,(byte) 0x60,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x31,(byte) 0x80,(byte) 0x1b,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xe,(byte) 0x0,
+(byte) 0x1b,(byte) 0x0,(byte) 0x31,(byte) 0x80,(byte) 0x71,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe0,(byte) 0xe0,(byte) 0xc0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(11,14,-1,0,13,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x1c,(byte) 0x38,(byte) 0x34,(byte) 0x2c,(byte) 0x36,(byte) 0x6c,(byte) 0x36,(byte) 0x6c,(byte) 0x66,(byte) 0x66,(byte) 0x66,(byte) 0x66,
+(byte) 0x62,(byte) 0x46,(byte) 0x63,(byte) 0xc6,(byte) 0xc3,(byte) 0xc3,(byte) 0xc1,(byte) 0x83,(byte) 0xc1,(byte) 0x83,(byte) 0xc1,(byte) 0x83,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(16,14,-1,0,18,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x6,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x30,(byte) 0xc0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(12,14,-1,0,14,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x1f,(byte) 0x0,(byte) 0x7f,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(11,14,-1,0,13,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,
+(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(10,14,-1,0,12,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0x3f,(byte) 0x0,(byte) 0x7f,(byte) 0xc0,(byte) 0xe0,(byte) 0xe0,(byte) 0xc0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0xe0,(byte) 0x3,(byte) 0xc0,(byte) 0x1f,(byte) 0x0,
+(byte) 0x7c,(byte) 0x0,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x60,(byte) 0xe0,(byte) 0xe0,(byte) 0x7f,(byte) 0xc0,(byte) 0x1f,(byte) 0x0,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(11,14,-1,0,13,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0xc0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x0,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(10,14,-1,0,12,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0x0,(byte) 0x30,(byte) 0xf,(byte) 0xb0,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0xf0,(byte) 0x61,(byte) 0xb0,(byte) 0xe1,(byte) 0xb8,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(13,15,-1,1,15,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0xc0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x0,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(10,14,-1,0,12,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x38,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0xc0,(byte) 0x18,
+(byte) 0xc0,(byte) 0x18,(byte) 0xe0,(byte) 0x38,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(13,14,-1,0,15,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe0,(byte) 0xc1,(byte) 0xe0,(byte) 0xc1,(byte) 0xe0,(byte) 0xc3,(byte) 0x60,(byte) 0xc6,(byte) 0x60,(byte) 0xc6,(byte) 0x60,(byte) 0xcc,(byte) 0x60,
+(byte) 0xcc,(byte) 0x60,(byte) 0xd8,(byte) 0x60,(byte) 0xf0,(byte) 0x60,(byte) 0xf0,(byte) 0x60,(byte) 0xe0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(11,14,-1,0,13,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0xc3,(byte) 0xc,(byte) 0xc3,(byte) 0xc,(byte) 0xc7,(byte) 0x8c,(byte) 0xc4,(byte) 0x8c,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xd8,(byte) 0x6c,(byte) 0xd8,(byte) 0x6c,
+(byte) 0xf0,(byte) 0x3c,(byte) 0xf0,(byte) 0x3c,(byte) 0xe0,(byte) 0x1c,(byte) 0xe0,(byte) 0x1c,(byte) 0xc0,(byte) 0xc,(byte) 0xc0,(byte) 0xc,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(14,14,-1,0,16,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xff,(byte) 0xff,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(8,14,-1,0,10,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0xc0,(byte) 0x70,(byte) 0xc0,(byte) 0xe0,(byte) 0xc1,(byte) 0xc0,(byte) 0xc3,(byte) 0x80,(byte) 0xc7,(byte) 0x0,(byte) 0xce,(byte) 0x0,(byte) 0xfc,(byte) 0x0,(byte) 0xf8,(byte) 0x0,
+(byte) 0xdc,(byte) 0x0,(byte) 0xce,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x80,(byte) 0xc1,(byte) 0xc0,(byte) 0xc0,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(12,14,-1,0,13,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0x3c,(byte) 0x7e,(byte) 0xe7,(byte) 0xc3,(byte) 0xc3,(byte) 0x3,(byte) 0x3,(byte) 0x3,(byte) 0x3,(byte) 0x3,(byte) 0x3,(byte) 0x3,(byte) 0x3,(byte) 0x3,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(8,14,-1,0,10,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(2,14,-2,0,6,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xff,(byte) 0xe0,(byte) 0xff,(byte) 0xe0,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(11,14,-1,0,13,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0xf,(byte) 0xb0,(byte) 0x3f,(byte) 0xf0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x30,(byte) 0xc1,(byte) 0xf0,(byte) 0xc1,(byte) 0xf0,(byte) 0xc0,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xe0,(byte) 0x30,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(12,14,-1,0,14,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(9,14,-1,0,11,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(9,14,-1,0,11,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xff,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xc1,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,
+(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0xc0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x0,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(11,14,-1,0,13,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0xf,(byte) 0x80,(byte) 0x3f,(byte) 0xe0,(byte) 0x70,(byte) 0x70,(byte) 0x60,(byte) 0x30,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xe0,(byte) 0x0,(byte) 0x60,(byte) 0x30,(byte) 0x70,(byte) 0x70,(byte) 0x3f,(byte) 0xe0,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(12,14,-1,0,14,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0xc0,(byte) 0xc0,(byte) 0xe0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe0,(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0xc0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x0,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(11,14,-1,0,13,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x7f,(byte) 0xe0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0xc0,
+(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0xf,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(12,14,0,0,12,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1f,(byte) 0xf0,(byte) 0x38,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x67,(byte) 0x70,(byte) 0xcf,(byte) 0xf8,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0x66,
+(byte) 0xcc,(byte) 0x66,(byte) 0xcc,(byte) 0x63,(byte) 0xc6,(byte) 0x33,(byte) 0x67,(byte) 0x73,(byte) 0x63,(byte) 0xb3,(byte) 0x30,(byte) 0x6,(byte) 0x1c,(byte) 0xe,(byte) 0xf,(byte) 0xfc,
+(byte) 0x3,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(16,17,-1,3,18,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x38,(byte) 0x1c,(byte) 0xe,(byte) 0xc6,(byte) 0xc6,(byte) 0xfe,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(7,14,-1,0,10,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0xc0,(byte) 0xf0,(byte) 0x3c,(byte) 0xe,(byte) 0x3,(byte) 0xe,(byte) 0x3c,(byte) 0xf0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(8,9,-1,0,10,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xfe,(byte) 0xfe,(byte) 0x0,(byte) 0x0,(byte) 0xfe,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(7,6,-2,-2,11,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0x3,(byte) 0xf,(byte) 0x3c,(byte) 0x70,(byte) 0xc0,(byte) 0x70,(byte) 0x3c,(byte) 0xf,(byte) 0x3,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(8,9,-1,0,10,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(2,13,-1,3,5,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(2,10,-1,0,5,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0x7c,(byte) 0xfe,(byte) 0xc6,(byte) 0x3,(byte) 0x3,(byte) 0x3b,(byte) 0x7f,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc7,(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(8,13,-1,0,10,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x3c,(byte) 0x7e,(byte) 0xe7,(byte) 0xc3,(byte) 0xc3,(byte) 0x66,(byte) 0x7e,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,(byte) 0xe7,(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(8,13,-1,0,10,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x60,(byte) 0x60,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x18,(byte) 0x18,(byte) 0xc,(byte) 0xc,(byte) 0x6,(byte) 0x3,(byte) 0xff,(byte) 0xff,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(8,13,-1,0,10,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x3c,(byte) 0x7e,(byte) 0xe3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xfe,(byte) 0xdc,(byte) 0xc0,(byte) 0xc0,(byte) 0x63,(byte) 0x7f,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(8,13,-1,0,10,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0x7c,(byte) 0xfe,(byte) 0xc7,(byte) 0xc3,(byte) 0x3,(byte) 0x3,(byte) 0xc7,(byte) 0xfe,(byte) 0xfc,(byte) 0xc0,(byte) 0xc0,(byte) 0xfe,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(8,13,-1,0,10,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+(byte) 0x33,(byte) 0x0,(byte) 0x1b,(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x7,(byte) 0x0,(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(9,13,-1,0,10,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0x3c,(byte) 0x7e,(byte) 0xc7,(byte) 0xc3,(byte) 0x3,(byte) 0x7,(byte) 0x1e,(byte) 0x1c,(byte) 0x6,(byte) 0xc3,(byte) 0xc3,(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(8,13,-1,0,10,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xff,(byte) 0xff,(byte) 0xc0,(byte) 0xe0,(byte) 0x70,(byte) 0x38,(byte) 0x1c,(byte) 0xe,(byte) 0x7,(byte) 0x3,(byte) 0xc3,(byte) 0xfe,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(8,13,-1,0,10,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xf8,(byte) 0xf8,(byte) 0x18,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(5,13,-2,0,10,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x3c,(byte) 0x7e,(byte) 0x66,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0xc3,(byte) 0x66,(byte) 0x7e,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(8,13,-1,0,10,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x40,(byte) 0x40,(byte) 0x60,(byte) 0x60,(byte) 0x20,(byte) 0x20,(byte) 0x30,(byte) 0x30,(byte) 0x10,(byte) 0x10,(byte) 0x18,(byte) 0x18,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(5,14,0,0,5,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(2,2,-1,0,5,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xff,(byte) 0xff,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(8,2,-1,-4,11,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(2,5,-1,3,5,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xff,(byte) 0xff,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(8,10,-1,0,10,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0x88,(byte) 0x70,(byte) 0x70,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(5,6,-1,-8,7,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0xc0,(byte) 0x60,(byte) 0x60,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x60,(byte) 0x60,
+(byte) 0xc0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(4,18,-1,4,6,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x10,(byte) 0x30,(byte) 0x60,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0x60,
+(byte) 0x30,(byte) 0x10,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(4,18,-1,4,6,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(2,5,-1,-9,4,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x3c,(byte) 0x70,(byte) 0x7e,(byte) 0xe0,(byte) 0xe7,(byte) 0xc0,(byte) 0xc3,(byte) 0x80,(byte) 0xc3,(byte) 0xc0,(byte) 0xc6,(byte) 0xc0,(byte) 0xee,(byte) 0xc0,(byte) 0x7c,(byte) 0x0,
+(byte) 0x3c,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x7e,(byte) 0x0,(byte) 0x3c,(byte) 0x0,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(12,13,-1,0,13,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x18,(byte) 0x78,(byte) 0x18,(byte) 0xfc,(byte) 0xc,(byte) 0xcc,(byte) 0xc,(byte) 0xcc,(byte) 0x6,(byte) 0xfc,(byte) 0x6,(byte) 0x78,(byte) 0x3,(byte) 0x0,(byte) 0x7b,(byte) 0x0,
+(byte) 0xfd,(byte) 0x80,(byte) 0xcd,(byte) 0x80,(byte) 0xcc,(byte) 0xc0,(byte) 0xfc,(byte) 0xc0,(byte) 0x78,(byte) 0x60,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(14,13,-1,0,16,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x8,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0xeb,(byte) 0x80,(byte) 0xc9,(byte) 0x80,(byte) 0x9,(byte) 0x80,(byte) 0xf,(byte) 0x0,
+(byte) 0x3e,(byte) 0x0,(byte) 0x78,(byte) 0x0,(byte) 0xe8,(byte) 0x0,(byte) 0xc8,(byte) 0x0,(byte) 0xcb,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x8,(byte) 0x0,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(9,16,-1,2,10,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x24,(byte) 0x0,(byte) 0x24,(byte) 0x0,(byte) 0x24,(byte) 0x0,(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0x80,(byte) 0x12,(byte) 0x0,(byte) 0x12,(byte) 0x0,(byte) 0x12,(byte) 0x0,
+(byte) 0x7f,(byte) 0xc0,(byte) 0x7f,(byte) 0xc0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(10,13,0,0,10,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0x90,(byte) 0x90,(byte) 0xd8,(byte) 0xd8,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(5,5,0,-9,5,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(2,14,-2,0,6,ch33data);
+
+/* char: 0x20 ' ' */
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,5,null);
+
+static final BitmapCharRec[] chars = {
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmapHelvetica18 = new BitmapFontRec("-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1",
+ 224,
+ 32,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java
new file mode 100644
index 000000000..32699863f
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman10.java
@@ -0,0 +1,1797 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmapTimesRoman10 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0x80,(byte) 0xc0,(byte) 0x40,(byte) 0x60,(byte) 0xa0,(byte) 0x90,(byte) 0xb8,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(5,9,0,2,5,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0xc0,(byte) 0x80,(byte) 0xe0,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(4,9,0,2,5,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0x80,(byte) 0xc0,(byte) 0x40,(byte) 0x60,(byte) 0xa0,(byte) 0x90,(byte) 0xb8,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(5,10,0,2,5,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(5,7,0,0,5,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(5,8,0,0,5,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(5,8,0,0,5,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(5,8,0,0,5,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0x80,(byte) 0x70,(byte) 0x48,(byte) 0x48,(byte) 0x48,(byte) 0x38,(byte) 0x4,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(6,7,1,1,5,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x20,(byte) 0x0,(byte) 0xf8,(byte) 0x0,(byte) 0x20,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(5,5,0,0,6,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(4,7,0,0,5,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0xa0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(4,8,0,0,5,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(4,8,0,0,5,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(4,8,0,0,5,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(4,8,0,0,5,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0xd8,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(5,8,0,0,5,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0xa0,(byte) 0x70,(byte) 0x40,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(4,8,0,0,5,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(3,7,0,0,4,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(3,8,0,0,4,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(3,8,0,0,4,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(3,8,0,0,4,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x60,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,(byte) 0x60,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(3,7,0,0,4,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x60,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,(byte) 0x60,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(3,8,0,0,4,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x60,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,(byte) 0x60,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(3,8,0,0,4,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x60,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,(byte) 0x60,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(3,8,0,0,4,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0x60,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x60,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(3,8,0,3,4,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0xd8,(byte) 0xa0,(byte) 0x70,(byte) 0x28,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(5,5,0,0,6,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,(byte) 0x40,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(3,8,0,0,4,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(3,7,0,0,4,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,(byte) 0x0,(byte) 0xa0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(4,8,0,0,4,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(3,8,0,0,4,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(3,8,0,0,4,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(3,8,0,0,4,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0xe0,(byte) 0x50,(byte) 0x50,(byte) 0x60,(byte) 0x50,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(4,7,0,0,5,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x70,(byte) 0x48,(byte) 0x70,(byte) 0x40,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(5,7,0,0,6,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x38,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0xee,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(7,10,0,0,8,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x38,(byte) 0x6c,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0xee,(byte) 0x0,(byte) 0x28,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(7,9,0,0,8,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x38,(byte) 0x6c,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0xee,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(7,10,0,0,8,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x38,(byte) 0x6c,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0xee,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(7,10,0,0,8,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x38,(byte) 0x6c,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0xee,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(7,10,0,0,8,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0x80,(byte) 0x7c,(byte) 0x66,(byte) 0x52,(byte) 0x52,(byte) 0x4a,(byte) 0x66,(byte) 0x3e,(byte) 0x1,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(8,9,0,1,8,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0x88,(byte) 0x50,(byte) 0x20,(byte) 0x50,(byte) 0x88,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(5,5,0,0,6,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(6,9,0,0,7,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(6,10,0,0,7,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(6,10,0,0,7,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(6,10,0,0,7,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(6,10,0,0,7,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0xe4,(byte) 0x4c,(byte) 0x4c,(byte) 0x54,(byte) 0x54,(byte) 0x64,(byte) 0xee,(byte) 0x0,(byte) 0x50,(byte) 0x28,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(7,10,0,0,8,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0xf8,(byte) 0x4c,(byte) 0x44,(byte) 0xe4,(byte) 0x44,(byte) 0x4c,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(6,7,0,0,7,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(3,9,0,0,4,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(3,10,0,0,4,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x0,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(3,10,0,0,4,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x0,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(3,10,0,0,4,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xf8,(byte) 0x48,(byte) 0x40,(byte) 0x70,(byte) 0x40,(byte) 0x48,(byte) 0xf8,(byte) 0x0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(5,9,0,0,6,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xf8,(byte) 0x48,(byte) 0x40,(byte) 0x70,(byte) 0x40,(byte) 0x48,(byte) 0xf8,(byte) 0x0,(byte) 0x50,(byte) 0x20,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(5,10,0,0,6,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xf8,(byte) 0x48,(byte) 0x40,(byte) 0x70,(byte) 0x40,(byte) 0x48,(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x10,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(5,10,0,0,6,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xf8,(byte) 0x48,(byte) 0x40,(byte) 0x70,(byte) 0x40,(byte) 0x48,(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(5,10,0,0,6,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x60,(byte) 0x10,(byte) 0x20,(byte) 0x78,(byte) 0xc4,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc4,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(6,10,0,3,7,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0xef,(byte) 0x49,(byte) 0x78,(byte) 0x2e,(byte) 0x28,(byte) 0x39,(byte) 0x1f,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(8,7,0,0,9,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(7,10,0,0,8,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,(byte) 0x0,(byte) 0x28,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(7,9,0,0,8,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,(byte) 0x0,(byte) 0x28,(byte) 0x14,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(7,10,0,0,8,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,(byte) 0x0,(byte) 0x28,(byte) 0x10,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(7,10,0,0,8,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x8,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(7,10,0,0,8,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,(byte) 0x0,(byte) 0x10,(byte) 0x20,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(7,10,0,0,8,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(3,7,0,2,4,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x44,(byte) 0x3e,(byte) 0x2c,(byte) 0xd4,(byte) 0x28,(byte) 0x48,(byte) 0xe4,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(7,7,0,0,8,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x4e,(byte) 0x24,(byte) 0x2a,(byte) 0xf6,(byte) 0x48,(byte) 0xc8,(byte) 0x44,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(7,7,0,0,8,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x44,(byte) 0x3e,(byte) 0x2c,(byte) 0xf4,(byte) 0x48,(byte) 0xc8,(byte) 0x44,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(7,7,0,0,8,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0xa0,(byte) 0x50,(byte) 0x50,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(4,4,0,-1,5,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0x40,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(3,5,0,-2,4,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(3,4,0,-3,3,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x40,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(3,3,0,3,4,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0x80,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(1,1,0,-2,2,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x28,(byte) 0x68,(byte) 0xe8,(byte) 0xe8,(byte) 0xe8,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(6,9,0,2,6,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xe8,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(5,7,0,2,5,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(2,2,0,-5,3,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(3,4,0,-3,3,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0xa0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(3,4,0,-3,3,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(5,7,0,0,6,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(4,4,0,-3,4,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xe0,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(3,1,0,-6,4,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0x38,(byte) 0x44,(byte) 0xaa,(byte) 0xb2,(byte) 0xba,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(7,7,-1,0,9,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xe0,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(3,1,0,-2,4,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x8,(byte) 0x8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(5,3,-1,-1,7,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x50,(byte) 0xa0,(byte) 0xa0,(byte) 0x50,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(4,4,0,-1,5,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xa0,(byte) 0x20,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(3,5,0,-2,4,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x9a,(byte) 0xa2,(byte) 0x9a,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(7,7,-1,0,9,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xa0,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(3,1,-1,-6,5,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0xe0,(byte) 0x90,(byte) 0x20,(byte) 0x50,(byte) 0x90,(byte) 0xa0,(byte) 0x40,(byte) 0x90,(byte) 0x70,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(4,9,0,1,5,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(1,7,0,0,2,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0x70,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0xd8,(byte) 0x50,(byte) 0x88,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(5,7,0,0,5,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0x88,(byte) 0x70,(byte) 0x50,(byte) 0x50,(byte) 0x70,(byte) 0x88,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(5,6,0,-1,5,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0xf0,(byte) 0xc8,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x50,(byte) 0x30,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(5,7,0,0,5,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x80,(byte) 0xe0,(byte) 0x90,(byte) 0x80,(byte) 0x90,(byte) 0x70,(byte) 0x10,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(4,7,0,1,5,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(1,7,-1,2,3,ch161data);
+
+/* char: 0xa0 */
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,2,null);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0x98,(byte) 0x64,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(6,2,0,-2,7,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(3,9,0,2,4,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(1,9,0,2,2,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(3,9,0,2,4,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xf0,(byte) 0x90,(byte) 0x40,(byte) 0x20,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(4,5,0,0,5,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x30,(byte) 0x50,(byte) 0x48,(byte) 0xdc,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(6,7,1,2,5,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0xd8,(byte) 0x50,(byte) 0x20,(byte) 0x50,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(5,5,0,0,6,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x28,(byte) 0x6c,(byte) 0x54,(byte) 0x92,(byte) 0xdb,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(8,5,0,0,8,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x20,(byte) 0x60,(byte) 0x50,(byte) 0x90,(byte) 0xd8,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(5,5,0,0,5,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(5,5,0,0,5,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x30,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(4,6,0,0,4,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0xe0,(byte) 0x20,(byte) 0x60,(byte) 0x80,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(3,5,0,0,4,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x60,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(3,5,0,0,4,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x38,(byte) 0x10,(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x70,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(5,7,0,2,5,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0xc0,(byte) 0x80,(byte) 0xe0,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(4,7,0,2,5,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(4,5,0,0,5,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0xd8,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(5,5,0,0,5,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0xdb,(byte) 0x92,(byte) 0x92,(byte) 0x92,(byte) 0xec,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(8,5,0,0,8,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(3,7,0,0,4,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0x98,(byte) 0x90,(byte) 0xe0,(byte) 0xa0,(byte) 0x90,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(5,7,0,0,5,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(2,9,0,2,3,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(2,7,0,0,3,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0xd8,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(5,7,0,0,5,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0xe0,(byte) 0x90,(byte) 0x60,(byte) 0x40,(byte) 0xa0,(byte) 0xa0,(byte) 0x70,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(4,7,0,2,5,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,(byte) 0x40,(byte) 0x30,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(4,7,0,0,4,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x60,(byte) 0x80,(byte) 0xc0,(byte) 0xa0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(3,5,0,0,4,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x68,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x70,(byte) 0x10,(byte) 0x30,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(5,7,0,0,5,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x60,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x60,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(3,5,0,0,4,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0xe0,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(4,7,0,0,5,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0xe0,(byte) 0xa0,(byte) 0x60,(byte) 0x20,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(3,5,0,0,4,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0xc0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(2,2,0,-5,3,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xf8,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(5,1,0,3,5,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0xa0,(byte) 0xa0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(3,3,-1,-4,5,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xc0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(2,9,0,2,3,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(3,7,0,0,3,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xc0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(2,9,0,2,3,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xf8,(byte) 0x88,(byte) 0x40,(byte) 0x20,(byte) 0x10,(byte) 0x88,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(5,7,0,0,6,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x38,(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x44,(byte) 0xee,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(7,7,0,0,8,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x28,(byte) 0x10,(byte) 0x28,(byte) 0x44,(byte) 0xee,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(7,7,0,0,8,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0xc9,(byte) 0x80,(byte) 0x88,(byte) 0x80,(byte) 0xdd,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(10,7,0,0,10,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x10,(byte) 0x10,(byte) 0x28,(byte) 0x28,(byte) 0x6c,(byte) 0x44,(byte) 0xee,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(7,7,0,0,8,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x38,(byte) 0x6c,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0xee,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(7,7,0,0,8,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0x70,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xa8,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(5,7,0,0,6,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0xe0,(byte) 0x90,(byte) 0x10,(byte) 0x60,(byte) 0xc0,(byte) 0x90,(byte) 0x70,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(4,7,0,0,5,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0xec,(byte) 0x48,(byte) 0x50,(byte) 0x70,(byte) 0x48,(byte) 0x48,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(6,7,0,0,7,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0xc,(byte) 0x18,(byte) 0x70,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(6,9,0,2,7,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x70,(byte) 0x48,(byte) 0x48,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(5,7,0,0,6,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0x84,(byte) 0x84,(byte) 0x84,(byte) 0xcc,(byte) 0x78,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(6,7,0,0,7,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0xe4,(byte) 0x4c,(byte) 0x4c,(byte) 0x54,(byte) 0x54,(byte) 0x64,(byte) 0xee,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(7,7,0,0,8,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0xeb,(byte) 0x80,(byte) 0x49,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x55,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0xe3,(byte) 0x80,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(9,7,0,0,10,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xf8,(byte) 0x48,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(5,7,0,0,6,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0xec,(byte) 0x48,(byte) 0x50,(byte) 0x60,(byte) 0x50,(byte) 0x48,(byte) 0xec,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(6,7,0,0,7,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0xc0,(byte) 0xa0,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x70,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(4,7,0,0,4,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(3,7,0,0,4,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x44,(byte) 0x7c,(byte) 0x44,(byte) 0x44,(byte) 0xee,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(7,7,0,0,8,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0x78,(byte) 0xc4,(byte) 0x84,(byte) 0x9c,(byte) 0x80,(byte) 0xc4,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(6,7,0,0,7,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x70,(byte) 0x40,(byte) 0x48,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(5,7,0,0,6,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xf8,(byte) 0x48,(byte) 0x40,(byte) 0x70,(byte) 0x40,(byte) 0x48,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(5,7,0,0,6,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xf8,(byte) 0x4c,(byte) 0x44,(byte) 0x44,(byte) 0x44,(byte) 0x4c,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(6,7,0,0,7,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0x78,(byte) 0xc4,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0xc4,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(6,7,0,0,7,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xf0,(byte) 0x48,(byte) 0x48,(byte) 0x70,(byte) 0x48,(byte) 0x48,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(5,7,0,0,6,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0xee,(byte) 0x44,(byte) 0x7c,(byte) 0x28,(byte) 0x28,(byte) 0x38,(byte) 0x10,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(7,7,0,0,8,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x3e,(byte) 0x40,(byte) 0x92,(byte) 0xad,(byte) 0xa5,(byte) 0xa5,(byte) 0x9d,(byte) 0x42,(byte) 0x3c,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(8,9,0,2,9,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0xa0,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(3,7,0,0,4,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(3,5,0,0,5,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xf8,(byte) 0x0,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(5,3,0,-1,6,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x80,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(3,5,-1,0,5,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(1,7,-1,2,3,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x80,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(1,5,-1,0,3,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0xc0,(byte) 0x20,(byte) 0x70,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(4,7,0,0,5,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(4,7,0,0,5,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x90,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(4,7,0,0,5,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0xe0,(byte) 0x40,(byte) 0x30,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(4,7,0,0,5,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0xe0,(byte) 0x90,(byte) 0x10,(byte) 0x10,(byte) 0xe0,(byte) 0x40,(byte) 0x70,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(4,7,0,0,5,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x10,(byte) 0x10,(byte) 0xf8,(byte) 0x90,(byte) 0x50,(byte) 0x30,(byte) 0x10,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(5,7,0,0,5,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0xe0,(byte) 0x10,(byte) 0x10,(byte) 0x60,(byte) 0x10,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(4,7,0,0,5,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xf0,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x10,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(4,7,0,0,5,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0xe0,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0xc0,(byte) 0x40,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(3,7,-1,0,5,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x60,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x90,(byte) 0x60,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(4,7,0,0,5,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(3,7,0,0,3,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0x80,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(1,1,-1,0,3,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xf0,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(4,1,-1,-2,7,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(1,3,-1,2,3,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x20,(byte) 0x20,(byte) 0xf8,(byte) 0x20,(byte) 0x20,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(5,5,0,0,6,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0xa0,(byte) 0x40,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(3,3,0,-4,5,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(3,9,0,2,4,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x20,(byte) 0x40,(byte) 0x40,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x40,(byte) 0x40,(byte) 0x20,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(3,9,0,2,4,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0x40,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(2,2,0,-5,3,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x76,(byte) 0x8d,(byte) 0x98,(byte) 0x74,(byte) 0x6e,(byte) 0x50,(byte) 0x30,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(8,7,0,0,8,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x44,(byte) 0x2a,(byte) 0x2a,(byte) 0x56,(byte) 0xa8,(byte) 0xa4,(byte) 0x7e,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(7,7,0,0,8,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x20,(byte) 0xe0,(byte) 0x90,(byte) 0x10,(byte) 0x60,(byte) 0x80,(byte) 0x90,(byte) 0x70,(byte) 0x20,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(4,9,0,1,5,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x50,(byte) 0x50,(byte) 0xf8,(byte) 0x50,(byte) 0xf8,(byte) 0x50,(byte) 0x50,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(5,7,0,0,5,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0xa0,(byte) 0xa0,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(3,2,0,-5,4,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0x80,(byte) 0x0,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,(byte) 0x80,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(1,7,-1,0,3,ch33data);
+
+/* char: 0x20 ' ' */
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,2,null);
+
+static final BitmapCharRec[] chars = {
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmapTimesRoman10 = new BitmapFontRec("-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1",
+ 224,
+ 32,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java
new file mode 100644
index 000000000..36fb76c66
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTBitmapTimesRoman24.java
@@ -0,0 +1,2080 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTBitmapTimesRoman24 {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 0xff */
+
+static final byte[] ch255data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xf0,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xe,(byte) 0x0,
+(byte) 0x1a,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x31,(byte) 0x0,(byte) 0x30,(byte) 0x80,(byte) 0x30,(byte) 0x80,(byte) 0x60,(byte) 0x80,(byte) 0x60,(byte) 0xc0,
+(byte) 0xf1,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+};
+
+static final BitmapCharRec ch255 = new BitmapCharRec(11,21,0,5,11,ch255data);
+
+/* char: 0xfe */
+
+static final byte[] ch254data = {
+(byte) 0xf0,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x6e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,
+(byte) 0x6e,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0xe0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch254 = new BitmapCharRec(10,22,-1,5,12,ch254data);
+
+/* char: 0xfd */
+
+static final byte[] ch253data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xf0,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xe,(byte) 0x0,
+(byte) 0x1a,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x31,(byte) 0x0,(byte) 0x30,(byte) 0x80,(byte) 0x30,(byte) 0x80,(byte) 0x60,(byte) 0x80,(byte) 0x60,(byte) 0xc0,
+(byte) 0xf1,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x80,(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch253 = new BitmapCharRec(11,22,0,5,11,ch253data);
+
+/* char: 0xfc */
+
+static final byte[] ch252data = {
+(byte) 0x1c,(byte) 0xe0,(byte) 0x3e,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe1,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+};
+
+static final BitmapCharRec ch252 = new BitmapCharRec(11,16,-1,0,13,ch252data);
+
+/* char: 0xfb */
+
+static final byte[] ch251data = {
+(byte) 0x1c,(byte) 0xe0,(byte) 0x3e,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe1,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x21,(byte) 0x0,(byte) 0x12,(byte) 0x0,(byte) 0x1e,(byte) 0x0,
+(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch251 = new BitmapCharRec(11,17,-1,0,13,ch251data);
+
+/* char: 0xfa */
+
+static final byte[] ch250data = {
+(byte) 0x1c,(byte) 0xe0,(byte) 0x3e,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe1,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x80,
+(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch250 = new BitmapCharRec(11,17,-1,0,13,ch250data);
+
+/* char: 0xf9 */
+
+static final byte[] ch249data = {
+(byte) 0x1c,(byte) 0xe0,(byte) 0x3e,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe1,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x2,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x38,(byte) 0x0,
+(byte) 0x30,(byte) 0x0,
+};
+
+static final BitmapCharRec ch249 = new BitmapCharRec(11,17,-1,0,13,ch249data);
+
+/* char: 0xf8 */
+
+static final byte[] ch248data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0xde,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x71,(byte) 0x80,(byte) 0xd0,(byte) 0xc0,(byte) 0xd8,(byte) 0xc0,(byte) 0xc8,(byte) 0xc0,(byte) 0xcc,(byte) 0xc0,
+(byte) 0xc4,(byte) 0xc0,(byte) 0xc6,(byte) 0xc0,(byte) 0x63,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch248 = new BitmapCharRec(10,14,-1,1,12,ch248data);
+
+/* char: 0xf7 */
+
+static final byte[] ch247data = {
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch247 = new BitmapCharRec(12,10,-1,-2,14,ch247data);
+
+/* char: 0xf6 */
+
+static final byte[] ch246data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+};
+
+static final BitmapCharRec ch246 = new BitmapCharRec(10,16,-1,0,12,ch246data);
+
+/* char: 0xf5 */
+
+static final byte[] ch245data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x27,(byte) 0x0,(byte) 0x1c,(byte) 0x80,
+};
+
+static final BitmapCharRec ch245 = new BitmapCharRec(10,16,-1,0,12,ch245data);
+
+/* char: 0xf4 */
+
+static final byte[] ch244data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x21,(byte) 0x0,(byte) 0x12,(byte) 0x0,(byte) 0x1e,(byte) 0x0,
+(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch244 = new BitmapCharRec(10,17,-1,0,12,ch244data);
+
+/* char: 0xf3 */
+
+static final byte[] ch243data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x80,
+(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch243 = new BitmapCharRec(10,17,-1,0,12,ch243data);
+
+/* char: 0xf2 */
+
+static final byte[] ch242data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x2,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x38,(byte) 0x0,
+(byte) 0x30,(byte) 0x0,
+};
+
+static final BitmapCharRec ch242 = new BitmapCharRec(10,17,-1,0,12,ch242data);
+
+/* char: 0xf1 */
+
+static final byte[] ch241data = {
+(byte) 0xf1,(byte) 0xe0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x6f,(byte) 0x80,(byte) 0xe7,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x27,(byte) 0x0,(byte) 0x1c,(byte) 0x80,
+};
+
+static final BitmapCharRec ch241 = new BitmapCharRec(11,16,-1,0,13,ch241data);
+
+/* char: 0xf0 */
+
+static final byte[] ch240data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1f,(byte) 0x0,(byte) 0xc6,(byte) 0x0,(byte) 0x3c,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x71,(byte) 0x80,
+(byte) 0xc0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch240 = new BitmapCharRec(10,17,-1,0,12,ch240data);
+
+/* char: 0xef */
+
+static final byte[] ch239data = {
+(byte) 0x78,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,(byte) 0x0,(byte) 0x0,(byte) 0xcc,(byte) 0xcc,
+};
+
+static final BitmapCharRec ch239 = new BitmapCharRec(6,16,0,0,6,ch239data);
+
+/* char: 0xee */
+
+static final byte[] ch238data = {
+(byte) 0x78,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,(byte) 0x0,(byte) 0x84,(byte) 0x48,(byte) 0x78,
+(byte) 0x30,
+};
+
+static final BitmapCharRec ch238 = new BitmapCharRec(6,17,0,0,6,ch238data);
+
+/* char: 0xed */
+
+static final byte[] ch237data = {
+(byte) 0xf0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xe0,(byte) 0x0,(byte) 0x80,(byte) 0x60,(byte) 0x38,
+(byte) 0x18,
+};
+
+static final BitmapCharRec ch237 = new BitmapCharRec(5,17,-1,0,6,ch237data);
+
+/* char: 0xec */
+
+static final byte[] ch236data = {
+(byte) 0x78,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,(byte) 0x0,(byte) 0x8,(byte) 0x30,(byte) 0xe0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch236 = new BitmapCharRec(5,17,0,0,6,ch236data);
+
+/* char: 0xeb */
+
+static final byte[] ch235data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0x41,(byte) 0x80,(byte) 0x63,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+};
+
+static final BitmapCharRec ch235 = new BitmapCharRec(9,16,-1,0,11,ch235data);
+
+/* char: 0xea */
+
+static final byte[] ch234data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0x41,(byte) 0x80,(byte) 0x63,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x21,(byte) 0x0,(byte) 0x12,(byte) 0x0,(byte) 0x1e,(byte) 0x0,
+(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch234 = new BitmapCharRec(9,17,-1,0,11,ch234data);
+
+/* char: 0xe9 */
+
+static final byte[] ch233data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0x41,(byte) 0x80,(byte) 0x63,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x7,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch233 = new BitmapCharRec(9,17,-1,0,11,ch233data);
+
+/* char: 0xe8 */
+
+static final byte[] ch232data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0x41,(byte) 0x80,(byte) 0x63,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x70,(byte) 0x0,
+(byte) 0x60,(byte) 0x0,
+};
+
+static final BitmapCharRec ch232 = new BitmapCharRec(9,17,-1,0,11,ch232data);
+
+/* char: 0xe7 */
+
+static final byte[] ch231data = {
+(byte) 0x3c,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,
+(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x41,(byte) 0x80,
+(byte) 0x63,(byte) 0x80,(byte) 0x1f,(byte) 0x0,
+};
+
+static final BitmapCharRec ch231 = new BitmapCharRec(9,18,-1,6,11,ch231data);
+
+/* char: 0xe6 */
+
+static final byte[] ch230data = {
+(byte) 0x70,(byte) 0xf0,(byte) 0xfb,(byte) 0xf8,(byte) 0xc7,(byte) 0x84,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0xfc,
+(byte) 0x3,(byte) 0xc,(byte) 0x63,(byte) 0xc,(byte) 0x67,(byte) 0x98,(byte) 0x3c,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch230 = new BitmapCharRec(14,12,-1,0,16,ch230data);
+
+/* char: 0xe5 */
+
+static final byte[] ch229data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,
+(byte) 0x1c,(byte) 0x0,
+};
+
+static final BitmapCharRec ch229 = new BitmapCharRec(9,17,-1,0,11,ch229data);
+
+/* char: 0xe4 */
+
+static final byte[] ch228data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x66,(byte) 0x0,
+};
+
+static final BitmapCharRec ch228 = new BitmapCharRec(9,16,-1,0,11,ch228data);
+
+/* char: 0xe3 */
+
+static final byte[] ch227data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x5c,(byte) 0x0,(byte) 0x3a,(byte) 0x0,
+};
+
+static final BitmapCharRec ch227 = new BitmapCharRec(9,16,-1,0,11,ch227data);
+
+/* char: 0xe2 */
+
+static final byte[] ch226data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x42,(byte) 0x0,(byte) 0x24,(byte) 0x0,(byte) 0x3c,(byte) 0x0,
+(byte) 0x18,(byte) 0x0,
+};
+
+static final BitmapCharRec ch226 = new BitmapCharRec(9,17,-1,0,11,ch226data);
+
+/* char: 0xe1 */
+
+static final byte[] ch225data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x7,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch225 = new BitmapCharRec(9,17,-1,0,11,ch225data);
+
+/* char: 0xe0 */
+
+static final byte[] ch224data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x70,(byte) 0x0,
+(byte) 0x60,(byte) 0x0,
+};
+
+static final BitmapCharRec ch224 = new BitmapCharRec(9,17,-1,0,11,ch224data);
+
+/* char: 0xdf */
+
+static final byte[] ch223data = {
+(byte) 0xe7,(byte) 0x0,(byte) 0x6c,(byte) 0x80,(byte) 0x6c,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x61,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x63,(byte) 0x80,
+(byte) 0x67,(byte) 0x0,(byte) 0x6c,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x33,(byte) 0x0,
+(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch223 = new BitmapCharRec(10,17,-1,0,12,ch223data);
+
+/* char: 0xde */
+
+static final byte[] ch222data = {
+(byte) 0xfc,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x70,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x18,
+(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+(byte) 0xfc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch222 = new BitmapCharRec(13,17,-1,0,15,ch222data);
+
+/* char: 0xdd */
+
+static final byte[] ch221data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x3,(byte) 0xc0,
+(byte) 0x3,(byte) 0x40,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x20,(byte) 0xc,(byte) 0x30,(byte) 0x1c,(byte) 0x10,(byte) 0x18,(byte) 0x18,(byte) 0x38,(byte) 0x8,(byte) 0x30,(byte) 0xc,
+(byte) 0xfc,(byte) 0x3f,(byte) 0x0,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x30,
+};
+
+static final BitmapCharRec ch221 = new BitmapCharRec(16,22,0,0,16,ch221data);
+
+/* char: 0xdc */
+
+static final byte[] ch220data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x30,(byte) 0x18,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xfc,(byte) 0x1f,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x30,(byte) 0x6,(byte) 0x30,
+};
+
+static final BitmapCharRec ch220 = new BitmapCharRec(16,21,-1,0,18,ch220data);
+
+/* char: 0xdb */
+
+static final byte[] ch219data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x30,(byte) 0x18,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xfc,(byte) 0x1f,(byte) 0x0,(byte) 0x0,(byte) 0x8,(byte) 0x10,(byte) 0x6,(byte) 0x60,(byte) 0x3,(byte) 0xc0,(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch219 = new BitmapCharRec(16,22,-1,0,18,ch219data);
+
+/* char: 0xda */
+
+static final byte[] ch218data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x30,(byte) 0x18,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xfc,(byte) 0x1f,(byte) 0x0,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x30,
+};
+
+static final BitmapCharRec ch218 = new BitmapCharRec(16,22,-1,0,18,ch218data);
+
+/* char: 0xd9 */
+
+static final byte[] ch217data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x30,(byte) 0x18,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xfc,(byte) 0x1f,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x40,(byte) 0x1,(byte) 0x80,(byte) 0x7,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch217 = new BitmapCharRec(16,22,-1,0,18,ch217data);
+
+/* char: 0xd8 */
+
+static final byte[] ch216data = {
+(byte) 0x20,(byte) 0x0,(byte) 0x27,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x68,(byte) 0x6,(byte) 0x64,(byte) 0x6,(byte) 0xc2,(byte) 0x3,(byte) 0xc2,(byte) 0x3,
+(byte) 0xc1,(byte) 0x3,(byte) 0xc1,(byte) 0x3,(byte) 0xc0,(byte) 0x83,(byte) 0xc0,(byte) 0x83,(byte) 0xc0,(byte) 0x43,(byte) 0x60,(byte) 0x46,(byte) 0x60,(byte) 0x26,(byte) 0x38,(byte) 0x1c,
+(byte) 0x1c,(byte) 0x38,(byte) 0x7,(byte) 0xe4,(byte) 0x0,(byte) 0x4,
+};
+
+static final BitmapCharRec ch216 = new BitmapCharRec(16,19,-1,1,18,ch216data);
+
+/* char: 0xd7 */
+
+static final byte[] ch215data = {
+(byte) 0x80,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x33,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0x80,(byte) 0x40,
+};
+
+static final BitmapCharRec ch215 = new BitmapCharRec(10,11,-2,-1,14,ch215data);
+
+/* char: 0xd6 */
+
+static final byte[] ch214data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,
+(byte) 0x7,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x60,
+};
+
+static final BitmapCharRec ch214 = new BitmapCharRec(16,21,-1,0,18,ch214data);
+
+/* char: 0xd5 */
+
+static final byte[] ch213data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,
+(byte) 0x7,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x4,(byte) 0xe0,(byte) 0x3,(byte) 0x90,
+};
+
+static final BitmapCharRec ch213 = new BitmapCharRec(16,21,-1,0,18,ch213data);
+
+/* char: 0xd4 */
+
+static final byte[] ch212data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,
+(byte) 0x7,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x8,(byte) 0x10,(byte) 0x6,(byte) 0x60,(byte) 0x3,(byte) 0xc0,(byte) 0x1,(byte) 0x80,
+};
+
+static final BitmapCharRec ch212 = new BitmapCharRec(16,22,-1,0,18,ch212data);
+
+/* char: 0xd3 */
+
+static final byte[] ch211data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,
+(byte) 0x7,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x30,
+};
+
+static final BitmapCharRec ch211 = new BitmapCharRec(16,22,-1,0,18,ch211data);
+
+/* char: 0xd2 */
+
+static final byte[] ch210data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,
+(byte) 0x7,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x40,(byte) 0x1,(byte) 0x80,(byte) 0x7,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch210 = new BitmapCharRec(16,22,-1,0,18,ch210data);
+
+/* char: 0xd1 */
+
+static final byte[] ch209data = {
+(byte) 0xf8,(byte) 0xc,(byte) 0x20,(byte) 0x1c,(byte) 0x20,(byte) 0x1c,(byte) 0x20,(byte) 0x34,(byte) 0x20,(byte) 0x64,(byte) 0x20,(byte) 0x64,(byte) 0x20,(byte) 0xc4,(byte) 0x21,(byte) 0x84,
+(byte) 0x21,(byte) 0x84,(byte) 0x23,(byte) 0x4,(byte) 0x26,(byte) 0x4,(byte) 0x26,(byte) 0x4,(byte) 0x2c,(byte) 0x4,(byte) 0x38,(byte) 0x4,(byte) 0x38,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xf0,(byte) 0x1f,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x4,(byte) 0xe0,(byte) 0x3,(byte) 0x90,
+};
+
+static final BitmapCharRec ch209 = new BitmapCharRec(16,21,-1,0,18,ch209data);
+
+/* char: 0xd0 */
+
+static final byte[] ch208data = {
+(byte) 0x7f,(byte) 0xe0,(byte) 0x18,(byte) 0x38,(byte) 0x18,(byte) 0x1c,(byte) 0x18,(byte) 0x6,(byte) 0x18,(byte) 0x6,(byte) 0x18,(byte) 0x3,(byte) 0x18,(byte) 0x3,(byte) 0x18,(byte) 0x3,
+(byte) 0xff,(byte) 0x3,(byte) 0x18,(byte) 0x3,(byte) 0x18,(byte) 0x3,(byte) 0x18,(byte) 0x3,(byte) 0x18,(byte) 0x6,(byte) 0x18,(byte) 0x6,(byte) 0x18,(byte) 0x1c,(byte) 0x18,(byte) 0x38,
+(byte) 0x7f,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch208 = new BitmapCharRec(16,17,0,0,17,ch208data);
+
+/* char: 0xcf */
+
+static final byte[] ch207data = {
+(byte) 0xfc,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0xfc,(byte) 0x0,(byte) 0x0,(byte) 0xcc,(byte) 0xcc,
+};
+
+static final BitmapCharRec ch207 = new BitmapCharRec(6,21,-1,0,8,ch207data);
+
+/* char: 0xce */
+
+static final byte[] ch206data = {
+(byte) 0x7e,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,
+(byte) 0x7e,(byte) 0x0,(byte) 0x81,(byte) 0x66,(byte) 0x3c,(byte) 0x18,
+};
+
+static final BitmapCharRec ch206 = new BitmapCharRec(8,22,-1,0,8,ch206data);
+
+/* char: 0xcd */
+
+static final byte[] ch205data = {
+(byte) 0xfc,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0xfc,(byte) 0x0,(byte) 0x40,(byte) 0x30,(byte) 0x1c,(byte) 0xc,
+};
+
+static final BitmapCharRec ch205 = new BitmapCharRec(6,22,-1,0,8,ch205data);
+
+/* char: 0xcc */
+
+static final byte[] ch204data = {
+(byte) 0xfc,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0xfc,(byte) 0x0,(byte) 0x8,(byte) 0x30,(byte) 0xe0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch204 = new BitmapCharRec(6,22,-1,0,8,ch204data);
+
+/* char: 0xcb */
+
+static final byte[] ch203data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x30,
+(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,
+};
+
+static final BitmapCharRec ch203 = new BitmapCharRec(13,21,-1,0,15,ch203data);
+
+/* char: 0xca */
+
+static final byte[] ch202data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x30,
+(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x20,(byte) 0xc,(byte) 0xc0,(byte) 0x7,(byte) 0x80,(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch202 = new BitmapCharRec(13,22,-1,0,15,ch202data);
+
+/* char: 0xc9 */
+
+static final byte[] ch201data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x30,
+(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch201 = new BitmapCharRec(13,22,-1,0,15,ch201data);
+
+/* char: 0xc8 */
+
+static final byte[] ch200data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x30,
+(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0x18,(byte) 0x0,
+};
+
+static final BitmapCharRec ch200 = new BitmapCharRec(13,22,-1,0,15,ch200data);
+
+/* char: 0xc7 */
+
+static final byte[] ch199data = {
+(byte) 0x7,(byte) 0x80,(byte) 0xc,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x7,(byte) 0xe0,(byte) 0x1e,(byte) 0x38,
+(byte) 0x38,(byte) 0x8,(byte) 0x60,(byte) 0x4,(byte) 0x60,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x60,(byte) 0x4,(byte) 0x60,(byte) 0x4,(byte) 0x38,(byte) 0xc,(byte) 0x1c,(byte) 0x3c,(byte) 0x7,(byte) 0xe4,
+};
+
+static final BitmapCharRec ch199 = new BitmapCharRec(14,23,-1,6,16,ch199data);
+
+/* char: 0xc6 */
+
+static final byte[] ch198data = {
+(byte) 0xf9,(byte) 0xff,(byte) 0xf0,(byte) 0x30,(byte) 0x60,(byte) 0x30,(byte) 0x10,(byte) 0x60,(byte) 0x10,(byte) 0x10,(byte) 0x60,(byte) 0x10,(byte) 0x18,(byte) 0x60,(byte) 0x0,(byte) 0x8,
+(byte) 0x60,(byte) 0x0,(byte) 0xf,(byte) 0xe0,(byte) 0x80,(byte) 0xc,(byte) 0x60,(byte) 0x80,(byte) 0x4,(byte) 0x7f,(byte) 0x80,(byte) 0x4,(byte) 0x60,(byte) 0x80,(byte) 0x6,(byte) 0x60,
+(byte) 0x80,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x20,(byte) 0x1,(byte) 0x60,(byte) 0x20,(byte) 0x1,(byte) 0xe0,(byte) 0x60,
+(byte) 0x3,(byte) 0xff,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch198 = new BitmapCharRec(20,17,0,0,21,ch198data);
+
+/* char: 0xc5 */
+
+static final byte[] ch197data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x2,(byte) 0x20,(byte) 0x0,(byte) 0x2,(byte) 0x20,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch197 = new BitmapCharRec(17,21,0,0,17,ch197data);
+
+/* char: 0xc4 */
+
+static final byte[] ch196data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,(byte) 0x0,
+};
+
+static final BitmapCharRec ch196 = new BitmapCharRec(17,21,0,0,17,ch196data);
+
+/* char: 0xc3 */
+
+static final byte[] ch195data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x7,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x4,(byte) 0xe0,(byte) 0x0,(byte) 0x3,(byte) 0x90,(byte) 0x0,
+};
+
+static final BitmapCharRec ch195 = new BitmapCharRec(17,21,0,0,17,ch195data);
+
+/* char: 0xc2 */
+
+static final byte[] ch194data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x8,(byte) 0x10,(byte) 0x0,(byte) 0x6,(byte) 0x60,(byte) 0x0,(byte) 0x3,(byte) 0xc0,(byte) 0x0,(byte) 0x1,
+(byte) 0x80,(byte) 0x0,
+};
+
+static final BitmapCharRec ch194 = new BitmapCharRec(17,22,0,0,17,ch194data);
+
+/* char: 0xc1 */
+
+static final byte[] ch193data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x0,
+(byte) 0x30,(byte) 0x0,
+};
+
+static final BitmapCharRec ch193 = new BitmapCharRec(17,22,0,0,17,ch193data);
+
+/* char: 0xc0 */
+
+static final byte[] ch192data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x20,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x3,(byte) 0x80,(byte) 0x0,(byte) 0x3,
+(byte) 0x0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch192 = new BitmapCharRec(17,22,0,0,17,ch192data);
+
+/* char: 0xbf */
+
+static final byte[] ch191data = {
+(byte) 0x3e,(byte) 0x63,(byte) 0xc1,(byte) 0xc3,(byte) 0xc3,(byte) 0xe0,(byte) 0x70,(byte) 0x30,(byte) 0x38,(byte) 0x18,(byte) 0x18,(byte) 0x8,(byte) 0x8,(byte) 0x0,(byte) 0x0,(byte) 0xc,
+(byte) 0xc,
+};
+
+static final BitmapCharRec ch191 = new BitmapCharRec(8,17,-1,5,11,ch191data);
+
+/* char: 0xbe */
+
+static final byte[] ch190data = {
+(byte) 0x18,(byte) 0x2,(byte) 0x0,(byte) 0x8,(byte) 0x2,(byte) 0x0,(byte) 0xc,(byte) 0x7f,(byte) 0x80,(byte) 0x4,(byte) 0x22,(byte) 0x0,(byte) 0x6,(byte) 0x32,(byte) 0x0,(byte) 0x3,
+(byte) 0x12,(byte) 0x0,(byte) 0x1,(byte) 0xa,(byte) 0x0,(byte) 0x71,(byte) 0x8e,(byte) 0x0,(byte) 0x88,(byte) 0x86,(byte) 0x0,(byte) 0x8c,(byte) 0xc2,(byte) 0x0,(byte) 0xc,(byte) 0x60,
+(byte) 0x0,(byte) 0x8,(byte) 0x20,(byte) 0x0,(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0x8,(byte) 0x10,(byte) 0x0,(byte) 0x8c,(byte) 0x18,(byte) 0x0,(byte) 0x4c,(byte) 0xc,(byte) 0x0,
+(byte) 0x38,(byte) 0x4,(byte) 0x0,
+};
+
+static final BitmapCharRec ch190 = new BitmapCharRec(17,17,0,0,18,ch190data);
+
+/* char: 0xbd */
+
+static final byte[] ch189data = {
+(byte) 0x30,(byte) 0x7e,(byte) 0x10,(byte) 0x22,(byte) 0x18,(byte) 0x10,(byte) 0x8,(byte) 0x18,(byte) 0xc,(byte) 0x8,(byte) 0x6,(byte) 0x4,(byte) 0x2,(byte) 0x6,(byte) 0xfb,(byte) 0x46,
+(byte) 0x21,(byte) 0x26,(byte) 0x21,(byte) 0x9c,(byte) 0x20,(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0x20,(byte) 0x60,(byte) 0x20,(byte) 0x20,(byte) 0xa0,(byte) 0x30,(byte) 0x60,(byte) 0x18,
+(byte) 0x20,(byte) 0x8,
+};
+
+static final BitmapCharRec ch189 = new BitmapCharRec(15,17,-1,0,18,ch189data);
+
+/* char: 0xbc */
+
+static final byte[] ch188data = {
+(byte) 0x30,(byte) 0x4,(byte) 0x10,(byte) 0x4,(byte) 0x18,(byte) 0xff,(byte) 0x8,(byte) 0x44,(byte) 0xc,(byte) 0x64,(byte) 0x6,(byte) 0x24,(byte) 0x2,(byte) 0x14,(byte) 0xfb,(byte) 0x1c,
+(byte) 0x21,(byte) 0xc,(byte) 0x21,(byte) 0x84,(byte) 0x20,(byte) 0xc0,(byte) 0x20,(byte) 0x40,(byte) 0x20,(byte) 0x60,(byte) 0x20,(byte) 0x20,(byte) 0xa0,(byte) 0x30,(byte) 0x60,(byte) 0x18,
+(byte) 0x20,(byte) 0x8,
+};
+
+static final BitmapCharRec ch188 = new BitmapCharRec(16,17,-1,0,18,ch188data);
+
+/* char: 0xbb */
+
+static final byte[] ch187data = {
+(byte) 0x88,(byte) 0x0,(byte) 0xcc,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x19,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0x33,(byte) 0x0,(byte) 0x66,(byte) 0x0,
+(byte) 0xcc,(byte) 0x0,(byte) 0x88,(byte) 0x0,
+};
+
+static final BitmapCharRec ch187 = new BitmapCharRec(9,10,-2,-1,12,ch187data);
+
+/* char: 0xba */
+
+static final byte[] ch186data = {
+(byte) 0xfc,(byte) 0x0,(byte) 0x78,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0x78,
+};
+
+static final BitmapCharRec ch186 = new BitmapCharRec(6,9,-1,-8,8,ch186data);
+
+/* char: 0xb9 */
+
+static final byte[] ch185data = {
+(byte) 0xf8,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0x20,(byte) 0xa0,(byte) 0x60,(byte) 0x20,
+};
+
+static final BitmapCharRec ch185 = new BitmapCharRec(5,10,-1,-7,7,ch185data);
+
+/* char: 0xb8 */
+
+static final byte[] ch184data = {
+(byte) 0x78,(byte) 0xcc,(byte) 0xc,(byte) 0x3c,(byte) 0x30,(byte) 0x10,
+};
+
+static final BitmapCharRec ch184 = new BitmapCharRec(6,6,-1,6,8,ch184data);
+
+/* char: 0xb7 */
+
+static final byte[] ch183data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch183 = new BitmapCharRec(2,2,-2,-6,6,ch183data);
+
+/* char: 0xb6 */
+
+static final byte[] ch182data = {
+(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,
+(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x9,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x39,(byte) 0x0,(byte) 0x79,(byte) 0x0,(byte) 0x79,(byte) 0x0,(byte) 0xf9,(byte) 0x0,
+(byte) 0xf9,(byte) 0x0,(byte) 0xf9,(byte) 0x0,(byte) 0x79,(byte) 0x0,(byte) 0x79,(byte) 0x0,(byte) 0x39,(byte) 0x0,(byte) 0x1f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch182 = new BitmapCharRec(9,22,-1,5,11,ch182data);
+
+/* char: 0xb5 */
+
+static final byte[] ch181data = {
+(byte) 0x40,(byte) 0x0,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x0,(byte) 0x5c,(byte) 0xe0,(byte) 0x7e,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0xe1,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch181 = new BitmapCharRec(11,17,-1,5,13,ch181data);
+
+/* char: 0xb4 */
+
+static final byte[] ch180data = {
+(byte) 0x80,(byte) 0x60,(byte) 0x38,(byte) 0x18,
+};
+
+static final BitmapCharRec ch180 = new BitmapCharRec(5,4,-2,-13,8,ch180data);
+
+/* char: 0xb3 */
+
+static final byte[] ch179data = {
+(byte) 0x70,(byte) 0x88,(byte) 0x8c,(byte) 0xc,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x8c,(byte) 0x4c,(byte) 0x38,
+};
+
+static final BitmapCharRec ch179 = new BitmapCharRec(6,10,0,-7,7,ch179data);
+
+/* char: 0xb2 */
+
+static final byte[] ch178data = {
+(byte) 0xfc,(byte) 0x44,(byte) 0x20,(byte) 0x30,(byte) 0x10,(byte) 0x8,(byte) 0xc,(byte) 0x8c,(byte) 0x4c,(byte) 0x38,
+};
+
+static final BitmapCharRec ch178 = new BitmapCharRec(6,10,0,-7,7,ch178data);
+
+/* char: 0xb1 */
+
+static final byte[] ch177data = {
+(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch177 = new BitmapCharRec(12,15,-1,0,14,ch177data);
+
+/* char: 0xb0 */
+
+static final byte[] ch176data = {
+(byte) 0x38,(byte) 0x44,(byte) 0x82,(byte) 0x82,(byte) 0x82,(byte) 0x44,(byte) 0x38,
+};
+
+static final BitmapCharRec ch176 = new BitmapCharRec(7,7,-1,-10,9,ch176data);
+
+/* char: 0xaf */
+
+static final byte[] ch175data = {
+(byte) 0xfc,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch175 = new BitmapCharRec(6,2,-1,-14,8,ch175data);
+
+/* char: 0xae */
+
+static final byte[] ch174data = {
+(byte) 0x7,(byte) 0xf0,(byte) 0x0,(byte) 0x1c,(byte) 0x1c,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x60,(byte) 0x3,(byte) 0x0,(byte) 0x47,(byte) 0x19,(byte) 0x0,(byte) 0xc2,
+(byte) 0x31,(byte) 0x80,(byte) 0x82,(byte) 0x20,(byte) 0x80,(byte) 0x82,(byte) 0x40,(byte) 0x80,(byte) 0x83,(byte) 0xe0,(byte) 0x80,(byte) 0x82,(byte) 0x30,(byte) 0x80,(byte) 0x82,(byte) 0x10,
+(byte) 0x80,(byte) 0xc2,(byte) 0x11,(byte) 0x80,(byte) 0x42,(byte) 0x31,(byte) 0x0,(byte) 0x67,(byte) 0xe3,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x1c,(byte) 0x1c,(byte) 0x0,
+(byte) 0x7,(byte) 0xf0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch174 = new BitmapCharRec(17,17,-1,0,19,ch174data);
+
+/* char: 0xad */
+
+static final byte[] ch173data = {
+(byte) 0xfe,(byte) 0xfe,
+};
+
+static final BitmapCharRec ch173 = new BitmapCharRec(7,2,-1,-5,9,ch173data);
+
+/* char: 0xac */
+
+static final byte[] ch172data = {
+(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch172 = new BitmapCharRec(12,7,-1,-3,14,ch172data);
+
+/* char: 0xab */
+
+static final byte[] ch171data = {
+(byte) 0x8,(byte) 0x80,(byte) 0x19,(byte) 0x80,(byte) 0x33,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0xcc,(byte) 0x0,(byte) 0xcc,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x33,(byte) 0x0,
+(byte) 0x19,(byte) 0x80,(byte) 0x8,(byte) 0x80,
+};
+
+static final BitmapCharRec ch171 = new BitmapCharRec(9,10,-2,-1,13,ch171data);
+
+/* char: 0xaa */
+
+static final byte[] ch170data = {
+(byte) 0x7e,(byte) 0x0,(byte) 0x76,(byte) 0xcc,(byte) 0xcc,(byte) 0x7c,(byte) 0xc,(byte) 0xcc,(byte) 0x78,
+};
+
+static final BitmapCharRec ch170 = new BitmapCharRec(7,9,0,-8,8,ch170data);
+
+/* char: 0xa9 */
+
+static final byte[] ch169data = {
+(byte) 0x7,(byte) 0xf0,(byte) 0x0,(byte) 0x1c,(byte) 0x1c,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x61,(byte) 0xc3,(byte) 0x0,(byte) 0x47,(byte) 0x71,(byte) 0x0,(byte) 0xc4,
+(byte) 0x19,(byte) 0x80,(byte) 0x8c,(byte) 0x0,(byte) 0x80,(byte) 0x88,(byte) 0x0,(byte) 0x80,(byte) 0x88,(byte) 0x0,(byte) 0x80,(byte) 0x88,(byte) 0x0,(byte) 0x80,(byte) 0x8c,(byte) 0x0,
+(byte) 0x80,(byte) 0xc4,(byte) 0x19,(byte) 0x80,(byte) 0x47,(byte) 0x31,(byte) 0x0,(byte) 0x61,(byte) 0xe3,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x1c,(byte) 0x1c,(byte) 0x0,
+(byte) 0x7,(byte) 0xf0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch169 = new BitmapCharRec(17,17,-1,0,19,ch169data);
+
+/* char: 0xa8 */
+
+static final byte[] ch168data = {
+(byte) 0xcc,(byte) 0xcc,
+};
+
+static final BitmapCharRec ch168 = new BitmapCharRec(6,2,-1,-14,8,ch168data);
+
+/* char: 0xa7 */
+
+static final byte[] ch167data = {
+(byte) 0x38,(byte) 0x64,(byte) 0x62,(byte) 0x6,(byte) 0xe,(byte) 0x1c,(byte) 0x38,(byte) 0x74,(byte) 0xe2,(byte) 0xc3,(byte) 0x83,(byte) 0x87,(byte) 0x4e,(byte) 0x3c,(byte) 0x38,(byte) 0x70,
+(byte) 0x60,(byte) 0x46,(byte) 0x26,(byte) 0x1c,
+};
+
+static final BitmapCharRec ch167 = new BitmapCharRec(8,20,-2,2,12,ch167data);
+
+/* char: 0xa6 */
+
+static final byte[] ch166data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch166 = new BitmapCharRec(2,17,-2,0,6,ch166data);
+
+/* char: 0xa5 */
+
+static final byte[] ch165data = {
+(byte) 0xf,(byte) 0xc0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x1f,(byte) 0xe0,(byte) 0x3,(byte) 0x0,(byte) 0x1f,(byte) 0xe0,
+(byte) 0x3,(byte) 0x0,(byte) 0x7,(byte) 0x80,(byte) 0xc,(byte) 0x80,(byte) 0xc,(byte) 0xc0,(byte) 0x18,(byte) 0x40,(byte) 0x18,(byte) 0x60,(byte) 0x30,(byte) 0x20,(byte) 0x70,(byte) 0x30,
+(byte) 0xf8,(byte) 0x7c,
+};
+
+static final BitmapCharRec ch165 = new BitmapCharRec(14,17,0,0,14,ch165data);
+
+/* char: 0xa4 */
+
+static final byte[] ch164data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0xee,(byte) 0xe0,(byte) 0x7f,(byte) 0xc0,(byte) 0x31,(byte) 0x80,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x31,(byte) 0x80,(byte) 0x7f,(byte) 0xc0,(byte) 0xee,(byte) 0xe0,(byte) 0xc0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch164 = new BitmapCharRec(11,12,-1,-3,13,ch164data);
+
+/* char: 0xa3 */
+
+static final byte[] ch163data = {
+(byte) 0xe7,(byte) 0x80,(byte) 0xbe,(byte) 0xc0,(byte) 0x78,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+(byte) 0x30,(byte) 0x0,(byte) 0xfc,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x31,(byte) 0x80,(byte) 0x19,(byte) 0x80,
+(byte) 0xf,(byte) 0x0,
+};
+
+static final BitmapCharRec ch163 = new BitmapCharRec(10,17,-1,0,12,ch163data);
+
+/* char: 0xa2 */
+
+static final byte[] ch162data = {
+(byte) 0x40,(byte) 0x0,(byte) 0x40,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xd0,(byte) 0x0,(byte) 0xc8,(byte) 0x0,(byte) 0xc8,(byte) 0x0,
+(byte) 0xc8,(byte) 0x0,(byte) 0xc4,(byte) 0x0,(byte) 0xc4,(byte) 0x0,(byte) 0x43,(byte) 0x80,(byte) 0x63,(byte) 0x80,(byte) 0x1f,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x1,(byte) 0x0,
+};
+
+static final BitmapCharRec ch162 = new BitmapCharRec(9,16,-1,2,12,ch162data);
+
+/* char: 0xa1 */
+
+static final byte[] ch161data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch161 = new BitmapCharRec(2,17,-4,5,8,ch161data);
+
+/* char: 0xa0 */
+
+static final BitmapCharRec ch160 = new BitmapCharRec(0,0,0,0,6,null);
+
+/* char: 0x7e '~' */
+
+static final byte[] ch126data = {
+(byte) 0x83,(byte) 0x80,(byte) 0xc7,(byte) 0xc0,(byte) 0x7c,(byte) 0x60,(byte) 0x38,(byte) 0x20,
+};
+
+static final BitmapCharRec ch126 = new BitmapCharRec(11,4,-1,-5,13,ch126data);
+
+/* char: 0x7d '}' */
+
+static final byte[] ch125data = {
+(byte) 0xe0,(byte) 0x30,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x8,(byte) 0xc,(byte) 0x4,(byte) 0x3,(byte) 0x4,(byte) 0xc,(byte) 0x8,(byte) 0x18,
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x30,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch125 = new BitmapCharRec(8,22,-1,5,10,ch125data);
+
+/* char: 0x7c '|' */
+
+static final byte[] ch124data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch124 = new BitmapCharRec(2,17,-2,0,6,ch124data);
+
+/* char: 0x7b '{' */
+
+static final byte[] ch123data = {
+(byte) 0x7,(byte) 0xc,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x10,(byte) 0x30,(byte) 0x20,(byte) 0xc0,(byte) 0x20,(byte) 0x30,(byte) 0x10,(byte) 0x18,
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xc,(byte) 0x7,
+};
+
+static final BitmapCharRec ch123 = new BitmapCharRec(8,22,-1,5,10,ch123data);
+
+/* char: 0x7a 'z' */
+
+static final byte[] ch122data = {
+(byte) 0xff,(byte) 0xc3,(byte) 0x61,(byte) 0x70,(byte) 0x30,(byte) 0x38,(byte) 0x18,(byte) 0x1c,(byte) 0xe,(byte) 0x86,(byte) 0xc3,(byte) 0xff,
+};
+
+static final BitmapCharRec ch122 = new BitmapCharRec(8,12,-1,0,10,ch122data);
+
+/* char: 0x79 'y' */
+
+static final byte[] ch121data = {
+(byte) 0xe0,(byte) 0x0,(byte) 0xf0,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x8,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xe,(byte) 0x0,
+(byte) 0x1a,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x31,(byte) 0x0,(byte) 0x30,(byte) 0x80,(byte) 0x30,(byte) 0x80,(byte) 0x60,(byte) 0x80,(byte) 0x60,(byte) 0xc0,
+(byte) 0xf1,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch121 = new BitmapCharRec(11,17,0,5,11,ch121data);
+
+/* char: 0x78 'x' */
+
+static final byte[] ch120data = {
+(byte) 0xf1,(byte) 0xe0,(byte) 0x60,(byte) 0xc0,(byte) 0x21,(byte) 0x80,(byte) 0x33,(byte) 0x80,(byte) 0x1b,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x1a,(byte) 0x0,
+(byte) 0x39,(byte) 0x0,(byte) 0x31,(byte) 0x80,(byte) 0x60,(byte) 0xc0,(byte) 0xf1,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch120 = new BitmapCharRec(11,12,-1,0,13,ch120data);
+
+/* char: 0x77 'w' */
+
+static final byte[] ch119data = {
+(byte) 0x4,(byte) 0x10,(byte) 0x0,(byte) 0xe,(byte) 0x38,(byte) 0x0,(byte) 0xe,(byte) 0x38,(byte) 0x0,(byte) 0x1a,(byte) 0x28,(byte) 0x0,(byte) 0x1a,(byte) 0x64,(byte) 0x0,(byte) 0x19,
+(byte) 0x64,(byte) 0x0,(byte) 0x31,(byte) 0x64,(byte) 0x0,(byte) 0x30,(byte) 0xc2,(byte) 0x0,(byte) 0x30,(byte) 0xc2,(byte) 0x0,(byte) 0x60,(byte) 0xc2,(byte) 0x0,(byte) 0x60,(byte) 0xc3,
+(byte) 0x0,(byte) 0xf1,(byte) 0xe7,(byte) 0x80,
+};
+
+static final BitmapCharRec ch119 = new BitmapCharRec(17,12,0,0,17,ch119data);
+
+/* char: 0x76 'v' */
+
+static final byte[] ch118data = {
+(byte) 0x4,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0xe,(byte) 0x0,(byte) 0x1a,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x19,(byte) 0x0,(byte) 0x31,(byte) 0x0,(byte) 0x30,(byte) 0x80,
+(byte) 0x30,(byte) 0x80,(byte) 0x60,(byte) 0x80,(byte) 0x60,(byte) 0xc0,(byte) 0xf1,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch118 = new BitmapCharRec(11,12,0,0,11,ch118data);
+
+/* char: 0x75 'u' */
+
+static final byte[] ch117data = {
+(byte) 0x1c,(byte) 0xe0,(byte) 0x3e,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0xe1,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch117 = new BitmapCharRec(11,12,-1,0,13,ch117data);
+
+/* char: 0x74 't' */
+
+static final byte[] ch116data = {
+(byte) 0x1c,(byte) 0x32,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0xfe,(byte) 0x70,(byte) 0x30,(byte) 0x10,
+};
+
+static final BitmapCharRec ch116 = new BitmapCharRec(7,15,0,0,7,ch116data);
+
+/* char: 0x73 's' */
+
+static final byte[] ch115data = {
+(byte) 0xf8,(byte) 0xc6,(byte) 0x83,(byte) 0x3,(byte) 0x7,(byte) 0x1e,(byte) 0x7c,(byte) 0x70,(byte) 0xe0,(byte) 0xc2,(byte) 0x66,(byte) 0x3e,
+};
+
+static final BitmapCharRec ch115 = new BitmapCharRec(8,12,-1,0,10,ch115data);
+
+/* char: 0x72 'r' */
+
+static final byte[] ch114data = {
+(byte) 0xf0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x76,(byte) 0x6e,(byte) 0xe6,
+};
+
+static final BitmapCharRec ch114 = new BitmapCharRec(7,12,-1,0,8,ch114data);
+
+/* char: 0x71 'q' */
+
+static final byte[] ch113data = {
+(byte) 0x3,(byte) 0xc0,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1d,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,
+(byte) 0x1d,(byte) 0x80,
+};
+
+static final BitmapCharRec ch113 = new BitmapCharRec(10,17,-1,5,12,ch113data);
+
+/* char: 0x70 'p' */
+
+static final byte[] ch112data = {
+(byte) 0xf0,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x6e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,
+(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,
+(byte) 0xee,(byte) 0x0,
+};
+
+static final BitmapCharRec ch112 = new BitmapCharRec(10,17,-1,5,12,ch112data);
+
+/* char: 0x6f 'o' */
+
+static final byte[] ch111data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch111 = new BitmapCharRec(10,12,-1,0,12,ch111data);
+
+/* char: 0x6e 'n' */
+
+static final byte[] ch110data = {
+(byte) 0xf1,(byte) 0xe0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x6f,(byte) 0x80,(byte) 0xe7,(byte) 0x0,
+};
+
+static final BitmapCharRec ch110 = new BitmapCharRec(11,12,-1,0,13,ch110data);
+
+/* char: 0x6d 'm' */
+
+static final byte[] ch109data = {
+(byte) 0xf1,(byte) 0xe3,(byte) 0xc0,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x60,
+(byte) 0xc1,(byte) 0x80,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x60,(byte) 0xc1,(byte) 0x80,(byte) 0x71,(byte) 0xe3,(byte) 0x80,(byte) 0x6f,(byte) 0x9f,
+(byte) 0x0,(byte) 0xe7,(byte) 0xe,(byte) 0x0,
+};
+
+static final BitmapCharRec ch109 = new BitmapCharRec(18,12,-1,0,20,ch109data);
+
+/* char: 0x6c 'l' */
+
+static final byte[] ch108data = {
+(byte) 0xf0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,
+(byte) 0xe0,
+};
+
+static final BitmapCharRec ch108 = new BitmapCharRec(4,17,-1,0,6,ch108data);
+
+/* char: 0x6b 'k' */
+
+static final byte[] ch107data = {
+(byte) 0xf3,(byte) 0xe0,(byte) 0x61,(byte) 0xc0,(byte) 0x63,(byte) 0x80,(byte) 0x67,(byte) 0x0,(byte) 0x6e,(byte) 0x0,(byte) 0x6c,(byte) 0x0,(byte) 0x78,(byte) 0x0,(byte) 0x68,(byte) 0x0,
+(byte) 0x64,(byte) 0x0,(byte) 0x66,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0xc0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,
+(byte) 0xe0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch107 = new BitmapCharRec(11,17,-1,0,12,ch107data);
+
+/* char: 0x6a 'j' */
+
+static final byte[] ch106data = {
+(byte) 0xc0,(byte) 0xe0,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0x70,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x30,
+};
+
+static final BitmapCharRec ch106 = new BitmapCharRec(4,22,0,5,6,ch106data);
+
+/* char: 0x69 'i' */
+
+static final byte[] ch105data = {
+(byte) 0xf0,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0x60,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x60,
+(byte) 0x60,
+};
+
+static final BitmapCharRec ch105 = new BitmapCharRec(4,17,-1,0,6,ch105data);
+
+/* char: 0x68 'h' */
+
+static final byte[] ch104data = {
+(byte) 0xf1,(byte) 0xe0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x71,(byte) 0xc0,(byte) 0x6f,(byte) 0x80,(byte) 0x67,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,
+(byte) 0xe0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch104 = new BitmapCharRec(11,17,-1,0,13,ch104data);
+
+/* char: 0x67 'g' */
+
+static final byte[] ch103data = {
+(byte) 0x3f,(byte) 0x0,(byte) 0xf1,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x20,(byte) 0x60,(byte) 0x60,(byte) 0x3f,(byte) 0xc0,(byte) 0x7f,(byte) 0x0,(byte) 0x60,(byte) 0x0,
+(byte) 0x30,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x33,(byte) 0x0,
+(byte) 0x1f,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch103 = new BitmapCharRec(11,17,-1,5,12,ch103data);
+
+/* char: 0x66 'f' */
+
+static final byte[] ch102data = {
+(byte) 0x78,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0xfe,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x16,
+(byte) 0xe,
+};
+
+static final BitmapCharRec ch102 = new BitmapCharRec(7,17,0,0,7,ch102data);
+
+/* char: 0x65 'e' */
+
+static final byte[] ch101data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xff,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0x41,(byte) 0x80,(byte) 0x63,(byte) 0x0,(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch101 = new BitmapCharRec(9,12,-1,0,11,ch101data);
+
+/* char: 0x64 'd' */
+
+static final byte[] ch100data = {
+(byte) 0x1e,(byte) 0xc0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0xc1,(byte) 0x80,
+(byte) 0xc1,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x1d,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,
+(byte) 0x3,(byte) 0x80,
+};
+
+static final BitmapCharRec ch100 = new BitmapCharRec(10,17,-1,0,12,ch100data);
+
+/* char: 0x63 'c' */
+
+static final byte[] ch99data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7f,(byte) 0x0,(byte) 0x70,(byte) 0x80,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0x41,(byte) 0x80,(byte) 0x63,(byte) 0x80,(byte) 0x1f,(byte) 0x0,
+};
+
+static final BitmapCharRec ch99 = new BitmapCharRec(9,12,-1,0,11,ch99data);
+
+/* char: 0x62 'b' */
+
+static final byte[] ch98data = {
+(byte) 0x5e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,(byte) 0x60,(byte) 0xc0,
+(byte) 0x60,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x73,(byte) 0x80,(byte) 0x6e,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,
+(byte) 0xe0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch98 = new BitmapCharRec(10,17,-1,0,12,ch98data);
+
+/* char: 0x61 'a' */
+
+static final byte[] ch97data = {
+(byte) 0x71,(byte) 0x80,(byte) 0xfb,(byte) 0x0,(byte) 0xc7,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x3b,(byte) 0x0,(byte) 0xf,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x67,(byte) 0x0,(byte) 0x3e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch97 = new BitmapCharRec(9,12,-1,0,11,ch97data);
+
+/* char: 0x60 '`' */
+
+static final byte[] ch96data = {
+(byte) 0x60,(byte) 0xe0,(byte) 0x80,(byte) 0xc0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch96 = new BitmapCharRec(3,5,-2,-12,7,ch96data);
+
+/* char: 0x5f '_' */
+
+static final byte[] ch95data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0xff,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch95 = new BitmapCharRec(13,2,0,5,13,ch95data);
+
+/* char: 0x5e '^' */
+
+static final byte[] ch94data = {
+(byte) 0x80,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x41,(byte) 0x0,(byte) 0x63,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x36,(byte) 0x0,(byte) 0x14,(byte) 0x0,(byte) 0x1c,(byte) 0x0,
+(byte) 0x8,(byte) 0x0,
+};
+
+static final BitmapCharRec ch94 = new BitmapCharRec(9,9,-1,-8,11,ch94data);
+
+/* char: 0x5d ']' */
+
+static final byte[] ch93data = {
+(byte) 0xf8,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,
+(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch93 = new BitmapCharRec(5,21,-1,4,8,ch93data);
+
+/* char: 0x5c '\' */
+
+static final byte[] ch92data = {
+(byte) 0x6,(byte) 0x6,(byte) 0x4,(byte) 0xc,(byte) 0xc,(byte) 0x8,(byte) 0x18,(byte) 0x18,(byte) 0x10,(byte) 0x30,(byte) 0x30,(byte) 0x20,(byte) 0x60,(byte) 0x60,(byte) 0x40,(byte) 0xc0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch92 = new BitmapCharRec(7,17,0,0,7,ch92data);
+
+/* char: 0x5b '[' */
+
+static final byte[] ch91data = {
+(byte) 0xf8,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch91 = new BitmapCharRec(5,21,-2,4,8,ch91data);
+
+/* char: 0x5a 'Z' */
+
+static final byte[] ch90data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0xe0,(byte) 0x18,(byte) 0x70,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x38,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0xe,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x7,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x80,(byte) 0x1,(byte) 0xc0,(byte) 0x80,(byte) 0xc0,(byte) 0x80,(byte) 0xe0,(byte) 0xc0,(byte) 0x70,
+(byte) 0xff,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch90 = new BitmapCharRec(13,17,-1,0,15,ch90data);
+
+/* char: 0x59 'Y' */
+
+static final byte[] ch89data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x3,(byte) 0xc0,
+(byte) 0x3,(byte) 0x40,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x20,(byte) 0xc,(byte) 0x30,(byte) 0x1c,(byte) 0x10,(byte) 0x18,(byte) 0x18,(byte) 0x38,(byte) 0x8,(byte) 0x30,(byte) 0xc,
+(byte) 0xfc,(byte) 0x3f,
+};
+
+static final BitmapCharRec ch89 = new BitmapCharRec(16,17,0,0,16,ch89data);
+
+/* char: 0x58 'X' */
+
+static final byte[] ch88data = {
+(byte) 0xfc,(byte) 0xf,(byte) 0xc0,(byte) 0x30,(byte) 0x3,(byte) 0x80,(byte) 0x18,(byte) 0x7,(byte) 0x0,(byte) 0x8,(byte) 0xe,(byte) 0x0,(byte) 0x4,(byte) 0xc,(byte) 0x0,(byte) 0x6,
+(byte) 0x18,(byte) 0x0,(byte) 0x2,(byte) 0x38,(byte) 0x0,(byte) 0x1,(byte) 0x70,(byte) 0x0,(byte) 0x0,(byte) 0xe0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,
+(byte) 0x0,(byte) 0x3,(byte) 0xa0,(byte) 0x0,(byte) 0x3,(byte) 0x10,(byte) 0x0,(byte) 0x6,(byte) 0x8,(byte) 0x0,(byte) 0xe,(byte) 0xc,(byte) 0x0,(byte) 0x1c,(byte) 0x6,(byte) 0x0,
+(byte) 0x7e,(byte) 0xf,(byte) 0x80,
+};
+
+static final BitmapCharRec ch88 = new BitmapCharRec(18,17,0,0,18,ch88data);
+
+/* char: 0x57 'W' */
+
+static final byte[] ch87data = {
+(byte) 0x1,(byte) 0x83,(byte) 0x0,(byte) 0x1,(byte) 0x83,(byte) 0x0,(byte) 0x1,(byte) 0x83,(byte) 0x80,(byte) 0x3,(byte) 0x87,(byte) 0x80,(byte) 0x3,(byte) 0x46,(byte) 0x80,(byte) 0x3,
+(byte) 0x46,(byte) 0xc0,(byte) 0x6,(byte) 0x46,(byte) 0x40,(byte) 0x6,(byte) 0x4c,(byte) 0x40,(byte) 0x6,(byte) 0x4c,(byte) 0x60,(byte) 0xc,(byte) 0x2c,(byte) 0x60,(byte) 0xc,(byte) 0x2c,
+(byte) 0x20,(byte) 0x18,(byte) 0x2c,(byte) 0x20,(byte) 0x18,(byte) 0x18,(byte) 0x30,(byte) 0x18,(byte) 0x18,(byte) 0x10,(byte) 0x30,(byte) 0x18,(byte) 0x10,(byte) 0x30,(byte) 0x18,(byte) 0x18,
+(byte) 0xfc,(byte) 0x7e,(byte) 0x7e,
+};
+
+static final BitmapCharRec ch87 = new BitmapCharRec(23,17,0,0,23,ch87data);
+
+/* char: 0x56 'V' */
+
+static final byte[] ch86data = {
+(byte) 0x1,(byte) 0x80,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x0,(byte) 0x3,(byte) 0xc0,(byte) 0x0,(byte) 0x3,(byte) 0x40,(byte) 0x0,(byte) 0x3,
+(byte) 0x60,(byte) 0x0,(byte) 0x6,(byte) 0x20,(byte) 0x0,(byte) 0x6,(byte) 0x20,(byte) 0x0,(byte) 0x6,(byte) 0x30,(byte) 0x0,(byte) 0xc,(byte) 0x10,(byte) 0x0,(byte) 0xc,(byte) 0x18,
+(byte) 0x0,(byte) 0x18,(byte) 0x8,(byte) 0x0,(byte) 0x18,(byte) 0x8,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x30,(byte) 0x4,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch86 = new BitmapCharRec(17,17,0,0,17,ch86data);
+
+/* char: 0x55 'U' */
+
+static final byte[] ch85data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x30,(byte) 0x18,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xfc,(byte) 0x1f,
+};
+
+static final BitmapCharRec ch85 = new BitmapCharRec(16,17,-1,0,18,ch85data);
+
+/* char: 0x54 'T' */
+
+static final byte[] ch84data = {
+(byte) 0xf,(byte) 0xc0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x83,(byte) 0x4,(byte) 0x83,(byte) 0x4,(byte) 0xc3,(byte) 0xc,
+(byte) 0xff,(byte) 0xfc,
+};
+
+static final BitmapCharRec ch84 = new BitmapCharRec(14,17,-1,0,16,ch84data);
+
+/* char: 0x53 'S' */
+
+static final byte[] ch83data = {
+(byte) 0x9e,(byte) 0x0,(byte) 0xf1,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0x80,(byte) 0x60,(byte) 0x80,(byte) 0x60,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0xe0,(byte) 0x3,(byte) 0xc0,
+(byte) 0xf,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x78,(byte) 0x0,(byte) 0xe0,(byte) 0x0,(byte) 0xc0,(byte) 0x40,(byte) 0xc0,(byte) 0x40,(byte) 0xc0,(byte) 0xc0,(byte) 0x63,(byte) 0xc0,
+(byte) 0x1e,(byte) 0x40,
+};
+
+static final BitmapCharRec ch83 = new BitmapCharRec(11,17,-1,0,13,ch83data);
+
+/* char: 0x52 'R' */
+
+static final byte[] ch82data = {
+(byte) 0xfc,(byte) 0x1e,(byte) 0x30,(byte) 0x1c,(byte) 0x30,(byte) 0x38,(byte) 0x30,(byte) 0x70,(byte) 0x30,(byte) 0x60,(byte) 0x30,(byte) 0xc0,(byte) 0x31,(byte) 0xc0,(byte) 0x33,(byte) 0x80,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x70,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x38,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x38,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,
+(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch82 = new BitmapCharRec(15,17,-1,0,16,ch82data);
+
+/* char: 0x51 'Q' */
+
+static final byte[] ch81data = {
+(byte) 0x0,(byte) 0xf,(byte) 0x0,(byte) 0x38,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0xe0,(byte) 0x1,(byte) 0xc0,(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,
+(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,(byte) 0x7,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch81 = new BitmapCharRec(16,22,-1,5,18,ch81data);
+
+/* char: 0x50 'P' */
+
+static final byte[] ch80data = {
+(byte) 0xfc,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x70,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,
+(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch80 = new BitmapCharRec(13,17,-1,0,15,ch80data);
+
+/* char: 0x4f 'O' */
+
+static final byte[] ch79data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1c,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,
+(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0xc0,(byte) 0x3,(byte) 0x60,(byte) 0x6,(byte) 0x60,(byte) 0x6,(byte) 0x38,(byte) 0x1c,(byte) 0x1c,(byte) 0x38,
+(byte) 0x7,(byte) 0xe0,
+};
+
+static final BitmapCharRec ch79 = new BitmapCharRec(16,17,-1,0,18,ch79data);
+
+/* char: 0x4e 'N' */
+
+static final byte[] ch78data = {
+(byte) 0xf8,(byte) 0xc,(byte) 0x20,(byte) 0x1c,(byte) 0x20,(byte) 0x1c,(byte) 0x20,(byte) 0x34,(byte) 0x20,(byte) 0x64,(byte) 0x20,(byte) 0x64,(byte) 0x20,(byte) 0xc4,(byte) 0x21,(byte) 0x84,
+(byte) 0x21,(byte) 0x84,(byte) 0x23,(byte) 0x4,(byte) 0x26,(byte) 0x4,(byte) 0x26,(byte) 0x4,(byte) 0x2c,(byte) 0x4,(byte) 0x38,(byte) 0x4,(byte) 0x38,(byte) 0x4,(byte) 0x30,(byte) 0x4,
+(byte) 0xf0,(byte) 0x1f,
+};
+
+static final BitmapCharRec ch78 = new BitmapCharRec(16,17,-1,0,18,ch78data);
+
+/* char: 0x4d 'M' */
+
+static final byte[] ch77data = {
+(byte) 0xf8,(byte) 0x21,(byte) 0xf8,(byte) 0x20,(byte) 0x60,(byte) 0x60,(byte) 0x20,(byte) 0x60,(byte) 0x60,(byte) 0x20,(byte) 0xd0,(byte) 0x60,(byte) 0x20,(byte) 0xd0,(byte) 0x60,(byte) 0x21,
+(byte) 0x88,(byte) 0x60,(byte) 0x21,(byte) 0x88,(byte) 0x60,(byte) 0x23,(byte) 0x8,(byte) 0x60,(byte) 0x23,(byte) 0x4,(byte) 0x60,(byte) 0x26,(byte) 0x4,(byte) 0x60,(byte) 0x26,(byte) 0x2,
+(byte) 0x60,(byte) 0x2c,(byte) 0x2,(byte) 0x60,(byte) 0x2c,(byte) 0x2,(byte) 0x60,(byte) 0x38,(byte) 0x1,(byte) 0x60,(byte) 0x38,(byte) 0x1,(byte) 0x60,(byte) 0x30,(byte) 0x0,(byte) 0xe0,
+(byte) 0xf0,(byte) 0x0,(byte) 0xf8,
+};
+
+static final BitmapCharRec ch77 = new BitmapCharRec(21,17,-1,0,22,ch77data);
+
+/* char: 0x4c 'L' */
+
+static final byte[] ch76data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,
+(byte) 0xfc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch76 = new BitmapCharRec(13,17,-1,0,14,ch76data);
+
+/* char: 0x4b 'K' */
+
+static final byte[] ch75data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x30,(byte) 0xe,(byte) 0x30,(byte) 0x1c,(byte) 0x30,(byte) 0x38,(byte) 0x30,(byte) 0x70,(byte) 0x30,(byte) 0xe0,(byte) 0x31,(byte) 0xc0,(byte) 0x33,(byte) 0x80,
+(byte) 0x3f,(byte) 0x0,(byte) 0x3e,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x31,(byte) 0x80,(byte) 0x30,(byte) 0xc0,(byte) 0x30,(byte) 0x60,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x18,
+(byte) 0xfc,(byte) 0x7e,
+};
+
+static final BitmapCharRec ch75 = new BitmapCharRec(16,17,-1,0,17,ch75data);
+
+/* char: 0x4a 'J' */
+
+static final byte[] ch74data = {
+(byte) 0x78,(byte) 0x0,(byte) 0xcc,(byte) 0x0,(byte) 0xc6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0x1f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch74 = new BitmapCharRec(9,17,-1,0,11,ch74data);
+
+/* char: 0x49 'I' */
+
+static final byte[] ch73data = {
+(byte) 0xfc,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x30,
+(byte) 0xfc,
+};
+
+static final BitmapCharRec ch73 = new BitmapCharRec(6,17,-1,0,8,ch73data);
+
+/* char: 0x48 'H' */
+
+static final byte[] ch72data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,
+(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x3f,(byte) 0xfe,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,
+(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x30,(byte) 0x6,(byte) 0x0,
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,
+};
+
+static final BitmapCharRec ch72 = new BitmapCharRec(17,17,-1,0,19,ch72data);
+
+/* char: 0x47 'G' */
+
+static final byte[] ch71data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1e,(byte) 0x38,(byte) 0x38,(byte) 0x1c,(byte) 0x60,(byte) 0xc,(byte) 0x60,(byte) 0xc,(byte) 0xc0,(byte) 0xc,(byte) 0xc0,(byte) 0xc,(byte) 0xc0,(byte) 0x3f,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x60,(byte) 0x4,(byte) 0x60,(byte) 0x4,(byte) 0x38,(byte) 0xc,(byte) 0x1c,(byte) 0x3c,
+(byte) 0x7,(byte) 0xe4,
+};
+
+static final BitmapCharRec ch71 = new BitmapCharRec(16,17,-1,0,18,ch71data);
+
+/* char: 0x46 'F' */
+
+static final byte[] ch70data = {
+(byte) 0xfc,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x20,(byte) 0x30,(byte) 0x20,
+(byte) 0x3f,(byte) 0xe0,(byte) 0x30,(byte) 0x20,(byte) 0x30,(byte) 0x20,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x30,
+(byte) 0xff,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch70 = new BitmapCharRec(12,17,-1,0,14,ch70data);
+
+/* char: 0x45 'E' */
+
+static final byte[] ch69data = {
+(byte) 0xff,(byte) 0xf8,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x8,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,
+(byte) 0x3f,(byte) 0xc0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x10,(byte) 0x30,(byte) 0x30,
+(byte) 0xff,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch69 = new BitmapCharRec(13,17,-1,0,15,ch69data);
+
+/* char: 0x44 'D' */
+
+static final byte[] ch68data = {
+(byte) 0xff,(byte) 0xc0,(byte) 0x30,(byte) 0x70,(byte) 0x30,(byte) 0x38,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0x6,(byte) 0x30,(byte) 0x6,(byte) 0x30,(byte) 0x6,
+(byte) 0x30,(byte) 0x6,(byte) 0x30,(byte) 0x6,(byte) 0x30,(byte) 0x6,(byte) 0x30,(byte) 0x6,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0x38,(byte) 0x30,(byte) 0x70,
+(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch68 = new BitmapCharRec(15,17,-1,0,17,ch68data);
+
+/* char: 0x43 'C' */
+
+static final byte[] ch67data = {
+(byte) 0x7,(byte) 0xe0,(byte) 0x1e,(byte) 0x38,(byte) 0x38,(byte) 0x8,(byte) 0x60,(byte) 0x4,(byte) 0x60,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x60,(byte) 0x4,(byte) 0x60,(byte) 0x4,(byte) 0x38,(byte) 0xc,(byte) 0x1c,(byte) 0x3c,
+(byte) 0x7,(byte) 0xe4,
+};
+
+static final BitmapCharRec ch67 = new BitmapCharRec(14,17,-1,0,16,ch67data);
+
+/* char: 0x42 'B' */
+
+static final byte[] ch66data = {
+(byte) 0xff,(byte) 0xe0,(byte) 0x30,(byte) 0x78,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0xc,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x38,
+(byte) 0x3f,(byte) 0xe0,(byte) 0x30,(byte) 0x40,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x18,(byte) 0x30,(byte) 0x30,(byte) 0x30,(byte) 0x70,
+(byte) 0xff,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch66 = new BitmapCharRec(14,17,-1,0,16,ch66data);
+
+/* char: 0x41 'A' */
+
+static final byte[] ch65data = {
+(byte) 0xfc,(byte) 0x1f,(byte) 0x80,(byte) 0x30,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0x6,(byte) 0x0,(byte) 0x10,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0xc,(byte) 0x0,(byte) 0x8,
+(byte) 0xc,(byte) 0x0,(byte) 0xf,(byte) 0xf8,(byte) 0x0,(byte) 0xc,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x18,(byte) 0x0,(byte) 0x4,(byte) 0x30,(byte) 0x0,(byte) 0x6,(byte) 0x30,
+(byte) 0x0,(byte) 0x2,(byte) 0x30,(byte) 0x0,(byte) 0x2,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0x60,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,
+(byte) 0x0,(byte) 0x80,(byte) 0x0,
+};
+
+static final BitmapCharRec ch65 = new BitmapCharRec(17,17,0,0,17,ch65data);
+
+/* char: 0x40 '@' */
+
+static final byte[] ch64data = {
+(byte) 0x3,(byte) 0xf0,(byte) 0x0,(byte) 0xe,(byte) 0xc,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x0,(byte) 0x61,(byte) 0xde,(byte) 0x0,(byte) 0x63,
+(byte) 0x7b,(byte) 0x0,(byte) 0xc6,(byte) 0x39,(byte) 0x80,(byte) 0xc6,(byte) 0x18,(byte) 0x80,(byte) 0xc6,(byte) 0x18,(byte) 0xc0,(byte) 0xc6,(byte) 0x18,(byte) 0x40,(byte) 0xc6,(byte) 0xc,
+(byte) 0x40,(byte) 0xc3,(byte) 0xc,(byte) 0x40,(byte) 0xc3,(byte) 0x8c,(byte) 0x40,(byte) 0xe1,(byte) 0xfc,(byte) 0x40,(byte) 0x60,(byte) 0xec,(byte) 0xc0,(byte) 0x70,(byte) 0x0,(byte) 0x80,
+(byte) 0x38,(byte) 0x1,(byte) 0x80,(byte) 0x1c,(byte) 0x3,(byte) 0x0,(byte) 0xf,(byte) 0xe,(byte) 0x0,(byte) 0x3,(byte) 0xf8,(byte) 0x0,
+};
+
+static final BitmapCharRec ch64 = new BitmapCharRec(18,20,-2,3,22,ch64data);
+
+/* char: 0x3f '?' */
+
+static final byte[] ch63data = {
+(byte) 0x30,(byte) 0x30,(byte) 0x0,(byte) 0x0,(byte) 0x10,(byte) 0x10,(byte) 0x10,(byte) 0x18,(byte) 0x18,(byte) 0xc,(byte) 0xe,(byte) 0x7,(byte) 0xc3,(byte) 0xc3,(byte) 0x83,(byte) 0xc6,
+(byte) 0x7c,
+};
+
+static final BitmapCharRec ch63 = new BitmapCharRec(8,17,-2,0,11,ch63data);
+
+/* char: 0x3e '>' */
+
+static final byte[] ch62data = {
+(byte) 0xc0,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0x7,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x60,(byte) 0x1,(byte) 0xc0,(byte) 0x7,(byte) 0x0,
+(byte) 0x1c,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0xc0,(byte) 0x0,
+};
+
+static final BitmapCharRec ch62 = new BitmapCharRec(11,11,-1,-1,13,ch62data);
+
+/* char: 0x3d '=' */
+
+static final byte[] ch61data = {
+(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch61 = new BitmapCharRec(12,6,-1,-4,14,ch61data);
+
+/* char: 0x3c '<' */
+
+static final byte[] ch60data = {
+(byte) 0x0,(byte) 0x60,(byte) 0x1,(byte) 0xc0,(byte) 0x7,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x1c,(byte) 0x0,
+(byte) 0x7,(byte) 0x0,(byte) 0x1,(byte) 0xc0,(byte) 0x0,(byte) 0x60,
+};
+
+static final BitmapCharRec ch60 = new BitmapCharRec(11,11,-1,-1,13,ch60data);
+
+/* char: 0x3b ';' */
+
+static final byte[] ch59data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0x20,(byte) 0xe0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch59 = new BitmapCharRec(3,14,-2,3,7,ch59data);
+
+/* char: 0x3a ':' */
+
+static final byte[] ch58data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch58 = new BitmapCharRec(2,11,-2,0,6,ch58data);
+
+/* char: 0x39 '9' */
+
+static final byte[] ch57data = {
+(byte) 0xf0,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1d,(byte) 0x80,(byte) 0x73,(byte) 0xc0,
+(byte) 0x61,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x77,(byte) 0x80,
+(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch57 = new BitmapCharRec(10,17,-1,0,12,ch57data);
+
+/* char: 0x38 '8' */
+
+static final byte[] ch56data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x73,(byte) 0x80,(byte) 0xe1,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x41,(byte) 0xc0,(byte) 0x61,(byte) 0x80,
+(byte) 0x37,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x33,(byte) 0x0,
+(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch56 = new BitmapCharRec(10,17,-1,0,12,ch56data);
+
+/* char: 0x37 '7' */
+
+static final byte[] ch55data = {
+(byte) 0x18,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0x2,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x81,(byte) 0x80,(byte) 0xc0,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,
+(byte) 0x7f,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch55 = new BitmapCharRec(10,17,-1,0,12,ch55data);
+
+/* char: 0x36 '6' */
+
+static final byte[] ch54data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x7b,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xe0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc1,(byte) 0x80,(byte) 0xf3,(byte) 0x80,(byte) 0xee,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x70,(byte) 0x0,(byte) 0x30,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0xe,(byte) 0x0,
+(byte) 0x3,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch54 = new BitmapCharRec(10,17,-1,0,12,ch54data);
+
+/* char: 0x35 '5' */
+
+static final byte[] ch53data = {
+(byte) 0x7e,(byte) 0x0,(byte) 0xe3,(byte) 0x80,(byte) 0xc1,(byte) 0x80,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x0,(byte) 0xc0,(byte) 0x1,(byte) 0xc0,
+(byte) 0x3,(byte) 0x80,(byte) 0xf,(byte) 0x80,(byte) 0x7e,(byte) 0x0,(byte) 0x78,(byte) 0x0,(byte) 0x60,(byte) 0x0,(byte) 0x20,(byte) 0x0,(byte) 0x20,(byte) 0x0,(byte) 0x1f,(byte) 0x80,
+(byte) 0x1f,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch53 = new BitmapCharRec(10,17,-1,0,12,ch53data);
+
+/* char: 0x34 '4' */
+
+static final byte[] ch52data = {
+(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,(byte) 0xc3,(byte) 0x0,(byte) 0x43,(byte) 0x0,
+(byte) 0x63,(byte) 0x0,(byte) 0x23,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x13,(byte) 0x0,(byte) 0x1b,(byte) 0x0,(byte) 0xb,(byte) 0x0,(byte) 0x7,(byte) 0x0,(byte) 0x7,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,
+};
+
+static final BitmapCharRec ch52 = new BitmapCharRec(10,17,-1,0,12,ch52data);
+
+/* char: 0x33 '3' */
+
+static final byte[] ch51data = {
+(byte) 0x78,(byte) 0x0,(byte) 0xe6,(byte) 0x0,(byte) 0xc3,(byte) 0x0,(byte) 0x1,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x3,(byte) 0x80,
+(byte) 0x7,(byte) 0x0,(byte) 0x1e,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x83,(byte) 0x0,(byte) 0x83,(byte) 0x0,(byte) 0x47,(byte) 0x0,(byte) 0x7e,(byte) 0x0,
+(byte) 0x1c,(byte) 0x0,
+};
+
+static final BitmapCharRec ch51 = new BitmapCharRec(9,17,-1,0,12,ch51data);
+
+/* char: 0x32 '2' */
+
+static final byte[] ch50data = {
+(byte) 0xff,(byte) 0x80,(byte) 0xff,(byte) 0xc0,(byte) 0x60,(byte) 0x40,(byte) 0x30,(byte) 0x0,(byte) 0x18,(byte) 0x0,(byte) 0xc,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+(byte) 0x3,(byte) 0x0,(byte) 0x3,(byte) 0x0,(byte) 0x1,(byte) 0x80,(byte) 0x1,(byte) 0x80,(byte) 0x81,(byte) 0x80,(byte) 0x81,(byte) 0x80,(byte) 0x43,(byte) 0x80,(byte) 0x7f,(byte) 0x0,
+(byte) 0x1c,(byte) 0x0,
+};
+
+static final BitmapCharRec ch50 = new BitmapCharRec(10,17,-1,0,12,ch50data);
+
+/* char: 0x31 '1' */
+
+static final byte[] ch49data = {
+(byte) 0xff,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x18,(byte) 0x78,(byte) 0x18,
+(byte) 0x8,
+};
+
+static final BitmapCharRec ch49 = new BitmapCharRec(8,17,-2,0,12,ch49data);
+
+/* char: 0x30 '0' */
+
+static final byte[] ch48data = {
+(byte) 0x1e,(byte) 0x0,(byte) 0x33,(byte) 0x0,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0xe1,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x61,(byte) 0x80,(byte) 0x61,(byte) 0x80,(byte) 0x33,(byte) 0x0,
+(byte) 0x1e,(byte) 0x0,
+};
+
+static final BitmapCharRec ch48 = new BitmapCharRec(10,17,-1,0,12,ch48data);
+
+/* char: 0x2f '/' */
+
+static final byte[] ch47data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,(byte) 0x60,(byte) 0x20,(byte) 0x30,(byte) 0x30,(byte) 0x10,(byte) 0x18,(byte) 0x18,(byte) 0x8,(byte) 0xc,(byte) 0xc,(byte) 0x4,(byte) 0x6,
+(byte) 0x6,(byte) 0x3,(byte) 0x3,(byte) 0x3,
+};
+
+static final BitmapCharRec ch47 = new BitmapCharRec(8,20,1,3,7,ch47data);
+
+/* char: 0x2e '.' */
+
+static final byte[] ch46data = {
+(byte) 0xc0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch46 = new BitmapCharRec(2,2,-2,0,6,ch46data);
+
+/* char: 0x2d '-' */
+
+static final byte[] ch45data = {
+(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,
+};
+
+static final BitmapCharRec ch45 = new BitmapCharRec(12,2,-1,-6,14,ch45data);
+
+/* char: 0x2c ',' */
+
+static final byte[] ch44data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0x20,(byte) 0xe0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch44 = new BitmapCharRec(3,5,-2,3,7,ch44data);
+
+/* char: 0x2b '+' */
+
+static final byte[] ch43data = {
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0xff,(byte) 0xf0,(byte) 0xff,(byte) 0xf0,(byte) 0x6,(byte) 0x0,
+(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,(byte) 0x6,(byte) 0x0,
+};
+
+static final BitmapCharRec ch43 = new BitmapCharRec(12,12,-1,-1,14,ch43data);
+
+/* char: 0x2a '*' */
+
+static final byte[] ch42data = {
+(byte) 0x8,(byte) 0x0,(byte) 0x1c,(byte) 0x0,(byte) 0xc9,(byte) 0x80,(byte) 0xeb,(byte) 0x80,(byte) 0x1c,(byte) 0x0,(byte) 0xeb,(byte) 0x80,(byte) 0xc9,(byte) 0x80,(byte) 0x1c,(byte) 0x0,
+(byte) 0x8,(byte) 0x0,
+};
+
+static final BitmapCharRec ch42 = new BitmapCharRec(9,9,-2,-8,12,ch42data);
+
+/* char: 0x29 ')' */
+
+static final byte[] ch41data = {
+(byte) 0x80,(byte) 0x40,(byte) 0x20,(byte) 0x30,(byte) 0x10,(byte) 0x18,(byte) 0x18,(byte) 0xc,(byte) 0xc,(byte) 0xc,(byte) 0xc,(byte) 0xc,(byte) 0xc,(byte) 0xc,(byte) 0xc,(byte) 0x18,
+(byte) 0x18,(byte) 0x10,(byte) 0x30,(byte) 0x20,(byte) 0x40,(byte) 0x80,
+};
+
+static final BitmapCharRec ch41 = new BitmapCharRec(6,22,-1,5,8,ch41data);
+
+/* char: 0x28 '(' */
+
+static final byte[] ch40data = {
+(byte) 0x4,(byte) 0x8,(byte) 0x10,(byte) 0x30,(byte) 0x20,(byte) 0x60,(byte) 0x60,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0x60,
+(byte) 0x60,(byte) 0x20,(byte) 0x30,(byte) 0x10,(byte) 0x8,(byte) 0x4,
+};
+
+static final BitmapCharRec ch40 = new BitmapCharRec(6,22,-1,5,8,ch40data);
+
+/* char: 0x27 ''' */
+
+static final byte[] ch39data = {
+(byte) 0xc0,(byte) 0x60,(byte) 0x20,(byte) 0xe0,(byte) 0xc0,
+};
+
+static final BitmapCharRec ch39 = new BitmapCharRec(3,5,-3,-12,8,ch39data);
+
+/* char: 0x26 '&' */
+
+static final byte[] ch38data = {
+(byte) 0x3c,(byte) 0x3c,(byte) 0x7f,(byte) 0x7e,(byte) 0xe1,(byte) 0xe1,(byte) 0xc0,(byte) 0xc0,(byte) 0xc1,(byte) 0xc0,(byte) 0xc1,(byte) 0xa0,(byte) 0x63,(byte) 0x20,(byte) 0x37,(byte) 0x10,
+(byte) 0x1e,(byte) 0x18,(byte) 0xe,(byte) 0x3e,(byte) 0xf,(byte) 0x0,(byte) 0x1d,(byte) 0x80,(byte) 0x18,(byte) 0xc0,(byte) 0x18,(byte) 0x40,(byte) 0x18,(byte) 0x40,(byte) 0xc,(byte) 0xc0,
+(byte) 0x7,(byte) 0x80,
+};
+
+static final BitmapCharRec ch38 = new BitmapCharRec(16,17,-1,0,18,ch38data);
+
+/* char: 0x25 '%' */
+
+static final byte[] ch37data = {
+(byte) 0x30,(byte) 0x3c,(byte) 0x0,(byte) 0x18,(byte) 0x72,(byte) 0x0,(byte) 0xc,(byte) 0x61,(byte) 0x0,(byte) 0x4,(byte) 0x60,(byte) 0x80,(byte) 0x6,(byte) 0x60,(byte) 0x80,(byte) 0x3,
+(byte) 0x30,(byte) 0x80,(byte) 0x1,(byte) 0x19,(byte) 0x80,(byte) 0x1,(byte) 0x8f,(byte) 0x0,(byte) 0x78,(byte) 0xc0,(byte) 0x0,(byte) 0xe4,(byte) 0x40,(byte) 0x0,(byte) 0xc2,(byte) 0x60,
+(byte) 0x0,(byte) 0xc1,(byte) 0x30,(byte) 0x0,(byte) 0xc1,(byte) 0x10,(byte) 0x0,(byte) 0x61,(byte) 0x18,(byte) 0x0,(byte) 0x33,(byte) 0xfc,(byte) 0x0,(byte) 0x1e,(byte) 0xc,(byte) 0x0,
+};
+
+static final BitmapCharRec ch37 = new BitmapCharRec(17,16,-1,0,19,ch37data);
+
+/* char: 0x24 '$' */
+
+static final byte[] ch36data = {
+(byte) 0x4,(byte) 0x0,(byte) 0x4,(byte) 0x0,(byte) 0x3f,(byte) 0x0,(byte) 0xe5,(byte) 0xc0,(byte) 0xc4,(byte) 0xc0,(byte) 0x84,(byte) 0x60,(byte) 0x84,(byte) 0x60,(byte) 0x4,(byte) 0x60,
+(byte) 0x4,(byte) 0xe0,(byte) 0x7,(byte) 0xc0,(byte) 0x7,(byte) 0x80,(byte) 0x1e,(byte) 0x0,(byte) 0x3c,(byte) 0x0,(byte) 0x74,(byte) 0x0,(byte) 0x64,(byte) 0x0,(byte) 0x64,(byte) 0x20,
+(byte) 0x64,(byte) 0x60,(byte) 0x34,(byte) 0xe0,(byte) 0x1f,(byte) 0x80,(byte) 0x4,(byte) 0x0,(byte) 0x4,(byte) 0x0,
+};
+
+static final BitmapCharRec ch36 = new BitmapCharRec(11,21,0,2,12,ch36data);
+
+/* char: 0x23 '#' */
+
+static final byte[] ch35data = {
+(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0x22,(byte) 0x0,(byte) 0xff,(byte) 0xc0,(byte) 0xff,(byte) 0xc0,(byte) 0x11,(byte) 0x0,
+(byte) 0x11,(byte) 0x0,(byte) 0x11,(byte) 0x0,(byte) 0x7f,(byte) 0xe0,(byte) 0x7f,(byte) 0xe0,(byte) 0x8,(byte) 0x80,(byte) 0x8,(byte) 0x80,(byte) 0x8,(byte) 0x80,(byte) 0x8,(byte) 0x80,
+(byte) 0x8,(byte) 0x80,
+};
+
+static final BitmapCharRec ch35 = new BitmapCharRec(11,17,-1,0,13,ch35data);
+
+/* char: 0x22 '"' */
+
+static final byte[] ch34data = {
+(byte) 0x88,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,(byte) 0xcc,
+};
+
+static final BitmapCharRec ch34 = new BitmapCharRec(6,5,-1,-12,10,ch34data);
+
+/* char: 0x21 '!' */
+
+static final byte[] ch33data = {
+(byte) 0xc0,(byte) 0xc0,(byte) 0x0,(byte) 0x0,(byte) 0x0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,(byte) 0xc0,
+(byte) 0xc0,
+};
+
+static final BitmapCharRec ch33 = new BitmapCharRec(2,17,-3,0,8,ch33data);
+
+/* char: 0x20 ' ' */
+
+static final BitmapCharRec ch32 = new BitmapCharRec(0,0,0,0,6,null);
+
+static final BitmapCharRec[] chars = {
+ch32,
+ch33,
+ch34,
+ch35,
+ch36,
+ch37,
+ch38,
+ch39,
+ch40,
+ch41,
+ch42,
+ch43,
+ch44,
+ch45,
+ch46,
+ch47,
+ch48,
+ch49,
+ch50,
+ch51,
+ch52,
+ch53,
+ch54,
+ch55,
+ch56,
+ch57,
+ch58,
+ch59,
+ch60,
+ch61,
+ch62,
+ch63,
+ch64,
+ch65,
+ch66,
+ch67,
+ch68,
+ch69,
+ch70,
+ch71,
+ch72,
+ch73,
+ch74,
+ch75,
+ch76,
+ch77,
+ch78,
+ch79,
+ch80,
+ch81,
+ch82,
+ch83,
+ch84,
+ch85,
+ch86,
+ch87,
+ch88,
+ch89,
+ch90,
+ch91,
+ch92,
+ch93,
+ch94,
+ch95,
+ch96,
+ch97,
+ch98,
+ch99,
+ch100,
+ch101,
+ch102,
+ch103,
+ch104,
+ch105,
+ch106,
+ch107,
+ch108,
+ch109,
+ch110,
+ch111,
+ch112,
+ch113,
+ch114,
+ch115,
+ch116,
+ch117,
+ch118,
+ch119,
+ch120,
+ch121,
+ch122,
+ch123,
+ch124,
+ch125,
+ch126,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+null,
+ch160,
+ch161,
+ch162,
+ch163,
+ch164,
+ch165,
+ch166,
+ch167,
+ch168,
+ch169,
+ch170,
+ch171,
+ch172,
+ch173,
+ch174,
+ch175,
+ch176,
+ch177,
+ch178,
+ch179,
+ch180,
+ch181,
+ch182,
+ch183,
+ch184,
+ch185,
+ch186,
+ch187,
+ch188,
+ch189,
+ch190,
+ch191,
+ch192,
+ch193,
+ch194,
+ch195,
+ch196,
+ch197,
+ch198,
+ch199,
+ch200,
+ch201,
+ch202,
+ch203,
+ch204,
+ch205,
+ch206,
+ch207,
+ch208,
+ch209,
+ch210,
+ch211,
+ch212,
+ch213,
+ch214,
+ch215,
+ch216,
+ch217,
+ch218,
+ch219,
+ch220,
+ch221,
+ch222,
+ch223,
+ch224,
+ch225,
+ch226,
+ch227,
+ch228,
+ch229,
+ch230,
+ch231,
+ch232,
+ch233,
+ch234,
+ch235,
+ch236,
+ch237,
+ch238,
+ch239,
+ch240,
+ch241,
+ch242,
+ch243,
+ch244,
+ch245,
+ch246,
+ch247,
+ch248,
+ch249,
+ch250,
+ch251,
+ch252,
+ch253,
+ch254,
+ch255,
+};
+
+ public static final BitmapFontRec glutBitmapTimesRoman24 = new BitmapFontRec("-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1",
+ 224,
+ 32,
+ chars);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java
new file mode 100644
index 000000000..79e4b70f8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeMonoRoman.java
@@ -0,0 +1,2491 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTStrokeMonoRoman {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 33 '!' */
+
+static final CoordRec char33_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 33.3333 ),
+};
+
+static final CoordRec char33_stroke1[] = {
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+ new CoordRec((float) 47.6191, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+};
+
+static final StrokeRec char33[] = {
+ new StrokeRec( 2, char33_stroke0 ),
+ new StrokeRec( 5, char33_stroke1 ),
+};
+
+/* char: 34 '"' */
+
+static final CoordRec char34_stroke0[] = {
+ new CoordRec((float) 33.3334, (float) 100 ),
+ new CoordRec((float) 33.3334, (float) 66.6667 ),
+};
+
+static final CoordRec char34_stroke1[] = {
+ new CoordRec((float) 71.4286, (float) 100 ),
+ new CoordRec((float) 71.4286, (float) 66.6667 ),
+};
+
+static final StrokeRec char34[] = {
+ new StrokeRec( 2, char34_stroke0 ),
+ new StrokeRec( 2, char34_stroke1 ),
+};
+
+/* char: 35 '#' */
+
+static final CoordRec char35_stroke0[] = {
+ new CoordRec((float) 54.7619, (float) 119.048 ),
+ new CoordRec((float) 21.4286, (float) -33.3333 ),
+};
+
+static final CoordRec char35_stroke1[] = {
+ new CoordRec((float) 83.3334, (float) 119.048 ),
+ new CoordRec((float) 50, (float) -33.3333 ),
+};
+
+static final CoordRec char35_stroke2[] = {
+ new CoordRec((float) 21.4286, (float) 57.1429 ),
+ new CoordRec((float) 88.0952, (float) 57.1429 ),
+};
+
+static final CoordRec char35_stroke3[] = {
+ new CoordRec((float) 16.6667, (float) 28.5714 ),
+ new CoordRec((float) 83.3334, (float) 28.5714 ),
+};
+
+static final StrokeRec char35[] = {
+ new StrokeRec( 2, char35_stroke0 ),
+ new StrokeRec( 2, char35_stroke1 ),
+ new StrokeRec( 2, char35_stroke2 ),
+ new StrokeRec( 2, char35_stroke3 ),
+};
+
+/* char: 36 '$' */
+
+static final CoordRec char36_stroke0[] = {
+ new CoordRec((float) 42.8571, (float) 119.048 ),
+ new CoordRec((float) 42.8571, (float) -19.0476 ),
+};
+
+static final CoordRec char36_stroke1[] = {
+ new CoordRec((float) 61.9047, (float) 119.048 ),
+ new CoordRec((float) 61.9047, (float) -19.0476 ),
+};
+
+static final CoordRec char36_stroke2[] = {
+ new CoordRec((float) 85.7143, (float) 85.7143 ),
+ new CoordRec((float) 76.1905, (float) 95.2381 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 28.5714, (float) 95.2381 ),
+ new CoordRec((float) 19.0476, (float) 85.7143 ),
+ new CoordRec((float) 19.0476, (float) 76.1905 ),
+ new CoordRec((float) 23.8095, (float) 66.6667 ),
+ new CoordRec((float) 28.5714, (float) 61.9048 ),
+ new CoordRec((float) 38.0952, (float) 57.1429 ),
+ new CoordRec((float) 66.6666, (float) 47.619 ),
+ new CoordRec((float) 76.1905, (float) 42.8571 ),
+ new CoordRec((float) 80.9524, (float) 38.0952 ),
+ new CoordRec((float) 85.7143, (float) 28.5714 ),
+ new CoordRec((float) 85.7143, (float) 14.2857 ),
+ new CoordRec((float) 76.1905, (float) 4.7619 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 28.5714, (float) 4.7619 ),
+ new CoordRec((float) 19.0476, (float) 14.2857 ),
+};
+
+static final StrokeRec char36[] = {
+ new StrokeRec( 2, char36_stroke0 ),
+ new StrokeRec( 2, char36_stroke1 ),
+ new StrokeRec( 20, char36_stroke2 ),
+};
+
+/* char: 37 '%' */
+
+static final CoordRec char37_stroke0[] = {
+ new CoordRec((float) 95.2381, (float) 100 ),
+ new CoordRec((float) 9.5238, (float) 0 ),
+};
+
+static final CoordRec char37_stroke1[] = {
+ new CoordRec((float) 33.3333, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 90.4762 ),
+ new CoordRec((float) 42.8571, (float) 80.9524 ),
+ new CoordRec((float) 38.0952, (float) 71.4286 ),
+ new CoordRec((float) 28.5714, (float) 66.6667 ),
+ new CoordRec((float) 19.0476, (float) 66.6667 ),
+ new CoordRec((float) 9.5238, (float) 76.1905 ),
+ new CoordRec((float) 9.5238, (float) 85.7143 ),
+ new CoordRec((float) 14.2857, (float) 95.2381 ),
+ new CoordRec((float) 23.8095, (float) 100 ),
+ new CoordRec((float) 33.3333, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 95.2381 ),
+ new CoordRec((float) 57.1428, (float) 90.4762 ),
+ new CoordRec((float) 71.4286, (float) 90.4762 ),
+ new CoordRec((float) 85.7143, (float) 95.2381 ),
+ new CoordRec((float) 95.2381, (float) 100 ),
+};
+
+static final CoordRec char37_stroke2[] = {
+ new CoordRec((float) 76.1905, (float) 33.3333 ),
+ new CoordRec((float) 66.6667, (float) 28.5714 ),
+ new CoordRec((float) 61.9048, (float) 19.0476 ),
+ new CoordRec((float) 61.9048, (float) 9.5238 ),
+ new CoordRec((float) 71.4286, (float) 0 ),
+ new CoordRec((float) 80.9524, (float) 0 ),
+ new CoordRec((float) 90.4762, (float) 4.7619 ),
+ new CoordRec((float) 95.2381, (float) 14.2857 ),
+ new CoordRec((float) 95.2381, (float) 23.8095 ),
+ new CoordRec((float) 85.7143, (float) 33.3333 ),
+ new CoordRec((float) 76.1905, (float) 33.3333 ),
+};
+
+static final StrokeRec char37[] = {
+ new StrokeRec( 2, char37_stroke0 ),
+ new StrokeRec( 16, char37_stroke1 ),
+ new StrokeRec( 11, char37_stroke2 ),
+};
+
+/* char: 38 '&' */
+
+static final CoordRec char38_stroke0[] = {
+ new CoordRec((float) 100, (float) 57.1429 ),
+ new CoordRec((float) 100, (float) 61.9048 ),
+ new CoordRec((float) 95.2381, (float) 66.6667 ),
+ new CoordRec((float) 90.4762, (float) 66.6667 ),
+ new CoordRec((float) 85.7143, (float) 61.9048 ),
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4286, (float) 28.5714 ),
+ new CoordRec((float) 61.9048, (float) 14.2857 ),
+ new CoordRec((float) 52.3809, (float) 4.7619 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 23.8095, (float) 0 ),
+ new CoordRec((float) 14.2857, (float) 4.7619 ),
+ new CoordRec((float) 9.5238, (float) 9.5238 ),
+ new CoordRec((float) 4.7619, (float) 19.0476 ),
+ new CoordRec((float) 4.7619, (float) 28.5714 ),
+ new CoordRec((float) 9.5238, (float) 38.0952 ),
+ new CoordRec((float) 14.2857, (float) 42.8571 ),
+ new CoordRec((float) 47.619, (float) 61.9048 ),
+ new CoordRec((float) 52.3809, (float) 66.6667 ),
+ new CoordRec((float) 57.1429, (float) 76.1905 ),
+ new CoordRec((float) 57.1429, (float) 85.7143 ),
+ new CoordRec((float) 52.3809, (float) 95.2381 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 33.3333, (float) 95.2381 ),
+ new CoordRec((float) 28.5714, (float) 85.7143 ),
+ new CoordRec((float) 28.5714, (float) 76.1905 ),
+ new CoordRec((float) 33.3333, (float) 61.9048 ),
+ new CoordRec((float) 42.8571, (float) 47.619 ),
+ new CoordRec((float) 66.6667, (float) 14.2857 ),
+ new CoordRec((float) 76.1905, (float) 4.7619 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+ new CoordRec((float) 95.2381, (float) 0 ),
+ new CoordRec((float) 100, (float) 4.7619 ),
+ new CoordRec((float) 100, (float) 9.5238 ),
+};
+
+static final StrokeRec char38[] = {
+ new StrokeRec( 34, char38_stroke0 ),
+};
+
+/* char: 39 ''' */
+
+static final CoordRec char39_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 66.6667 ),
+};
+
+static final StrokeRec char39[] = {
+ new StrokeRec( 2, char39_stroke0 ),
+};
+
+/* char: 40 '(' */
+
+static final CoordRec char40_stroke0[] = {
+ new CoordRec((float) 69.0476, (float) 119.048 ),
+ new CoordRec((float) 59.5238, (float) 109.524 ),
+ new CoordRec((float) 50, (float) 95.2381 ),
+ new CoordRec((float) 40.4762, (float) 76.1905 ),
+ new CoordRec((float) 35.7143, (float) 52.381 ),
+ new CoordRec((float) 35.7143, (float) 33.3333 ),
+ new CoordRec((float) 40.4762, (float) 9.5238 ),
+ new CoordRec((float) 50, (float) -9.5238 ),
+ new CoordRec((float) 59.5238, (float) -23.8095 ),
+ new CoordRec((float) 69.0476, (float) -33.3333 ),
+};
+
+static final StrokeRec char40[] = {
+ new StrokeRec( 10, char40_stroke0 ),
+};
+
+/* char: 41 ')' */
+
+static final CoordRec char41_stroke0[] = {
+ new CoordRec((float) 35.7143, (float) 119.048 ),
+ new CoordRec((float) 45.2381, (float) 109.524 ),
+ new CoordRec((float) 54.7619, (float) 95.2381 ),
+ new CoordRec((float) 64.2857, (float) 76.1905 ),
+ new CoordRec((float) 69.0476, (float) 52.381 ),
+ new CoordRec((float) 69.0476, (float) 33.3333 ),
+ new CoordRec((float) 64.2857, (float) 9.5238 ),
+ new CoordRec((float) 54.7619, (float) -9.5238 ),
+ new CoordRec((float) 45.2381, (float) -23.8095 ),
+ new CoordRec((float) 35.7143, (float) -33.3333 ),
+};
+
+static final StrokeRec char41[] = {
+ new StrokeRec( 10, char41_stroke0 ),
+};
+
+/* char: 42 '*' */
+
+static final CoordRec char42_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 71.4286 ),
+ new CoordRec((float) 52.381, (float) 14.2857 ),
+};
+
+static final CoordRec char42_stroke1[] = {
+ new CoordRec((float) 28.5715, (float) 57.1429 ),
+ new CoordRec((float) 76.1905, (float) 28.5714 ),
+};
+
+static final CoordRec char42_stroke2[] = {
+ new CoordRec((float) 76.1905, (float) 57.1429 ),
+ new CoordRec((float) 28.5715, (float) 28.5714 ),
+};
+
+static final StrokeRec char42[] = {
+ new StrokeRec( 2, char42_stroke0 ),
+ new StrokeRec( 2, char42_stroke1 ),
+ new StrokeRec( 2, char42_stroke2 ),
+};
+
+/* char: 43 '+' */
+
+static final CoordRec char43_stroke0[] = {
+ new CoordRec((float) 52.3809, (float) 85.7143 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char43_stroke1[] = {
+ new CoordRec((float) 9.5238, (float) 42.8571 ),
+ new CoordRec((float) 95.2381, (float) 42.8571 ),
+};
+
+static final StrokeRec char43[] = {
+ new StrokeRec( 2, char43_stroke0 ),
+ new StrokeRec( 2, char43_stroke1 ),
+};
+
+/* char: 44 ',' */
+
+static final CoordRec char44_stroke0[] = {
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 47.6191, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 57.1429, (float) -4.7619 ),
+ new CoordRec((float) 52.381, (float) -14.2857 ),
+ new CoordRec((float) 47.6191, (float) -19.0476 ),
+};
+
+static final StrokeRec char44[] = {
+ new StrokeRec( 8, char44_stroke0 ),
+};
+
+/* char: 45 '-' */
+
+static final CoordRec char45_stroke0[] = {
+ new CoordRec((float) 9.5238, (float) 42.8571 ),
+ new CoordRec((float) 95.2381, (float) 42.8571 ),
+};
+
+static final StrokeRec char45[] = {
+ new StrokeRec( 2, char45_stroke0 ),
+};
+
+/* char: 46 '.' */
+
+static final CoordRec char46_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+ new CoordRec((float) 47.6191, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+};
+
+static final StrokeRec char46[] = {
+ new StrokeRec( 5, char46_stroke0 ),
+};
+
+/* char: 47 '/' */
+
+static final CoordRec char47_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) -14.2857 ),
+ new CoordRec((float) 85.7143, (float) 100 ),
+};
+
+static final StrokeRec char47[] = {
+ new StrokeRec( 2, char47_stroke0 ),
+};
+
+/* char: 48 '0' */
+
+static final CoordRec char48_stroke0[] = {
+ new CoordRec((float) 47.619, (float) 100 ),
+ new CoordRec((float) 33.3333, (float) 95.2381 ),
+ new CoordRec((float) 23.8095, (float) 80.9524 ),
+ new CoordRec((float) 19.0476, (float) 57.1429 ),
+ new CoordRec((float) 19.0476, (float) 42.8571 ),
+ new CoordRec((float) 23.8095, (float) 19.0476 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 19.0476 ),
+ new CoordRec((float) 85.7143, (float) 42.8571 ),
+ new CoordRec((float) 85.7143, (float) 57.1429 ),
+ new CoordRec((float) 80.9524, (float) 80.9524 ),
+ new CoordRec((float) 71.4286, (float) 95.2381 ),
+ new CoordRec((float) 57.1428, (float) 100 ),
+ new CoordRec((float) 47.619, (float) 100 ),
+};
+
+static final StrokeRec char48[] = {
+ new StrokeRec( 17, char48_stroke0 ),
+};
+
+/* char: 49 '1' */
+
+static final CoordRec char49_stroke0[] = {
+ new CoordRec((float) 40.4762, (float) 80.9524 ),
+ new CoordRec((float) 50, (float) 85.7143 ),
+ new CoordRec((float) 64.2857, (float) 100 ),
+ new CoordRec((float) 64.2857, (float) 0 ),
+};
+
+static final StrokeRec char49[] = {
+ new StrokeRec( 4, char49_stroke0 ),
+};
+
+/* char: 50 '2' */
+
+static final CoordRec char50_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 76.1905 ),
+ new CoordRec((float) 23.8095, (float) 80.9524 ),
+ new CoordRec((float) 28.5714, (float) 90.4762 ),
+ new CoordRec((float) 33.3333, (float) 95.2381 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 71.4286, (float) 95.2381 ),
+ new CoordRec((float) 76.1905, (float) 90.4762 ),
+ new CoordRec((float) 80.9524, (float) 80.9524 ),
+ new CoordRec((float) 80.9524, (float) 71.4286 ),
+ new CoordRec((float) 76.1905, (float) 61.9048 ),
+ new CoordRec((float) 66.6666, (float) 47.619 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final StrokeRec char50[] = {
+ new StrokeRec( 14, char50_stroke0 ),
+};
+
+/* char: 51 '3' */
+
+static final CoordRec char51_stroke0[] = {
+ new CoordRec((float) 28.5714, (float) 100 ),
+ new CoordRec((float) 80.9524, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 61.9048 ),
+ new CoordRec((float) 66.6666, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 57.1429 ),
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 85.7143, (float) 38.0952 ),
+ new CoordRec((float) 85.7143, (float) 28.5714 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 28.5714, (float) 4.7619 ),
+ new CoordRec((float) 23.8095, (float) 9.5238 ),
+ new CoordRec((float) 19.0476, (float) 19.0476 ),
+};
+
+static final StrokeRec char51[] = {
+ new StrokeRec( 15, char51_stroke0 ),
+};
+
+/* char: 52 '4' */
+
+static final CoordRec char52_stroke0[] = {
+ new CoordRec((float) 64.2857, (float) 100 ),
+ new CoordRec((float) 16.6667, (float) 33.3333 ),
+ new CoordRec((float) 88.0952, (float) 33.3333 ),
+};
+
+static final CoordRec char52_stroke1[] = {
+ new CoordRec((float) 64.2857, (float) 100 ),
+ new CoordRec((float) 64.2857, (float) 0 ),
+};
+
+static final StrokeRec char52[] = {
+ new StrokeRec( 3, char52_stroke0 ),
+ new StrokeRec( 2, char52_stroke1 ),
+};
+
+/* char: 53 '5' */
+
+static final CoordRec char53_stroke0[] = {
+ new CoordRec((float) 76.1905, (float) 100 ),
+ new CoordRec((float) 28.5714, (float) 100 ),
+ new CoordRec((float) 23.8095, (float) 57.1429 ),
+ new CoordRec((float) 28.5714, (float) 61.9048 ),
+ new CoordRec((float) 42.8571, (float) 66.6667 ),
+ new CoordRec((float) 57.1428, (float) 66.6667 ),
+ new CoordRec((float) 71.4286, (float) 61.9048 ),
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 85.7143, (float) 38.0952 ),
+ new CoordRec((float) 85.7143, (float) 28.5714 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 28.5714, (float) 4.7619 ),
+ new CoordRec((float) 23.8095, (float) 9.5238 ),
+ new CoordRec((float) 19.0476, (float) 19.0476 ),
+};
+
+static final StrokeRec char53[] = {
+ new StrokeRec( 17, char53_stroke0 ),
+};
+
+/* char: 54 '6' */
+
+static final CoordRec char54_stroke0[] = {
+ new CoordRec((float) 78.5714, (float) 85.7143 ),
+ new CoordRec((float) 73.8096, (float) 95.2381 ),
+ new CoordRec((float) 59.5238, (float) 100 ),
+ new CoordRec((float) 50, (float) 100 ),
+ new CoordRec((float) 35.7143, (float) 95.2381 ),
+ new CoordRec((float) 26.1905, (float) 80.9524 ),
+ new CoordRec((float) 21.4286, (float) 57.1429 ),
+ new CoordRec((float) 21.4286, (float) 33.3333 ),
+ new CoordRec((float) 26.1905, (float) 14.2857 ),
+ new CoordRec((float) 35.7143, (float) 4.7619 ),
+ new CoordRec((float) 50, (float) 0 ),
+ new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 69.0476, (float) 4.7619 ),
+ new CoordRec((float) 78.5714, (float) 14.2857 ),
+ new CoordRec((float) 83.3334, (float) 28.5714 ),
+ new CoordRec((float) 83.3334, (float) 33.3333 ),
+ new CoordRec((float) 78.5714, (float) 47.619 ),
+ new CoordRec((float) 69.0476, (float) 57.1429 ),
+ new CoordRec((float) 54.7619, (float) 61.9048 ),
+ new CoordRec((float) 50, (float) 61.9048 ),
+ new CoordRec((float) 35.7143, (float) 57.1429 ),
+ new CoordRec((float) 26.1905, (float) 47.619 ),
+ new CoordRec((float) 21.4286, (float) 33.3333 ),
+};
+
+static final StrokeRec char54[] = {
+ new StrokeRec( 23, char54_stroke0 ),
+};
+
+/* char: 55 '7' */
+
+static final CoordRec char55_stroke0[] = {
+ new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 38.0952, (float) 0 ),
+};
+
+static final CoordRec char55_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 100 ),
+};
+
+static final StrokeRec char55[] = {
+ new StrokeRec( 2, char55_stroke0 ),
+ new StrokeRec( 2, char55_stroke1 ),
+};
+
+/* char: 56 '8' */
+
+static final CoordRec char56_stroke0[] = {
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 28.5714, (float) 95.2381 ),
+ new CoordRec((float) 23.8095, (float) 85.7143 ),
+ new CoordRec((float) 23.8095, (float) 76.1905 ),
+ new CoordRec((float) 28.5714, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 57.1428, (float) 57.1429 ),
+ new CoordRec((float) 71.4286, (float) 52.381 ),
+ new CoordRec((float) 80.9524, (float) 42.8571 ),
+ new CoordRec((float) 85.7143, (float) 33.3333 ),
+ new CoordRec((float) 85.7143, (float) 19.0476 ),
+ new CoordRec((float) 80.9524, (float) 9.5238 ),
+ new CoordRec((float) 76.1905, (float) 4.7619 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 28.5714, (float) 4.7619 ),
+ new CoordRec((float) 23.8095, (float) 9.5238 ),
+ new CoordRec((float) 19.0476, (float) 19.0476 ),
+ new CoordRec((float) 19.0476, (float) 33.3333 ),
+ new CoordRec((float) 23.8095, (float) 42.8571 ),
+ new CoordRec((float) 33.3333, (float) 52.381 ),
+ new CoordRec((float) 47.619, (float) 57.1429 ),
+ new CoordRec((float) 66.6666, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 66.6667 ),
+ new CoordRec((float) 80.9524, (float) 76.1905 ),
+ new CoordRec((float) 80.9524, (float) 85.7143 ),
+ new CoordRec((float) 76.1905, (float) 95.2381 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+};
+
+static final StrokeRec char56[] = {
+ new StrokeRec( 29, char56_stroke0 ),
+};
+
+/* char: 57 '9' */
+
+static final CoordRec char57_stroke0[] = {
+ new CoordRec((float) 83.3334, (float) 66.6667 ),
+ new CoordRec((float) 78.5714, (float) 52.381 ),
+ new CoordRec((float) 69.0476, (float) 42.8571 ),
+ new CoordRec((float) 54.7619, (float) 38.0952 ),
+ new CoordRec((float) 50, (float) 38.0952 ),
+ new CoordRec((float) 35.7143, (float) 42.8571 ),
+ new CoordRec((float) 26.1905, (float) 52.381 ),
+ new CoordRec((float) 21.4286, (float) 66.6667 ),
+ new CoordRec((float) 21.4286, (float) 71.4286 ),
+ new CoordRec((float) 26.1905, (float) 85.7143 ),
+ new CoordRec((float) 35.7143, (float) 95.2381 ),
+ new CoordRec((float) 50, (float) 100 ),
+ new CoordRec((float) 54.7619, (float) 100 ),
+ new CoordRec((float) 69.0476, (float) 95.2381 ),
+ new CoordRec((float) 78.5714, (float) 85.7143 ),
+ new CoordRec((float) 83.3334, (float) 66.6667 ),
+ new CoordRec((float) 83.3334, (float) 42.8571 ),
+ new CoordRec((float) 78.5714, (float) 19.0476 ),
+ new CoordRec((float) 69.0476, (float) 4.7619 ),
+ new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 30.9524, (float) 4.7619 ),
+ new CoordRec((float) 26.1905, (float) 14.2857 ),
+};
+
+static final StrokeRec char57[] = {
+ new StrokeRec( 23, char57_stroke0 ),
+};
+
+/* char: 58 ':' */
+
+static final CoordRec char58_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 66.6667 ),
+ new CoordRec((float) 47.6191, (float) 61.9048 ),
+ new CoordRec((float) 52.381, (float) 57.1429 ),
+ new CoordRec((float) 57.1429, (float) 61.9048 ),
+ new CoordRec((float) 52.381, (float) 66.6667 ),
+};
+
+static final CoordRec char58_stroke1[] = {
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+ new CoordRec((float) 47.6191, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+};
+
+static final StrokeRec char58[] = {
+ new StrokeRec( 5, char58_stroke0 ),
+ new StrokeRec( 5, char58_stroke1 ),
+};
+
+/* char: 59 ';' */
+
+static final CoordRec char59_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 66.6667 ),
+ new CoordRec((float) 47.6191, (float) 61.9048 ),
+ new CoordRec((float) 52.381, (float) 57.1429 ),
+ new CoordRec((float) 57.1429, (float) 61.9048 ),
+ new CoordRec((float) 52.381, (float) 66.6667 ),
+};
+
+static final CoordRec char59_stroke1[] = {
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+ new CoordRec((float) 47.6191, (float) 4.7619 ),
+ new CoordRec((float) 52.381, (float) 9.5238 ),
+ new CoordRec((float) 57.1429, (float) 4.7619 ),
+ new CoordRec((float) 57.1429, (float) -4.7619 ),
+ new CoordRec((float) 52.381, (float) -14.2857 ),
+ new CoordRec((float) 47.6191, (float) -19.0476 ),
+};
+
+static final StrokeRec char59[] = {
+ new StrokeRec( 5, char59_stroke0 ),
+ new StrokeRec( 8, char59_stroke1 ),
+};
+
+/* char: 60 '<' */
+
+static final CoordRec char60_stroke0[] = {
+ new CoordRec((float) 90.4762, (float) 85.7143 ),
+ new CoordRec((float) 14.2857, (float) 42.8571 ),
+ new CoordRec((float) 90.4762, (float) 0 ),
+};
+
+static final StrokeRec char60[] = {
+ new StrokeRec( 3, char60_stroke0 ),
+};
+
+/* char: 61 '=' */
+
+static final CoordRec char61_stroke0[] = {
+ new CoordRec((float) 9.5238, (float) 57.1429 ),
+ new CoordRec((float) 95.2381, (float) 57.1429 ),
+};
+
+static final CoordRec char61_stroke1[] = {
+ new CoordRec((float) 9.5238, (float) 28.5714 ),
+ new CoordRec((float) 95.2381, (float) 28.5714 ),
+};
+
+static final StrokeRec char61[] = {
+ new StrokeRec( 2, char61_stroke0 ),
+ new StrokeRec( 2, char61_stroke1 ),
+};
+
+/* char: 62 '>' */
+
+static final CoordRec char62_stroke0[] = {
+ new CoordRec((float) 14.2857, (float) 85.7143 ),
+ new CoordRec((float) 90.4762, (float) 42.8571 ),
+ new CoordRec((float) 14.2857, (float) 0 ),
+};
+
+static final StrokeRec char62[] = {
+ new StrokeRec( 3, char62_stroke0 ),
+};
+
+/* char: 63 '?' */
+
+static final CoordRec char63_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 76.1905 ),
+ new CoordRec((float) 23.8095, (float) 80.9524 ),
+ new CoordRec((float) 28.5714, (float) 90.4762 ),
+ new CoordRec((float) 33.3333, (float) 95.2381 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 71.4285, (float) 95.2381 ),
+ new CoordRec((float) 76.1905, (float) 90.4762 ),
+ new CoordRec((float) 80.9524, (float) 80.9524 ),
+ new CoordRec((float) 80.9524, (float) 71.4286 ),
+ new CoordRec((float) 76.1905, (float) 61.9048 ),
+ new CoordRec((float) 71.4285, (float) 57.1429 ),
+ new CoordRec((float) 52.3809, (float) 47.619 ),
+ new CoordRec((float) 52.3809, (float) 33.3333 ),
+};
+
+static final CoordRec char63_stroke1[] = {
+ new CoordRec((float) 52.3809, (float) 9.5238 ),
+ new CoordRec((float) 47.619, (float) 4.7619 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 57.1428, (float) 4.7619 ),
+ new CoordRec((float) 52.3809, (float) 9.5238 ),
+};
+
+static final StrokeRec char63[] = {
+ new StrokeRec( 14, char63_stroke0 ),
+ new StrokeRec( 5, char63_stroke1 ),
+};
+
+/* char: 64 '@' */
+
+static final CoordRec char64_stroke0[] = {
+ new CoordRec((float) 64.2857, (float) 52.381 ),
+ new CoordRec((float) 54.7619, (float) 57.1429 ),
+ new CoordRec((float) 45.2381, (float) 57.1429 ),
+ new CoordRec((float) 40.4762, (float) 47.619 ),
+ new CoordRec((float) 40.4762, (float) 42.8571 ),
+ new CoordRec((float) 45.2381, (float) 33.3333 ),
+ new CoordRec((float) 54.7619, (float) 33.3333 ),
+ new CoordRec((float) 64.2857, (float) 38.0952 ),
+};
+
+static final CoordRec char64_stroke1[] = {
+ new CoordRec((float) 64.2857, (float) 57.1429 ),
+ new CoordRec((float) 64.2857, (float) 38.0952 ),
+ new CoordRec((float) 69.0476, (float) 33.3333 ),
+ new CoordRec((float) 78.5714, (float) 33.3333 ),
+ new CoordRec((float) 83.3334, (float) 42.8571 ),
+ new CoordRec((float) 83.3334, (float) 47.619 ),
+ new CoordRec((float) 78.5714, (float) 61.9048 ),
+ new CoordRec((float) 69.0476, (float) 71.4286 ),
+ new CoordRec((float) 54.7619, (float) 76.1905 ),
+ new CoordRec((float) 50, (float) 76.1905 ),
+ new CoordRec((float) 35.7143, (float) 71.4286 ),
+ new CoordRec((float) 26.1905, (float) 61.9048 ),
+ new CoordRec((float) 21.4286, (float) 47.619 ),
+ new CoordRec((float) 21.4286, (float) 42.8571 ),
+ new CoordRec((float) 26.1905, (float) 28.5714 ),
+ new CoordRec((float) 35.7143, (float) 19.0476 ),
+ new CoordRec((float) 50, (float) 14.2857 ),
+ new CoordRec((float) 54.7619, (float) 14.2857 ),
+ new CoordRec((float) 69.0476, (float) 19.0476 ),
+};
+
+static final StrokeRec char64[] = {
+ new StrokeRec( 8, char64_stroke0 ),
+ new StrokeRec( 19, char64_stroke1 ),
+};
+
+/* char: 65 'A' */
+
+static final CoordRec char65_stroke0[] = {
+ new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 14.2857, (float) 0 ),
+};
+
+static final CoordRec char65_stroke1[] = {
+ new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 90.4762, (float) 0 ),
+};
+
+static final CoordRec char65_stroke2[] = {
+ new CoordRec((float) 28.5714, (float) 33.3333 ),
+ new CoordRec((float) 76.1905, (float) 33.3333 ),
+};
+
+static final StrokeRec char65[] = {
+ new StrokeRec( 2, char65_stroke0 ),
+ new StrokeRec( 2, char65_stroke1 ),
+ new StrokeRec( 2, char65_stroke2 ),
+};
+
+/* char: 66 'B' */
+
+static final CoordRec char66_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char66_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 76.1905, (float) 95.2381 ),
+ new CoordRec((float) 80.9524, (float) 90.4762 ),
+ new CoordRec((float) 85.7143, (float) 80.9524 ),
+ new CoordRec((float) 85.7143, (float) 71.4286 ),
+ new CoordRec((float) 80.9524, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 57.1429 ),
+ new CoordRec((float) 61.9047, (float) 52.381 ),
+};
+
+static final CoordRec char66_stroke2[] = {
+ new CoordRec((float) 19.0476, (float) 52.381 ),
+ new CoordRec((float) 61.9047, (float) 52.381 ),
+ new CoordRec((float) 76.1905, (float) 47.619 ),
+ new CoordRec((float) 80.9524, (float) 42.8571 ),
+ new CoordRec((float) 85.7143, (float) 33.3333 ),
+ new CoordRec((float) 85.7143, (float) 19.0476 ),
+ new CoordRec((float) 80.9524, (float) 9.5238 ),
+ new CoordRec((float) 76.1905, (float) 4.7619 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final StrokeRec char66[] = {
+ new StrokeRec( 2, char66_stroke0 ),
+ new StrokeRec( 9, char66_stroke1 ),
+ new StrokeRec( 10, char66_stroke2 ),
+};
+
+/* char: 67 'C' */
+
+static final CoordRec char67_stroke0[] = {
+ new CoordRec((float) 88.0952, (float) 76.1905 ),
+ new CoordRec((float) 83.3334, (float) 85.7143 ),
+ new CoordRec((float) 73.8096, (float) 95.2381 ),
+ new CoordRec((float) 64.2857, (float) 100 ),
+ new CoordRec((float) 45.2381, (float) 100 ),
+ new CoordRec((float) 35.7143, (float) 95.2381 ),
+ new CoordRec((float) 26.1905, (float) 85.7143 ),
+ new CoordRec((float) 21.4286, (float) 76.1905 ),
+ new CoordRec((float) 16.6667, (float) 61.9048 ),
+ new CoordRec((float) 16.6667, (float) 38.0952 ),
+ new CoordRec((float) 21.4286, (float) 23.8095 ),
+ new CoordRec((float) 26.1905, (float) 14.2857 ),
+ new CoordRec((float) 35.7143, (float) 4.7619 ),
+ new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 64.2857, (float) 0 ),
+ new CoordRec((float) 73.8096, (float) 4.7619 ),
+ new CoordRec((float) 83.3334, (float) 14.2857 ),
+ new CoordRec((float) 88.0952, (float) 23.8095 ),
+};
+
+static final StrokeRec char67[] = {
+ new StrokeRec( 18, char67_stroke0 ),
+};
+
+/* char: 68 'D' */
+
+static final CoordRec char68_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char68_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 66.6666, (float) 95.2381 ),
+ new CoordRec((float) 76.1905, (float) 85.7143 ),
+ new CoordRec((float) 80.9524, (float) 76.1905 ),
+ new CoordRec((float) 85.7143, (float) 61.9048 ),
+ new CoordRec((float) 85.7143, (float) 38.0952 ),
+ new CoordRec((float) 80.9524, (float) 23.8095 ),
+ new CoordRec((float) 76.1905, (float) 14.2857 ),
+ new CoordRec((float) 66.6666, (float) 4.7619 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final StrokeRec char68[] = {
+ new StrokeRec( 2, char68_stroke0 ),
+ new StrokeRec( 12, char68_stroke1 ),
+};
+
+/* char: 69 'E' */
+
+static final CoordRec char69_stroke0[] = {
+ new CoordRec((float) 21.4286, (float) 100 ),
+ new CoordRec((float) 21.4286, (float) 0 ),
+};
+
+static final CoordRec char69_stroke1[] = {
+ new CoordRec((float) 21.4286, (float) 100 ),
+ new CoordRec((float) 83.3334, (float) 100 ),
+};
+
+static final CoordRec char69_stroke2[] = {
+ new CoordRec((float) 21.4286, (float) 52.381 ),
+ new CoordRec((float) 59.5238, (float) 52.381 ),
+};
+
+static final CoordRec char69_stroke3[] = {
+ new CoordRec((float) 21.4286, (float) 0 ),
+ new CoordRec((float) 83.3334, (float) 0 ),
+};
+
+static final StrokeRec char69[] = {
+ new StrokeRec( 2, char69_stroke0 ),
+ new StrokeRec( 2, char69_stroke1 ),
+ new StrokeRec( 2, char69_stroke2 ),
+ new StrokeRec( 2, char69_stroke3 ),
+};
+
+/* char: 70 'F' */
+
+static final CoordRec char70_stroke0[] = {
+ new CoordRec((float) 21.4286, (float) 100 ),
+ new CoordRec((float) 21.4286, (float) 0 ),
+};
+
+static final CoordRec char70_stroke1[] = {
+ new CoordRec((float) 21.4286, (float) 100 ),
+ new CoordRec((float) 83.3334, (float) 100 ),
+};
+
+static final CoordRec char70_stroke2[] = {
+ new CoordRec((float) 21.4286, (float) 52.381 ),
+ new CoordRec((float) 59.5238, (float) 52.381 ),
+};
+
+static final StrokeRec char70[] = {
+ new StrokeRec( 2, char70_stroke0 ),
+ new StrokeRec( 2, char70_stroke1 ),
+ new StrokeRec( 2, char70_stroke2 ),
+};
+
+/* char: 71 'G' */
+
+static final CoordRec char71_stroke0[] = {
+ new CoordRec((float) 88.0952, (float) 76.1905 ),
+ new CoordRec((float) 83.3334, (float) 85.7143 ),
+ new CoordRec((float) 73.8096, (float) 95.2381 ),
+ new CoordRec((float) 64.2857, (float) 100 ),
+ new CoordRec((float) 45.2381, (float) 100 ),
+ new CoordRec((float) 35.7143, (float) 95.2381 ),
+ new CoordRec((float) 26.1905, (float) 85.7143 ),
+ new CoordRec((float) 21.4286, (float) 76.1905 ),
+ new CoordRec((float) 16.6667, (float) 61.9048 ),
+ new CoordRec((float) 16.6667, (float) 38.0952 ),
+ new CoordRec((float) 21.4286, (float) 23.8095 ),
+ new CoordRec((float) 26.1905, (float) 14.2857 ),
+ new CoordRec((float) 35.7143, (float) 4.7619 ),
+ new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 64.2857, (float) 0 ),
+ new CoordRec((float) 73.8096, (float) 4.7619 ),
+ new CoordRec((float) 83.3334, (float) 14.2857 ),
+ new CoordRec((float) 88.0952, (float) 23.8095 ),
+ new CoordRec((float) 88.0952, (float) 38.0952 ),
+};
+
+static final CoordRec char71_stroke1[] = {
+ new CoordRec((float) 64.2857, (float) 38.0952 ),
+ new CoordRec((float) 88.0952, (float) 38.0952 ),
+};
+
+static final StrokeRec char71[] = {
+ new StrokeRec( 19, char71_stroke0 ),
+ new StrokeRec( 2, char71_stroke1 ),
+};
+
+/* char: 72 'H' */
+
+static final CoordRec char72_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char72_stroke1[] = {
+ new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final CoordRec char72_stroke2[] = {
+ new CoordRec((float) 19.0476, (float) 52.381 ),
+ new CoordRec((float) 85.7143, (float) 52.381 ),
+};
+
+static final StrokeRec char72[] = {
+ new StrokeRec( 2, char72_stroke0 ),
+ new StrokeRec( 2, char72_stroke1 ),
+ new StrokeRec( 2, char72_stroke2 ),
+};
+
+/* char: 73 'I' */
+
+static final CoordRec char73_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+};
+
+static final StrokeRec char73[] = {
+ new StrokeRec( 2, char73_stroke0 ),
+};
+
+/* char: 74 'J' */
+
+static final CoordRec char74_stroke0[] = {
+ new CoordRec((float) 76.1905, (float) 100 ),
+ new CoordRec((float) 76.1905, (float) 23.8095 ),
+ new CoordRec((float) 71.4286, (float) 9.5238 ),
+ new CoordRec((float) 66.6667, (float) 4.7619 ),
+ new CoordRec((float) 57.1429, (float) 0 ),
+ new CoordRec((float) 47.6191, (float) 0 ),
+ new CoordRec((float) 38.0953, (float) 4.7619 ),
+ new CoordRec((float) 33.3334, (float) 9.5238 ),
+ new CoordRec((float) 28.5715, (float) 23.8095 ),
+ new CoordRec((float) 28.5715, (float) 33.3333 ),
+};
+
+static final StrokeRec char74[] = {
+ new StrokeRec( 10, char74_stroke0 ),
+};
+
+/* char: 75 'K' */
+
+static final CoordRec char75_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char75_stroke1[] = {
+ new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 33.3333 ),
+};
+
+static final CoordRec char75_stroke2[] = {
+ new CoordRec((float) 42.8571, (float) 57.1429 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final StrokeRec char75[] = {
+ new StrokeRec( 2, char75_stroke0 ),
+ new StrokeRec( 2, char75_stroke1 ),
+ new StrokeRec( 2, char75_stroke2 ),
+};
+
+/* char: 76 'L' */
+
+static final CoordRec char76_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 100 ),
+ new CoordRec((float) 23.8095, (float) 0 ),
+};
+
+static final CoordRec char76_stroke1[] = {
+ new CoordRec((float) 23.8095, (float) 0 ),
+ new CoordRec((float) 80.9524, (float) 0 ),
+};
+
+static final StrokeRec char76[] = {
+ new StrokeRec( 2, char76_stroke0 ),
+ new StrokeRec( 2, char76_stroke1 ),
+};
+
+/* char: 77 'M' */
+
+static final CoordRec char77_stroke0[] = {
+ new CoordRec((float) 14.2857, (float) 100 ),
+ new CoordRec((float) 14.2857, (float) 0 ),
+};
+
+static final CoordRec char77_stroke1[] = {
+ new CoordRec((float) 14.2857, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char77_stroke2[] = {
+ new CoordRec((float) 90.4762, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char77_stroke3[] = {
+ new CoordRec((float) 90.4762, (float) 100 ),
+ new CoordRec((float) 90.4762, (float) 0 ),
+};
+
+static final StrokeRec char77[] = {
+ new StrokeRec( 2, char77_stroke0 ),
+ new StrokeRec( 2, char77_stroke1 ),
+ new StrokeRec( 2, char77_stroke2 ),
+ new StrokeRec( 2, char77_stroke3 ),
+};
+
+/* char: 78 'N' */
+
+static final CoordRec char78_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char78_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final CoordRec char78_stroke2[] = {
+ new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final StrokeRec char78[] = {
+ new StrokeRec( 2, char78_stroke0 ),
+ new StrokeRec( 2, char78_stroke1 ),
+ new StrokeRec( 2, char78_stroke2 ),
+};
+
+/* char: 79 'O' */
+
+static final CoordRec char79_stroke0[] = {
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 33.3333, (float) 95.2381 ),
+ new CoordRec((float) 23.8095, (float) 85.7143 ),
+ new CoordRec((float) 19.0476, (float) 76.1905 ),
+ new CoordRec((float) 14.2857, (float) 61.9048 ),
+ new CoordRec((float) 14.2857, (float) 38.0952 ),
+ new CoordRec((float) 19.0476, (float) 23.8095 ),
+ new CoordRec((float) 23.8095, (float) 14.2857 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+ new CoordRec((float) 85.7143, (float) 23.8095 ),
+ new CoordRec((float) 90.4762, (float) 38.0952 ),
+ new CoordRec((float) 90.4762, (float) 61.9048 ),
+ new CoordRec((float) 85.7143, (float) 76.1905 ),
+ new CoordRec((float) 80.9524, (float) 85.7143 ),
+ new CoordRec((float) 71.4286, (float) 95.2381 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+};
+
+static final StrokeRec char79[] = {
+ new StrokeRec( 21, char79_stroke0 ),
+};
+
+/* char: 80 'P' */
+
+static final CoordRec char80_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char80_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 76.1905, (float) 95.2381 ),
+ new CoordRec((float) 80.9524, (float) 90.4762 ),
+ new CoordRec((float) 85.7143, (float) 80.9524 ),
+ new CoordRec((float) 85.7143, (float) 66.6667 ),
+ new CoordRec((float) 80.9524, (float) 57.1429 ),
+ new CoordRec((float) 76.1905, (float) 52.381 ),
+ new CoordRec((float) 61.9047, (float) 47.619 ),
+ new CoordRec((float) 19.0476, (float) 47.619 ),
+};
+
+static final StrokeRec char80[] = {
+ new StrokeRec( 2, char80_stroke0 ),
+ new StrokeRec( 10, char80_stroke1 ),
+};
+
+/* char: 81 'Q' */
+
+static final CoordRec char81_stroke0[] = {
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 33.3333, (float) 95.2381 ),
+ new CoordRec((float) 23.8095, (float) 85.7143 ),
+ new CoordRec((float) 19.0476, (float) 76.1905 ),
+ new CoordRec((float) 14.2857, (float) 61.9048 ),
+ new CoordRec((float) 14.2857, (float) 38.0952 ),
+ new CoordRec((float) 19.0476, (float) 23.8095 ),
+ new CoordRec((float) 23.8095, (float) 14.2857 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+ new CoordRec((float) 85.7143, (float) 23.8095 ),
+ new CoordRec((float) 90.4762, (float) 38.0952 ),
+ new CoordRec((float) 90.4762, (float) 61.9048 ),
+ new CoordRec((float) 85.7143, (float) 76.1905 ),
+ new CoordRec((float) 80.9524, (float) 85.7143 ),
+ new CoordRec((float) 71.4286, (float) 95.2381 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+};
+
+static final CoordRec char81_stroke1[] = {
+ new CoordRec((float) 57.1428, (float) 19.0476 ),
+ new CoordRec((float) 85.7143, (float) -9.5238 ),
+};
+
+static final StrokeRec char81[] = {
+ new StrokeRec( 21, char81_stroke0 ),
+ new StrokeRec( 2, char81_stroke1 ),
+};
+
+/* char: 82 'R' */
+
+static final CoordRec char82_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char82_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 76.1905, (float) 95.2381 ),
+ new CoordRec((float) 80.9524, (float) 90.4762 ),
+ new CoordRec((float) 85.7143, (float) 80.9524 ),
+ new CoordRec((float) 85.7143, (float) 71.4286 ),
+ new CoordRec((float) 80.9524, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 57.1429 ),
+ new CoordRec((float) 61.9047, (float) 52.381 ),
+ new CoordRec((float) 19.0476, (float) 52.381 ),
+};
+
+static final CoordRec char82_stroke2[] = {
+ new CoordRec((float) 52.3809, (float) 52.381 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final StrokeRec char82[] = {
+ new StrokeRec( 2, char82_stroke0 ),
+ new StrokeRec( 10, char82_stroke1 ),
+ new StrokeRec( 2, char82_stroke2 ),
+};
+
+/* char: 83 'S' */
+
+static final CoordRec char83_stroke0[] = {
+ new CoordRec((float) 85.7143, (float) 85.7143 ),
+ new CoordRec((float) 76.1905, (float) 95.2381 ),
+ new CoordRec((float) 61.9047, (float) 100 ),
+ new CoordRec((float) 42.8571, (float) 100 ),
+ new CoordRec((float) 28.5714, (float) 95.2381 ),
+ new CoordRec((float) 19.0476, (float) 85.7143 ),
+ new CoordRec((float) 19.0476, (float) 76.1905 ),
+ new CoordRec((float) 23.8095, (float) 66.6667 ),
+ new CoordRec((float) 28.5714, (float) 61.9048 ),
+ new CoordRec((float) 38.0952, (float) 57.1429 ),
+ new CoordRec((float) 66.6666, (float) 47.619 ),
+ new CoordRec((float) 76.1905, (float) 42.8571 ),
+ new CoordRec((float) 80.9524, (float) 38.0952 ),
+ new CoordRec((float) 85.7143, (float) 28.5714 ),
+ new CoordRec((float) 85.7143, (float) 14.2857 ),
+ new CoordRec((float) 76.1905, (float) 4.7619 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 28.5714, (float) 4.7619 ),
+ new CoordRec((float) 19.0476, (float) 14.2857 ),
+};
+
+static final StrokeRec char83[] = {
+ new StrokeRec( 20, char83_stroke0 ),
+};
+
+/* char: 84 'T' */
+
+static final CoordRec char84_stroke0[] = {
+ new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char84_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 100 ),
+};
+
+static final StrokeRec char84[] = {
+ new StrokeRec( 2, char84_stroke0 ),
+ new StrokeRec( 2, char84_stroke1 ),
+};
+
+/* char: 85 'U' */
+
+static final CoordRec char85_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 28.5714 ),
+ new CoordRec((float) 23.8095, (float) 14.2857 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+ new CoordRec((float) 85.7143, (float) 28.5714 ),
+ new CoordRec((float) 85.7143, (float) 100 ),
+};
+
+static final StrokeRec char85[] = {
+ new StrokeRec( 10, char85_stroke0 ),
+};
+
+/* char: 86 'V' */
+
+static final CoordRec char86_stroke0[] = {
+ new CoordRec((float) 14.2857, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char86_stroke1[] = {
+ new CoordRec((float) 90.4762, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final StrokeRec char86[] = {
+ new StrokeRec( 2, char86_stroke0 ),
+ new StrokeRec( 2, char86_stroke1 ),
+};
+
+/* char: 87 'W' */
+
+static final CoordRec char87_stroke0[] = {
+ new CoordRec((float) 4.7619, (float) 100 ),
+ new CoordRec((float) 28.5714, (float) 0 ),
+};
+
+static final CoordRec char87_stroke1[] = {
+ new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 28.5714, (float) 0 ),
+};
+
+static final CoordRec char87_stroke2[] = {
+ new CoordRec((float) 52.3809, (float) 100 ),
+ new CoordRec((float) 76.1905, (float) 0 ),
+};
+
+static final CoordRec char87_stroke3[] = {
+ new CoordRec((float) 100, (float) 100 ),
+ new CoordRec((float) 76.1905, (float) 0 ),
+};
+
+static final StrokeRec char87[] = {
+ new StrokeRec( 2, char87_stroke0 ),
+ new StrokeRec( 2, char87_stroke1 ),
+ new StrokeRec( 2, char87_stroke2 ),
+ new StrokeRec( 2, char87_stroke3 ),
+};
+
+/* char: 88 'X' */
+
+static final CoordRec char88_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final CoordRec char88_stroke1[] = {
+ new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final StrokeRec char88[] = {
+ new StrokeRec( 2, char88_stroke0 ),
+ new StrokeRec( 2, char88_stroke1 ),
+};
+
+/* char: 89 'Y' */
+
+static final CoordRec char89_stroke0[] = {
+ new CoordRec((float) 14.2857, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 52.381 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char89_stroke1[] = {
+ new CoordRec((float) 90.4762, (float) 100 ),
+ new CoordRec((float) 52.3809, (float) 52.381 ),
+};
+
+static final StrokeRec char89[] = {
+ new StrokeRec( 3, char89_stroke0 ),
+ new StrokeRec( 2, char89_stroke1 ),
+};
+
+/* char: 90 'Z' */
+
+static final CoordRec char90_stroke0[] = {
+ new CoordRec((float) 85.7143, (float) 100 ),
+ new CoordRec((float) 19.0476, (float) 0 ),
+};
+
+static final CoordRec char90_stroke1[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) 100 ),
+};
+
+static final CoordRec char90_stroke2[] = {
+ new CoordRec((float) 19.0476, (float) 0 ),
+ new CoordRec((float) 85.7143, (float) 0 ),
+};
+
+static final StrokeRec char90[] = {
+ new StrokeRec( 2, char90_stroke0 ),
+ new StrokeRec( 2, char90_stroke1 ),
+ new StrokeRec( 2, char90_stroke2 ),
+};
+
+/* char: 91 '[' */
+
+static final CoordRec char91_stroke0[] = {
+ new CoordRec((float) 35.7143, (float) 119.048 ),
+ new CoordRec((float) 35.7143, (float) -33.3333 ),
+};
+
+static final CoordRec char91_stroke1[] = {
+ new CoordRec((float) 40.4762, (float) 119.048 ),
+ new CoordRec((float) 40.4762, (float) -33.3333 ),
+};
+
+static final CoordRec char91_stroke2[] = {
+ new CoordRec((float) 35.7143, (float) 119.048 ),
+ new CoordRec((float) 69.0476, (float) 119.048 ),
+};
+
+static final CoordRec char91_stroke3[] = {
+ new CoordRec((float) 35.7143, (float) -33.3333 ),
+ new CoordRec((float) 69.0476, (float) -33.3333 ),
+};
+
+static final StrokeRec char91[] = {
+ new StrokeRec( 2, char91_stroke0 ),
+ new StrokeRec( 2, char91_stroke1 ),
+ new StrokeRec( 2, char91_stroke2 ),
+ new StrokeRec( 2, char91_stroke3 ),
+};
+
+/* char: 92 '\' */
+
+static final CoordRec char92_stroke0[] = {
+ new CoordRec((float) 19.0476, (float) 100 ),
+ new CoordRec((float) 85.7143, (float) -14.2857 ),
+};
+
+static final StrokeRec char92[] = {
+ new StrokeRec( 2, char92_stroke0 ),
+};
+
+/* char: 93 ']' */
+
+static final CoordRec char93_stroke0[] = {
+ new CoordRec((float) 64.2857, (float) 119.048 ),
+ new CoordRec((float) 64.2857, (float) -33.3333 ),
+};
+
+static final CoordRec char93_stroke1[] = {
+ new CoordRec((float) 69.0476, (float) 119.048 ),
+ new CoordRec((float) 69.0476, (float) -33.3333 ),
+};
+
+static final CoordRec char93_stroke2[] = {
+ new CoordRec((float) 35.7143, (float) 119.048 ),
+ new CoordRec((float) 69.0476, (float) 119.048 ),
+};
+
+static final CoordRec char93_stroke3[] = {
+ new CoordRec((float) 35.7143, (float) -33.3333 ),
+ new CoordRec((float) 69.0476, (float) -33.3333 ),
+};
+
+static final StrokeRec char93[] = {
+ new StrokeRec( 2, char93_stroke0 ),
+ new StrokeRec( 2, char93_stroke1 ),
+ new StrokeRec( 2, char93_stroke2 ),
+ new StrokeRec( 2, char93_stroke3 ),
+};
+
+/* char: 94 '^' */
+
+static final CoordRec char94_stroke0[] = {
+ new CoordRec((float) 52.3809, (float) 109.524 ),
+ new CoordRec((float) 14.2857, (float) 42.8571 ),
+};
+
+static final CoordRec char94_stroke1[] = {
+ new CoordRec((float) 52.3809, (float) 109.524 ),
+ new CoordRec((float) 90.4762, (float) 42.8571 ),
+};
+
+static final StrokeRec char94[] = {
+ new StrokeRec( 2, char94_stroke0 ),
+ new StrokeRec( 2, char94_stroke1 ),
+};
+
+/* char: 95 '_' */
+
+static final CoordRec char95_stroke0[] = {
+ new CoordRec((float) 0, (float) -33.3333 ),
+ new CoordRec((float) 104.762, (float) -33.3333 ),
+ new CoordRec((float) 104.762, (float) -28.5714 ),
+ new CoordRec((float) 0, (float) -28.5714 ),
+ new CoordRec((float) 0, (float) -33.3333 ),
+};
+
+static final StrokeRec char95[] = {
+ new StrokeRec( 5, char95_stroke0 ),
+};
+
+/* char: 96 '`' */
+
+static final CoordRec char96_stroke0[] = {
+ new CoordRec((float) 42.8572, (float) 100 ),
+ new CoordRec((float) 66.6667, (float) 71.4286 ),
+};
+
+static final CoordRec char96_stroke1[] = {
+ new CoordRec((float) 42.8572, (float) 100 ),
+ new CoordRec((float) 38.0953, (float) 95.2381 ),
+ new CoordRec((float) 66.6667, (float) 71.4286 ),
+};
+
+static final StrokeRec char96[] = {
+ new StrokeRec( 2, char96_stroke0 ),
+ new StrokeRec( 3, char96_stroke1 ),
+};
+
+/* char: 97 'a' */
+
+static final CoordRec char97_stroke0[] = {
+ new CoordRec((float) 80.9524, (float) 66.6667 ),
+ new CoordRec((float) 80.9524, (float) 0 ),
+};
+
+static final CoordRec char97_stroke1[] = {
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4285, (float) 61.9048 ),
+ new CoordRec((float) 61.9047, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 28.5714, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 23.8095, (float) 28.5714 ),
+ new CoordRec((float) 28.5714, (float) 14.2857 ),
+ new CoordRec((float) 38.0952, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4285, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+};
+
+static final StrokeRec char97[] = {
+ new StrokeRec( 2, char97_stroke0 ),
+ new StrokeRec( 14, char97_stroke1 ),
+};
+
+/* char: 98 'b' */
+
+static final CoordRec char98_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 100 ),
+ new CoordRec((float) 23.8095, (float) 0 ),
+};
+
+static final CoordRec char98_stroke1[] = {
+ new CoordRec((float) 23.8095, (float) 52.381 ),
+ new CoordRec((float) 33.3333, (float) 61.9048 ),
+ new CoordRec((float) 42.8571, (float) 66.6667 ),
+ new CoordRec((float) 57.1428, (float) 66.6667 ),
+ new CoordRec((float) 66.6666, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 52.381 ),
+ new CoordRec((float) 80.9524, (float) 38.0952 ),
+ new CoordRec((float) 80.9524, (float) 28.5714 ),
+ new CoordRec((float) 76.1905, (float) 14.2857 ),
+ new CoordRec((float) 66.6666, (float) 4.7619 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 23.8095, (float) 14.2857 ),
+};
+
+static final StrokeRec char98[] = {
+ new StrokeRec( 2, char98_stroke0 ),
+ new StrokeRec( 14, char98_stroke1 ),
+};
+
+/* char: 99 'c' */
+
+static final CoordRec char99_stroke0[] = {
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4285, (float) 61.9048 ),
+ new CoordRec((float) 61.9047, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 28.5714, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 23.8095, (float) 28.5714 ),
+ new CoordRec((float) 28.5714, (float) 14.2857 ),
+ new CoordRec((float) 38.0952, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4285, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+};
+
+static final StrokeRec char99[] = {
+ new StrokeRec( 14, char99_stroke0 ),
+};
+
+/* char: 100 'd' */
+
+static final CoordRec char100_stroke0[] = {
+ new CoordRec((float) 80.9524, (float) 100 ),
+ new CoordRec((float) 80.9524, (float) 0 ),
+};
+
+static final CoordRec char100_stroke1[] = {
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4285, (float) 61.9048 ),
+ new CoordRec((float) 61.9047, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 28.5714, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 23.8095, (float) 28.5714 ),
+ new CoordRec((float) 28.5714, (float) 14.2857 ),
+ new CoordRec((float) 38.0952, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4285, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+};
+
+static final StrokeRec char100[] = {
+ new StrokeRec( 2, char100_stroke0 ),
+ new StrokeRec( 14, char100_stroke1 ),
+};
+
+/* char: 101 'e' */
+
+static final CoordRec char101_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 80.9524, (float) 38.0952 ),
+ new CoordRec((float) 80.9524, (float) 47.619 ),
+ new CoordRec((float) 76.1905, (float) 57.1429 ),
+ new CoordRec((float) 71.4285, (float) 61.9048 ),
+ new CoordRec((float) 61.9047, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 28.5714, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 23.8095, (float) 28.5714 ),
+ new CoordRec((float) 28.5714, (float) 14.2857 ),
+ new CoordRec((float) 38.0952, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4285, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+};
+
+static final StrokeRec char101[] = {
+ new StrokeRec( 17, char101_stroke0 ),
+};
+
+/* char: 102 'f' */
+
+static final CoordRec char102_stroke0[] = {
+ new CoordRec((float) 71.4286, (float) 100 ),
+ new CoordRec((float) 61.9048, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 95.2381 ),
+ new CoordRec((float) 47.6191, (float) 80.9524 ),
+ new CoordRec((float) 47.6191, (float) 0 ),
+};
+
+static final CoordRec char102_stroke1[] = {
+ new CoordRec((float) 33.3334, (float) 66.6667 ),
+ new CoordRec((float) 66.6667, (float) 66.6667 ),
+};
+
+static final StrokeRec char102[] = {
+ new StrokeRec( 5, char102_stroke0 ),
+ new StrokeRec( 2, char102_stroke1 ),
+};
+
+/* char: 103 'g' */
+
+static final CoordRec char103_stroke0[] = {
+ new CoordRec((float) 80.9524, (float) 66.6667 ),
+ new CoordRec((float) 80.9524, (float) -9.5238 ),
+ new CoordRec((float) 76.1905, (float) -23.8095 ),
+ new CoordRec((float) 71.4285, (float) -28.5714 ),
+ new CoordRec((float) 61.9047, (float) -33.3333 ),
+ new CoordRec((float) 47.619, (float) -33.3333 ),
+ new CoordRec((float) 38.0952, (float) -28.5714 ),
+};
+
+static final CoordRec char103_stroke1[] = {
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4285, (float) 61.9048 ),
+ new CoordRec((float) 61.9047, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 28.5714, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 23.8095, (float) 28.5714 ),
+ new CoordRec((float) 28.5714, (float) 14.2857 ),
+ new CoordRec((float) 38.0952, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4285, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+};
+
+static final StrokeRec char103[] = {
+ new StrokeRec( 7, char103_stroke0 ),
+ new StrokeRec( 14, char103_stroke1 ),
+};
+
+/* char: 104 'h' */
+
+static final CoordRec char104_stroke0[] = {
+ new CoordRec((float) 26.1905, (float) 100 ),
+ new CoordRec((float) 26.1905, (float) 0 ),
+};
+
+static final CoordRec char104_stroke1[] = {
+ new CoordRec((float) 26.1905, (float) 47.619 ),
+ new CoordRec((float) 40.4762, (float) 61.9048 ),
+ new CoordRec((float) 50, (float) 66.6667 ),
+ new CoordRec((float) 64.2857, (float) 66.6667 ),
+ new CoordRec((float) 73.8095, (float) 61.9048 ),
+ new CoordRec((float) 78.5715, (float) 47.619 ),
+ new CoordRec((float) 78.5715, (float) 0 ),
+};
+
+static final StrokeRec char104[] = {
+ new StrokeRec( 2, char104_stroke0 ),
+ new StrokeRec( 7, char104_stroke1 ),
+};
+
+/* char: 105 'i' */
+
+static final CoordRec char105_stroke0[] = {
+ new CoordRec((float) 47.6191, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 95.2381 ),
+ new CoordRec((float) 57.1429, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 104.762 ),
+ new CoordRec((float) 47.6191, (float) 100 ),
+};
+
+static final CoordRec char105_stroke1[] = {
+ new CoordRec((float) 52.381, (float) 66.6667 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+};
+
+static final StrokeRec char105[] = {
+ new StrokeRec( 5, char105_stroke0 ),
+ new StrokeRec( 2, char105_stroke1 ),
+};
+
+/* char: 106 'j' */
+
+static final CoordRec char106_stroke0[] = {
+ new CoordRec((float) 57.1429, (float) 100 ),
+ new CoordRec((float) 61.9048, (float) 95.2381 ),
+ new CoordRec((float) 66.6667, (float) 100 ),
+ new CoordRec((float) 61.9048, (float) 104.762 ),
+ new CoordRec((float) 57.1429, (float) 100 ),
+};
+
+static final CoordRec char106_stroke1[] = {
+ new CoordRec((float) 61.9048, (float) 66.6667 ),
+ new CoordRec((float) 61.9048, (float) -14.2857 ),
+ new CoordRec((float) 57.1429, (float) -28.5714 ),
+ new CoordRec((float) 47.6191, (float) -33.3333 ),
+ new CoordRec((float) 38.0953, (float) -33.3333 ),
+};
+
+static final StrokeRec char106[] = {
+ new StrokeRec( 5, char106_stroke0 ),
+ new StrokeRec( 5, char106_stroke1 ),
+};
+
+/* char: 107 'k' */
+
+static final CoordRec char107_stroke0[] = {
+ new CoordRec((float) 26.1905, (float) 100 ),
+ new CoordRec((float) 26.1905, (float) 0 ),
+};
+
+static final CoordRec char107_stroke1[] = {
+ new CoordRec((float) 73.8095, (float) 66.6667 ),
+ new CoordRec((float) 26.1905, (float) 19.0476 ),
+};
+
+static final CoordRec char107_stroke2[] = {
+ new CoordRec((float) 45.2381, (float) 38.0952 ),
+ new CoordRec((float) 78.5715, (float) 0 ),
+};
+
+static final StrokeRec char107[] = {
+ new StrokeRec( 2, char107_stroke0 ),
+ new StrokeRec( 2, char107_stroke1 ),
+ new StrokeRec( 2, char107_stroke2 ),
+};
+
+/* char: 108 'l' */
+
+static final CoordRec char108_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 100 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+};
+
+static final StrokeRec char108[] = {
+ new StrokeRec( 2, char108_stroke0 ),
+};
+
+/* char: 109 'm' */
+
+static final CoordRec char109_stroke0[] = {
+ new CoordRec((float) 0, (float) 66.6667 ),
+ new CoordRec((float) 0, (float) 0 ),
+};
+
+static final CoordRec char109_stroke1[] = {
+ new CoordRec((float) 0, (float) 47.619 ),
+ new CoordRec((float) 14.2857, (float) 61.9048 ),
+ new CoordRec((float) 23.8095, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 61.9048 ),
+ new CoordRec((float) 52.381, (float) 47.619 ),
+ new CoordRec((float) 52.381, (float) 0 ),
+};
+
+static final CoordRec char109_stroke2[] = {
+ new CoordRec((float) 52.381, (float) 47.619 ),
+ new CoordRec((float) 66.6667, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 66.6667 ),
+ new CoordRec((float) 90.4762, (float) 66.6667 ),
+ new CoordRec((float) 100, (float) 61.9048 ),
+ new CoordRec((float) 104.762, (float) 47.619 ),
+ new CoordRec((float) 104.762, (float) 0 ),
+};
+
+static final StrokeRec char109[] = {
+ new StrokeRec( 2, char109_stroke0 ),
+ new StrokeRec( 7, char109_stroke1 ),
+ new StrokeRec( 7, char109_stroke2 ),
+};
+
+/* char: 110 'n' */
+
+static final CoordRec char110_stroke0[] = {
+ new CoordRec((float) 26.1905, (float) 66.6667 ),
+ new CoordRec((float) 26.1905, (float) 0 ),
+};
+
+static final CoordRec char110_stroke1[] = {
+ new CoordRec((float) 26.1905, (float) 47.619 ),
+ new CoordRec((float) 40.4762, (float) 61.9048 ),
+ new CoordRec((float) 50, (float) 66.6667 ),
+ new CoordRec((float) 64.2857, (float) 66.6667 ),
+ new CoordRec((float) 73.8095, (float) 61.9048 ),
+ new CoordRec((float) 78.5715, (float) 47.619 ),
+ new CoordRec((float) 78.5715, (float) 0 ),
+};
+
+static final StrokeRec char110[] = {
+ new StrokeRec( 2, char110_stroke0 ),
+ new StrokeRec( 7, char110_stroke1 ),
+};
+
+/* char: 111 'o' */
+
+static final CoordRec char111_stroke0[] = {
+ new CoordRec((float) 45.2381, (float) 66.6667 ),
+ new CoordRec((float) 35.7143, (float) 61.9048 ),
+ new CoordRec((float) 26.1905, (float) 52.381 ),
+ new CoordRec((float) 21.4286, (float) 38.0952 ),
+ new CoordRec((float) 21.4286, (float) 28.5714 ),
+ new CoordRec((float) 26.1905, (float) 14.2857 ),
+ new CoordRec((float) 35.7143, (float) 4.7619 ),
+ new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 59.5238, (float) 0 ),
+ new CoordRec((float) 69.0476, (float) 4.7619 ),
+ new CoordRec((float) 78.5714, (float) 14.2857 ),
+ new CoordRec((float) 83.3334, (float) 28.5714 ),
+ new CoordRec((float) 83.3334, (float) 38.0952 ),
+ new CoordRec((float) 78.5714, (float) 52.381 ),
+ new CoordRec((float) 69.0476, (float) 61.9048 ),
+ new CoordRec((float) 59.5238, (float) 66.6667 ),
+ new CoordRec((float) 45.2381, (float) 66.6667 ),
+};
+
+static final StrokeRec char111[] = {
+ new StrokeRec( 17, char111_stroke0 ),
+};
+
+/* char: 112 'p' */
+
+static final CoordRec char112_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 66.6667 ),
+ new CoordRec((float) 23.8095, (float) -33.3333 ),
+};
+
+static final CoordRec char112_stroke1[] = {
+ new CoordRec((float) 23.8095, (float) 52.381 ),
+ new CoordRec((float) 33.3333, (float) 61.9048 ),
+ new CoordRec((float) 42.8571, (float) 66.6667 ),
+ new CoordRec((float) 57.1428, (float) 66.6667 ),
+ new CoordRec((float) 66.6666, (float) 61.9048 ),
+ new CoordRec((float) 76.1905, (float) 52.381 ),
+ new CoordRec((float) 80.9524, (float) 38.0952 ),
+ new CoordRec((float) 80.9524, (float) 28.5714 ),
+ new CoordRec((float) 76.1905, (float) 14.2857 ),
+ new CoordRec((float) 66.6666, (float) 4.7619 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 42.8571, (float) 0 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 23.8095, (float) 14.2857 ),
+};
+
+static final StrokeRec char112[] = {
+ new StrokeRec( 2, char112_stroke0 ),
+ new StrokeRec( 14, char112_stroke1 ),
+};
+
+/* char: 113 'q' */
+
+static final CoordRec char113_stroke0[] = {
+ new CoordRec((float) 80.9524, (float) 66.6667 ),
+ new CoordRec((float) 80.9524, (float) -33.3333 ),
+};
+
+static final CoordRec char113_stroke1[] = {
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4285, (float) 61.9048 ),
+ new CoordRec((float) 61.9047, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 38.0952, (float) 61.9048 ),
+ new CoordRec((float) 28.5714, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 38.0952 ),
+ new CoordRec((float) 23.8095, (float) 28.5714 ),
+ new CoordRec((float) 28.5714, (float) 14.2857 ),
+ new CoordRec((float) 38.0952, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 61.9047, (float) 0 ),
+ new CoordRec((float) 71.4285, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+};
+
+static final StrokeRec char113[] = {
+ new StrokeRec( 2, char113_stroke0 ),
+ new StrokeRec( 14, char113_stroke1 ),
+};
+
+/* char: 114 'r' */
+
+static final CoordRec char114_stroke0[] = {
+ new CoordRec((float) 33.3334, (float) 66.6667 ),
+ new CoordRec((float) 33.3334, (float) 0 ),
+};
+
+static final CoordRec char114_stroke1[] = {
+ new CoordRec((float) 33.3334, (float) 38.0952 ),
+ new CoordRec((float) 38.0953, (float) 52.381 ),
+ new CoordRec((float) 47.6191, (float) 61.9048 ),
+ new CoordRec((float) 57.1429, (float) 66.6667 ),
+ new CoordRec((float) 71.4286, (float) 66.6667 ),
+};
+
+static final StrokeRec char114[] = {
+ new StrokeRec( 2, char114_stroke0 ),
+ new StrokeRec( 5, char114_stroke1 ),
+};
+
+/* char: 115 's' */
+
+static final CoordRec char115_stroke0[] = {
+ new CoordRec((float) 78.5715, (float) 52.381 ),
+ new CoordRec((float) 73.8095, (float) 61.9048 ),
+ new CoordRec((float) 59.5238, (float) 66.6667 ),
+ new CoordRec((float) 45.2381, (float) 66.6667 ),
+ new CoordRec((float) 30.9524, (float) 61.9048 ),
+ new CoordRec((float) 26.1905, (float) 52.381 ),
+ new CoordRec((float) 30.9524, (float) 42.8571 ),
+ new CoordRec((float) 40.4762, (float) 38.0952 ),
+ new CoordRec((float) 64.2857, (float) 33.3333 ),
+ new CoordRec((float) 73.8095, (float) 28.5714 ),
+ new CoordRec((float) 78.5715, (float) 19.0476 ),
+ new CoordRec((float) 78.5715, (float) 14.2857 ),
+ new CoordRec((float) 73.8095, (float) 4.7619 ),
+ new CoordRec((float) 59.5238, (float) 0 ),
+ new CoordRec((float) 45.2381, (float) 0 ),
+ new CoordRec((float) 30.9524, (float) 4.7619 ),
+ new CoordRec((float) 26.1905, (float) 14.2857 ),
+};
+
+static final StrokeRec char115[] = {
+ new StrokeRec( 17, char115_stroke0 ),
+};
+
+/* char: 116 't' */
+
+static final CoordRec char116_stroke0[] = {
+ new CoordRec((float) 47.6191, (float) 100 ),
+ new CoordRec((float) 47.6191, (float) 19.0476 ),
+ new CoordRec((float) 52.381, (float) 4.7619 ),
+ new CoordRec((float) 61.9048, (float) 0 ),
+ new CoordRec((float) 71.4286, (float) 0 ),
+};
+
+static final CoordRec char116_stroke1[] = {
+ new CoordRec((float) 33.3334, (float) 66.6667 ),
+ new CoordRec((float) 66.6667, (float) 66.6667 ),
+};
+
+static final StrokeRec char116[] = {
+ new StrokeRec( 5, char116_stroke0 ),
+ new StrokeRec( 2, char116_stroke1 ),
+};
+
+/* char: 117 'u' */
+
+static final CoordRec char117_stroke0[] = {
+ new CoordRec((float) 26.1905, (float) 66.6667 ),
+ new CoordRec((float) 26.1905, (float) 19.0476 ),
+ new CoordRec((float) 30.9524, (float) 4.7619 ),
+ new CoordRec((float) 40.4762, (float) 0 ),
+ new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 64.2857, (float) 4.7619 ),
+ new CoordRec((float) 78.5715, (float) 19.0476 ),
+};
+
+static final CoordRec char117_stroke1[] = {
+ new CoordRec((float) 78.5715, (float) 66.6667 ),
+ new CoordRec((float) 78.5715, (float) 0 ),
+};
+
+static final StrokeRec char117[] = {
+ new StrokeRec( 7, char117_stroke0 ),
+ new StrokeRec( 2, char117_stroke1 ),
+};
+
+/* char: 118 'v' */
+
+static final CoordRec char118_stroke0[] = {
+ new CoordRec((float) 23.8095, (float) 66.6667 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final CoordRec char118_stroke1[] = {
+ new CoordRec((float) 80.9524, (float) 66.6667 ),
+ new CoordRec((float) 52.3809, (float) 0 ),
+};
+
+static final StrokeRec char118[] = {
+ new StrokeRec( 2, char118_stroke0 ),
+ new StrokeRec( 2, char118_stroke1 ),
+};
+
+/* char: 119 'w' */
+
+static final CoordRec char119_stroke0[] = {
+ new CoordRec((float) 14.2857, (float) 66.6667 ),
+ new CoordRec((float) 33.3333, (float) 0 ),
+};
+
+static final CoordRec char119_stroke1[] = {
+ new CoordRec((float) 52.3809, (float) 66.6667 ),
+ new CoordRec((float) 33.3333, (float) 0 ),
+};
+
+static final CoordRec char119_stroke2[] = {
+ new CoordRec((float) 52.3809, (float) 66.6667 ),
+ new CoordRec((float) 71.4286, (float) 0 ),
+};
+
+static final CoordRec char119_stroke3[] = {
+ new CoordRec((float) 90.4762, (float) 66.6667 ),
+ new CoordRec((float) 71.4286, (float) 0 ),
+};
+
+static final StrokeRec char119[] = {
+ new StrokeRec( 2, char119_stroke0 ),
+ new StrokeRec( 2, char119_stroke1 ),
+ new StrokeRec( 2, char119_stroke2 ),
+ new StrokeRec( 2, char119_stroke3 ),
+};
+
+/* char: 120 'x' */
+
+static final CoordRec char120_stroke0[] = {
+ new CoordRec((float) 26.1905, (float) 66.6667 ),
+ new CoordRec((float) 78.5715, (float) 0 ),
+};
+
+static final CoordRec char120_stroke1[] = {
+ new CoordRec((float) 78.5715, (float) 66.6667 ),
+ new CoordRec((float) 26.1905, (float) 0 ),
+};
+
+static final StrokeRec char120[] = {
+ new StrokeRec( 2, char120_stroke0 ),
+ new StrokeRec( 2, char120_stroke1 ),
+};
+
+/* char: 121 'y' */
+
+static final CoordRec char121_stroke0[] = {
+ new CoordRec((float) 26.1905, (float) 66.6667 ),
+ new CoordRec((float) 54.7619, (float) 0 ),
+};
+
+static final CoordRec char121_stroke1[] = {
+ new CoordRec((float) 83.3334, (float) 66.6667 ),
+ new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 45.2381, (float) -19.0476 ),
+ new CoordRec((float) 35.7143, (float) -28.5714 ),
+ new CoordRec((float) 26.1905, (float) -33.3333 ),
+ new CoordRec((float) 21.4286, (float) -33.3333 ),
+};
+
+static final StrokeRec char121[] = {
+ new StrokeRec( 2, char121_stroke0 ),
+ new StrokeRec( 6, char121_stroke1 ),
+};
+
+/* char: 122 'z' */
+
+static final CoordRec char122_stroke0[] = {
+ new CoordRec((float) 78.5715, (float) 66.6667 ),
+ new CoordRec((float) 26.1905, (float) 0 ),
+};
+
+static final CoordRec char122_stroke1[] = {
+ new CoordRec((float) 26.1905, (float) 66.6667 ),
+ new CoordRec((float) 78.5715, (float) 66.6667 ),
+};
+
+static final CoordRec char122_stroke2[] = {
+ new CoordRec((float) 26.1905, (float) 0 ),
+ new CoordRec((float) 78.5715, (float) 0 ),
+};
+
+static final StrokeRec char122[] = {
+ new StrokeRec( 2, char122_stroke0 ),
+ new StrokeRec( 2, char122_stroke1 ),
+ new StrokeRec( 2, char122_stroke2 ),
+};
+
+/* char: 123 '{' */
+
+static final CoordRec char123_stroke0[] = {
+ new CoordRec((float) 64.2857, (float) 119.048 ),
+ new CoordRec((float) 54.7619, (float) 114.286 ),
+ new CoordRec((float) 50, (float) 109.524 ),
+ new CoordRec((float) 45.2381, (float) 100 ),
+ new CoordRec((float) 45.2381, (float) 90.4762 ),
+ new CoordRec((float) 50, (float) 80.9524 ),
+ new CoordRec((float) 54.7619, (float) 76.1905 ),
+ new CoordRec((float) 59.5238, (float) 66.6667 ),
+ new CoordRec((float) 59.5238, (float) 57.1429 ),
+ new CoordRec((float) 50, (float) 47.619 ),
+};
+
+static final CoordRec char123_stroke1[] = {
+ new CoordRec((float) 54.7619, (float) 114.286 ),
+ new CoordRec((float) 50, (float) 104.762 ),
+ new CoordRec((float) 50, (float) 95.2381 ),
+ new CoordRec((float) 54.7619, (float) 85.7143 ),
+ new CoordRec((float) 59.5238, (float) 80.9524 ),
+ new CoordRec((float) 64.2857, (float) 71.4286 ),
+ new CoordRec((float) 64.2857, (float) 61.9048 ),
+ new CoordRec((float) 59.5238, (float) 52.381 ),
+ new CoordRec((float) 40.4762, (float) 42.8571 ),
+ new CoordRec((float) 59.5238, (float) 33.3333 ),
+ new CoordRec((float) 64.2857, (float) 23.8095 ),
+ new CoordRec((float) 64.2857, (float) 14.2857 ),
+ new CoordRec((float) 59.5238, (float) 4.7619 ),
+ new CoordRec((float) 54.7619, (float) 0 ),
+ new CoordRec((float) 50, (float) -9.5238 ),
+ new CoordRec((float) 50, (float) -19.0476 ),
+ new CoordRec((float) 54.7619, (float) -28.5714 ),
+};
+
+static final CoordRec char123_stroke2[] = {
+ new CoordRec((float) 50, (float) 38.0952 ),
+ new CoordRec((float) 59.5238, (float) 28.5714 ),
+ new CoordRec((float) 59.5238, (float) 19.0476 ),
+ new CoordRec((float) 54.7619, (float) 9.5238 ),
+ new CoordRec((float) 50, (float) 4.7619 ),
+ new CoordRec((float) 45.2381, (float) -4.7619 ),
+ new CoordRec((float) 45.2381, (float) -14.2857 ),
+ new CoordRec((float) 50, (float) -23.8095 ),
+ new CoordRec((float) 54.7619, (float) -28.5714 ),
+ new CoordRec((float) 64.2857, (float) -33.3333 ),
+};
+
+static final StrokeRec char123[] = {
+ new StrokeRec( 10, char123_stroke0 ),
+ new StrokeRec( 17, char123_stroke1 ),
+ new StrokeRec( 10, char123_stroke2 ),
+};
+
+/* char: 124 '|' */
+
+static final CoordRec char124_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 119.048 ),
+ new CoordRec((float) 52.381, (float) -33.3333 ),
+};
+
+static final StrokeRec char124[] = {
+ new StrokeRec( 2, char124_stroke0 ),
+};
+
+/* char: 125 '}' */
+
+static final CoordRec char125_stroke0[] = {
+ new CoordRec((float) 40.4762, (float) 119.048 ),
+ new CoordRec((float) 50, (float) 114.286 ),
+ new CoordRec((float) 54.7619, (float) 109.524 ),
+ new CoordRec((float) 59.5238, (float) 100 ),
+ new CoordRec((float) 59.5238, (float) 90.4762 ),
+ new CoordRec((float) 54.7619, (float) 80.9524 ),
+ new CoordRec((float) 50, (float) 76.1905 ),
+ new CoordRec((float) 45.2381, (float) 66.6667 ),
+ new CoordRec((float) 45.2381, (float) 57.1429 ),
+ new CoordRec((float) 54.7619, (float) 47.619 ),
+};
+
+static final CoordRec char125_stroke1[] = {
+ new CoordRec((float) 50, (float) 114.286 ),
+ new CoordRec((float) 54.7619, (float) 104.762 ),
+ new CoordRec((float) 54.7619, (float) 95.2381 ),
+ new CoordRec((float) 50, (float) 85.7143 ),
+ new CoordRec((float) 45.2381, (float) 80.9524 ),
+ new CoordRec((float) 40.4762, (float) 71.4286 ),
+ new CoordRec((float) 40.4762, (float) 61.9048 ),
+ new CoordRec((float) 45.2381, (float) 52.381 ),
+ new CoordRec((float) 64.2857, (float) 42.8571 ),
+ new CoordRec((float) 45.2381, (float) 33.3333 ),
+ new CoordRec((float) 40.4762, (float) 23.8095 ),
+ new CoordRec((float) 40.4762, (float) 14.2857 ),
+ new CoordRec((float) 45.2381, (float) 4.7619 ),
+ new CoordRec((float) 50, (float) 0 ),
+ new CoordRec((float) 54.7619, (float) -9.5238 ),
+ new CoordRec((float) 54.7619, (float) -19.0476 ),
+ new CoordRec((float) 50, (float) -28.5714 ),
+};
+
+static final CoordRec char125_stroke2[] = {
+ new CoordRec((float) 54.7619, (float) 38.0952 ),
+ new CoordRec((float) 45.2381, (float) 28.5714 ),
+ new CoordRec((float) 45.2381, (float) 19.0476 ),
+ new CoordRec((float) 50, (float) 9.5238 ),
+ new CoordRec((float) 54.7619, (float) 4.7619 ),
+ new CoordRec((float) 59.5238, (float) -4.7619 ),
+ new CoordRec((float) 59.5238, (float) -14.2857 ),
+ new CoordRec((float) 54.7619, (float) -23.8095 ),
+ new CoordRec((float) 50, (float) -28.5714 ),
+ new CoordRec((float) 40.4762, (float) -33.3333 ),
+};
+
+static final StrokeRec char125[] = {
+ new StrokeRec( 10, char125_stroke0 ),
+ new StrokeRec( 17, char125_stroke1 ),
+ new StrokeRec( 10, char125_stroke2 ),
+};
+
+/* char: 126 '~' */
+
+static final CoordRec char126_stroke0[] = {
+ new CoordRec((float) 9.5238, (float) 28.5714 ),
+ new CoordRec((float) 9.5238, (float) 38.0952 ),
+ new CoordRec((float) 14.2857, (float) 52.381 ),
+ new CoordRec((float) 23.8095, (float) 57.1429 ),
+ new CoordRec((float) 33.3333, (float) 57.1429 ),
+ new CoordRec((float) 42.8571, (float) 52.381 ),
+ new CoordRec((float) 61.9048, (float) 38.0952 ),
+ new CoordRec((float) 71.4286, (float) 33.3333 ),
+ new CoordRec((float) 80.9524, (float) 33.3333 ),
+ new CoordRec((float) 90.4762, (float) 38.0952 ),
+ new CoordRec((float) 95.2381, (float) 47.619 ),
+};
+
+static final CoordRec char126_stroke1[] = {
+ new CoordRec((float) 9.5238, (float) 38.0952 ),
+ new CoordRec((float) 14.2857, (float) 47.619 ),
+ new CoordRec((float) 23.8095, (float) 52.381 ),
+ new CoordRec((float) 33.3333, (float) 52.381 ),
+ new CoordRec((float) 42.8571, (float) 47.619 ),
+ new CoordRec((float) 61.9048, (float) 33.3333 ),
+ new CoordRec((float) 71.4286, (float) 28.5714 ),
+ new CoordRec((float) 80.9524, (float) 28.5714 ),
+ new CoordRec((float) 90.4762, (float) 33.3333 ),
+ new CoordRec((float) 95.2381, (float) 47.619 ),
+ new CoordRec((float) 95.2381, (float) 57.1429 ),
+};
+
+static final StrokeRec char126[] = {
+ new StrokeRec( 11, char126_stroke0 ),
+ new StrokeRec( 11, char126_stroke1 ),
+};
+
+/* char: 127 */
+
+static final CoordRec char127_stroke0[] = {
+ new CoordRec((float) 71.4286, (float) 100 ),
+ new CoordRec((float) 33.3333, (float) -33.3333 ),
+};
+
+static final CoordRec char127_stroke1[] = {
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+ new CoordRec((float) 33.3333, (float) 61.9048 ),
+ new CoordRec((float) 23.8095, (float) 52.381 ),
+ new CoordRec((float) 19.0476, (float) 38.0952 ),
+ new CoordRec((float) 19.0476, (float) 23.8095 ),
+ new CoordRec((float) 23.8095, (float) 14.2857 ),
+ new CoordRec((float) 33.3333, (float) 4.7619 ),
+ new CoordRec((float) 47.619, (float) 0 ),
+ new CoordRec((float) 57.1428, (float) 0 ),
+ new CoordRec((float) 71.4286, (float) 4.7619 ),
+ new CoordRec((float) 80.9524, (float) 14.2857 ),
+ new CoordRec((float) 85.7143, (float) 28.5714 ),
+ new CoordRec((float) 85.7143, (float) 42.8571 ),
+ new CoordRec((float) 80.9524, (float) 52.381 ),
+ new CoordRec((float) 71.4286, (float) 61.9048 ),
+ new CoordRec((float) 57.1428, (float) 66.6667 ),
+ new CoordRec((float) 47.619, (float) 66.6667 ),
+};
+
+static final StrokeRec char127[] = {
+ new StrokeRec( 2, char127_stroke0 ),
+ new StrokeRec( 17, char127_stroke1 ),
+};
+
+static final StrokeCharRec chars[] = {
+ new StrokeCharRec(0, /* char0 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char1 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char2 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char3 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char4 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char5 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char6 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char7 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char8 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char9 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char10 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char11 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char12 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char13 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char14 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char15 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char16 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char17 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char18 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char19 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char20 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char21 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char22 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char23 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char24 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char25 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char26 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char27 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char28 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char29 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char30 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char31 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec(0, /* char32 */ null, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char33, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char34, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char35, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char36, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char37, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char38, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char39, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char40, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char41, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char42, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char43, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char44, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char45, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char46, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char47, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char48, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char49, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char50, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char51, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char52, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char53, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char54, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char55, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char56, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char57, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char58, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char59, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char60, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char61, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char62, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char63, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char64, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char65, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char66, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char67, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char68, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char69, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char70, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char71, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char72, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char73, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char74, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char75, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char76, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char77, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char78, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char79, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char80, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char81, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char82, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char83, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char84, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char85, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char86, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char87, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char88, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char89, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char90, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char91, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char92, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char93, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char94, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char95, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char96, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char97, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char98, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char99, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char100, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char101, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char102, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char103, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char104, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char105, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char106, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char107, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char108, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char109, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char110, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char111, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char112, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char113, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char114, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char115, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char116, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char117, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char118, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(4, char119, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char120, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char121, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char122, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char123, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(1, char124, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(3, char125, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char126, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec(2, char127, (float) 52.381, (float) 104.762 ),
+};
+
+public static final StrokeFontRec glutStrokeMonoRoman = new StrokeFontRec( "Roman", 128, chars, (float) 119.048, (float) -33.3333 );
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java
new file mode 100644
index 000000000..e960f155a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/GLUTStrokeRoman.java
@@ -0,0 +1,2491 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+class GLUTStrokeRoman {
+
+/* GENERATED FILE -- DO NOT MODIFY */
+
+/* char: 33 '!' */
+
+static final CoordRec char33_stroke0[] = {
+ new CoordRec((float) 13.3819, (float) 100),
+ new CoordRec((float) 13.3819, (float) 33.3333),
+};
+
+static final CoordRec char33_stroke1[] = {
+ new CoordRec((float) 13.3819, (float) 9.5238),
+ new CoordRec((float) 8.62, (float) 4.7619),
+ new CoordRec((float) 13.3819, (float) 0),
+ new CoordRec((float) 18.1438, (float) 4.7619),
+ new CoordRec((float) 13.3819, (float) 9.5238),
+};
+
+static final StrokeRec char33[] = {
+ new StrokeRec(2, char33_stroke0),
+ new StrokeRec(5, char33_stroke1),
+};
+
+/* char: 34 '"' */
+
+static final CoordRec char34_stroke0[] = {
+ new CoordRec((float) 4.02, (float) 100),
+ new CoordRec((float) 4.02, (float) 66.6667),
+};
+
+static final CoordRec char34_stroke1[] = {
+ new CoordRec((float) 42.1152, (float) 100),
+ new CoordRec((float) 42.1152, (float) 66.6667),
+};
+
+static final StrokeRec char34[] = {
+ new StrokeRec(2, char34_stroke0),
+ new StrokeRec(2, char34_stroke1),
+};
+
+/* char: 35 '#' */
+
+static final CoordRec char35_stroke0[] = {
+ new CoordRec((float) 41.2952, (float) 119.048),
+ new CoordRec((float) 7.9619, (float) -33.3333),
+};
+
+static final CoordRec char35_stroke1[] = {
+ new CoordRec((float) 69.8667, (float) 119.048),
+ new CoordRec((float) 36.5333, (float) -33.3333),
+};
+
+static final CoordRec char35_stroke2[] = {
+ new CoordRec((float) 7.9619, (float) 57.1429),
+ new CoordRec((float) 74.6286, (float) 57.1429),
+};
+
+static final CoordRec char35_stroke3[] = {
+ new CoordRec((float) 3.2, (float) 28.5714),
+ new CoordRec((float) 69.8667, (float) 28.5714),
+};
+
+static final StrokeRec char35[] = {
+ new StrokeRec(2, char35_stroke0),
+ new StrokeRec(2, char35_stroke1),
+ new StrokeRec(2, char35_stroke2),
+ new StrokeRec(2, char35_stroke3),
+};
+
+/* char: 36 '$' */
+
+static final CoordRec char36_stroke0[] = {
+ new CoordRec((float) 28.6295, (float) 119.048),
+ new CoordRec((float) 28.6295, (float) -19.0476),
+};
+
+static final CoordRec char36_stroke1[] = {
+ new CoordRec((float) 47.6771, (float) 119.048),
+ new CoordRec((float) 47.6771, (float) -19.0476),
+};
+
+static final CoordRec char36_stroke2[] = {
+ new CoordRec((float) 71.4867, (float) 85.7143),
+ new CoordRec((float) 61.9629, (float) 95.2381),
+ new CoordRec((float) 47.6771, (float) 100),
+ new CoordRec((float) 28.6295, (float) 100),
+ new CoordRec((float) 14.3438, (float) 95.2381),
+ new CoordRec((float) 4.82, (float) 85.7143),
+ new CoordRec((float) 4.82, (float) 76.1905),
+ new CoordRec((float) 9.5819, (float) 66.6667),
+ new CoordRec((float) 14.3438, (float) 61.9048),
+ new CoordRec((float) 23.8676, (float) 57.1429),
+ new CoordRec((float) 52.439, (float) 47.619),
+ new CoordRec((float) 61.9629, (float) 42.8571),
+ new CoordRec((float) 66.7248, (float) 38.0952),
+ new CoordRec((float) 71.4867, (float) 28.5714),
+ new CoordRec((float) 71.4867, (float) 14.2857),
+ new CoordRec((float) 61.9629, (float) 4.7619),
+ new CoordRec((float) 47.6771, (float) 0),
+ new CoordRec((float) 28.6295, (float) 0),
+ new CoordRec((float) 14.3438, (float) 4.7619),
+ new CoordRec((float) 4.82, (float) 14.2857),
+};
+
+static final StrokeRec char36[] = {
+ new StrokeRec(2, char36_stroke0),
+ new StrokeRec(2, char36_stroke1),
+ new StrokeRec(20, char36_stroke2),
+};
+
+/* char: 37 '%' */
+
+static final CoordRec char37_stroke0[] = {
+ new CoordRec((float) 92.0743, (float) 100),
+ new CoordRec((float) 6.36, (float) 0),
+};
+
+static final CoordRec char37_stroke1[] = {
+ new CoordRec((float) 30.1695, (float) 100),
+ new CoordRec((float) 39.6933, (float) 90.4762),
+ new CoordRec((float) 39.6933, (float) 80.9524),
+ new CoordRec((float) 34.9314, (float) 71.4286),
+ new CoordRec((float) 25.4076, (float) 66.6667),
+ new CoordRec((float) 15.8838, (float) 66.6667),
+ new CoordRec((float) 6.36, (float) 76.1905),
+ new CoordRec((float) 6.36, (float) 85.7143),
+ new CoordRec((float) 11.1219, (float) 95.2381),
+ new CoordRec((float) 20.6457, (float) 100),
+ new CoordRec((float) 30.1695, (float) 100),
+ new CoordRec((float) 39.6933, (float) 95.2381),
+ new CoordRec((float) 53.979, (float) 90.4762),
+ new CoordRec((float) 68.2648, (float) 90.4762),
+ new CoordRec((float) 82.5505, (float) 95.2381),
+ new CoordRec((float) 92.0743, (float) 100),
+};
+
+static final CoordRec char37_stroke2[] = {
+ new CoordRec((float) 73.0267, (float) 33.3333),
+ new CoordRec((float) 63.5029, (float) 28.5714),
+ new CoordRec((float) 58.741, (float) 19.0476),
+ new CoordRec((float) 58.741, (float) 9.5238),
+ new CoordRec((float) 68.2648, (float) 0),
+ new CoordRec((float) 77.7886, (float) 0),
+ new CoordRec((float) 87.3124, (float) 4.7619),
+ new CoordRec((float) 92.0743, (float) 14.2857),
+ new CoordRec((float) 92.0743, (float) 23.8095),
+ new CoordRec((float) 82.5505, (float) 33.3333),
+ new CoordRec((float) 73.0267, (float) 33.3333),
+};
+
+static final StrokeRec char37[] = {
+ new StrokeRec(2, char37_stroke0),
+ new StrokeRec(16, char37_stroke1),
+ new StrokeRec(11, char37_stroke2),
+};
+
+/* char: 38 '&' */
+
+static final CoordRec char38_stroke0[] = {
+ new CoordRec((float) 101.218, (float) 57.1429),
+ new CoordRec((float) 101.218, (float) 61.9048),
+ new CoordRec((float) 96.4562, (float) 66.6667),
+ new CoordRec((float) 91.6943, (float) 66.6667),
+ new CoordRec((float) 86.9324, (float) 61.9048),
+ new CoordRec((float) 82.1705, (float) 52.381),
+ new CoordRec((float) 72.6467, (float) 28.5714),
+ new CoordRec((float) 63.1229, (float) 14.2857),
+ new CoordRec((float) 53.599, (float) 4.7619),
+ new CoordRec((float) 44.0752, (float) 0),
+ new CoordRec((float) 25.0276, (float) 0),
+ new CoordRec((float) 15.5038, (float) 4.7619),
+ new CoordRec((float) 10.7419, (float) 9.5238),
+ new CoordRec((float) 5.98, (float) 19.0476),
+ new CoordRec((float) 5.98, (float) 28.5714),
+ new CoordRec((float) 10.7419, (float) 38.0952),
+ new CoordRec((float) 15.5038, (float) 42.8571),
+ new CoordRec((float) 48.8371, (float) 61.9048),
+ new CoordRec((float) 53.599, (float) 66.6667),
+ new CoordRec((float) 58.361, (float) 76.1905),
+ new CoordRec((float) 58.361, (float) 85.7143),
+ new CoordRec((float) 53.599, (float) 95.2381),
+ new CoordRec((float) 44.0752, (float) 100),
+ new CoordRec((float) 34.5514, (float) 95.2381),
+ new CoordRec((float) 29.7895, (float) 85.7143),
+ new CoordRec((float) 29.7895, (float) 76.1905),
+ new CoordRec((float) 34.5514, (float) 61.9048),
+ new CoordRec((float) 44.0752, (float) 47.619),
+ new CoordRec((float) 67.8848, (float) 14.2857),
+ new CoordRec((float) 77.4086, (float) 4.7619),
+ new CoordRec((float) 86.9324, (float) 0),
+ new CoordRec((float) 96.4562, (float) 0),
+ new CoordRec((float) 101.218, (float) 4.7619),
+ new CoordRec((float) 101.218, (float) 9.5238),
+};
+
+static final StrokeRec char38[] = {
+ new StrokeRec(34, char38_stroke0),
+};
+
+/* char: 39 ''' */
+
+static final CoordRec char39_stroke0[] = {
+ new CoordRec((float) 4.44, (float) 100),
+ new CoordRec((float) 4.44, (float) 66.6667),
+};
+
+static final StrokeRec char39[] = {
+ new StrokeRec(2, char39_stroke0),
+};
+
+/* char: 40 '(' */
+
+static final CoordRec char40_stroke0[] = {
+ new CoordRec((float) 40.9133, (float) 119.048),
+ new CoordRec((float) 31.3895, (float) 109.524),
+ new CoordRec((float) 21.8657, (float) 95.2381),
+ new CoordRec((float) 12.3419, (float) 76.1905),
+ new CoordRec((float) 7.58, (float) 52.381),
+ new CoordRec((float) 7.58, (float) 33.3333),
+ new CoordRec((float) 12.3419, (float) 9.5238),
+ new CoordRec((float) 21.8657, (float) -9.5238),
+ new CoordRec((float) 31.3895, (float) -23.8095),
+ new CoordRec((float) 40.9133, (float) -33.3333),
+};
+
+static final StrokeRec char40[] = {
+ new StrokeRec(10, char40_stroke0),
+};
+
+/* char: 41 ')' */
+
+static final CoordRec char41_stroke0[] = {
+ new CoordRec((float) 5.28, (float) 119.048),
+ new CoordRec((float) 14.8038, (float) 109.524),
+ new CoordRec((float) 24.3276, (float) 95.2381),
+ new CoordRec((float) 33.8514, (float) 76.1905),
+ new CoordRec((float) 38.6133, (float) 52.381),
+ new CoordRec((float) 38.6133, (float) 33.3333),
+ new CoordRec((float) 33.8514, (float) 9.5238),
+ new CoordRec((float) 24.3276, (float) -9.5238),
+ new CoordRec((float) 14.8038, (float) -23.8095),
+ new CoordRec((float) 5.28, (float) -33.3333),
+};
+
+static final StrokeRec char41[] = {
+ new StrokeRec(10, char41_stroke0),
+};
+
+/* char: 42 '*' */
+
+static final CoordRec char42_stroke0[] = {
+ new CoordRec((float) 30.7695, (float) 71.4286),
+ new CoordRec((float) 30.7695, (float) 14.2857),
+};
+
+static final CoordRec char42_stroke1[] = {
+ new CoordRec((float) 6.96, (float) 57.1429),
+ new CoordRec((float) 54.579, (float) 28.5714),
+};
+
+static final CoordRec char42_stroke2[] = {
+ new CoordRec((float) 54.579, (float) 57.1429),
+ new CoordRec((float) 6.96, (float) 28.5714),
+};
+
+static final StrokeRec char42[] = {
+ new StrokeRec(2, char42_stroke0),
+ new StrokeRec(2, char42_stroke1),
+ new StrokeRec(2, char42_stroke2),
+};
+
+/* char: 43 '+' */
+
+static final CoordRec char43_stroke0[] = {
+ new CoordRec((float) 48.8371, (float) 85.7143),
+ new CoordRec((float) 48.8371, (float) 0),
+};
+
+static final CoordRec char43_stroke1[] = {
+ new CoordRec((float) 5.98, (float) 42.8571),
+ new CoordRec((float) 91.6943, (float) 42.8571),
+};
+
+static final StrokeRec char43[] = {
+ new StrokeRec(2, char43_stroke0),
+ new StrokeRec(2, char43_stroke1),
+};
+
+/* char: 44 ',' */
+
+static final CoordRec char44_stroke0[] = {
+ new CoordRec((float) 18.2838, (float) 4.7619),
+ new CoordRec((float) 13.5219, (float) 0),
+ new CoordRec((float) 8.76, (float) 4.7619),
+ new CoordRec((float) 13.5219, (float) 9.5238),
+ new CoordRec((float) 18.2838, (float) 4.7619),
+ new CoordRec((float) 18.2838, (float) -4.7619),
+ new CoordRec((float) 13.5219, (float) -14.2857),
+ new CoordRec((float) 8.76, (float) -19.0476),
+};
+
+static final StrokeRec char44[] = {
+ new StrokeRec(8, char44_stroke0),
+};
+
+/* char: 45 '-' */
+
+static final CoordRec char45_stroke0[] = {
+ new CoordRec((float) 7.38, (float) 42.8571),
+ new CoordRec((float) 93.0943, (float) 42.8571),
+};
+
+static final StrokeRec char45[] = {
+ new StrokeRec(2, char45_stroke0),
+};
+
+/* char: 46 '.' */
+
+static final CoordRec char46_stroke0[] = {
+ new CoordRec((float) 13.1019, (float) 9.5238),
+ new CoordRec((float) 8.34, (float) 4.7619),
+ new CoordRec((float) 13.1019, (float) 0),
+ new CoordRec((float) 17.8638, (float) 4.7619),
+ new CoordRec((float) 13.1019, (float) 9.5238),
+};
+
+static final StrokeRec char46[] = {
+ new StrokeRec(5, char46_stroke0),
+};
+
+/* char: 47 '/' */
+
+static final CoordRec char47_stroke0[] = {
+ new CoordRec((float) 7.24, (float) -14.2857),
+ new CoordRec((float) 73.9067, (float) 100),
+};
+
+static final StrokeRec char47[] = {
+ new StrokeRec(2, char47_stroke0),
+};
+
+/* char: 48 '0' */
+
+static final CoordRec char48_stroke0[] = {
+ new CoordRec((float) 33.5514, (float) 100),
+ new CoordRec((float) 19.2657, (float) 95.2381),
+ new CoordRec((float) 9.7419, (float) 80.9524),
+ new CoordRec((float) 4.98, (float) 57.1429),
+ new CoordRec((float) 4.98, (float) 42.8571),
+ new CoordRec((float) 9.7419, (float) 19.0476),
+ new CoordRec((float) 19.2657, (float) 4.7619),
+ new CoordRec((float) 33.5514, (float) 0),
+ new CoordRec((float) 43.0752, (float) 0),
+ new CoordRec((float) 57.361, (float) 4.7619),
+ new CoordRec((float) 66.8848, (float) 19.0476),
+ new CoordRec((float) 71.6467, (float) 42.8571),
+ new CoordRec((float) 71.6467, (float) 57.1429),
+ new CoordRec((float) 66.8848, (float) 80.9524),
+ new CoordRec((float) 57.361, (float) 95.2381),
+ new CoordRec((float) 43.0752, (float) 100),
+ new CoordRec((float) 33.5514, (float) 100),
+};
+
+static final StrokeRec char48[] = {
+ new StrokeRec(17, char48_stroke0),
+};
+
+/* char: 49 '1' */
+
+static final CoordRec char49_stroke0[] = {
+ new CoordRec((float) 11.82, (float) 80.9524),
+ new CoordRec((float) 21.3438, (float) 85.7143),
+ new CoordRec((float) 35.6295, (float) 100),
+ new CoordRec((float) 35.6295, (float) 0),
+};
+
+static final StrokeRec char49[] = {
+ new StrokeRec(4, char49_stroke0),
+};
+
+/* char: 50 '2' */
+
+static final CoordRec char50_stroke0[] = {
+ new CoordRec((float) 10.1819, (float) 76.1905),
+ new CoordRec((float) 10.1819, (float) 80.9524),
+ new CoordRec((float) 14.9438, (float) 90.4762),
+ new CoordRec((float) 19.7057, (float) 95.2381),
+ new CoordRec((float) 29.2295, (float) 100),
+ new CoordRec((float) 48.2771, (float) 100),
+ new CoordRec((float) 57.801, (float) 95.2381),
+ new CoordRec((float) 62.5629, (float) 90.4762),
+ new CoordRec((float) 67.3248, (float) 80.9524),
+ new CoordRec((float) 67.3248, (float) 71.4286),
+ new CoordRec((float) 62.5629, (float) 61.9048),
+ new CoordRec((float) 53.039, (float) 47.619),
+ new CoordRec((float) 5.42, (float) 0),
+ new CoordRec((float) 72.0867, (float) 0),
+};
+
+static final StrokeRec char50[] = {
+ new StrokeRec(14, char50_stroke0),
+};
+
+/* char: 51 '3' */
+
+static final CoordRec char51_stroke0[] = {
+ new CoordRec((float) 14.5238, (float) 100),
+ new CoordRec((float) 66.9048, (float) 100),
+ new CoordRec((float) 38.3333, (float) 61.9048),
+ new CoordRec((float) 52.619, (float) 61.9048),
+ new CoordRec((float) 62.1429, (float) 57.1429),
+ new CoordRec((float) 66.9048, (float) 52.381),
+ new CoordRec((float) 71.6667, (float) 38.0952),
+ new CoordRec((float) 71.6667, (float) 28.5714),
+ new CoordRec((float) 66.9048, (float) 14.2857),
+ new CoordRec((float) 57.381, (float) 4.7619),
+ new CoordRec((float) 43.0952, (float) 0),
+ new CoordRec((float) 28.8095, (float) 0),
+ new CoordRec((float) 14.5238, (float) 4.7619),
+ new CoordRec((float) 9.7619, (float) 9.5238),
+ new CoordRec((float) 5, (float) 19.0476),
+};
+
+static final StrokeRec char51[] = {
+ new StrokeRec(15, char51_stroke0),
+};
+
+/* char: 52 '4' */
+
+static final CoordRec char52_stroke0[] = {
+ new CoordRec((float) 51.499, (float) 100),
+ new CoordRec((float) 3.88, (float) 33.3333),
+ new CoordRec((float) 75.3086, (float) 33.3333),
+};
+
+static final CoordRec char52_stroke1[] = {
+ new CoordRec((float) 51.499, (float) 100),
+ new CoordRec((float) 51.499, (float) 0),
+};
+
+static final StrokeRec char52[] = {
+ new StrokeRec(3, char52_stroke0),
+ new StrokeRec(2, char52_stroke1),
+};
+
+/* char: 53 '5' */
+
+static final CoordRec char53_stroke0[] = {
+ new CoordRec((float) 62.0029, (float) 100),
+ new CoordRec((float) 14.3838, (float) 100),
+ new CoordRec((float) 9.6219, (float) 57.1429),
+ new CoordRec((float) 14.3838, (float) 61.9048),
+ new CoordRec((float) 28.6695, (float) 66.6667),
+ new CoordRec((float) 42.9552, (float) 66.6667),
+ new CoordRec((float) 57.241, (float) 61.9048),
+ new CoordRec((float) 66.7648, (float) 52.381),
+ new CoordRec((float) 71.5267, (float) 38.0952),
+ new CoordRec((float) 71.5267, (float) 28.5714),
+ new CoordRec((float) 66.7648, (float) 14.2857),
+ new CoordRec((float) 57.241, (float) 4.7619),
+ new CoordRec((float) 42.9552, (float) 0),
+ new CoordRec((float) 28.6695, (float) 0),
+ new CoordRec((float) 14.3838, (float) 4.7619),
+ new CoordRec((float) 9.6219, (float) 9.5238),
+ new CoordRec((float) 4.86, (float) 19.0476),
+};
+
+static final StrokeRec char53[] = {
+ new StrokeRec(17, char53_stroke0),
+};
+
+/* char: 54 '6' */
+
+static final CoordRec char54_stroke0[] = {
+ new CoordRec((float) 62.7229, (float) 85.7143),
+ new CoordRec((float) 57.961, (float) 95.2381),
+ new CoordRec((float) 43.6752, (float) 100),
+ new CoordRec((float) 34.1514, (float) 100),
+ new CoordRec((float) 19.8657, (float) 95.2381),
+ new CoordRec((float) 10.3419, (float) 80.9524),
+ new CoordRec((float) 5.58, (float) 57.1429),
+ new CoordRec((float) 5.58, (float) 33.3333),
+ new CoordRec((float) 10.3419, (float) 14.2857),
+ new CoordRec((float) 19.8657, (float) 4.7619),
+ new CoordRec((float) 34.1514, (float) 0),
+ new CoordRec((float) 38.9133, (float) 0),
+ new CoordRec((float) 53.199, (float) 4.7619),
+ new CoordRec((float) 62.7229, (float) 14.2857),
+ new CoordRec((float) 67.4848, (float) 28.5714),
+ new CoordRec((float) 67.4848, (float) 33.3333),
+ new CoordRec((float) 62.7229, (float) 47.619),
+ new CoordRec((float) 53.199, (float) 57.1429),
+ new CoordRec((float) 38.9133, (float) 61.9048),
+ new CoordRec((float) 34.1514, (float) 61.9048),
+ new CoordRec((float) 19.8657, (float) 57.1429),
+ new CoordRec((float) 10.3419, (float) 47.619),
+ new CoordRec((float) 5.58, (float) 33.3333),
+};
+
+static final StrokeRec char54[] = {
+ new StrokeRec(23, char54_stroke0),
+};
+
+/* char: 55 '7' */
+
+static final CoordRec char55_stroke0[] = {
+ new CoordRec((float) 72.2267, (float) 100),
+ new CoordRec((float) 24.6076, (float) 0),
+};
+
+static final CoordRec char55_stroke1[] = {
+ new CoordRec((float) 5.56, (float) 100),
+ new CoordRec((float) 72.2267, (float) 100),
+};
+
+static final StrokeRec char55[] = {
+ new StrokeRec(2, char55_stroke0),
+ new StrokeRec(2, char55_stroke1),
+};
+
+/* char: 56 '8' */
+
+static final CoordRec char56_stroke0[] = {
+ new CoordRec((float) 29.4095, (float) 100),
+ new CoordRec((float) 15.1238, (float) 95.2381),
+ new CoordRec((float) 10.3619, (float) 85.7143),
+ new CoordRec((float) 10.3619, (float) 76.1905),
+ new CoordRec((float) 15.1238, (float) 66.6667),
+ new CoordRec((float) 24.6476, (float) 61.9048),
+ new CoordRec((float) 43.6952, (float) 57.1429),
+ new CoordRec((float) 57.981, (float) 52.381),
+ new CoordRec((float) 67.5048, (float) 42.8571),
+ new CoordRec((float) 72.2667, (float) 33.3333),
+ new CoordRec((float) 72.2667, (float) 19.0476),
+ new CoordRec((float) 67.5048, (float) 9.5238),
+ new CoordRec((float) 62.7429, (float) 4.7619),
+ new CoordRec((float) 48.4571, (float) 0),
+ new CoordRec((float) 29.4095, (float) 0),
+ new CoordRec((float) 15.1238, (float) 4.7619),
+ new CoordRec((float) 10.3619, (float) 9.5238),
+ new CoordRec((float) 5.6, (float) 19.0476),
+ new CoordRec((float) 5.6, (float) 33.3333),
+ new CoordRec((float) 10.3619, (float) 42.8571),
+ new CoordRec((float) 19.8857, (float) 52.381),
+ new CoordRec((float) 34.1714, (float) 57.1429),
+ new CoordRec((float) 53.219, (float) 61.9048),
+ new CoordRec((float) 62.7429, (float) 66.6667),
+ new CoordRec((float) 67.5048, (float) 76.1905),
+ new CoordRec((float) 67.5048, (float) 85.7143),
+ new CoordRec((float) 62.7429, (float) 95.2381),
+ new CoordRec((float) 48.4571, (float) 100),
+ new CoordRec((float) 29.4095, (float) 100),
+};
+
+static final StrokeRec char56[] = {
+ new StrokeRec(29, char56_stroke0),
+};
+
+/* char: 57 '9' */
+
+static final CoordRec char57_stroke0[] = {
+ new CoordRec((float) 68.5048, (float) 66.6667),
+ new CoordRec((float) 63.7429, (float) 52.381),
+ new CoordRec((float) 54.219, (float) 42.8571),
+ new CoordRec((float) 39.9333, (float) 38.0952),
+ new CoordRec((float) 35.1714, (float) 38.0952),
+ new CoordRec((float) 20.8857, (float) 42.8571),
+ new CoordRec((float) 11.3619, (float) 52.381),
+ new CoordRec((float) 6.6, (float) 66.6667),
+ new CoordRec((float) 6.6, (float) 71.4286),
+ new CoordRec((float) 11.3619, (float) 85.7143),
+ new CoordRec((float) 20.8857, (float) 95.2381),
+ new CoordRec((float) 35.1714, (float) 100),
+ new CoordRec((float) 39.9333, (float) 100),
+ new CoordRec((float) 54.219, (float) 95.2381),
+ new CoordRec((float) 63.7429, (float) 85.7143),
+ new CoordRec((float) 68.5048, (float) 66.6667),
+ new CoordRec((float) 68.5048, (float) 42.8571),
+ new CoordRec((float) 63.7429, (float) 19.0476),
+ new CoordRec((float) 54.219, (float) 4.7619),
+ new CoordRec((float) 39.9333, (float) 0),
+ new CoordRec((float) 30.4095, (float) 0),
+ new CoordRec((float) 16.1238, (float) 4.7619),
+ new CoordRec((float) 11.3619, (float) 14.2857),
+};
+
+static final StrokeRec char57[] = {
+ new StrokeRec(23, char57_stroke0),
+};
+
+/* char: 58 ':' */
+
+static final CoordRec char58_stroke0[] = {
+ new CoordRec((float) 14.0819, (float) 66.6667),
+ new CoordRec((float) 9.32, (float) 61.9048),
+ new CoordRec((float) 14.0819, (float) 57.1429),
+ new CoordRec((float) 18.8438, (float) 61.9048),
+ new CoordRec((float) 14.0819, (float) 66.6667),
+};
+
+static final CoordRec char58_stroke1[] = {
+ new CoordRec((float) 14.0819, (float) 9.5238),
+ new CoordRec((float) 9.32, (float) 4.7619),
+ new CoordRec((float) 14.0819, (float) 0),
+ new CoordRec((float) 18.8438, (float) 4.7619),
+ new CoordRec((float) 14.0819, (float) 9.5238),
+};
+
+static final StrokeRec char58[] = {
+ new StrokeRec(5, char58_stroke0),
+ new StrokeRec(5, char58_stroke1),
+};
+
+/* char: 59 ';' */
+
+static final CoordRec char59_stroke0[] = {
+ new CoordRec((float) 12.9619, (float) 66.6667),
+ new CoordRec((float) 8.2, (float) 61.9048),
+ new CoordRec((float) 12.9619, (float) 57.1429),
+ new CoordRec((float) 17.7238, (float) 61.9048),
+ new CoordRec((float) 12.9619, (float) 66.6667),
+};
+
+static final CoordRec char59_stroke1[] = {
+ new CoordRec((float) 17.7238, (float) 4.7619),
+ new CoordRec((float) 12.9619, (float) 0),
+ new CoordRec((float) 8.2, (float) 4.7619),
+ new CoordRec((float) 12.9619, (float) 9.5238),
+ new CoordRec((float) 17.7238, (float) 4.7619),
+ new CoordRec((float) 17.7238, (float) -4.7619),
+ new CoordRec((float) 12.9619, (float) -14.2857),
+ new CoordRec((float) 8.2, (float) -19.0476),
+};
+
+static final StrokeRec char59[] = {
+ new StrokeRec(5, char59_stroke0),
+ new StrokeRec(8, char59_stroke1),
+};
+
+/* char: 60 '<' */
+
+static final CoordRec char60_stroke0[] = {
+ new CoordRec((float) 79.2505, (float) 85.7143),
+ new CoordRec((float) 3.06, (float) 42.8571),
+ new CoordRec((float) 79.2505, (float) 0),
+};
+
+static final StrokeRec char60[] = {
+ new StrokeRec(3, char60_stroke0),
+};
+
+/* char: 61 '=' */
+
+static final CoordRec char61_stroke0[] = {
+ new CoordRec((float) 5.7, (float) 57.1429),
+ new CoordRec((float) 91.4143, (float) 57.1429),
+};
+
+static final CoordRec char61_stroke1[] = {
+ new CoordRec((float) 5.7, (float) 28.5714),
+ new CoordRec((float) 91.4143, (float) 28.5714),
+};
+
+static final StrokeRec char61[] = {
+ new StrokeRec(2, char61_stroke0),
+ new StrokeRec(2, char61_stroke1),
+};
+
+/* char: 62 '>' */
+
+static final CoordRec char62_stroke0[] = {
+ new CoordRec((float) 2.78, (float) 85.7143),
+ new CoordRec((float) 78.9705, (float) 42.8571),
+ new CoordRec((float) 2.78, (float) 0),
+};
+
+static final StrokeRec char62[] = {
+ new StrokeRec(3, char62_stroke0),
+};
+
+/* char: 63 '?' */
+
+static final CoordRec char63_stroke0[] = {
+ new CoordRec((float) 8.42, (float) 76.1905),
+ new CoordRec((float) 8.42, (float) 80.9524),
+ new CoordRec((float) 13.1819, (float) 90.4762),
+ new CoordRec((float) 17.9438, (float) 95.2381),
+ new CoordRec((float) 27.4676, (float) 100),
+ new CoordRec((float) 46.5152, (float) 100),
+ new CoordRec((float) 56.039, (float) 95.2381),
+ new CoordRec((float) 60.801, (float) 90.4762),
+ new CoordRec((float) 65.5629, (float) 80.9524),
+ new CoordRec((float) 65.5629, (float) 71.4286),
+ new CoordRec((float) 60.801, (float) 61.9048),
+ new CoordRec((float) 56.039, (float) 57.1429),
+ new CoordRec((float) 36.9914, (float) 47.619),
+ new CoordRec((float) 36.9914, (float) 33.3333),
+};
+
+static final CoordRec char63_stroke1[] = {
+ new CoordRec((float) 36.9914, (float) 9.5238),
+ new CoordRec((float) 32.2295, (float) 4.7619),
+ new CoordRec((float) 36.9914, (float) 0),
+ new CoordRec((float) 41.7533, (float) 4.7619),
+ new CoordRec((float) 36.9914, (float) 9.5238),
+};
+
+static final StrokeRec char63[] = {
+ new StrokeRec(14, char63_stroke0),
+ new StrokeRec(5, char63_stroke1),
+};
+
+/* char: 64 '@' */
+
+static final CoordRec char64_stroke0[] = {
+ new CoordRec((float) 49.2171, (float) 52.381),
+ new CoordRec((float) 39.6933, (float) 57.1429),
+ new CoordRec((float) 30.1695, (float) 57.1429),
+ new CoordRec((float) 25.4076, (float) 47.619),
+ new CoordRec((float) 25.4076, (float) 42.8571),
+ new CoordRec((float) 30.1695, (float) 33.3333),
+ new CoordRec((float) 39.6933, (float) 33.3333),
+ new CoordRec((float) 49.2171, (float) 38.0952),
+};
+
+static final CoordRec char64_stroke1[] = {
+ new CoordRec((float) 49.2171, (float) 57.1429),
+ new CoordRec((float) 49.2171, (float) 38.0952),
+ new CoordRec((float) 53.979, (float) 33.3333),
+ new CoordRec((float) 63.5029, (float) 33.3333),
+ new CoordRec((float) 68.2648, (float) 42.8571),
+ new CoordRec((float) 68.2648, (float) 47.619),
+ new CoordRec((float) 63.5029, (float) 61.9048),
+ new CoordRec((float) 53.979, (float) 71.4286),
+ new CoordRec((float) 39.6933, (float) 76.1905),
+ new CoordRec((float) 34.9314, (float) 76.1905),
+ new CoordRec((float) 20.6457, (float) 71.4286),
+ new CoordRec((float) 11.1219, (float) 61.9048),
+ new CoordRec((float) 6.36, (float) 47.619),
+ new CoordRec((float) 6.36, (float) 42.8571),
+ new CoordRec((float) 11.1219, (float) 28.5714),
+ new CoordRec((float) 20.6457, (float) 19.0476),
+ new CoordRec((float) 34.9314, (float) 14.2857),
+ new CoordRec((float) 39.6933, (float) 14.2857),
+ new CoordRec((float) 53.979, (float) 19.0476),
+};
+
+static final StrokeRec char64[] = {
+ new StrokeRec(8, char64_stroke0),
+ new StrokeRec(19, char64_stroke1),
+};
+
+/* char: 65 'A' */
+
+static final CoordRec char65_stroke0[] = {
+ new CoordRec((float) 40.5952, (float) 100),
+ new CoordRec((float) 2.5, (float) 0),
+};
+
+static final CoordRec char65_stroke1[] = {
+ new CoordRec((float) 40.5952, (float) 100),
+ new CoordRec((float) 78.6905, (float) 0),
+};
+
+static final CoordRec char65_stroke2[] = {
+ new CoordRec((float) 16.7857, (float) 33.3333),
+ new CoordRec((float) 64.4048, (float) 33.3333),
+};
+
+static final StrokeRec char65[] = {
+ new StrokeRec(2, char65_stroke0),
+ new StrokeRec(2, char65_stroke1),
+ new StrokeRec(2, char65_stroke2),
+};
+
+/* char: 66 'B' */
+
+static final CoordRec char66_stroke0[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 11.42, (float) 0),
+};
+
+static final CoordRec char66_stroke1[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 54.2771, (float) 100),
+ new CoordRec((float) 68.5629, (float) 95.2381),
+ new CoordRec((float) 73.3248, (float) 90.4762),
+ new CoordRec((float) 78.0867, (float) 80.9524),
+ new CoordRec((float) 78.0867, (float) 71.4286),
+ new CoordRec((float) 73.3248, (float) 61.9048),
+ new CoordRec((float) 68.5629, (float) 57.1429),
+ new CoordRec((float) 54.2771, (float) 52.381),
+};
+
+static final CoordRec char66_stroke2[] = {
+ new CoordRec((float) 11.42, (float) 52.381),
+ new CoordRec((float) 54.2771, (float) 52.381),
+ new CoordRec((float) 68.5629, (float) 47.619),
+ new CoordRec((float) 73.3248, (float) 42.8571),
+ new CoordRec((float) 78.0867, (float) 33.3333),
+ new CoordRec((float) 78.0867, (float) 19.0476),
+ new CoordRec((float) 73.3248, (float) 9.5238),
+ new CoordRec((float) 68.5629, (float) 4.7619),
+ new CoordRec((float) 54.2771, (float) 0),
+ new CoordRec((float) 11.42, (float) 0),
+};
+
+static final StrokeRec char66[] = {
+ new StrokeRec(2, char66_stroke0),
+ new StrokeRec(9, char66_stroke1),
+ new StrokeRec(10, char66_stroke2),
+};
+
+/* char: 67 'C' */
+
+static final CoordRec char67_stroke0[] = {
+ new CoordRec((float) 78.0886, (float) 76.1905),
+ new CoordRec((float) 73.3267, (float) 85.7143),
+ new CoordRec((float) 63.8029, (float) 95.2381),
+ new CoordRec((float) 54.279, (float) 100),
+ new CoordRec((float) 35.2314, (float) 100),
+ new CoordRec((float) 25.7076, (float) 95.2381),
+ new CoordRec((float) 16.1838, (float) 85.7143),
+ new CoordRec((float) 11.4219, (float) 76.1905),
+ new CoordRec((float) 6.66, (float) 61.9048),
+ new CoordRec((float) 6.66, (float) 38.0952),
+ new CoordRec((float) 11.4219, (float) 23.8095),
+ new CoordRec((float) 16.1838, (float) 14.2857),
+ new CoordRec((float) 25.7076, (float) 4.7619),
+ new CoordRec((float) 35.2314, (float) 0),
+ new CoordRec((float) 54.279, (float) 0),
+ new CoordRec((float) 63.8029, (float) 4.7619),
+ new CoordRec((float) 73.3267, (float) 14.2857),
+ new CoordRec((float) 78.0886, (float) 23.8095),
+};
+
+static final StrokeRec char67[] = {
+ new StrokeRec(18, char67_stroke0),
+};
+
+/* char: 68 'D' */
+
+static final CoordRec char68_stroke0[] = {
+ new CoordRec((float) 11.96, (float) 100),
+ new CoordRec((float) 11.96, (float) 0),
+};
+
+static final CoordRec char68_stroke1[] = {
+ new CoordRec((float) 11.96, (float) 100),
+ new CoordRec((float) 45.2933, (float) 100),
+ new CoordRec((float) 59.579, (float) 95.2381),
+ new CoordRec((float) 69.1029, (float) 85.7143),
+ new CoordRec((float) 73.8648, (float) 76.1905),
+ new CoordRec((float) 78.6267, (float) 61.9048),
+ new CoordRec((float) 78.6267, (float) 38.0952),
+ new CoordRec((float) 73.8648, (float) 23.8095),
+ new CoordRec((float) 69.1029, (float) 14.2857),
+ new CoordRec((float) 59.579, (float) 4.7619),
+ new CoordRec((float) 45.2933, (float) 0),
+ new CoordRec((float) 11.96, (float) 0),
+};
+
+static final StrokeRec char68[] = {
+ new StrokeRec(2, char68_stroke0),
+ new StrokeRec(12, char68_stroke1),
+};
+
+/* char: 69 'E' */
+
+static final CoordRec char69_stroke0[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 11.42, (float) 0),
+};
+
+static final CoordRec char69_stroke1[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 73.3248, (float) 100),
+};
+
+static final CoordRec char69_stroke2[] = {
+ new CoordRec((float) 11.42, (float) 52.381),
+ new CoordRec((float) 49.5152, (float) 52.381),
+};
+
+static final CoordRec char69_stroke3[] = {
+ new CoordRec((float) 11.42, (float) 0),
+ new CoordRec((float) 73.3248, (float) 0),
+};
+
+static final StrokeRec char69[] = {
+ new StrokeRec(2, char69_stroke0),
+ new StrokeRec(2, char69_stroke1),
+ new StrokeRec(2, char69_stroke2),
+ new StrokeRec(2, char69_stroke3),
+};
+
+/* char: 70 'F' */
+
+static final CoordRec char70_stroke0[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 11.42, (float) 0),
+};
+
+static final CoordRec char70_stroke1[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 73.3248, (float) 100),
+};
+
+static final CoordRec char70_stroke2[] = {
+ new CoordRec((float) 11.42, (float) 52.381),
+ new CoordRec((float) 49.5152, (float) 52.381),
+};
+
+static final StrokeRec char70[] = {
+ new StrokeRec(2, char70_stroke0),
+ new StrokeRec(2, char70_stroke1),
+ new StrokeRec(2, char70_stroke2),
+};
+
+/* char: 71 'G' */
+
+static final CoordRec char71_stroke0[] = {
+ new CoordRec((float) 78.4886, (float) 76.1905),
+ new CoordRec((float) 73.7267, (float) 85.7143),
+ new CoordRec((float) 64.2029, (float) 95.2381),
+ new CoordRec((float) 54.679, (float) 100),
+ new CoordRec((float) 35.6314, (float) 100),
+ new CoordRec((float) 26.1076, (float) 95.2381),
+ new CoordRec((float) 16.5838, (float) 85.7143),
+ new CoordRec((float) 11.8219, (float) 76.1905),
+ new CoordRec((float) 7.06, (float) 61.9048),
+ new CoordRec((float) 7.06, (float) 38.0952),
+ new CoordRec((float) 11.8219, (float) 23.8095),
+ new CoordRec((float) 16.5838, (float) 14.2857),
+ new CoordRec((float) 26.1076, (float) 4.7619),
+ new CoordRec((float) 35.6314, (float) 0),
+ new CoordRec((float) 54.679, (float) 0),
+ new CoordRec((float) 64.2029, (float) 4.7619),
+ new CoordRec((float) 73.7267, (float) 14.2857),
+ new CoordRec((float) 78.4886, (float) 23.8095),
+ new CoordRec((float) 78.4886, (float) 38.0952),
+};
+
+static final CoordRec char71_stroke1[] = {
+ new CoordRec((float) 54.679, (float) 38.0952),
+ new CoordRec((float) 78.4886, (float) 38.0952),
+};
+
+static final StrokeRec char71[] = {
+ new StrokeRec(19, char71_stroke0),
+ new StrokeRec(2, char71_stroke1),
+};
+
+/* char: 72 'H' */
+
+static final CoordRec char72_stroke0[] = {
+ new CoordRec((float) 11.42, (float) 100),
+ new CoordRec((float) 11.42, (float) 0),
+};
+
+static final CoordRec char72_stroke1[] = {
+ new CoordRec((float) 78.0867, (float) 100),
+ new CoordRec((float) 78.0867, (float) 0),
+};
+
+static final CoordRec char72_stroke2[] = {
+ new CoordRec((float) 11.42, (float) 52.381),
+ new CoordRec((float) 78.0867, (float) 52.381),
+};
+
+static final StrokeRec char72[] = {
+ new StrokeRec(2, char72_stroke0),
+ new StrokeRec(2, char72_stroke1),
+ new StrokeRec(2, char72_stroke2),
+};
+
+/* char: 73 'I' */
+
+static final CoordRec char73_stroke0[] = {
+ new CoordRec((float) 10.86, (float) 100),
+ new CoordRec((float) 10.86, (float) 0),
+};
+
+static final StrokeRec char73[] = {
+ new StrokeRec(2, char73_stroke0),
+};
+
+/* char: 74 'J' */
+
+static final CoordRec char74_stroke0[] = {
+ new CoordRec((float) 50.119, (float) 100),
+ new CoordRec((float) 50.119, (float) 23.8095),
+ new CoordRec((float) 45.3571, (float) 9.5238),
+ new CoordRec((float) 40.5952, (float) 4.7619),
+ new CoordRec((float) 31.0714, (float) 0),
+ new CoordRec((float) 21.5476, (float) 0),
+ new CoordRec((float) 12.0238, (float) 4.7619),
+ new CoordRec((float) 7.2619, (float) 9.5238),
+ new CoordRec((float) 2.5, (float) 23.8095),
+ new CoordRec((float) 2.5, (float) 33.3333),
+};
+
+static final StrokeRec char74[] = {
+ new StrokeRec(10, char74_stroke0),
+};
+
+/* char: 75 'K' */
+
+static final CoordRec char75_stroke0[] = {
+ new CoordRec((float) 11.28, (float) 100),
+ new CoordRec((float) 11.28, (float) 0),
+};
+
+static final CoordRec char75_stroke1[] = {
+ new CoordRec((float) 77.9467, (float) 100),
+ new CoordRec((float) 11.28, (float) 33.3333),
+};
+
+static final CoordRec char75_stroke2[] = {
+ new CoordRec((float) 35.0895, (float) 57.1429),
+ new CoordRec((float) 77.9467, (float) 0),
+};
+
+static final StrokeRec char75[] = {
+ new StrokeRec(2, char75_stroke0),
+ new StrokeRec(2, char75_stroke1),
+ new StrokeRec(2, char75_stroke2),
+};
+
+/* char: 76 'L' */
+
+static final CoordRec char76_stroke0[] = {
+ new CoordRec((float) 11.68, (float) 100),
+ new CoordRec((float) 11.68, (float) 0),
+};
+
+static final CoordRec char76_stroke1[] = {
+ new CoordRec((float) 11.68, (float) 0),
+ new CoordRec((float) 68.8229, (float) 0),
+};
+
+static final StrokeRec char76[] = {
+ new StrokeRec(2, char76_stroke0),
+ new StrokeRec(2, char76_stroke1),
+};
+
+/* char: 77 'M' */
+
+static final CoordRec char77_stroke0[] = {
+ new CoordRec((float) 10.86, (float) 100),
+ new CoordRec((float) 10.86, (float) 0),
+};
+
+static final CoordRec char77_stroke1[] = {
+ new CoordRec((float) 10.86, (float) 100),
+ new CoordRec((float) 48.9552, (float) 0),
+};
+
+static final CoordRec char77_stroke2[] = {
+ new CoordRec((float) 87.0505, (float) 100),
+ new CoordRec((float) 48.9552, (float) 0),
+};
+
+static final CoordRec char77_stroke3[] = {
+ new CoordRec((float) 87.0505, (float) 100),
+ new CoordRec((float) 87.0505, (float) 0),
+};
+
+static final StrokeRec char77[] = {
+ new StrokeRec(2, char77_stroke0),
+ new StrokeRec(2, char77_stroke1),
+ new StrokeRec(2, char77_stroke2),
+ new StrokeRec(2, char77_stroke3),
+};
+
+/* char: 78 'N' */
+
+static final CoordRec char78_stroke0[] = {
+ new CoordRec((float) 11.14, (float) 100),
+ new CoordRec((float) 11.14, (float) 0),
+};
+
+static final CoordRec char78_stroke1[] = {
+ new CoordRec((float) 11.14, (float) 100),
+ new CoordRec((float) 77.8067, (float) 0),
+};
+
+static final CoordRec char78_stroke2[] = {
+ new CoordRec((float) 77.8067, (float) 100),
+ new CoordRec((float) 77.8067, (float) 0),
+};
+
+static final StrokeRec char78[] = {
+ new StrokeRec(2, char78_stroke0),
+ new StrokeRec(2, char78_stroke1),
+ new StrokeRec(2, char78_stroke2),
+};
+
+/* char: 79 'O' */
+
+static final CoordRec char79_stroke0[] = {
+ new CoordRec((float) 34.8114, (float) 100),
+ new CoordRec((float) 25.2876, (float) 95.2381),
+ new CoordRec((float) 15.7638, (float) 85.7143),
+ new CoordRec((float) 11.0019, (float) 76.1905),
+ new CoordRec((float) 6.24, (float) 61.9048),
+ new CoordRec((float) 6.24, (float) 38.0952),
+ new CoordRec((float) 11.0019, (float) 23.8095),
+ new CoordRec((float) 15.7638, (float) 14.2857),
+ new CoordRec((float) 25.2876, (float) 4.7619),
+ new CoordRec((float) 34.8114, (float) 0),
+ new CoordRec((float) 53.859, (float) 0),
+ new CoordRec((float) 63.3829, (float) 4.7619),
+ new CoordRec((float) 72.9067, (float) 14.2857),
+ new CoordRec((float) 77.6686, (float) 23.8095),
+ new CoordRec((float) 82.4305, (float) 38.0952),
+ new CoordRec((float) 82.4305, (float) 61.9048),
+ new CoordRec((float) 77.6686, (float) 76.1905),
+ new CoordRec((float) 72.9067, (float) 85.7143),
+ new CoordRec((float) 63.3829, (float) 95.2381),
+ new CoordRec((float) 53.859, (float) 100),
+ new CoordRec((float) 34.8114, (float) 100),
+};
+
+static final StrokeRec char79[] = {
+ new StrokeRec(21, char79_stroke0),
+};
+
+/* char: 80 'P' */
+
+static final CoordRec char80_stroke0[] = {
+ new CoordRec((float) 12.1, (float) 100),
+ new CoordRec((float) 12.1, (float) 0),
+};
+
+static final CoordRec char80_stroke1[] = {
+ new CoordRec((float) 12.1, (float) 100),
+ new CoordRec((float) 54.9571, (float) 100),
+ new CoordRec((float) 69.2429, (float) 95.2381),
+ new CoordRec((float) 74.0048, (float) 90.4762),
+ new CoordRec((float) 78.7667, (float) 80.9524),
+ new CoordRec((float) 78.7667, (float) 66.6667),
+ new CoordRec((float) 74.0048, (float) 57.1429),
+ new CoordRec((float) 69.2429, (float) 52.381),
+ new CoordRec((float) 54.9571, (float) 47.619),
+ new CoordRec((float) 12.1, (float) 47.619),
+};
+
+static final StrokeRec char80[] = {
+ new StrokeRec(2, char80_stroke0),
+ new StrokeRec(10, char80_stroke1),
+};
+
+/* char: 81 'Q' */
+
+static final CoordRec char81_stroke0[] = {
+ new CoordRec((float) 33.8714, (float) 100),
+ new CoordRec((float) 24.3476, (float) 95.2381),
+ new CoordRec((float) 14.8238, (float) 85.7143),
+ new CoordRec((float) 10.0619, (float) 76.1905),
+ new CoordRec((float) 5.3, (float) 61.9048),
+ new CoordRec((float) 5.3, (float) 38.0952),
+ new CoordRec((float) 10.0619, (float) 23.8095),
+ new CoordRec((float) 14.8238, (float) 14.2857),
+ new CoordRec((float) 24.3476, (float) 4.7619),
+ new CoordRec((float) 33.8714, (float) 0),
+ new CoordRec((float) 52.919, (float) 0),
+ new CoordRec((float) 62.4429, (float) 4.7619),
+ new CoordRec((float) 71.9667, (float) 14.2857),
+ new CoordRec((float) 76.7286, (float) 23.8095),
+ new CoordRec((float) 81.4905, (float) 38.0952),
+ new CoordRec((float) 81.4905, (float) 61.9048),
+ new CoordRec((float) 76.7286, (float) 76.1905),
+ new CoordRec((float) 71.9667, (float) 85.7143),
+ new CoordRec((float) 62.4429, (float) 95.2381),
+ new CoordRec((float) 52.919, (float) 100),
+ new CoordRec((float) 33.8714, (float) 100),
+};
+
+static final CoordRec char81_stroke1[] = {
+ new CoordRec((float) 48.1571, (float) 19.0476),
+ new CoordRec((float) 76.7286, (float) -9.5238),
+};
+
+static final StrokeRec char81[] = {
+ new StrokeRec(21, char81_stroke0),
+ new StrokeRec(2, char81_stroke1),
+};
+
+/* char: 82 'R' */
+
+static final CoordRec char82_stroke0[] = {
+ new CoordRec((float) 11.68, (float) 100),
+ new CoordRec((float) 11.68, (float) 0),
+};
+
+static final CoordRec char82_stroke1[] = {
+ new CoordRec((float) 11.68, (float) 100),
+ new CoordRec((float) 54.5371, (float) 100),
+ new CoordRec((float) 68.8229, (float) 95.2381),
+ new CoordRec((float) 73.5848, (float) 90.4762),
+ new CoordRec((float) 78.3467, (float) 80.9524),
+ new CoordRec((float) 78.3467, (float) 71.4286),
+ new CoordRec((float) 73.5848, (float) 61.9048),
+ new CoordRec((float) 68.8229, (float) 57.1429),
+ new CoordRec((float) 54.5371, (float) 52.381),
+ new CoordRec((float) 11.68, (float) 52.381),
+};
+
+static final CoordRec char82_stroke2[] = {
+ new CoordRec((float) 45.0133, (float) 52.381),
+ new CoordRec((float) 78.3467, (float) 0),
+};
+
+static final StrokeRec char82[] = {
+ new StrokeRec(2, char82_stroke0),
+ new StrokeRec(10, char82_stroke1),
+ new StrokeRec(2, char82_stroke2),
+};
+
+/* char: 83 'S' */
+
+static final CoordRec char83_stroke0[] = {
+ new CoordRec((float) 74.6667, (float) 85.7143),
+ new CoordRec((float) 65.1429, (float) 95.2381),
+ new CoordRec((float) 50.8571, (float) 100),
+ new CoordRec((float) 31.8095, (float) 100),
+ new CoordRec((float) 17.5238, (float) 95.2381),
+ new CoordRec((float) 8, (float) 85.7143),
+ new CoordRec((float) 8, (float) 76.1905),
+ new CoordRec((float) 12.7619, (float) 66.6667),
+ new CoordRec((float) 17.5238, (float) 61.9048),
+ new CoordRec((float) 27.0476, (float) 57.1429),
+ new CoordRec((float) 55.619, (float) 47.619),
+ new CoordRec((float) 65.1429, (float) 42.8571),
+ new CoordRec((float) 69.9048, (float) 38.0952),
+ new CoordRec((float) 74.6667, (float) 28.5714),
+ new CoordRec((float) 74.6667, (float) 14.2857),
+ new CoordRec((float) 65.1429, (float) 4.7619),
+ new CoordRec((float) 50.8571, (float) 0),
+ new CoordRec((float) 31.8095, (float) 0),
+ new CoordRec((float) 17.5238, (float) 4.7619),
+ new CoordRec((float) 8, (float) 14.2857),
+};
+
+static final StrokeRec char83[] = {
+ new StrokeRec(20, char83_stroke0),
+};
+
+/* char: 84 'T' */
+
+static final CoordRec char84_stroke0[] = {
+ new CoordRec((float) 35.6933, (float) 100),
+ new CoordRec((float) 35.6933, (float) 0),
+};
+
+static final CoordRec char84_stroke1[] = {
+ new CoordRec((float) 2.36, (float) 100),
+ new CoordRec((float) 69.0267, (float) 100),
+};
+
+static final StrokeRec char84[] = {
+ new StrokeRec(2, char84_stroke0),
+ new StrokeRec(2, char84_stroke1),
+};
+
+/* char: 85 'U' */
+
+static final CoordRec char85_stroke0[] = {
+ new CoordRec((float) 11.54, (float) 100),
+ new CoordRec((float) 11.54, (float) 28.5714),
+ new CoordRec((float) 16.3019, (float) 14.2857),
+ new CoordRec((float) 25.8257, (float) 4.7619),
+ new CoordRec((float) 40.1114, (float) 0),
+ new CoordRec((float) 49.6352, (float) 0),
+ new CoordRec((float) 63.921, (float) 4.7619),
+ new CoordRec((float) 73.4448, (float) 14.2857),
+ new CoordRec((float) 78.2067, (float) 28.5714),
+ new CoordRec((float) 78.2067, (float) 100),
+};
+
+static final StrokeRec char85[] = {
+ new StrokeRec(10, char85_stroke0),
+};
+
+/* char: 86 'V' */
+
+static final CoordRec char86_stroke0[] = {
+ new CoordRec((float) 2.36, (float) 100),
+ new CoordRec((float) 40.4552, (float) 0),
+};
+
+static final CoordRec char86_stroke1[] = {
+ new CoordRec((float) 78.5505, (float) 100),
+ new CoordRec((float) 40.4552, (float) 0),
+};
+
+static final StrokeRec char86[] = {
+ new StrokeRec(2, char86_stroke0),
+ new StrokeRec(2, char86_stroke1),
+};
+
+/* char: 87 'W' */
+
+static final CoordRec char87_stroke0[] = {
+ new CoordRec((float) 2.22, (float) 100),
+ new CoordRec((float) 26.0295, (float) 0),
+};
+
+static final CoordRec char87_stroke1[] = {
+ new CoordRec((float) 49.839, (float) 100),
+ new CoordRec((float) 26.0295, (float) 0),
+};
+
+static final CoordRec char87_stroke2[] = {
+ new CoordRec((float) 49.839, (float) 100),
+ new CoordRec((float) 73.6486, (float) 0),
+};
+
+static final CoordRec char87_stroke3[] = {
+ new CoordRec((float) 97.4581, (float) 100),
+ new CoordRec((float) 73.6486, (float) 0),
+};
+
+static final StrokeRec char87[] = {
+ new StrokeRec(2, char87_stroke0),
+ new StrokeRec(2, char87_stroke1),
+ new StrokeRec(2, char87_stroke2),
+ new StrokeRec(2, char87_stroke3),
+};
+
+/* char: 88 'X' */
+
+static final CoordRec char88_stroke0[] = {
+ new CoordRec((float) 2.5, (float) 100),
+ new CoordRec((float) 69.1667, (float) 0),
+};
+
+static final CoordRec char88_stroke1[] = {
+ new CoordRec((float) 69.1667, (float) 100),
+ new CoordRec((float) 2.5, (float) 0),
+};
+
+static final StrokeRec char88[] = {
+ new StrokeRec(2, char88_stroke0),
+ new StrokeRec(2, char88_stroke1),
+};
+
+/* char: 89 'Y' */
+
+static final CoordRec char89_stroke0[] = {
+ new CoordRec((float) 1.52, (float) 100),
+ new CoordRec((float) 39.6152, (float) 52.381),
+ new CoordRec((float) 39.6152, (float) 0),
+};
+
+static final CoordRec char89_stroke1[] = {
+ new CoordRec((float) 77.7105, (float) 100),
+ new CoordRec((float) 39.6152, (float) 52.381),
+};
+
+static final StrokeRec char89[] = {
+ new StrokeRec(3, char89_stroke0),
+ new StrokeRec(2, char89_stroke1),
+};
+
+/* char: 90 'Z' */
+
+static final CoordRec char90_stroke0[] = {
+ new CoordRec((float) 69.1667, (float) 100),
+ new CoordRec((float) 2.5, (float) 0),
+};
+
+static final CoordRec char90_stroke1[] = {
+ new CoordRec((float) 2.5, (float) 100),
+ new CoordRec((float) 69.1667, (float) 100),
+};
+
+static final CoordRec char90_stroke2[] = {
+ new CoordRec((float) 2.5, (float) 0),
+ new CoordRec((float) 69.1667, (float) 0),
+};
+
+static final StrokeRec char90[] = {
+ new StrokeRec(2, char90_stroke0),
+ new StrokeRec(2, char90_stroke1),
+ new StrokeRec(2, char90_stroke2),
+};
+
+/* char: 91 '[' */
+
+static final CoordRec char91_stroke0[] = {
+ new CoordRec((float) 7.78, (float) 119.048),
+ new CoordRec((float) 7.78, (float) -33.3333),
+};
+
+static final CoordRec char91_stroke1[] = {
+ new CoordRec((float) 12.5419, (float) 119.048),
+ new CoordRec((float) 12.5419, (float) -33.3333),
+};
+
+static final CoordRec char91_stroke2[] = {
+ new CoordRec((float) 7.78, (float) 119.048),
+ new CoordRec((float) 41.1133, (float) 119.048),
+};
+
+static final CoordRec char91_stroke3[] = {
+ new CoordRec((float) 7.78, (float) -33.3333),
+ new CoordRec((float) 41.1133, (float) -33.3333),
+};
+
+static final StrokeRec char91[] = {
+ new StrokeRec(2, char91_stroke0),
+ new StrokeRec(2, char91_stroke1),
+ new StrokeRec(2, char91_stroke2),
+ new StrokeRec(2, char91_stroke3),
+};
+
+/* char: 92 '\' */
+
+static final CoordRec char92_stroke0[] = {
+ new CoordRec((float) 5.84, (float) 100),
+ new CoordRec((float) 72.5067, (float) -14.2857),
+};
+
+static final StrokeRec char92[] = {
+ new StrokeRec(2, char92_stroke0),
+};
+
+/* char: 93 ']' */
+
+static final CoordRec char93_stroke0[] = {
+ new CoordRec((float) 33.0114, (float) 119.048),
+ new CoordRec((float) 33.0114, (float) -33.3333),
+};
+
+static final CoordRec char93_stroke1[] = {
+ new CoordRec((float) 37.7733, (float) 119.048),
+ new CoordRec((float) 37.7733, (float) -33.3333),
+};
+
+static final CoordRec char93_stroke2[] = {
+ new CoordRec((float) 4.44, (float) 119.048),
+ new CoordRec((float) 37.7733, (float) 119.048),
+};
+
+static final CoordRec char93_stroke3[] = {
+ new CoordRec((float) 4.44, (float) -33.3333),
+ new CoordRec((float) 37.7733, (float) -33.3333),
+};
+
+static final StrokeRec char93[] = {
+ new StrokeRec(2, char93_stroke0),
+ new StrokeRec(2, char93_stroke1),
+ new StrokeRec(2, char93_stroke2),
+ new StrokeRec(2, char93_stroke3),
+};
+
+/* char: 94 '^' */
+
+static final CoordRec char94_stroke0[] = {
+ new CoordRec((float) 44.0752, (float) 109.524),
+ new CoordRec((float) 5.98, (float) 42.8571),
+};
+
+static final CoordRec char94_stroke1[] = {
+ new CoordRec((float) 44.0752, (float) 109.524),
+ new CoordRec((float) 82.1705, (float) 42.8571),
+};
+
+static final StrokeRec char94[] = {
+ new StrokeRec(2, char94_stroke0),
+ new StrokeRec(2, char94_stroke1),
+};
+
+/* char: 95 '_' */
+
+static final CoordRec char95_stroke0[] = {
+ new CoordRec((float)-1.1, (float) -33.3333),
+ new CoordRec((float) 103.662, (float) -33.3333),
+ new CoordRec((float) 103.662, (float) -28.5714),
+ new CoordRec((float)-1.1, (float) -28.5714),
+ new CoordRec((float)-1.1, (float) -33.3333),
+};
+
+static final StrokeRec char95[] = {
+ new StrokeRec(5, char95_stroke0),
+};
+
+/* char: 96 '`' */
+
+static final CoordRec char96_stroke0[] = {
+ new CoordRec((float) 33.0219, (float) 100),
+ new CoordRec((float) 56.8314, (float) 71.4286),
+};
+
+static final CoordRec char96_stroke1[] = {
+ new CoordRec((float) 33.0219, (float) 100),
+ new CoordRec((float) 28.26, (float) 95.2381),
+ new CoordRec((float) 56.8314, (float) 71.4286),
+};
+
+static final StrokeRec char96[] = {
+ new StrokeRec(2, char96_stroke0),
+ new StrokeRec(3, char96_stroke1),
+};
+
+/* char: 97 'a' */
+
+static final CoordRec char97_stroke0[] = {
+ new CoordRec((float) 63.8229, (float) 66.6667),
+ new CoordRec((float) 63.8229, (float) 0),
+};
+
+static final CoordRec char97_stroke1[] = {
+ new CoordRec((float) 63.8229, (float) 52.381),
+ new CoordRec((float) 54.299, (float) 61.9048),
+ new CoordRec((float) 44.7752, (float) 66.6667),
+ new CoordRec((float) 30.4895, (float) 66.6667),
+ new CoordRec((float) 20.9657, (float) 61.9048),
+ new CoordRec((float) 11.4419, (float) 52.381),
+ new CoordRec((float) 6.68, (float) 38.0952),
+ new CoordRec((float) 6.68, (float) 28.5714),
+ new CoordRec((float) 11.4419, (float) 14.2857),
+ new CoordRec((float) 20.9657, (float) 4.7619),
+ new CoordRec((float) 30.4895, (float) 0),
+ new CoordRec((float) 44.7752, (float) 0),
+ new CoordRec((float) 54.299, (float) 4.7619),
+ new CoordRec((float) 63.8229, (float) 14.2857),
+};
+
+static final StrokeRec char97[] = {
+ new StrokeRec(2, char97_stroke0),
+ new StrokeRec(14, char97_stroke1),
+};
+
+/* char: 98 'b' */
+
+static final CoordRec char98_stroke0[] = {
+ new CoordRec((float) 8.76, (float) 100),
+ new CoordRec((float) 8.76, (float) 0),
+};
+
+static final CoordRec char98_stroke1[] = {
+ new CoordRec((float) 8.76, (float) 52.381),
+ new CoordRec((float) 18.2838, (float) 61.9048),
+ new CoordRec((float) 27.8076, (float) 66.6667),
+ new CoordRec((float) 42.0933, (float) 66.6667),
+ new CoordRec((float) 51.6171, (float) 61.9048),
+ new CoordRec((float) 61.141, (float) 52.381),
+ new CoordRec((float) 65.9029, (float) 38.0952),
+ new CoordRec((float) 65.9029, (float) 28.5714),
+ new CoordRec((float) 61.141, (float) 14.2857),
+ new CoordRec((float) 51.6171, (float) 4.7619),
+ new CoordRec((float) 42.0933, (float) 0),
+ new CoordRec((float) 27.8076, (float) 0),
+ new CoordRec((float) 18.2838, (float) 4.7619),
+ new CoordRec((float) 8.76, (float) 14.2857),
+};
+
+static final StrokeRec char98[] = {
+ new StrokeRec(2, char98_stroke0),
+ new StrokeRec(14, char98_stroke1),
+};
+
+/* char: 99 'c' */
+
+static final CoordRec char99_stroke0[] = {
+ new CoordRec((float) 62.6629, (float) 52.381),
+ new CoordRec((float) 53.139, (float) 61.9048),
+ new CoordRec((float) 43.6152, (float) 66.6667),
+ new CoordRec((float) 29.3295, (float) 66.6667),
+ new CoordRec((float) 19.8057, (float) 61.9048),
+ new CoordRec((float) 10.2819, (float) 52.381),
+ new CoordRec((float) 5.52, (float) 38.0952),
+ new CoordRec((float) 5.52, (float) 28.5714),
+ new CoordRec((float) 10.2819, (float) 14.2857),
+ new CoordRec((float) 19.8057, (float) 4.7619),
+ new CoordRec((float) 29.3295, (float) 0),
+ new CoordRec((float) 43.6152, (float) 0),
+ new CoordRec((float) 53.139, (float) 4.7619),
+ new CoordRec((float) 62.6629, (float) 14.2857),
+};
+
+static final StrokeRec char99[] = {
+ new StrokeRec(14, char99_stroke0),
+};
+
+/* char: 100 'd' */
+
+static final CoordRec char100_stroke0[] = {
+ new CoordRec((float) 61.7829, (float) 100),
+ new CoordRec((float) 61.7829, (float) 0),
+};
+
+static final CoordRec char100_stroke1[] = {
+ new CoordRec((float) 61.7829, (float) 52.381),
+ new CoordRec((float) 52.259, (float) 61.9048),
+ new CoordRec((float) 42.7352, (float) 66.6667),
+ new CoordRec((float) 28.4495, (float) 66.6667),
+ new CoordRec((float) 18.9257, (float) 61.9048),
+ new CoordRec((float) 9.4019, (float) 52.381),
+ new CoordRec((float) 4.64, (float) 38.0952),
+ new CoordRec((float) 4.64, (float) 28.5714),
+ new CoordRec((float) 9.4019, (float) 14.2857),
+ new CoordRec((float) 18.9257, (float) 4.7619),
+ new CoordRec((float) 28.4495, (float) 0),
+ new CoordRec((float) 42.7352, (float) 0),
+ new CoordRec((float) 52.259, (float) 4.7619),
+ new CoordRec((float) 61.7829, (float) 14.2857),
+};
+
+static final StrokeRec char100[] = {
+ new StrokeRec(2, char100_stroke0),
+ new StrokeRec(14, char100_stroke1),
+};
+
+/* char: 101 'e' */
+
+static final CoordRec char101_stroke0[] = {
+ new CoordRec((float) 5.72, (float) 38.0952),
+ new CoordRec((float) 62.8629, (float) 38.0952),
+ new CoordRec((float) 62.8629, (float) 47.619),
+ new CoordRec((float) 58.101, (float) 57.1429),
+ new CoordRec((float) 53.339, (float) 61.9048),
+ new CoordRec((float) 43.8152, (float) 66.6667),
+ new CoordRec((float) 29.5295, (float) 66.6667),
+ new CoordRec((float) 20.0057, (float) 61.9048),
+ new CoordRec((float) 10.4819, (float) 52.381),
+ new CoordRec((float) 5.72, (float) 38.0952),
+ new CoordRec((float) 5.72, (float) 28.5714),
+ new CoordRec((float) 10.4819, (float) 14.2857),
+ new CoordRec((float) 20.0057, (float) 4.7619),
+ new CoordRec((float) 29.5295, (float) 0),
+ new CoordRec((float) 43.8152, (float) 0),
+ new CoordRec((float) 53.339, (float) 4.7619),
+ new CoordRec((float) 62.8629, (float) 14.2857),
+};
+
+static final StrokeRec char101[] = {
+ new StrokeRec(17, char101_stroke0),
+};
+
+/* char: 102 'f' */
+
+static final CoordRec char102_stroke0[] = {
+ new CoordRec((float) 38.7752, (float) 100),
+ new CoordRec((float) 29.2514, (float) 100),
+ new CoordRec((float) 19.7276, (float) 95.2381),
+ new CoordRec((float) 14.9657, (float) 80.9524),
+ new CoordRec((float) 14.9657, (float) 0),
+};
+
+static final CoordRec char102_stroke1[] = {
+ new CoordRec((float) 0.68, (float) 66.6667),
+ new CoordRec((float) 34.0133, (float) 66.6667),
+};
+
+static final StrokeRec char102[] = {
+ new StrokeRec(5, char102_stroke0),
+ new StrokeRec(2, char102_stroke1),
+};
+
+/* char: 103 'g' */
+
+static final CoordRec char103_stroke0[] = {
+ new CoordRec((float) 62.5029, (float) 66.6667),
+ new CoordRec((float) 62.5029, (float) -9.5238),
+ new CoordRec((float) 57.741, (float) -23.8095),
+ new CoordRec((float) 52.979, (float) -28.5714),
+ new CoordRec((float) 43.4552, (float) -33.3333),
+ new CoordRec((float) 29.1695, (float) -33.3333),
+ new CoordRec((float) 19.6457, (float) -28.5714),
+};
+
+static final CoordRec char103_stroke1[] = {
+ new CoordRec((float) 62.5029, (float) 52.381),
+ new CoordRec((float) 52.979, (float) 61.9048),
+ new CoordRec((float) 43.4552, (float) 66.6667),
+ new CoordRec((float) 29.1695, (float) 66.6667),
+ new CoordRec((float) 19.6457, (float) 61.9048),
+ new CoordRec((float) 10.1219, (float) 52.381),
+ new CoordRec((float) 5.36, (float) 38.0952),
+ new CoordRec((float) 5.36, (float) 28.5714),
+ new CoordRec((float) 10.1219, (float) 14.2857),
+ new CoordRec((float) 19.6457, (float) 4.7619),
+ new CoordRec((float) 29.1695, (float) 0),
+ new CoordRec((float) 43.4552, (float) 0),
+ new CoordRec((float) 52.979, (float) 4.7619),
+ new CoordRec((float) 62.5029, (float) 14.2857),
+};
+
+static final StrokeRec char103[] = {
+ new StrokeRec(7, char103_stroke0),
+ new StrokeRec(14, char103_stroke1),
+};
+
+/* char: 104 'h' */
+
+static final CoordRec char104_stroke0[] = {
+ new CoordRec((float) 9.6, (float) 100),
+ new CoordRec((float) 9.6, (float) 0),
+};
+
+static final CoordRec char104_stroke1[] = {
+ new CoordRec((float) 9.6, (float) 47.619),
+ new CoordRec((float) 23.8857, (float) 61.9048),
+ new CoordRec((float) 33.4095, (float) 66.6667),
+ new CoordRec((float) 47.6952, (float) 66.6667),
+ new CoordRec((float) 57.219, (float) 61.9048),
+ new CoordRec((float) 61.981, (float) 47.619),
+ new CoordRec((float) 61.981, (float) 0),
+};
+
+static final StrokeRec char104[] = {
+ new StrokeRec(2, char104_stroke0),
+ new StrokeRec(7, char104_stroke1),
+};
+
+/* char: 105 'i' */
+
+static final CoordRec char105_stroke0[] = {
+ new CoordRec((float) 10.02, (float) 100),
+ new CoordRec((float) 14.7819, (float) 95.2381),
+ new CoordRec((float) 19.5438, (float) 100),
+ new CoordRec((float) 14.7819, (float) 104.762),
+ new CoordRec((float) 10.02, (float) 100),
+};
+
+static final CoordRec char105_stroke1[] = {
+ new CoordRec((float) 14.7819, (float) 66.6667),
+ new CoordRec((float) 14.7819, (float) 0),
+};
+
+static final StrokeRec char105[] = {
+ new StrokeRec(5, char105_stroke0),
+ new StrokeRec(2, char105_stroke1),
+};
+
+/* char: 106 'j' */
+
+static final CoordRec char106_stroke0[] = {
+ new CoordRec((float) 17.3876, (float) 100),
+ new CoordRec((float) 22.1495, (float) 95.2381),
+ new CoordRec((float) 26.9114, (float) 100),
+ new CoordRec((float) 22.1495, (float) 104.762),
+ new CoordRec((float) 17.3876, (float) 100),
+};
+
+static final CoordRec char106_stroke1[] = {
+ new CoordRec((float) 22.1495, (float) 66.6667),
+ new CoordRec((float) 22.1495, (float) -14.2857),
+ new CoordRec((float) 17.3876, (float) -28.5714),
+ new CoordRec((float) 7.8638, (float) -33.3333),
+ new CoordRec((float)-1.66, (float) -33.3333),
+};
+
+static final StrokeRec char106[] = {
+ new StrokeRec(5, char106_stroke0),
+ new StrokeRec(5, char106_stroke1),
+};
+
+/* char: 107 'k' */
+
+static final CoordRec char107_stroke0[] = {
+ new CoordRec((float) 9.6, (float) 100),
+ new CoordRec((float) 9.6, (float) 0),
+};
+
+static final CoordRec char107_stroke1[] = {
+ new CoordRec((float) 57.219, (float) 66.6667),
+ new CoordRec((float) 9.6, (float) 19.0476),
+};
+
+static final CoordRec char107_stroke2[] = {
+ new CoordRec((float) 28.6476, (float) 38.0952),
+ new CoordRec((float) 61.981, (float) 0),
+};
+
+static final StrokeRec char107[] = {
+ new StrokeRec(2, char107_stroke0),
+ new StrokeRec(2, char107_stroke1),
+ new StrokeRec(2, char107_stroke2),
+};
+
+/* char: 108 'l' */
+
+static final CoordRec char108_stroke0[] = {
+ new CoordRec((float) 10.02, (float) 100),
+ new CoordRec((float) 10.02, (float) 0),
+};
+
+static final StrokeRec char108[] = {
+ new StrokeRec(2, char108_stroke0),
+};
+
+/* char: 109 'm' */
+
+static final CoordRec char109_stroke0[] = {
+ new CoordRec((float) 9.6, (float) 66.6667),
+ new CoordRec((float) 9.6, (float) 0),
+};
+
+static final CoordRec char109_stroke1[] = {
+ new CoordRec((float) 9.6, (float) 47.619),
+ new CoordRec((float) 23.8857, (float) 61.9048),
+ new CoordRec((float) 33.4095, (float) 66.6667),
+ new CoordRec((float) 47.6952, (float) 66.6667),
+ new CoordRec((float) 57.219, (float) 61.9048),
+ new CoordRec((float) 61.981, (float) 47.619),
+ new CoordRec((float) 61.981, (float) 0),
+};
+
+static final CoordRec char109_stroke2[] = {
+ new CoordRec((float) 61.981, (float) 47.619),
+ new CoordRec((float) 76.2667, (float) 61.9048),
+ new CoordRec((float) 85.7905, (float) 66.6667),
+ new CoordRec((float) 100.076, (float) 66.6667),
+ new CoordRec((float) 109.6, (float) 61.9048),
+ new CoordRec((float) 114.362, (float) 47.619),
+ new CoordRec((float) 114.362, (float) 0),
+};
+
+static final StrokeRec char109[] = {
+ new StrokeRec(2, char109_stroke0),
+ new StrokeRec(7, char109_stroke1),
+ new StrokeRec(7, char109_stroke2),
+};
+
+/* char: 110 'n' */
+
+static final CoordRec char110_stroke0[] = {
+ new CoordRec((float) 9.18, (float) 66.6667),
+ new CoordRec((float) 9.18, (float) 0),
+};
+
+static final CoordRec char110_stroke1[] = {
+ new CoordRec((float) 9.18, (float) 47.619),
+ new CoordRec((float) 23.4657, (float) 61.9048),
+ new CoordRec((float) 32.9895, (float) 66.6667),
+ new CoordRec((float) 47.2752, (float) 66.6667),
+ new CoordRec((float) 56.799, (float) 61.9048),
+ new CoordRec((float) 61.561, (float) 47.619),
+ new CoordRec((float) 61.561, (float) 0),
+};
+
+static final StrokeRec char110[] = {
+ new StrokeRec(2, char110_stroke0),
+ new StrokeRec(7, char110_stroke1),
+};
+
+/* char: 111 'o' */
+
+static final CoordRec char111_stroke0[] = {
+ new CoordRec((float) 28.7895, (float) 66.6667),
+ new CoordRec((float) 19.2657, (float) 61.9048),
+ new CoordRec((float) 9.7419, (float) 52.381),
+ new CoordRec((float) 4.98, (float) 38.0952),
+ new CoordRec((float) 4.98, (float) 28.5714),
+ new CoordRec((float) 9.7419, (float) 14.2857),
+ new CoordRec((float) 19.2657, (float) 4.7619),
+ new CoordRec((float) 28.7895, (float) 0),
+ new CoordRec((float) 43.0752, (float) 0),
+ new CoordRec((float) 52.599, (float) 4.7619),
+ new CoordRec((float) 62.1229, (float) 14.2857),
+ new CoordRec((float) 66.8848, (float) 28.5714),
+ new CoordRec((float) 66.8848, (float) 38.0952),
+ new CoordRec((float) 62.1229, (float) 52.381),
+ new CoordRec((float) 52.599, (float) 61.9048),
+ new CoordRec((float) 43.0752, (float) 66.6667),
+ new CoordRec((float) 28.7895, (float) 66.6667),
+};
+
+static final StrokeRec char111[] = {
+ new StrokeRec(17, char111_stroke0),
+};
+
+/* char: 112 'p' */
+
+static final CoordRec char112_stroke0[] = {
+ new CoordRec((float) 9.46, (float) 66.6667),
+ new CoordRec((float) 9.46, (float) -33.3333),
+};
+
+static final CoordRec char112_stroke1[] = {
+ new CoordRec((float) 9.46, (float) 52.381),
+ new CoordRec((float) 18.9838, (float) 61.9048),
+ new CoordRec((float) 28.5076, (float) 66.6667),
+ new CoordRec((float) 42.7933, (float) 66.6667),
+ new CoordRec((float) 52.3171, (float) 61.9048),
+ new CoordRec((float) 61.841, (float) 52.381),
+ new CoordRec((float) 66.6029, (float) 38.0952),
+ new CoordRec((float) 66.6029, (float) 28.5714),
+ new CoordRec((float) 61.841, (float) 14.2857),
+ new CoordRec((float) 52.3171, (float) 4.7619),
+ new CoordRec((float) 42.7933, (float) 0),
+ new CoordRec((float) 28.5076, (float) 0),
+ new CoordRec((float) 18.9838, (float) 4.7619),
+ new CoordRec((float) 9.46, (float) 14.2857),
+};
+
+static final StrokeRec char112[] = {
+ new StrokeRec(2, char112_stroke0),
+ new StrokeRec(14, char112_stroke1),
+};
+
+/* char: 113 'q' */
+
+static final CoordRec char113_stroke0[] = {
+ new CoordRec((float) 61.9829, (float) 66.6667),
+ new CoordRec((float) 61.9829, (float) -33.3333),
+};
+
+static final CoordRec char113_stroke1[] = {
+ new CoordRec((float) 61.9829, (float) 52.381),
+ new CoordRec((float) 52.459, (float) 61.9048),
+ new CoordRec((float) 42.9352, (float) 66.6667),
+ new CoordRec((float) 28.6495, (float) 66.6667),
+ new CoordRec((float) 19.1257, (float) 61.9048),
+ new CoordRec((float) 9.6019, (float) 52.381),
+ new CoordRec((float) 4.84, (float) 38.0952),
+ new CoordRec((float) 4.84, (float) 28.5714),
+ new CoordRec((float) 9.6019, (float) 14.2857),
+ new CoordRec((float) 19.1257, (float) 4.7619),
+ new CoordRec((float) 28.6495, (float) 0),
+ new CoordRec((float) 42.9352, (float) 0),
+ new CoordRec((float) 52.459, (float) 4.7619),
+ new CoordRec((float) 61.9829, (float) 14.2857),
+};
+
+static final StrokeRec char113[] = {
+ new StrokeRec(2, char113_stroke0),
+ new StrokeRec(14, char113_stroke1),
+};
+
+/* char: 114 'r' */
+
+static final CoordRec char114_stroke0[] = {
+ new CoordRec((float) 9.46, (float) 66.6667),
+ new CoordRec((float) 9.46, (float) 0),
+};
+
+static final CoordRec char114_stroke1[] = {
+ new CoordRec((float) 9.46, (float) 38.0952),
+ new CoordRec((float) 14.2219, (float) 52.381),
+ new CoordRec((float) 23.7457, (float) 61.9048),
+ new CoordRec((float) 33.2695, (float) 66.6667),
+ new CoordRec((float) 47.5552, (float) 66.6667),
+};
+
+static final StrokeRec char114[] = {
+ new StrokeRec(2, char114_stroke0),
+ new StrokeRec(5, char114_stroke1),
+};
+
+/* char: 115 's' */
+
+static final CoordRec char115_stroke0[] = {
+ new CoordRec((float) 57.081, (float) 52.381),
+ new CoordRec((float) 52.319, (float) 61.9048),
+ new CoordRec((float) 38.0333, (float) 66.6667),
+ new CoordRec((float) 23.7476, (float) 66.6667),
+ new CoordRec((float) 9.4619, (float) 61.9048),
+ new CoordRec((float) 4.7, (float) 52.381),
+ new CoordRec((float) 9.4619, (float) 42.8571),
+ new CoordRec((float) 18.9857, (float) 38.0952),
+ new CoordRec((float) 42.7952, (float) 33.3333),
+ new CoordRec((float) 52.319, (float) 28.5714),
+ new CoordRec((float) 57.081, (float) 19.0476),
+ new CoordRec((float) 57.081, (float) 14.2857),
+ new CoordRec((float) 52.319, (float) 4.7619),
+ new CoordRec((float) 38.0333, (float) 0),
+ new CoordRec((float) 23.7476, (float) 0),
+ new CoordRec((float) 9.4619, (float) 4.7619),
+ new CoordRec((float) 4.7, (float) 14.2857),
+};
+
+static final StrokeRec char115[] = {
+ new StrokeRec(17, char115_stroke0),
+};
+
+/* char: 116 't' */
+
+static final CoordRec char116_stroke0[] = {
+ new CoordRec((float) 14.8257, (float) 100),
+ new CoordRec((float) 14.8257, (float) 19.0476),
+ new CoordRec((float) 19.5876, (float) 4.7619),
+ new CoordRec((float) 29.1114, (float) 0),
+ new CoordRec((float) 38.6352, (float) 0),
+};
+
+static final CoordRec char116_stroke1[] = {
+ new CoordRec((float) 0.54, (float) 66.6667),
+ new CoordRec((float) 33.8733, (float) 66.6667),
+};
+
+static final StrokeRec char116[] = {
+ new StrokeRec(5, char116_stroke0),
+ new StrokeRec(2, char116_stroke1),
+};
+
+/* char: 117 'u' */
+
+static final CoordRec char117_stroke0[] = {
+ new CoordRec((float) 9.46, (float) 66.6667),
+ new CoordRec((float) 9.46, (float) 19.0476),
+ new CoordRec((float) 14.2219, (float) 4.7619),
+ new CoordRec((float) 23.7457, (float) 0),
+ new CoordRec((float) 38.0314, (float) 0),
+ new CoordRec((float) 47.5552, (float) 4.7619),
+ new CoordRec((float) 61.841, (float) 19.0476),
+};
+
+static final CoordRec char117_stroke1[] = {
+ new CoordRec((float) 61.841, (float) 66.6667),
+ new CoordRec((float) 61.841, (float) 0),
+};
+
+static final StrokeRec char117[] = {
+ new StrokeRec(7, char117_stroke0),
+ new StrokeRec(2, char117_stroke1),
+};
+
+/* char: 118 'v' */
+
+static final CoordRec char118_stroke0[] = {
+ new CoordRec((float) 1.8, (float) 66.6667),
+ new CoordRec((float) 30.3714, (float) 0),
+};
+
+static final CoordRec char118_stroke1[] = {
+ new CoordRec((float) 58.9429, (float) 66.6667),
+ new CoordRec((float) 30.3714, (float) 0),
+};
+
+static final StrokeRec char118[] = {
+ new StrokeRec(2, char118_stroke0),
+ new StrokeRec(2, char118_stroke1),
+};
+
+/* char: 119 'w' */
+
+static final CoordRec char119_stroke0[] = {
+ new CoordRec((float) 2.5, (float) 66.6667),
+ new CoordRec((float) 21.5476, (float) 0),
+};
+
+static final CoordRec char119_stroke1[] = {
+ new CoordRec((float) 40.5952, (float) 66.6667),
+ new CoordRec((float) 21.5476, (float) 0),
+};
+
+static final CoordRec char119_stroke2[] = {
+ new CoordRec((float) 40.5952, (float) 66.6667),
+ new CoordRec((float) 59.6429, (float) 0),
+};
+
+static final CoordRec char119_stroke3[] = {
+ new CoordRec((float) 78.6905, (float) 66.6667),
+ new CoordRec((float) 59.6429, (float) 0),
+};
+
+static final StrokeRec char119[] = {
+ new StrokeRec(2, char119_stroke0),
+ new StrokeRec(2, char119_stroke1),
+ new StrokeRec(2, char119_stroke2),
+ new StrokeRec(2, char119_stroke3),
+};
+
+/* char: 120 'x' */
+
+static final CoordRec char120_stroke0[] = {
+ new CoordRec((float) 1.66, (float) 66.6667),
+ new CoordRec((float) 54.041, (float) 0),
+};
+
+static final CoordRec char120_stroke1[] = {
+ new CoordRec((float) 54.041, (float) 66.6667),
+ new CoordRec((float) 1.66, (float) 0),
+};
+
+static final StrokeRec char120[] = {
+ new StrokeRec(2, char120_stroke0),
+ new StrokeRec(2, char120_stroke1),
+};
+
+/* char: 121 'y' */
+
+static final CoordRec char121_stroke0[] = {
+ new CoordRec((float) 6.5619, (float) 66.6667),
+ new CoordRec((float) 35.1333, (float) 0),
+};
+
+static final CoordRec char121_stroke1[] = {
+ new CoordRec((float) 63.7048, (float) 66.6667),
+ new CoordRec((float) 35.1333, (float) 0),
+ new CoordRec((float) 25.6095, (float) -19.0476),
+ new CoordRec((float) 16.0857, (float) -28.5714),
+ new CoordRec((float) 6.5619, (float) -33.3333),
+ new CoordRec((float) 1.8, (float) -33.3333),
+};
+
+static final StrokeRec char121[] = {
+ new StrokeRec(2, char121_stroke0),
+ new StrokeRec(6, char121_stroke1),
+};
+
+/* char: 122 'z' */
+
+static final CoordRec char122_stroke0[] = {
+ new CoordRec((float) 56.821, (float) 66.6667),
+ new CoordRec((float) 4.44, (float) 0),
+};
+
+static final CoordRec char122_stroke1[] = {
+ new CoordRec((float) 4.44, (float) 66.6667),
+ new CoordRec((float) 56.821, (float) 66.6667),
+};
+
+static final CoordRec char122_stroke2[] = {
+ new CoordRec((float) 4.44, (float) 0),
+ new CoordRec((float) 56.821, (float) 0),
+};
+
+static final StrokeRec char122[] = {
+ new StrokeRec(2, char122_stroke0),
+ new StrokeRec(2, char122_stroke1),
+ new StrokeRec(2, char122_stroke2),
+};
+
+/* char: 123 '{' */
+
+static final CoordRec char123_stroke0[] = {
+ new CoordRec((float) 31.1895, (float) 119.048),
+ new CoordRec((float) 21.6657, (float) 114.286),
+ new CoordRec((float) 16.9038, (float) 109.524),
+ new CoordRec((float) 12.1419, (float) 100),
+ new CoordRec((float) 12.1419, (float) 90.4762),
+ new CoordRec((float) 16.9038, (float) 80.9524),
+ new CoordRec((float) 21.6657, (float) 76.1905),
+ new CoordRec((float) 26.4276, (float) 66.6667),
+ new CoordRec((float) 26.4276, (float) 57.1429),
+ new CoordRec((float) 16.9038, (float) 47.619),
+};
+
+static final CoordRec char123_stroke1[] = {
+ new CoordRec((float) 21.6657, (float) 114.286),
+ new CoordRec((float) 16.9038, (float) 104.762),
+ new CoordRec((float) 16.9038, (float) 95.2381),
+ new CoordRec((float) 21.6657, (float) 85.7143),
+ new CoordRec((float) 26.4276, (float) 80.9524),
+ new CoordRec((float) 31.1895, (float) 71.4286),
+ new CoordRec((float) 31.1895, (float) 61.9048),
+ new CoordRec((float) 26.4276, (float) 52.381),
+ new CoordRec((float) 7.38, (float) 42.8571),
+ new CoordRec((float) 26.4276, (float) 33.3333),
+ new CoordRec((float) 31.1895, (float) 23.8095),
+ new CoordRec((float) 31.1895, (float) 14.2857),
+ new CoordRec((float) 26.4276, (float) 4.7619),
+ new CoordRec((float) 21.6657, (float) 0),
+ new CoordRec((float) 16.9038, (float) -9.5238),
+ new CoordRec((float) 16.9038, (float) -19.0476),
+ new CoordRec((float) 21.6657, (float) -28.5714),
+};
+
+static final CoordRec char123_stroke2[] = {
+ new CoordRec((float) 16.9038, (float) 38.0952),
+ new CoordRec((float) 26.4276, (float) 28.5714),
+ new CoordRec((float) 26.4276, (float) 19.0476),
+ new CoordRec((float) 21.6657, (float) 9.5238),
+ new CoordRec((float) 16.9038, (float) 4.7619),
+ new CoordRec((float) 12.1419, (float) -4.7619),
+ new CoordRec((float) 12.1419, (float) -14.2857),
+ new CoordRec((float) 16.9038, (float) -23.8095),
+ new CoordRec((float) 21.6657, (float) -28.5714),
+ new CoordRec((float) 31.1895, (float) -33.3333),
+};
+
+static final StrokeRec char123[] = {
+ new StrokeRec(10, char123_stroke0),
+ new StrokeRec(17, char123_stroke1),
+ new StrokeRec(10, char123_stroke2),
+};
+
+/* char: 124 '|' */
+
+static final CoordRec char124_stroke0[] = {
+ new CoordRec((float) 11.54, (float) 119.048),
+ new CoordRec((float) 11.54, (float) -33.3333),
+};
+
+static final StrokeRec char124[] = {
+ new StrokeRec(2, char124_stroke0),
+};
+
+/* char: 125 '}' */
+
+static final CoordRec char125_stroke0[] = {
+ new CoordRec((float) 9.18, (float) 119.048),
+ new CoordRec((float) 18.7038, (float) 114.286),
+ new CoordRec((float) 23.4657, (float) 109.524),
+ new CoordRec((float) 28.2276, (float) 100),
+ new CoordRec((float) 28.2276, (float) 90.4762),
+ new CoordRec((float) 23.4657, (float) 80.9524),
+ new CoordRec((float) 18.7038, (float) 76.1905),
+ new CoordRec((float) 13.9419, (float) 66.6667),
+ new CoordRec((float) 13.9419, (float) 57.1429),
+ new CoordRec((float) 23.4657, (float) 47.619),
+};
+
+static final CoordRec char125_stroke1[] = {
+ new CoordRec((float) 18.7038, (float) 114.286),
+ new CoordRec((float) 23.4657, (float) 104.762),
+ new CoordRec((float) 23.4657, (float) 95.2381),
+ new CoordRec((float) 18.7038, (float) 85.7143),
+ new CoordRec((float) 13.9419, (float) 80.9524),
+ new CoordRec((float) 9.18, (float) 71.4286),
+ new CoordRec((float) 9.18, (float) 61.9048),
+ new CoordRec((float) 13.9419, (float) 52.381),
+ new CoordRec((float) 32.9895, (float) 42.8571),
+ new CoordRec((float) 13.9419, (float) 33.3333),
+ new CoordRec((float) 9.18, (float) 23.8095),
+ new CoordRec((float) 9.18, (float) 14.2857),
+ new CoordRec((float) 13.9419, (float) 4.7619),
+ new CoordRec((float) 18.7038, (float) 0),
+ new CoordRec((float) 23.4657, (float) -9.5238),
+ new CoordRec((float) 23.4657, (float) -19.0476),
+ new CoordRec((float) 18.7038, (float) -28.5714),
+};
+
+static final CoordRec char125_stroke2[] = {
+ new CoordRec((float) 23.4657, (float) 38.0952),
+ new CoordRec((float) 13.9419, (float) 28.5714),
+ new CoordRec((float) 13.9419, (float) 19.0476),
+ new CoordRec((float) 18.7038, (float) 9.5238),
+ new CoordRec((float) 23.4657, (float) 4.7619),
+ new CoordRec((float) 28.2276, (float) -4.7619),
+ new CoordRec((float) 28.2276, (float) -14.2857),
+ new CoordRec((float) 23.4657, (float) -23.8095),
+ new CoordRec((float) 18.7038, (float) -28.5714),
+ new CoordRec((float) 9.18, (float) -33.3333),
+};
+
+static final StrokeRec char125[] = {
+ new StrokeRec(10, char125_stroke0),
+ new StrokeRec(17, char125_stroke1),
+ new StrokeRec(10, char125_stroke2),
+};
+
+/* char: 126 '~' */
+
+static final CoordRec char126_stroke0[] = {
+ new CoordRec((float) 2.92, (float) 28.5714),
+ new CoordRec((float) 2.92, (float) 38.0952),
+ new CoordRec((float) 7.6819, (float) 52.381),
+ new CoordRec((float) 17.2057, (float) 57.1429),
+ new CoordRec((float) 26.7295, (float) 57.1429),
+ new CoordRec((float) 36.2533, (float) 52.381),
+ new CoordRec((float) 55.301, (float) 38.0952),
+ new CoordRec((float) 64.8248, (float) 33.3333),
+ new CoordRec((float) 74.3486, (float) 33.3333),
+ new CoordRec((float) 83.8724, (float) 38.0952),
+ new CoordRec((float) 88.6343, (float) 47.619),
+};
+
+static final CoordRec char126_stroke1[] = {
+ new CoordRec((float) 2.92, (float) 38.0952),
+ new CoordRec((float) 7.6819, (float) 47.619),
+ new CoordRec((float) 17.2057, (float) 52.381),
+ new CoordRec((float) 26.7295, (float) 52.381),
+ new CoordRec((float) 36.2533, (float) 47.619),
+ new CoordRec((float) 55.301, (float) 33.3333),
+ new CoordRec((float) 64.8248, (float) 28.5714),
+ new CoordRec((float) 74.3486, (float) 28.5714),
+ new CoordRec((float) 83.8724, (float) 33.3333),
+ new CoordRec((float) 88.6343, (float) 47.619),
+ new CoordRec((float) 88.6343, (float) 57.1429),
+};
+
+static final StrokeRec char126[] = {
+ new StrokeRec(11, char126_stroke0),
+ new StrokeRec(11, char126_stroke1),
+};
+
+/* char: 127 */
+
+static final CoordRec char127_stroke0[] = {
+ new CoordRec((float) 52.381, (float) 100),
+ new CoordRec((float) 14.2857, (float) -33.3333),
+};
+
+static final CoordRec char127_stroke1[] = {
+ new CoordRec((float) 28.5714, (float) 66.6667),
+ new CoordRec((float) 14.2857, (float) 61.9048),
+ new CoordRec((float) 4.7619, (float) 52.381),
+ new CoordRec((float) 0, (float) 38.0952),
+ new CoordRec((float) 0, (float) 23.8095),
+ new CoordRec((float) 4.7619, (float) 14.2857),
+ new CoordRec((float) 14.2857, (float) 4.7619),
+ new CoordRec((float) 28.5714, (float) 0),
+ new CoordRec((float) 38.0952, (float) 0),
+ new CoordRec((float) 52.381, (float) 4.7619),
+ new CoordRec((float) 61.9048, (float) 14.2857),
+ new CoordRec((float) 66.6667, (float) 28.5714),
+ new CoordRec((float) 66.6667, (float) 42.8571),
+ new CoordRec((float) 61.9048, (float) 52.381),
+ new CoordRec((float) 52.381, (float) 61.9048),
+ new CoordRec((float) 38.0952, (float) 66.6667),
+ new CoordRec((float) 28.5714, (float) 66.6667),
+};
+
+static final StrokeRec char127[] = {
+ new StrokeRec(2, char127_stroke0),
+ new StrokeRec(17, char127_stroke1),
+};
+
+static final StrokeCharRec chars[] = {
+ new StrokeCharRec( 0, /* char0 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char1 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char2 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char3 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char4 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char5 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char6 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char7 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char8 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char9 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char10 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char11 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char12 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char13 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char14 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char15 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char16 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char17 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char18 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char19 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char20 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char21 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char22 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char23 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char24 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char25 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char26 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char27 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char28 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char29 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char30 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char31 */ null, (float) 0, (float) 0 ),
+ new StrokeCharRec( 0, /* char32 */ null, (float) 52.381, (float) 104.762 ),
+ new StrokeCharRec( 2, char33, (float) 13.3819, (float) 26.6238 ),
+ new StrokeCharRec( 2, char34, (float) 23.0676, (float) 51.4352 ),
+ new StrokeCharRec( 4, char35, (float) 36.5333, (float) 79.4886 ),
+ new StrokeCharRec( 3, char36, (float) 38.1533, (float) 76.2067 ),
+ new StrokeCharRec( 3, char37, (float) 49.2171, (float) 96.5743 ),
+ new StrokeCharRec( 1, char38, (float) 53.599, (float) 101.758 ),
+ new StrokeCharRec( 1, char39, (float) 4.44, (float) 13.62 ),
+ new StrokeCharRec( 1, char40, (float) 21.8657, (float) 47.1733 ),
+ new StrokeCharRec( 1, char41, (float) 24.3276, (float) 47.5333 ),
+ new StrokeCharRec( 3, char42, (float) 30.7695, (float) 59.439 ),
+ new StrokeCharRec( 2, char43, (float) 48.8371, (float) 97.2543 ),
+ new StrokeCharRec( 1, char44, (float) 13.5219, (float) 26.0638 ),
+ new StrokeCharRec( 1, char45, (float) 50.2371, (float) 100.754 ),
+ new StrokeCharRec( 1, char46, (float) 13.1019, (float) 26.4838 ),
+ new StrokeCharRec( 1, char47, (float) 40.5733, (float) 82.1067 ),
+ new StrokeCharRec( 1, char48, (float) 38.3133, (float) 77.0667 ),
+ new StrokeCharRec( 1, char49, (float) 30.8676, (float) 66.5295 ),
+ new StrokeCharRec( 1, char50, (float) 38.7533, (float) 77.6467 ),
+ new StrokeCharRec( 1, char51, (float) 38.3333, (float) 77.0467 ),
+ new StrokeCharRec( 2, char52, (float) 37.2133, (float) 80.1686 ),
+ new StrokeCharRec( 1, char53, (float) 38.1933, (float) 77.6867 ),
+ new StrokeCharRec( 1, char54, (float) 34.1514, (float) 73.8048 ),
+ new StrokeCharRec( 2, char55, (float) 38.8933, (float) 77.2267 ),
+ new StrokeCharRec( 1, char56, (float) 38.9333, (float) 77.6667 ),
+ new StrokeCharRec( 1, char57, (float) 39.9333, (float) 74.0648 ),
+ new StrokeCharRec( 2, char58, (float) 14.0819, (float) 26.2238 ),
+ new StrokeCharRec( 2, char59, (float) 12.9619, (float) 26.3038 ),
+ new StrokeCharRec( 1, char60, (float) 41.1552, (float) 81.6105 ),
+ new StrokeCharRec( 2, char61, (float) 48.5571, (float) 97.2543 ),
+ new StrokeCharRec( 1, char62, (float) 40.8752, (float) 81.6105 ),
+ new StrokeCharRec( 2, char63, (float) 36.9914, (float) 73.9029 ),
+ new StrokeCharRec( 2, char64, (float) 34.9314, (float) 74.3648 ),
+ new StrokeCharRec( 3, char65, (float) 40.5952, (float) 80.4905 ),
+ new StrokeCharRec( 3, char66, (float) 44.7533, (float) 83.6267 ),
+ new StrokeCharRec( 1, char67, (float) 39.9933, (float) 84.4886 ),
+ new StrokeCharRec( 2, char68, (float) 45.2933, (float) 85.2867 ),
+ new StrokeCharRec( 4, char69, (float) 39.9914, (float) 78.1848 ),
+ new StrokeCharRec( 3, char70, (float) 39.9914, (float) 78.7448 ),
+ new StrokeCharRec( 2, char71, (float) 40.3933, (float) 89.7686 ),
+ new StrokeCharRec( 3, char72, (float) 44.7533, (float) 89.0867 ),
+ new StrokeCharRec( 1, char73, (float) 10.86, (float) 21.3 ),
+ new StrokeCharRec( 1, char74, (float) 31.0714, (float) 59.999 ),
+ new StrokeCharRec( 3, char75, (float) 44.6133, (float) 79.3267 ),
+ new StrokeCharRec( 2, char76, (float) 40.2514, (float) 71.3229 ),
+ new StrokeCharRec( 4, char77, (float) 48.9552, (float) 97.2105 ),
+ new StrokeCharRec( 3, char78, (float) 44.4733, (float) 88.8067 ),
+ new StrokeCharRec( 1, char79, (float) 44.3352, (float) 88.8305 ),
+ new StrokeCharRec( 2, char80, (float) 45.4333, (float) 85.6667 ),
+ new StrokeCharRec( 2, char81, (float) 43.3952, (float) 88.0905 ),
+ new StrokeCharRec( 3, char82, (float) 45.0133, (float) 82.3667 ),
+ new StrokeCharRec( 1, char83, (float) 41.3333, (float) 80.8267 ),
+ new StrokeCharRec( 2, char84, (float) 35.6933, (float) 71.9467 ),
+ new StrokeCharRec( 1, char85, (float) 44.8733, (float) 89.4867 ),
+ new StrokeCharRec( 2, char86, (float) 40.4552, (float) 81.6105 ),
+ new StrokeCharRec( 4, char87, (float) 49.839, (float) 100.518 ),
+ new StrokeCharRec( 2, char88, (float) 35.8333, (float) 72.3667 ),
+ new StrokeCharRec( 2, char89, (float) 39.6152, (float) 79.6505 ),
+ new StrokeCharRec( 3, char90, (float) 35.8333, (float) 73.7467 ),
+ new StrokeCharRec( 4, char91, (float) 22.0657, (float) 46.1133 ),
+ new StrokeCharRec( 1, char92, (float) 39.1733, (float) 78.2067 ),
+ new StrokeCharRec( 4, char93, (float) 23.4876, (float) 46.3933 ),
+ new StrokeCharRec( 2, char94, (float) 44.0752, (float) 90.2305 ),
+ new StrokeCharRec( 1, char95, (float) 51.281, (float) 104.062 ),
+ new StrokeCharRec( 2, char96, (float) 42.5457, (float) 83.5714 ),
+ new StrokeCharRec( 2, char97, (float) 35.2514, (float) 66.6029 ),
+ new StrokeCharRec( 2, char98, (float) 37.3314, (float) 70.4629 ),
+ new StrokeCharRec( 1, char99, (float) 34.0914, (float) 68.9229 ),
+ new StrokeCharRec( 2, char100, (float) 33.2114, (float) 70.2629 ),
+ new StrokeCharRec( 1, char101, (float) 34.2914, (float) 68.5229 ),
+ new StrokeCharRec( 2, char102, (float) 14.9657, (float) 38.6552 ),
+ new StrokeCharRec( 2, char103, (float) 33.9314, (float) 70.9829 ),
+ new StrokeCharRec( 2, char104, (float) 33.4095, (float) 71.021 ),
+ new StrokeCharRec( 2, char105, (float) 14.7819, (float) 28.8638 ),
+ new StrokeCharRec( 2, char106, (float) 17.3876, (float) 36.2314 ),
+ new StrokeCharRec( 3, char107, (float) 33.4095, (float) 62.521 ),
+ new StrokeCharRec( 1, char108, (float) 10.02, (float) 19.34 ),
+ new StrokeCharRec( 3, char109, (float) 61.981, (float) 123.962 ),
+ new StrokeCharRec( 2, char110, (float) 32.9895, (float) 70.881 ),
+ new StrokeCharRec( 1, char111, (float) 33.5514, (float) 71.7448 ),
+ new StrokeCharRec( 2, char112, (float) 38.0314, (float) 70.8029 ),
+ new StrokeCharRec( 2, char113, (float) 33.4114, (float) 70.7429 ),
+ new StrokeCharRec( 2, char114, (float) 23.7457, (float) 49.4952 ),
+ new StrokeCharRec( 1, char115, (float) 28.5095, (float) 62.321 ),
+ new StrokeCharRec( 2, char116, (float) 14.8257, (float) 39.3152 ),
+ new StrokeCharRec( 2, char117, (float) 33.2695, (float) 71.161 ),
+ new StrokeCharRec( 2, char118, (float) 30.3714, (float) 60.6029 ),
+ new StrokeCharRec( 4, char119, (float) 40.5952, (float) 80.4905 ),
+ new StrokeCharRec( 2, char120, (float) 25.4695, (float) 56.401 ),
+ new StrokeCharRec( 2, char121, (float) 35.1333, (float) 66.0648 ),
+ new StrokeCharRec( 3, char122, (float) 28.2495, (float) 61.821 ),
+ new StrokeCharRec( 3, char123, (float) 21.6657, (float) 41.6295 ),
+ new StrokeCharRec( 1, char124, (float) 11.54, (float) 23.78 ),
+ new StrokeCharRec( 3, char125, (float) 18.7038, (float) 41.4695 ),
+ new StrokeCharRec( 2, char126, (float) 45.7771, (float) 91.2743 ),
+ new StrokeCharRec( 2, char127, (float) 33.3333, (float) 66.6667 ),
+};
+
+public static final StrokeFontRec glutStrokeRoman = new StrokeFontRec( "Roman", 128, chars, (float) 119.048, (float) -33.3333 );
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java b/src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java
new file mode 100644
index 000000000..1d5d3de63
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/StrokeCharRec.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+class StrokeCharRec {
+ public int num_strokes;
+ public StrokeRec[] stroke;
+ public float center;
+ public float right;
+
+ public StrokeCharRec(int num_strokes,
+ StrokeRec[] stroke,
+ float center,
+ float right) {
+ this.num_strokes = num_strokes;
+ this.stroke = stroke;
+ this.center = center;
+ this.right = right;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java b/src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java
new file mode 100644
index 000000000..0e6133a2d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/StrokeFontRec.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+class StrokeFontRec {
+ public String name;
+ public int num_chars;
+ public StrokeCharRec[] ch;
+ public float top;
+ public float bottom;
+
+ public StrokeFontRec(String name,
+ int num_chars,
+ StrokeCharRec[] ch,
+ float top,
+ float bottom) {
+ this.name = name;
+ this.num_chars = num_chars;
+ this.ch = ch;
+ this.top = top;
+ this.bottom = bottom;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java b/src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java
new file mode 100644
index 000000000..91241ebc0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/StrokeRec.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.gl2;
+
+/* Copyright (c) Mark J. Kilgard, 1994, 1998. */
+
+/* This program is freely distributable without licensing fees
+ and is provided without guarantee or warrantee expressed or
+ implied. This program is -not- in the public domain. */
+
+class StrokeRec {
+ public int num_coords;
+ public CoordRec[] coord;
+
+ public StrokeRec(int num_coords,
+ CoordRec[] coord) {
+ this.num_coords = num_coords;
+ this.coord = coord;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java b/src/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java
new file mode 100755
index 000000000..a446b0928
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/gl2/TileRenderer.java
@@ -0,0 +1,601 @@
+package com.sun.opengl.util.gl2;
+
+import java.awt.Dimension;
+import java.nio.Buffer;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import javax.media.opengl.glu.gl2.*;
+
+/**
+ * A fairly direct port of Brian Paul's tile rendering library, found
+ * at <a href = "http://www.mesa3d.org/brianp/TR.html">
+ * http://www.mesa3d.org/brianp/TR.html </a> . I've java-fied it, but
+ * the functionality is the same.
+ *
+ * Original code Copyright (C) 1997-2005 Brian Paul. Licensed under
+ * BSD-compatible terms with permission of the author. See LICENSE.txt
+ * for license information.
+ *
+ * @author ryanm
+ */
+public class TileRenderer
+{
+ private static final int DEFAULT_TILE_WIDTH = 256;
+
+ private static final int DEFAULT_TILE_HEIGHT = 256;
+
+ private static final int DEFAULT_TILE_BORDER = 0;
+
+ //
+ // Enumeration flags for accessing variables
+ //
+ // @author ryanm
+ //
+
+ /**
+ * The width of a tile
+ */
+ public static final int TR_TILE_WIDTH = 0;
+ /**
+ * The height of a tile
+ */
+ public static final int TR_TILE_HEIGHT = 1;
+ /**
+ * The width of the border around the tiles
+ */
+ public static final int TR_TILE_BORDER = 2;
+ /**
+ * The width of the final image
+ */
+ public static final int TR_IMAGE_WIDTH = 3;
+ /**
+ * The height of the final image
+ */
+ public static final int TR_IMAGE_HEIGHT = 4;
+ /**
+ * The number of rows of tiles
+ */
+ public static final int TR_ROWS = 5;
+ /**
+ * The number of columns of tiles
+ */
+ public static final int TR_COLUMNS = 6;
+ /**
+ * The current row number
+ */
+ public static final int TR_CURRENT_ROW = 7;
+ /**
+ * The current column number
+ */
+ public static final int TR_CURRENT_COLUMN = 8;
+ /**
+ * The width of the current tile
+ */
+ public static final int TR_CURRENT_TILE_WIDTH = 9;
+ /**
+ * The height of the current tile
+ */
+ public static final int TR_CURRENT_TILE_HEIGHT = 10;
+ /**
+ * The order that the rows are traversed
+ */
+ public static final int TR_ROW_ORDER = 11;
+
+
+ /**
+ * Indicates we are traversing rows from the top to the bottom
+ */
+ public static final int TR_TOP_TO_BOTTOM = 1;
+
+ /**
+ * Indicates we are traversing rows from the bottom to the top
+ */
+ public static final int TR_BOTTOM_TO_TOP = 2;
+
+ /* Final image parameters */
+ private Dimension imageSize = new Dimension();
+
+ private int imageFormat, imageType;
+
+ private Buffer imageBuffer;
+
+ /* Tile parameters */
+ private Dimension tileSize = new Dimension();
+
+ private Dimension tileSizeNB = new Dimension();
+
+ private int tileBorder;
+
+ private int tileFormat, tileType;
+
+ private Buffer tileBuffer;
+
+ /* Projection parameters */
+ private boolean perspective;
+
+ private double left;
+
+ private double right;
+
+ private double bottom;
+
+ private double top;
+
+ private double near;
+
+ private double far;
+
+ /* Misc */
+ private int rowOrder;
+
+ private int rows, columns;
+
+ private int currentTile;
+
+ private int currentTileWidth, currentTileHeight;
+
+ private int currentRow, currentColumn;
+
+ private int[] viewportSave = new int[ 4 ];
+
+ /**
+ * Creates a new TileRenderer object
+ */
+ public TileRenderer()
+ {
+ tileSize.width = DEFAULT_TILE_WIDTH;
+ tileSize.height = DEFAULT_TILE_HEIGHT;
+ tileBorder = DEFAULT_TILE_BORDER;
+ rowOrder = TR_BOTTOM_TO_TOP;
+ currentTile = -1;
+ }
+
+ /**
+ * Sets up the number of rows and columns needed
+ */
+ private void setup()
+ {
+ columns = ( imageSize.width + tileSizeNB.width - 1 ) / tileSizeNB.width;
+ rows = ( imageSize.height + tileSizeNB.height - 1 ) / tileSizeNB.height;
+ currentTile = 0;
+
+ assert columns >= 0;
+ assert rows >= 0;
+ }
+
+ /**
+ * Sets the size of the tiles to use in rendering. The actual
+ * effective size of the tile depends on the border size, ie (
+ * width - 2*border ) * ( height - 2 * border )
+ *
+ * @param width
+ * The width of the tiles. Must not be larger than the GL
+ * context
+ * @param height
+ * The height of the tiles. Must not be larger than the
+ * GL context
+ * @param border
+ * The width of the borders on each tile. This is needed
+ * to avoid artifacts when rendering lines or points with
+ * thickness > 1.
+ */
+ public void setTileSize( int width, int height, int border )
+ {
+ assert ( border >= 0 );
+ assert ( width >= 1 );
+ assert ( height >= 1 );
+ assert ( width >= 2 * border );
+ assert ( height >= 2 * border );
+
+ tileBorder = border;
+ tileSize.width = width;
+ tileSize.height = height;
+ tileSizeNB.width = width - 2 * border;
+ tileSizeNB.height = height - 2 * border;
+ setup();
+ }
+
+ /**
+ * Specify a buffer the tiles to be copied to. This is not
+ * necessary for the creation of the final image, but useful if you
+ * want to inspect each tile in turn.
+ *
+ * @param format
+ * Interpreted as in glReadPixels
+ * @param type
+ * Interpreted as in glReadPixels
+ * @param image
+ * The buffer itself. Must be large enough to contain a
+ * tile, minus any borders
+ */
+ public void setTileBuffer( int format, int type, Buffer image )
+ {
+ tileFormat = format;
+ tileType = type;
+ tileBuffer = image;
+ }
+
+ /**
+ * Sets the desired size of the final image
+ *
+ * @param width
+ * The width of the final image
+ * @param height
+ * The height of the final image
+ */
+ public void setImageSize( int width, int height )
+ {
+ imageSize.width = width;
+ imageSize.height = height;
+ setup();
+ }
+
+ /**
+ * Sets the buffer in which to store the final image
+ *
+ * @param format
+ * Interpreted as in glReadPixels
+ * @param type
+ * Interpreted as in glReadPixels
+ * @param image
+ * the buffer itself, must be large enough to hold the
+ * final image
+ */
+ public void setImageBuffer( int format, int type, Buffer image )
+ {
+ imageFormat = format;
+ imageType = type;
+ imageBuffer = image;
+ }
+
+ /**
+ * Gets the parameters of this TileRenderer object
+ *
+ * @param param
+ * The parameter that is to be retrieved
+ * @return the value of the parameter
+ */
+ public int getParam( int param )
+ {
+ switch (param) {
+ case TR_TILE_WIDTH:
+ return tileSize.width;
+ case TR_TILE_HEIGHT:
+ return tileSize.height;
+ case TR_TILE_BORDER:
+ return tileBorder;
+ case TR_IMAGE_WIDTH:
+ return imageSize.width;
+ case TR_IMAGE_HEIGHT:
+ return imageSize.height;
+ case TR_ROWS:
+ return rows;
+ case TR_COLUMNS:
+ return columns;
+ case TR_CURRENT_ROW:
+ if( currentTile < 0 )
+ return -1;
+ else
+ return currentRow;
+ case TR_CURRENT_COLUMN:
+ if( currentTile < 0 )
+ return -1;
+ else
+ return currentColumn;
+ case TR_CURRENT_TILE_WIDTH:
+ return currentTileWidth;
+ case TR_CURRENT_TILE_HEIGHT:
+ return currentTileHeight;
+ case TR_ROW_ORDER:
+ return rowOrder;
+ default:
+ throw new IllegalArgumentException("Invalid enumerant as argument");
+ }
+ }
+
+ /**
+ * Sets the order of row traversal
+ *
+ * @param order
+ * The row traversal order, must be
+ * eitherTR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP
+ */
+ public void setRowOrder( int order )
+ {
+ if (order == TR_TOP_TO_BOTTOM || order == TR_BOTTOM_TO_TOP) {
+ rowOrder = order;
+ } else {
+ throw new IllegalArgumentException("Must pass TR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP");
+ }
+ }
+
+ /**
+ * Sets the context to use an orthographic projection. Must be
+ * called before rendering the first tile
+ *
+ * @param left
+ * As in glOrtho
+ * @param right
+ * As in glOrtho
+ * @param bottom
+ * As in glOrtho
+ * @param top
+ * As in glOrtho
+ * @param zNear
+ * As in glOrtho
+ * @param zFar
+ * As in glOrtho
+ */
+ public void trOrtho( double left, double right, double bottom, double top, double zNear,
+ double zFar )
+ {
+ this.perspective = false;
+ this.left = left;
+ this.right = right;
+ this.bottom = bottom;
+ this.top = top;
+ this.near = zNear;
+ this.far = zFar;
+ }
+
+ /**
+ * Sets the perspective projection frustrum. Must be called before
+ * rendering the first tile
+ *
+ * @param left
+ * As in glFrustrum
+ * @param right
+ * As in glFrustrum
+ * @param bottom
+ * As in glFrustrum
+ * @param top
+ * As in glFrustrum
+ * @param zNear
+ * As in glFrustrum
+ * @param zFar
+ * As in glFrustrum
+ */
+ public void trFrustum( double left, double right, double bottom, double top, double zNear,
+ double zFar )
+ {
+ this.perspective = true;
+ this.left = left;
+ this.right = right;
+ this.bottom = bottom;
+ this.top = top;
+ this.near = zNear;
+ this.far = zFar;
+ }
+
+ /**
+ * Convenient way to specify a perspective projection
+ *
+ * @param fovy
+ * As in gluPerspective
+ * @param aspect
+ * As in gluPerspective
+ * @param zNear
+ * As in gluPerspective
+ * @param zFar
+ * As in gluPerspective
+ */
+ public void trPerspective( double fovy, double aspect, double zNear, double zFar )
+ {
+ double xmin, xmax, ymin, ymax;
+ ymax = zNear * Math.tan( fovy * 3.14159265 / 360.0 );
+ ymin = -ymax;
+ xmin = ymin * aspect;
+ xmax = ymax * aspect;
+ trFrustum( xmin, xmax, ymin, ymax, zNear, zFar );
+ }
+
+ /**
+ * Begins rendering a tile. The projection matrix stack should be
+ * left alone after calling this
+ *
+ * @param gl
+ * The gl context
+ */
+ public void beginTile( GL2 gl )
+ {
+ if (currentTile <= 0) {
+ setup();
+ /*
+ * Save user's viewport, will be restored after last tile
+ * rendered
+ */
+ gl.glGetIntegerv( GL2.GL_VIEWPORT, viewportSave, 0 );
+ }
+
+ /* which tile (by row and column) we're about to render */
+ if (rowOrder == TR_BOTTOM_TO_TOP) {
+ currentRow = currentTile / columns;
+ currentColumn = currentTile % columns;
+ } else {
+ currentRow = rows - ( currentTile / columns ) - 1;
+ currentColumn = currentTile % columns;
+ }
+ assert ( currentRow < rows );
+ assert ( currentColumn < columns );
+
+ int border = tileBorder;
+
+ int th, tw;
+
+ /* Compute actual size of this tile with border */
+ if (currentRow < rows - 1) {
+ th = tileSize.height;
+ } else {
+ th = imageSize.height - ( rows - 1 ) * ( tileSizeNB.height ) + 2 * border;
+ }
+
+ if (currentColumn < columns - 1) {
+ tw = tileSize.width;
+ } else {
+ tw = imageSize.width - ( columns - 1 ) * ( tileSizeNB.width ) + 2 * border;
+ }
+
+ /* Save tile size, with border */
+ currentTileWidth = tw;
+ currentTileHeight = th;
+
+ gl.glViewport( 0, 0, tw, th );
+
+ /* save current matrix mode */
+ int[] matrixMode = new int[ 1 ];
+ gl.glGetIntegerv( GL2.GL_MATRIX_MODE, matrixMode, 0 );
+ gl.glMatrixMode( GL2.GL_PROJECTION );
+ gl.glLoadIdentity();
+
+ /* compute projection parameters */
+ double l =
+ left + ( right - left ) * ( currentColumn * tileSizeNB.width - border )
+ / imageSize.width;
+ double r = l + ( right - left ) * tw / imageSize.width;
+ double b =
+ bottom + ( top - bottom ) * ( currentRow * tileSizeNB.height - border )
+ / imageSize.height;
+ double t = b + ( top - bottom ) * th / imageSize.height;
+
+ if( perspective ) {
+ gl.glFrustum( l, r, b, t, near, far );
+ } else {
+ gl.glOrtho( l, r, b, t, near, far );
+ }
+
+ /* restore user's matrix mode */
+ gl.glMatrixMode( matrixMode[ 0 ] );
+ }
+
+ /**
+ * Must be called after rendering the scene
+ *
+ * @param gl
+ * the gl context
+ * @return true if there are more tiles to be rendered, false if
+ * the final image is complete
+ */
+ public boolean endTile( GL2 gl )
+ {
+ int[] prevRowLength = new int[ 1 ], prevSkipRows = new int[ 1 ], prevSkipPixels = new int[ 1 ], prevAlignment =
+ new int[ 1 ];
+
+ assert ( currentTile >= 0 );
+
+ // be sure OpenGL rendering is finished
+ gl.glFlush();
+
+ // save current glPixelStore values
+ gl.glGetIntegerv( GL2.GL_PACK_ROW_LENGTH, prevRowLength, 0 );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_ROWS, prevSkipRows, 0 );
+ gl.glGetIntegerv( GL2.GL_PACK_SKIP_PIXELS, prevSkipPixels, 0 );
+ gl.glGetIntegerv( GL2.GL_PACK_ALIGNMENT, prevAlignment, 0 );
+
+ if( tileBuffer != null ) {
+ int srcX = tileBorder;
+ int srcY = tileBorder;
+ int srcWidth = tileSizeNB.width;
+ int srcHeight = tileSizeNB.height;
+ gl.glReadPixels( srcX, srcY, srcWidth, srcHeight, tileFormat, tileType, tileBuffer );
+ }
+
+ if( imageBuffer != null ) {
+ int srcX = tileBorder;
+ int srcY = tileBorder;
+ int srcWidth = currentTileWidth - 2 * tileBorder;
+ int srcHeight = currentTileHeight - 2 * tileBorder;
+ int destX = tileSizeNB.width * currentColumn;
+ int destY = tileSizeNB.height * currentRow;
+
+ /* setup pixel store for glReadPixels */
+ gl.glPixelStorei( GL2.GL_PACK_ROW_LENGTH, imageSize.width );
+ gl.glPixelStorei( GL2.GL_PACK_SKIP_ROWS, destY );
+ gl.glPixelStorei( GL2.GL_PACK_SKIP_PIXELS, destX );
+ gl.glPixelStorei( GL2.GL_PACK_ALIGNMENT, 1 );
+
+ /* read the tile into the final image */
+ gl.glReadPixels( srcX, srcY, srcWidth, srcHeight, imageFormat, imageType, imageBuffer );
+ }
+
+ /* restore previous glPixelStore values */
+ gl.glPixelStorei( GL2.GL_PACK_ROW_LENGTH, prevRowLength[ 0 ] );
+ gl.glPixelStorei( GL2.GL_PACK_SKIP_ROWS, prevSkipRows[ 0 ] );
+ gl.glPixelStorei( GL2.GL_PACK_SKIP_PIXELS, prevSkipPixels[ 0 ] );
+ gl.glPixelStorei( GL2.GL_PACK_ALIGNMENT, prevAlignment[ 0 ] );
+
+ /* increment tile counter, return 1 if more tiles left to render */
+ currentTile++;
+ if( currentTile >= rows * columns ) {
+ /* restore user's viewport */
+ gl.glViewport( viewportSave[ 0 ], viewportSave[ 1 ], viewportSave[ 2 ], viewportSave[ 3 ] );
+ currentTile = -1; /* all done */
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Tile rendering causes problems with using glRasterPos3f, so you
+ * should use this replacement instead
+ *
+ * @param x
+ * As in glRasterPos3f
+ * @param y
+ * As in glRasterPos3f
+ * @param z
+ * As in glRasterPos3f
+ * @param gl
+ * The gl context
+ * @param glu
+ * A GLUgl2 object
+ */
+ public void trRasterPos3f( float x, float y, float z, GL2 gl, GLUgl2 glu )
+ {
+ if (currentTile < 0) {
+ /* not doing tile rendering right now. Let OpenGL do this. */
+ gl.glRasterPos3f( x, y, z );
+ } else {
+ double[] modelview = new double[ 16 ], proj = new double[ 16 ];
+ int[] viewport = new int[ 4 ];
+ double[] win = new double[3];
+
+ /* Get modelview, projection and viewport */
+ gl.glGetDoublev( GL2.GL_MODELVIEW_MATRIX, modelview, 0 );
+ gl.glGetDoublev( GL2.GL_PROJECTION_MATRIX, proj, 0 );
+ viewport[ 0 ] = 0;
+ viewport[ 1 ] = 0;
+ viewport[ 2 ] = currentTileWidth;
+ viewport[ 3 ] = currentTileHeight;
+
+ /* Project object coord to window coordinate */
+ if( glu.gluProject( x, y, z, modelview, 0, proj, 0, viewport, 0, win, 0 ) ) {
+
+ /* set raster pos to window coord (0,0) */
+ gl.glMatrixMode( GL2.GL_MODELVIEW );
+ gl.glPushMatrix();
+ gl.glLoadIdentity();
+ gl.glMatrixMode( GL2.GL_PROJECTION );
+ gl.glPushMatrix();
+ gl.glLoadIdentity();
+ gl.glOrtho( 0.0, currentTileWidth, 0.0, currentTileHeight, 0.0, 1.0 );
+ gl.glRasterPos3d( 0.0, 0.0, -win[ 2 ] );
+
+ /*
+ * Now use empty bitmap to adjust raster position to
+ * (winX,winY)
+ */
+ {
+ byte[] bitmap = { 0 };
+ gl.glBitmap( 1, 1, 0.0f, 0.0f, ( float ) win[ 0 ], ( float ) win[ 1 ], bitmap , 0 );
+ }
+
+ /* restore original matrices */
+ gl.glPopMatrix(); /* proj */
+ gl.glMatrixMode( GL2.GL_MODELVIEW );
+ gl.glPopMatrix();
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java
new file mode 100644
index 000000000..1ef9874e4
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/GLSLArrayHandler.java
@@ -0,0 +1,60 @@
+
+package com.sun.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 java.nio.*;
+
+public class GLSLArrayHandler implements GLArrayHandler {
+ private GLArrayDataEditable ad;
+
+ public GLSLArrayHandler(GLArrayDataEditable ad) {
+ this.ad = ad;
+ }
+
+ protected final void passVertexAttribPointer(GL2ES2 gl, ShaderState st) {
+ st.glVertexAttribPointer(gl, ad);
+ }
+
+ public void enableBuffer(GL gl, boolean enable) {
+ if(!gl.isGL2ES2()) {
+ throw new GLException("GLSLArrayHandler expects a GL2ES2 implementation");
+ }
+ GL2ES2 glsl = gl.getGL2ES2();
+ ShaderState st = ShaderState.getCurrent();
+ if(null==st) {
+ throw new GLException("No ShaderState current");
+ }
+
+ if(enable) {
+ st.glEnableVertexAttribArray(glsl, ad.getName());
+
+ Buffer buffer = ad.getBuffer();
+
+ if(ad.isVBO()) {
+ // always bind and refresh the VBO mgr,
+ // in case more than one gl*Pointer objects are in use
+ glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, ad.getVBOName());
+ if(!ad.isBufferWritten()) {
+ if(null!=buffer) {
+ glsl.glBufferData(GL.GL_ARRAY_BUFFER, buffer.limit() * ad.getComponentSize(), buffer, ad.getBufferUsage());
+ }
+ ad.setBufferWritten(true);
+ }
+ passVertexAttribPointer(glsl, st);
+ } else if(null!=buffer) {
+ passVertexAttribPointer(glsl, st);
+ ad.setBufferWritten(true);
+ }
+ } else {
+ if(ad.isVBO()) {
+ glsl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+ }
+ st.glDisableVertexAttribArray(glsl, ad.getName());
+ }
+ }
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java
new file mode 100644
index 000000000..6e7512e6a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderCode.java
@@ -0,0 +1,367 @@
+
+package com.sun.opengl.util.glsl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.util.*;
+
+import java.util.*;
+import java.nio.*;
+import java.io.*;
+import java.net.*;
+
+public class ShaderCode {
+ public static final String SUFFIX_VERTEX_SOURCE = "vp" ;
+ public static final String SUFFIX_VERTEX_BINARY = "bvp" ;
+ public static final String SUFFIX_FRAGMENT_SOURCE = "fp" ;
+ public static final String SUFFIX_FRAGMENT_BINARY = "bfp" ;
+
+ public static final String SUB_PATH_NVIDIA = "nvidia" ;
+
+ public ShaderCode(int type, int number, String[][] source) {
+ switch (type) {
+ case GL2ES2.GL_VERTEX_SHADER:
+ case GL2ES2.GL_FRAGMENT_SHADER:
+ break;
+ default:
+ throw new GLException("Unknown shader type: "+type);
+ }
+ shaderSource = source;
+ shaderBinaryFormat = -1;
+ shaderBinary = null;
+ shaderType = type;
+ shader = BufferUtil.newIntBuffer(number);
+ id = getNextID();
+ }
+
+ public ShaderCode(int type, int number, int binFormat, Buffer binary) {
+ switch (type) {
+ case GL2ES2.GL_VERTEX_SHADER:
+ case GL2ES2.GL_FRAGMENT_SHADER:
+ break;
+ default:
+ throw new GLException("Unknown shader type: "+type);
+ }
+ shaderSource = null;
+ shaderBinaryFormat = binFormat;
+ shaderBinary = binary;
+ shaderType = type;
+ shader = BufferUtil.newIntBuffer(number);
+ id = getNextID();
+ }
+
+ public static ShaderCode create(GL2ES2 gl, int type, int number, Class context, String[] sourceFiles) {
+ if(!ShaderUtil.isShaderCompilerAvailable(gl)) return null;
+
+ String[][] shaderSources = null;
+ if(null!=sourceFiles) {
+ shaderSources = new String[sourceFiles.length][1];
+ for(int i=0; null!=shaderSources && i<sourceFiles.length; i++) {
+ shaderSources[i][0] = readShaderSource(context, sourceFiles[i]);
+ if(null == shaderSources[i][0]) {
+ shaderSources = null;
+ }
+ }
+ }
+ if(null==shaderSources) {
+ return null;
+ }
+ return new ShaderCode(type, number, shaderSources);
+ }
+
+ public static ShaderCode create(int type, int number, Class context, int binFormat, String binaryFile) {
+ ByteBuffer shaderBinary = null;
+ if(null!=binaryFile && 0<=binFormat) {
+ shaderBinary = readShaderBinary(context, binaryFile);
+ if(null == shaderBinary) {
+ binFormat = -1;
+ }
+ }
+ if(null==shaderBinary) {
+ return null;
+ }
+ return new ShaderCode(type, number, binFormat, shaderBinary);
+ }
+
+ public static String getFileSuffix(boolean binary, int type) {
+ switch (type) {
+ case GL2ES2.GL_VERTEX_SHADER:
+ return binary?SUFFIX_VERTEX_BINARY:SUFFIX_VERTEX_SOURCE;
+ case GL2ES2.GL_FRAGMENT_SHADER:
+ return binary?SUFFIX_FRAGMENT_BINARY:SUFFIX_FRAGMENT_SOURCE;
+ default:
+ throw new GLException("illegal shader type: "+type);
+ }
+ }
+
+ public static String getBinarySubPath(int binFormat) {
+ switch (binFormat) {
+ case GLES2.GL_NVIDIA_PLATFORM_BINARY_NV:
+ return SUB_PATH_NVIDIA;
+ default:
+ throw new GLException("unsupported binary format: "+binFormat);
+ }
+ }
+
+ public static ShaderCode create(GL2ES2 gl, int type, int number, Class context,
+ String srcRoot, String binRoot, String basename) {
+ ShaderCode res = null;
+ String srcFileName = null;
+ String binFileName = null;
+
+ if(ShaderUtil.isShaderCompilerAvailable(gl)) {
+ String srcPath[] = new String[1];
+ srcFileName = srcRoot + '/' + basename + "." + getFileSuffix(false, type);
+ srcPath[0] = srcFileName;
+ res = create(gl, type, number, context, srcPath);
+ if(null!=res) {
+ return res;
+ }
+ }
+ Set binFmts = ShaderUtil.getShaderBinaryFormats(gl);
+ for(Iterator iter=binFmts.iterator(); null==res && iter.hasNext(); ) {
+ int bFmt = ((Integer)(iter.next())).intValue();
+ String bFmtPath = getBinarySubPath(bFmt);
+ if(null==bFmtPath) continue;
+ binFileName = binRoot + '/' + bFmtPath + '/' + basename + "." + getFileSuffix(true, type);
+ res = create(type, number, context, bFmt, binFileName);
+ }
+
+ if(null==res) {
+ throw new GLException("No shader code found (source nor binary) for src: "+srcFileName+
+ ", bin: "+binFileName);
+ }
+
+ return res;
+ }
+
+ public static boolean createAndLoadShader(GL2ES2 gl, IntBuffer shader, int shaderType,
+ int binFormat, java.nio.Buffer bin,
+ PrintStream verboseOut)
+ {
+ int err = gl.glGetError(); // flush previous errors ..
+ if(err!=GL.GL_NO_ERROR && null!=verboseOut) {
+ verboseOut.println("createAndLoadShader: Pre GL Error: 0x"+Integer.toHexString(err));
+ }
+
+ ShaderUtil.createShader(gl, shaderType, shader);
+ err = gl.glGetError();
+ if(err!=GL.GL_NO_ERROR) {
+ throw new GLException("createAndLoadShader: CreateShader failed, GL Error: 0x"+Integer.toHexString(err));
+ }
+
+
+ ShaderUtil.shaderBinary(gl, shader, binFormat, bin);
+
+ err = gl.glGetError();
+ if(err!=GL.GL_NO_ERROR && null!=verboseOut) {
+ verboseOut.println("createAndLoadShader: ShaderBinary failed, GL Error: 0x"+Integer.toHexString(err));
+ }
+ return err == GL.GL_NO_ERROR;
+ }
+
+ public static boolean createAndCompileShader(GL2ES2 gl, IntBuffer shader, int shaderType,
+ java.lang.String[][] sources,
+ PrintStream verboseOut)
+ {
+ int err = gl.glGetError(); // flush previous errors ..
+ if(err!=GL.GL_NO_ERROR && null!=verboseOut) {
+ verboseOut.println("createAndCompileShader: Pre GL Error: 0x"+Integer.toHexString(err));
+ }
+
+ ShaderUtil.createShader(gl, shaderType, shader);
+ err = gl.glGetError();
+ if(err!=GL.GL_NO_ERROR) {
+ throw new GLException("createAndCompileShader: CreateShader failed, GL Error: 0x"+Integer.toHexString(err));
+ }
+
+ ShaderUtil.shaderSource(gl, shader, sources);
+ err = gl.glGetError();
+ if(err!=GL.GL_NO_ERROR) {
+ throw new GLException("createAndCompileShader: ShaderSource failed, GL Error: 0x"+Integer.toHexString(err));
+ }
+
+ ShaderUtil.compileShader(gl, shader);
+ err = gl.glGetError();
+ if(err!=GL.GL_NO_ERROR && null!=verboseOut) {
+ verboseOut.println("createAndCompileShader: CompileShader failed, GL Error: 0x"+Integer.toHexString(err));
+ }
+
+ return ShaderUtil.isShaderStatusValid(gl, shader, gl.GL_COMPILE_STATUS, verboseOut) && err == GL.GL_NO_ERROR;
+ }
+
+ /**
+ * returns the uniq shader id as an integer
+ * @see #key()
+ */
+ public int id() { return id.intValue(); }
+
+ /**
+ * returns the uniq shader id as an Integer
+ *
+ * @see #id()
+ */
+ public Integer key() { return id; }
+
+ public int shaderType() { return shaderType; }
+ public String shaderTypeStr() { return shaderTypeStr(shaderType); }
+
+ public static String shaderTypeStr(int type) {
+ switch (type) {
+ case GL2ES2.GL_VERTEX_SHADER:
+ return "VERTEX_SHADER";
+ case GL2ES2.GL_FRAGMENT_SHADER:
+ return "FRAGMENT_SHADER";
+ }
+ return "UNKNOWN_SHADER";
+ }
+
+ public int shaderBinaryFormat() { return shaderBinaryFormat; }
+ public Buffer shaderBinary() { return shaderBinary; }
+ public String[][] shaderSource() { return shaderSource; }
+
+ public boolean isValid() { return valid; }
+
+ public IntBuffer shader() { return shader; }
+
+ public boolean compile(GL2ES2 gl) {
+ return compile(gl, null);
+ }
+ public boolean compile(GL2ES2 gl, PrintStream verboseOut) {
+ if(isValid()) return true;
+
+ // Create & Compile the vertex/fragment shader objects
+ if(null!=shaderSource) {
+ valid=createAndCompileShader(gl, shader, shaderType,
+ shaderSource, verboseOut);
+ } else if(null!=shaderBinary) {
+ valid=createAndLoadShader(gl, shader, shaderType,
+ shaderBinaryFormat, shaderBinary, verboseOut);
+ } else {
+ throw new GLException("no code (source or binary)");
+ }
+ return valid;
+ }
+
+ public void destroy(GL2ES2 gl) {
+ if(isValid()) {
+ if(null!=gl) {
+ ShaderUtil.deleteShader(gl, shader());
+ }
+ valid=false;
+ }
+ if(null!=shaderBinary) {
+ shaderBinary.clear();
+ shaderBinary=null;
+ }
+ shaderSource=null;
+ shaderBinaryFormat=-1;
+ shaderType=-1;
+ id=null;
+ }
+
+ public boolean equals(Object obj) {
+ if(this==obj) return true;
+ if(obj instanceof ShaderCode) {
+ return id()==((ShaderCode)obj).id();
+ }
+ return false;
+ }
+ public int hashCode() {
+ return id.intValue();
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer("ShaderCode [id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
+ for(int i=0; i<shader.remaining(); i++) {
+ buf.append(" "+shader.get(i));
+ }
+ if(null!=shaderSource) {
+ buf.append(", source]");
+ } else if(null!=shaderBinary) {
+ buf.append(", binary "+shaderBinary+"]");
+ }
+ return buf.toString();
+ }
+
+ public static void readShaderSource(ClassLoader context, String path, URL url, StringBuffer result) {
+ try {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ if (line.startsWith("#include ")) {
+ String includeFile = line.substring(9).trim();
+ // Try relative path first
+ String next = Locator.getRelativeOf(path, includeFile);
+ URL nextURL = Locator.getResource(next, context);
+ if (nextURL == null) {
+ // Try absolute path
+ next = includeFile;
+ nextURL = Locator.getResource(next, context);
+ }
+ if (nextURL == null) {
+ // Fail
+ throw new FileNotFoundException("Can't find include file " + includeFile);
+ }
+ readShaderSource(context, next, nextURL, result);
+ } else {
+ result.append(line + "\n");
+ }
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static String readShaderSource(Class context, String path) {
+ ClassLoader contextCL = (null!=context)?context.getClassLoader():null;
+ URL url = Locator.getResource(path, contextCL);
+ if (url == null && null!=context) {
+ // Try again by scoping the path within the class's package
+ String className = context.getName().replace('.', '/');
+ int lastSlash = className.lastIndexOf('/');
+ if (lastSlash >= 0) {
+ String tmpPath = className.substring(0, lastSlash + 1) + path;
+ url = Locator.getResource(tmpPath, contextCL);
+ if (url != null) {
+ path = tmpPath;
+ }
+ }
+ }
+ if (url == null) {
+ return null;
+ }
+ StringBuffer result = new StringBuffer();
+ readShaderSource(contextCL, path, url, result);
+ return result.toString();
+ }
+
+ public static ByteBuffer readShaderBinary(Class context, String path) {
+ try {
+ URL url = Locator.getResource(context, path);
+ if (url == null) {
+ return null;
+ }
+ return StreamUtil.readAll2Buffer(new BufferedInputStream(url.openStream()));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ protected String[][] shaderSource = null;
+ protected Buffer shaderBinary = null;
+ protected int shaderBinaryFormat = -1;
+ protected IntBuffer shader = null;
+ protected int shaderType = -1;
+ protected Integer id = null;
+
+ protected boolean valid=false;
+
+ private static synchronized Integer getNextID() {
+ return new Integer(nextID++);
+ }
+ protected static int nextID = 1;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java
new file mode 100644
index 000000000..c06eae383
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderProgram.java
@@ -0,0 +1,212 @@
+
+package com.sun.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 {
+ public ShaderProgram() {
+ id = getNextID();
+ }
+
+ public boolean linked() {
+ return programLinked;
+ }
+
+ public boolean inUse() {
+ return programInUse;
+ }
+
+ public int program() { return shaderProgram; }
+
+ /**
+ * returns the uniq shader id as an integer
+ * @see #key()
+ */
+ public int id() { return id.intValue(); }
+
+ /**
+ * returns the uniq shader id as an Integer
+ *
+ * @see #id()
+ */
+ public Integer key() { return id; }
+
+ /**
+ * Detaches all shader codes and deletes the program.
+ * Destroys the shader codes as well.
+ * Calls release(gl, true)
+ *
+ * @see #release(GL2ES2, boolean)
+ */
+ public synchronized void destroy(GL2ES2 gl) {
+ release(gl, true);
+ }
+
+ /**
+ * Detaches all shader codes and deletes the program.
+ * Calls release(gl, false)
+ *
+ * @see #release(GL2ES2, boolean)
+ */
+ public synchronized void release(GL2ES2 gl) {
+ release(gl, false);
+ }
+
+ /**
+ * Detaches all shader codes and deletes the program.
+ * If releaseShaderToo is true, destroys the shader codes as well.
+ */
+ public synchronized void release(GL2ES2 gl, boolean releaseShaderToo) {
+ glUseProgram(gl, false);
+ for(Iterator iter=shaderMap.values().iterator(); iter.hasNext(); ) {
+ ShaderCode shaderCode = (ShaderCode) iter.next();
+ ShaderUtil.detachShader(gl, shaderProgram, shaderCode.shader());
+ if(releaseShaderToo) {
+ shaderCode.destroy(gl);
+ }
+ }
+ shaderMap.clear();
+ gl.glDeleteProgram(shaderProgram);
+ shaderProgram=-1;
+ }
+
+ //
+ // ShaderCode handling
+ //
+
+ /**
+ * Adds a new shader to a this non running program.
+ *
+ * @return false if the program is in use, or the shader already exist,
+ * otherwise true.
+ */
+ public synchronized boolean add(ShaderCode shaderCode) {
+ if(shaderMap.containsKey(shaderCode.key())) return false;
+ shaderMap.put(shaderCode.key(), shaderCode);
+ return true;
+ }
+
+ public synchronized ShaderCode getShader(int id) {
+ return (ShaderCode) shaderMap.get(new Integer(id));
+ }
+
+ //
+ // Program handling
+ //
+
+ /**
+ * Replace a shader in a 'running' program.
+ * 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
+ */
+ public synchronized boolean glReplaceShader(GL2ES2 gl, int oldShaderID, ShaderCode newShader, PrintStream verboseOut) {
+ if(!programLinked) throw new GLException("Program is not linked");
+ boolean shaderWasInUse = programInUse;
+ glUseProgram(gl, false);
+ if(!newShader.compile(gl, verboseOut)) {
+ return false;
+ }
+ if(oldShaderID>=0) {
+ ShaderCode oldShader = (ShaderCode) shaderMap.remove(new Integer(oldShaderID));
+ if(null!=oldShader) {
+ ShaderUtil.detachShader(gl, shaderProgram, oldShader.shader());
+ }
+ }
+ add(newShader);
+
+ ShaderUtil.attachShader(gl, shaderProgram, newShader.shader());
+ gl.glLinkProgram(shaderProgram);
+ if ( ! ShaderUtil.isProgramValid(gl, shaderProgram, System.err) ) {
+ return false;
+ }
+
+ if(shaderWasInUse) {
+ glUseProgram(gl, true);
+ }
+ return true;
+ }
+
+ public synchronized boolean link(GL2ES2 gl, PrintStream verboseOut) {
+ if(programLinked) throw new GLException("Program is already linked");
+
+ if(0>shaderProgram) {
+ shaderProgram = gl.glCreateProgram();
+ }
+
+ for(Iterator iter=shaderMap.values().iterator(); iter.hasNext(); ) {
+ ShaderCode shaderCode = (ShaderCode) iter.next();
+ if(!shaderCode.compile(gl, verboseOut)) {
+ return false;
+ }
+ ShaderUtil.attachShader(gl, shaderProgram, shaderCode.shader());
+ }
+
+ // Link the program
+ gl.glLinkProgram(shaderProgram);
+
+ programLinked = ShaderUtil.isProgramValid(gl, shaderProgram, System.err);
+
+ return programLinked;
+ }
+
+ public boolean equals(Object obj) {
+ if(this==obj) return true;
+ if(obj instanceof ShaderCode) {
+ return id()==((ShaderCode)obj).id();
+ }
+ return false;
+ }
+ public int hashCode() {
+ return id.intValue();
+ }
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("ShaderProgram[id="+id);
+ buf.append(", linked="+programLinked+", inUse="+programInUse+", program: "+shaderProgram+", [");
+ for(Iterator iter=shaderMap.values().iterator(); iter.hasNext(); ) {
+ buf.append((ShaderCode) iter.next());
+ buf.append(" ");
+ }
+ buf.append("]");
+ return buf.toString();
+ }
+
+ protected synchronized void glUseProgram(GL2ES2 gl, boolean on) {
+ if(!programLinked) throw new GLException("Program is not linked");
+ if(programInUse==on) return;
+ gl.glUseProgram(on?shaderProgram:0);
+ programInUse = on;
+
+ //Throwable tX = new Throwable("Info: ShaderProgram.glUseProgram: "+on);
+ //tX.printStackTrace();
+
+ }
+
+ protected boolean programLinked = false;
+ protected boolean programInUse = false;
+ protected int shaderProgram=-1;
+ protected HashMap shaderMap = new HashMap();
+ protected Integer id = null;
+
+ private static synchronized Integer getNextID() {
+ return new Integer(nextID++);
+ }
+ protected static int nextID = 1;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java
new file mode 100644
index 000000000..bab9ef4f3
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderState.java
@@ -0,0 +1,648 @@
+
+package com.sun.opengl.util.glsl;
+
+import javax.media.opengl.*;
+import com.sun.opengl.util.*;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.nio.*;
+import java.io.PrintStream;
+
+public class ShaderState {
+
+ public ShaderState() {
+ }
+
+ public boolean verbose() { return verbose; }
+
+ public void setVerbose(boolean v) { verbose=v; }
+
+ /**
+ * 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()
+ */
+ public static synchronized ShaderState getCurrent() {
+ GLContext current = GLContext.getCurrent();
+ if(null==current) {
+ throw new GLException("No context is current on this thread");
+ }
+ return (ShaderState) current.getAttachedObject(ShaderState.class.getName());
+ }
+
+ /**
+ * Turns the shader program on or off.<br>
+ * 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()
+ */
+ public synchronized void glUseProgram(GL2ES2 gl, boolean on) {
+ if(on) {
+ if(null!=shaderProgram) {
+ shaderProgram.glUseProgram(gl, true);
+ } else {
+ throw new GLException("No program is attached");
+ }
+ // update the current ShaderState to the TLS ..
+ gl.getContext().putAttachedObject(ShaderState.class.getName(), this);
+ } else if(null!=shaderProgram) {
+ shaderProgram.glUseProgram(gl, false);
+ }
+ }
+
+ public boolean linked() {
+ return (null!=shaderProgram)?shaderProgram.linked():false;
+ }
+
+ public boolean inUse() {
+ return (null!=shaderProgram)?shaderProgram.inUse():false;
+ }
+
+ /**
+ * Attach or switch a shader program
+ *
+ * Attaching a shader program the first time,
+ * as well as switching to another program on the fly,
+ * while managing all attribute and uniform data.
+ */
+ public synchronized void attachShaderProgram(GL2ES2 gl, ShaderProgram prog) {
+ boolean prgInUse = false; // earmarked state
+
+ if(DEBUG) {
+ int curId = (null!=shaderProgram)?shaderProgram.id():-1;
+ int newId = (null!=prog)?prog.id():-1;
+ System.err.println("Info: attachShaderProgram: "+curId+" -> "+newId+"\n\t"+shaderProgram+"\n\t"+prog);
+ Throwable tX = new Throwable("Info: attachShaderProgram: Trace");
+ tX.printStackTrace();
+ }
+ if(null!=shaderProgram) {
+ if(shaderProgram.equals(prog)) {
+ // nothing to do ..
+ if(DEBUG) {
+ System.err.println("Info: attachShaderProgram: NOP: equal id: "+shaderProgram.id());
+ }
+ return;
+ }
+ prgInUse = shaderProgram.inUse();
+ shaderProgram.glUseProgram(gl, false);
+ }
+
+ // register new one
+ shaderProgram = prog;
+
+ if(null!=shaderProgram) {
+ // reinstall all data ..
+ shaderProgram.glUseProgram(gl, true);
+ glResetAllVertexAttributes(gl);
+ glResetAllUniforms(gl);
+ if(!prgInUse) {
+ shaderProgram.glUseProgram(gl, false);
+ }
+ }
+ if(DEBUG) {
+ System.err.println("Info: attachShaderProgram: END");
+ }
+ }
+
+ public ShaderProgram shaderProgram() { return shaderProgram; }
+
+ /**
+ * Calls release(gl, true, true)
+ *
+ * @see #glReleaseAllVertexAttributes
+ * @see #glReleaseAllUniforms
+ * @see #release(GL2ES2, boolean, boolean)
+ */
+ public synchronized void destroy(GL2ES2 gl) {
+ release(gl, true, true);
+ }
+
+ /**
+ * Calls release(gl, false, false)
+ *
+ * @see #glReleaseAllVertexAttributes
+ * @see #glReleaseAllUniforms
+ * @see #release(GL2ES2, boolean, boolean)
+ */
+ public synchronized void releaseAllData(GL2ES2 gl) {
+ release(gl, false, false);
+ }
+
+ /**
+ * @see #glReleaseAllVertexAttributes
+ * @see #glReleaseAllUniforms
+ * @see ShaderProgram#release(GL2ES2, boolean)
+ */
+ public synchronized void release(GL2ES2 gl, boolean releaseProgramToo, boolean releaseShaderToo) {
+ boolean prgInUse = false;
+ if(null!=shaderProgram) {
+ prgInUse = shaderProgram.inUse();
+ if(!prgInUse) {
+ shaderProgram.glUseProgram(gl, true);
+ }
+ }
+ glReleaseAllVertexAttributes(gl);
+ glReleaseAllUniforms(gl);
+ if(null!=shaderProgram) {
+ if(releaseProgramToo) {
+ shaderProgram.release(gl, releaseShaderToo);
+ } else if(!prgInUse) {
+ shaderProgram.glUseProgram(gl, false);
+ }
+ }
+ }
+
+ //
+ // Shader attribute handling
+ //
+
+ /**
+ * Binds an attribute to the shader.
+ * This must be done before the program is linked !
+ * n name - 1 idx, where name is a uniq key
+ *
+ * @throws GLException is the program is already linked
+ *
+ * @see #glBindAttribLocation
+ * @see javax.media.opengl.GL2ES2#glBindAttribLocation
+ * @see #glGetAttribLocation
+ * @see javax.media.opengl.GL2ES2#glGetAttribLocation
+ * @see #getAttribLocation
+ * @see #glReplaceShader
+ */
+ public void glBindAttribLocation(GL2ES2 gl, int index, String name) {
+ if(null==shaderProgram) throw new GLException("No program is attached");
+ if(shaderProgram.linked()) throw new GLException("Program is already linked");
+ Integer idx = new Integer(index);
+ if(!attribMap2Idx.containsKey(name)) {
+ attribMap2Idx.put(name, idx);
+ gl.glBindAttribLocation(shaderProgram.program(), index, name);
+ }
+ }
+
+ /**
+ * Gets the index of a shader attribute.
+ * This must be done after the program is linked !
+ *
+ * @return -1 if there is no such attribute available,
+ * otherwise >= 0
+ * @throws GLException is the program is not linked
+ *
+ * @see #glBindAttribLocation
+ * @see javax.media.opengl.GL2ES2#glBindAttribLocation
+ * @see #glGetAttribLocation
+ * @see javax.media.opengl.GL2ES2#glGetAttribLocation
+ * @see #getAttribLocation
+ * @see #glReplaceShader
+ */
+ public int glGetAttribLocation(GL2ES2 gl, String name) {
+ if(!shaderProgram.linked()) throw new GLException("Program is not linked");
+ int index = getAttribLocation(name);
+ if(0>index) {
+ index = gl.glGetAttribLocation(shaderProgram.program(), name);
+ if(0<=index) {
+ Integer idx = new Integer(index);
+ attribMap2Idx.put(name, idx);
+ if(DEBUG) {
+ System.err.println("Info: glGetAttribLocation: "+name+", loc: "+index);
+ }
+ } else if(verbose) {
+ Throwable tX = new Throwable("Info: glGetAttribLocation failed, no location for: "+name+", index: "+index);
+ tX.printStackTrace();
+ }
+ }
+ return index;
+ }
+
+ protected int getAttribLocation(String name) {
+ Integer idx = (Integer) attribMap2Idx.get(name);
+ return (null!=idx)?idx.intValue():-1;
+ }
+
+
+ //
+ // Enabled Vertex Arrays and its data
+ //
+
+ /**
+ * Enable a vertex attribute array
+ *
+ * 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
+ *
+ * @throws GLException if the program is not in use
+ *
+ * @see #glEnableVertexAttribArray
+ * @see #glDisableVertexAttribArray
+ * @see #glVertexAttribPointer
+ * @see #getVertexAttributePointer
+ * @see #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public boolean glEnableVertexAttribArray(GL2ES2 gl, String name) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ enabledVertexAttribArraySet.add(name);
+ int index = glGetAttribLocation(gl, name);
+ if(0>index) {
+ if(verbose) {
+ Throwable tX = new Throwable("Info: glEnableVertexAttribArray failed, no index for: "+name);
+ tX.printStackTrace();
+ }
+ return false;
+ }
+ if(DEBUG) {
+ System.err.println("Info: glEnableVertexAttribArray: "+name+", loc: "+index);
+ }
+ gl.glEnableVertexAttribArray(index);
+ return true;
+ }
+
+ public boolean isVertexAttribArrayEnabled(String name) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ return enabledVertexAttribArraySet.contains(name);
+ }
+
+ /**
+ * Disables a vertex attribute array
+ *
+ * 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
+ *
+ * @throws GLException if the program is not in use
+ *
+ * @see #glEnableVertexAttribArray
+ * @see #glDisableVertexAttribArray
+ * @see #glVertexAttribPointer
+ * @see #getVertexAttributePointer
+ * @see #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public boolean glDisableVertexAttribArray(GL2ES2 gl, String name) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ enabledVertexAttribArraySet.remove(name);
+ int index = glGetAttribLocation(gl, name);
+ if(0>index) {
+ if(verbose) {
+ Throwable tX = new Throwable("Info: glDisableVertexAttribArray failed, no index for: "+name);
+ tX.printStackTrace();
+ }
+ return false;
+ }
+ if(DEBUG) {
+ System.err.println("Info: glDisableVertexAttribArray: "+name);
+ }
+ gl.glDisableVertexAttribArray(index);
+ return true;
+ }
+
+ /**
+ * Set the vertex attribute data.
+ * Enable the attribute, if it is not enabled yet.
+ *
+ * Even if the attribute is not found in the current shader,
+ * it is stored in this state.
+ *
+ * @arg data the GLArrayData's name must match the attributes one,
+ * it's index will be set with the attribute's location,
+ * if found.
+ *
+ * @returns 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 #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public boolean glVertexAttribPointer(GL2ES2 gl, GLArrayData data) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ if(!enabledVertexAttribArraySet.contains(data.getName())) {
+ if(!glEnableVertexAttribArray(gl, data.getName())) {
+ if(verbose) {
+ Throwable tX = new Throwable("Info: glVertexAttribPointer: couldn't enable: "+data);
+ tX.printStackTrace();
+ }
+ }
+ }
+ int index = getAttribLocation(data.getName());
+ if(0>index) {
+ if(verbose) {
+ Throwable tX = new Throwable("Info: glVertexAttribPointer failed, no index for: "+data);
+ tX.printStackTrace();
+ }
+ }
+ data.setLocation(index);
+ vertexAttribMap2Data.put(data.getName(), data);
+ if(0<=index) {
+ // only pass the data, if the attribute exists in the current shader
+ if(DEBUG) {
+ System.err.println("Info: glVertexAttribPointer: "+data);
+ }
+ gl.glVertexAttribPointer(data);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get the vertex attribute data, previously set.
+ *
+ * @returns the GLArrayData object, null if not previously set.
+ *
+ * @see #glEnableVertexAttribArray
+ * @see #glDisableVertexAttribArray
+ * @see #glVertexAttribPointer
+ * @see #getVertexAttributePointer
+ * @see #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public GLArrayData getVertexAttribPointer(String name) {
+ return (GLArrayData) vertexAttribMap2Data.get(name);
+ }
+
+ /**
+ * Releases all mapped vertex attribute data,
+ * disables all enabled attributes and loses all indices
+ *
+ * @throws GLException is the program is not in use but the shaderProgram is set
+ *
+ * @see #glEnableVertexAttribArray
+ * @see #glDisableVertexAttribArray
+ * @see #glVertexAttribPointer
+ * @see #getVertexAttributePointer
+ * @see #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public void glReleaseAllVertexAttributes(GL2ES2 gl) {
+ if(null!=shaderProgram) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ for(Iterator iter = vertexAttribMap2Data.keySet().iterator(); iter.hasNext(); ) {
+ if(!glDisableVertexAttribArray(gl, (String) iter.next())) {
+ throw new GLException("Internal Error: mapped vertex attribute couldn't be disabled");
+ }
+ }
+ for(Iterator iter = enabledVertexAttribArraySet.iterator(); iter.hasNext(); ) {
+ if(!glDisableVertexAttribArray(gl, (String) iter.next())) {
+ throw new GLException("Internal Error: prev enabled vertex attribute couldn't be disabled");
+ }
+ }
+ }
+ vertexAttribMap2Data.clear();
+ enabledVertexAttribArraySet.clear();
+ attribMap2Idx.clear();
+ }
+
+ /**
+ * Disables all vertex attribute arrays.
+ *
+ * Their enabled stated will be removed from this state only
+ * if 'removeFromState' is true.
+ *
+ * This method purpose is more for debugging.
+ *
+ * @throws GLException is the program is not in use but the shaderProgram is set
+ *
+ * @see #glEnableVertexAttribArray
+ * @see #glDisableVertexAttribArray
+ * @see #glVertexAttribPointer
+ * @see #getVertexAttributePointer
+ * @see #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public void glDisableAllVertexAttributeArrays(GL2ES2 gl, boolean removeFromState) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+
+ for(Iterator iter = enabledVertexAttribArraySet.iterator(); iter.hasNext(); ) {
+ String name = (String) iter.next();
+ if(removeFromState) {
+ enabledVertexAttribArraySet.remove(name);
+ }
+ int index = glGetAttribLocation(gl, name);
+ if(0<=index) {
+ gl.glDisableVertexAttribArray(index);
+ }
+ }
+ }
+
+ /**
+ * Reset all previously enabled mapped vertex attribute data,
+ * incl enabling them
+ *
+ * @throws GLException is the program is not in use
+ *
+ * @see #glEnableVertexAttribArray
+ * @see #glDisableVertexAttribArray
+ * @see #glVertexAttribPointer
+ * @see #getVertexAttributePointer
+ * @see #glReleaseAllVertexAttributes
+ * @see #glResetAllVertexAttributes
+ * @see #glReplaceShader
+ */
+ public void glResetAllVertexAttributes(GL2ES2 gl) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ attribMap2Idx.clear();
+
+ /**
+ *
+ for(Iterator iter = enabledVertexAttribArraySet.iterator(); iter.hasNext(); ) {
+ glEnableVertexAttribArray(gl, (String) iter.next());
+ }
+ for(Iterator iter = vertexAttribMap2Data.values().iterator(); iter.hasNext(); ) {
+ GLArrayData data = (GLArrayData) iter.next();
+
+ ...
+ } */
+
+ for(Iterator iter = enabledVertexAttribArraySet.iterator(); iter.hasNext(); ) {
+ // get new location ..
+ String name = (String) iter.next();
+ int loc = glGetAttribLocation(gl, name);
+
+ // get & update data ..
+ GLArrayData data = getVertexAttribPointer(name);
+ data.setLocation(loc);
+ vertexAttribMap2Data.put(name, data);
+
+ if(0>loc) {
+ // not used in shader
+ continue;
+ }
+
+ // enable attrib, VBO and pass location/data
+ gl.glEnableVertexAttribArray(loc);
+
+ if( data.isVBO() ) {
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, data.getVBOName());
+ }
+
+ gl.glVertexAttribPointer(data);
+ }
+ }
+
+ //
+ // Shader Uniform handling
+ //
+
+ /**
+ * Gets the index of a shader uniform.
+ * This must be done when the program is in use !
+ *
+ * @return -1 if there is no such attribute available,
+ * otherwise >= 0
+
+ * @throws GLException is the program is not linked
+ *
+ * @see #glGetUniformLocation
+ * @see javax.media.opengl.GL2ES2#glGetUniformLocation
+ * @see #getUniformLocation
+ * @see #glReplaceShader
+ */
+ protected int glGetUniformLocation(GL2ES2 gl, String name) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ int index = getUniformLocation(name);
+ if(0>index) {
+ index = gl.glGetUniformLocation(shaderProgram.program(), name);
+ if(0<=index) {
+ Integer idx = new Integer(index);
+ uniformMap2Idx.put(name, idx);
+ } else if(verbose) {
+ Throwable tX = new Throwable("Info: glUniform failed, no location for: "+name+", index: "+index);
+ tX.printStackTrace();
+ }
+ }
+ return index;
+ }
+
+ protected int getUniformLocation(String name) {
+ Integer idx = (Integer) uniformMap2Idx.get(name);
+ return (null!=idx)?idx.intValue():-1;
+ }
+
+ /**
+ * Set the uniform data.
+ *
+ * Even if the uniform is not found in the current shader,
+ * it is stored in this state.
+ *
+ * @arg data the GLUniforms's name must match the uniform one,
+ * it's index will be set with the uniforms's location,
+ * if found.
+ *
+ *
+ * @returns 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
+ */
+ public boolean glUniform(GL2ES2 gl, GLUniformData data) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ int location = glGetUniformLocation(gl, data.getName());
+ data.setLocation(location);
+ uniformMap2Data.put(data.getName(), data);
+ if(0<=location) {
+ // only pass the data, if the uniform exists in the current shader
+ if(DEBUG) {
+ System.err.println("Info: glUniform: "+data);
+ }
+ gl.glUniform(data);
+ }
+ return true;
+ }
+
+ /**
+ * Get the uniform data, previously set.
+ *
+ * @returns the GLUniformData object, null if not previously set.
+ */
+ public GLUniformData getUniform(String name) {
+ return (GLUniformData) uniformMap2Data.get(name);
+ }
+
+ /**
+ * Releases all mapped uniform data
+ * and loses all indices
+ *
+ * @throws GLException is the program is not in use
+ */
+ public void glReleaseAllUniforms(GL2ES2 gl) {
+ uniformMap2Data.clear();
+ uniformMap2Idx.clear();
+ }
+
+ /**
+ * Reset all previously mapped uniform data
+ *
+ * @throws GLException is the program is not in use
+ */
+ public void glResetAllUniforms(GL2ES2 gl) {
+ if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
+ uniformMap2Idx.clear();
+ for(Iterator iter = uniformMap2Data.values().iterator(); iter.hasNext(); ) {
+ glUniform(gl, (GLUniformData) iter.next());
+ }
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("ShaderState[");
+ buf.append(shaderProgram.toString());
+ buf.append(",EnabledStates: [");
+ for(Iterator iter = enabledVertexAttribArraySet.iterator(); iter.hasNext(); ) {
+ buf.append("\n ");
+ buf.append((String)iter.next());
+ }
+ buf.append("], [");
+ for(Iterator iter = vertexAttribMap2Data.values().iterator(); iter.hasNext(); ) {
+ GLArrayData data = (GLArrayData) iter.next();
+ if(data.getLocation()>=0) {
+ buf.append("\n ");
+ buf.append(data);
+ }
+ }
+ buf.append("], [");
+ for(Iterator iter=uniformMap2Data.values().iterator(); iter.hasNext(); ) {
+ GLUniformData data = (GLUniformData) iter.next();
+ if(data.getLocation()>=0) {
+ buf.append("\n ");
+ buf.append(data);
+ }
+ }
+ buf.append("]");
+ return buf.toString();
+ }
+
+ protected static final boolean DEBUG = false;
+ protected boolean verbose = false;
+ protected ShaderProgram shaderProgram=null;
+ protected HashMap attribMap2Idx = new HashMap();
+ protected HashSet enabledVertexAttribArraySet = new HashSet();
+ protected HashMap vertexAttribMap2Data = new HashMap();
+ protected HashMap uniformMap2Idx = new HashMap();
+ protected HashMap uniformMap2Data = new HashMap();
+
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java
new file mode 100644
index 000000000..d1bb8b32b
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/ShaderUtil.java
@@ -0,0 +1,398 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.opengl.util.glsl;
+
+import java.io.PrintStream;
+import java.nio.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+
+public class ShaderUtil {
+ static abstract class Impl {
+ public abstract String getShaderInfoLog(GL gl, int shaderObj);
+ public abstract String getProgramInfoLog(GL gl, int programObj);
+ public abstract boolean isShaderStatusValid(GL gl, int shaderObj, int name);
+ public abstract boolean isShaderStatusValid(GL gl, int shaderObj, int name, PrintStream verboseOut);
+ public abstract boolean isShaderStatusValid(GL gl, IntBuffer shaders, int name);
+ public abstract boolean isShaderStatusValid(GL gl, IntBuffer shaders, int name, PrintStream verboseOut);
+ public abstract boolean isProgramStatusValid(GL gl, int programObj, int name);
+ public abstract boolean isProgramValid(GL gl, int programObj);
+ public abstract boolean isProgramValid(GL gl, int programObj, PrintStream verboseOut);
+ public abstract void createShader(GL gl, int type, IntBuffer shaders);
+ public abstract Set getShaderBinaryFormats(GL gl);
+ public abstract boolean isShaderCompilerAvailable(GL gl);
+ public abstract void shaderSource(GL gl, int shader, java.lang.String[] source);
+ public abstract void shaderSource(GL gl, IntBuffer shaders, java.lang.String[][] sources);
+ public abstract void shaderBinary(GL gl, IntBuffer shaders, int binFormat, java.nio.Buffer bin);
+ public abstract void compileShader(GL gl, IntBuffer shaders);
+ public abstract void attachShader(GL gl, int program, IntBuffer shaders);
+ public abstract void detachShader(GL gl, int program, IntBuffer shaders);
+ public abstract void deleteShader(GL gl, IntBuffer shaders);
+ }
+
+ static class GL2ES2Impl extends Impl {
+ public String getShaderInfoLog(GL _gl, int shaderObj) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ int[] infoLogLength=new int[1];
+ gl.glGetShaderiv(shaderObj, gl.GL_INFO_LOG_LENGTH, infoLogLength, 0);
+
+ if(infoLogLength[0]==0) {
+ return "(no info log)";
+ }
+ int[] charsWritten=new int[1];
+ byte[] infoLogBytes = new byte[infoLogLength[0]];
+ gl.glGetShaderInfoLog(shaderObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0);
+
+ return new String(infoLogBytes, 0, charsWritten[0]);
+ }
+
+ public String getProgramInfoLog(GL _gl, int programObj) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ int[] infoLogLength=new int[1];
+ gl.glGetProgramiv(programObj, gl.GL_INFO_LOG_LENGTH, infoLogLength, 0);
+
+ if(infoLogLength[0]==0) {
+ return "(no info log)";
+ }
+ int[] charsWritten=new int[1];
+ byte[] infoLogBytes = new byte[infoLogLength[0]];
+ gl.glGetProgramInfoLog(programObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0);
+
+ return new String(infoLogBytes, 0, charsWritten[0]);
+ }
+
+ public boolean isShaderStatusValid(GL _gl, int shaderObj, int name) {
+ return isShaderStatusValid(_gl, shaderObj, name, null);
+ }
+
+ public boolean isShaderStatusValid(GL _gl, int shaderObj, int name, PrintStream verboseOut) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ int[] ires = new int[1];
+ gl.glGetShaderiv(shaderObj, name, ires, 0);
+
+ boolean res = ires[0]==1;
+ if(!res && null!=verboseOut) {
+ verboseOut.println("Shader status invalid: "+ getShaderInfoLog(gl, shaderObj));
+ }
+ return res;
+ }
+
+ public boolean isShaderStatusValid(GL _gl, IntBuffer shaders, int name) {
+ return isShaderStatusValid(_gl, shaders, name, null);
+ }
+
+ public boolean isShaderStatusValid(GL _gl, IntBuffer shaders, int name, PrintStream verboseOut) {
+ boolean res = true;
+ for (int i = shaders.position(); i < shaders.limit(); i++) {
+ res = isShaderStatusValid(_gl, shaders.get(i), name, verboseOut) && res;
+ }
+ return res;
+ }
+
+ public boolean isProgramStatusValid(GL _gl, int programObj, int name) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ int[] ires = new int[1];
+ gl.glGetProgramiv(programObj, name, ires, 0);
+
+ return ires[0]==1;
+ }
+
+ public boolean isProgramValid(GL _gl, int programObj) {
+ return isProgramValid(_gl, programObj, null);
+ }
+
+ public boolean isProgramValid(GL _gl, int programObj, PrintStream verboseOut) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ int[] ires = new int[1];
+ if(!gl.glIsProgram(programObj)) {
+ if(null!=verboseOut) {
+ verboseOut.println("Program name invalid: "+programObj);
+ }
+ return false;
+ }
+ if(!isProgramStatusValid(gl, programObj, gl.GL_LINK_STATUS)) {
+ if(null!=verboseOut) {
+ verboseOut.println("Program link failed: "+programObj+"\n\t"+ getProgramInfoLog(gl, programObj));
+ }
+ return false;
+ }
+ if ( !gl.isGLES2() || isShaderCompilerAvailable(gl) ) {
+ // failed on APX2500 (ES2.0, no compiler) for valid programs
+ gl.glValidateProgram(programObj);
+ if(!isProgramStatusValid(gl, programObj, gl.GL_VALIDATE_STATUS)) {
+ if(null!=verboseOut) {
+ verboseOut.println("Program validation failed: "+programObj+"\n\t"+ getProgramInfoLog(gl, programObj));
+ }
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public void createShader(GL _gl, int type, IntBuffer shaders) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ for (int i = shaders.position(); i < shaders.limit(); i++) {
+ shaders.put(i, gl.glCreateShader(type));
+ }
+ }
+
+ private Boolean shaderCompilerAvailable = null;
+ private Set shaderBinaryFormats = null;
+
+ public Set getShaderBinaryFormats(GL _gl) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ if(null==shaderBinaryFormats) {
+ if(gl.getContext()!=GLContext.getCurrent()) {
+ return new HashSet(0); // bail out
+ }
+
+ int[] param = new int[1];
+ shaderBinaryFormats = new HashSet();
+
+ if (gl.isGLES2()) {
+ gl.glGetIntegerv(GL2ES2.GL_NUM_SHADER_BINARY_FORMATS, param, 0);
+ int numFormats = param[0];
+ if(numFormats>0) {
+ int[] formats = new int[numFormats];
+ gl.glGetIntegerv(GL2ES2.GL_SHADER_BINARY_FORMATS, formats, 0);
+ for(int i=0; i<numFormats; i++) {
+ shaderBinaryFormats.add(new Integer(formats[i]));
+ }
+ }
+ }
+ }
+ return shaderBinaryFormats;
+ }
+
+
+ public boolean isShaderCompilerAvailable(GL _gl) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ if(null==shaderCompilerAvailable) {
+ if(gl.getContext()!=GLContext.getCurrent()) {
+ return false; // bail out
+ }
+ Set bfs = getShaderBinaryFormats(gl);
+ if(gl.isGLES2()) {
+ byte[] param = new byte[1];
+ gl.glGetBooleanv(GL2ES2.GL_SHADER_COMPILER, param, 0);
+ boolean v = param[0]!=(byte)0x00;
+ if(!v && bfs.size()==0) {
+ // no supported binary formats, hence a compiler must be available!
+ v = true;
+ }
+ shaderCompilerAvailable = new Boolean(v);
+ } else if( gl.isGL2() || gl.isGL2ES2() ) {
+ shaderCompilerAvailable = new Boolean(true);
+ } else {
+ throw new GLException("Invalid OpenGL profile");
+ }
+ }
+ return shaderCompilerAvailable.booleanValue();
+ }
+
+ public void shaderSource(GL _gl, int shader, java.lang.String[] source)
+ {
+ GL2ES2 gl = _gl.getGL2ES2();
+ if(!isShaderCompilerAvailable(_gl)) {
+ throw new GLException("No compiler is available");
+ }
+
+ int count = (null!=source)?source.length:0;
+ if(count==0) {
+ throw new GLException("No sources specified");
+ }
+
+ int[] lengths = new int[count];
+ for(int i=0; i<count; i++) {
+ lengths[i] = source[i].length();
+ }
+ gl.glShaderSource(shader, count, source, lengths, 0);
+ }
+
+ public void shaderSource(GL _gl, IntBuffer shaders, java.lang.String[][] sources)
+ {
+ int sourceNum = (null!=sources)?sources.length:0;
+ int shaderNum = (null!=shaders)?shaders.remaining():0;
+ if(shaderNum<=0 || sourceNum<=0 || shaderNum!=sourceNum) {
+ throw new GLException("Invalid number of shaders and/or sources: shaders="+
+ shaderNum+", sources="+sourceNum);
+ }
+ for(int i=0; i<sourceNum; i++) {
+ shaderSource(_gl, shaders.get(shaders.position() + i), sources[i]);
+ }
+ }
+
+ public void shaderBinary(GL _gl, IntBuffer shaders, int binFormat, java.nio.Buffer bin)
+ {
+ GL2ES2 gl = _gl.getGL2ES2();
+ if(getShaderBinaryFormats(gl).size()<=0) {
+ throw new GLException("No binary formats are supported");
+ }
+
+ int shaderNum = shaders.remaining();
+ if(shaderNum<=0) {
+ throw new GLException("No shaders specified");
+ }
+ if(null==bin) {
+ throw new GLException("Null shader binary");
+ }
+ int binLength = bin.remaining();
+ if(0>=binLength) {
+ throw new GLException("Empty shader binary (remaining == 0)");
+ }
+ gl.glShaderBinary(shaderNum, shaders, binFormat, bin, binLength);
+ }
+
+ public void compileShader(GL _gl, IntBuffer shaders)
+ {
+ GL2ES2 gl = _gl.getGL2ES2();
+ for (int i = shaders.position(); i < shaders.limit(); i++) {
+ gl.glCompileShader(shaders.get(i));
+ }
+ }
+
+ public void attachShader(GL _gl, int program, IntBuffer shaders)
+ {
+ GL2ES2 gl = _gl.getGL2ES2();
+ for (int i = shaders.position(); i < shaders.limit(); i++) {
+ gl.glAttachShader(program, shaders.get(i));
+ }
+ }
+
+ public void detachShader(GL _gl, int program, IntBuffer shaders)
+ {
+ GL2ES2 gl = _gl.getGL2ES2();
+ for (int i = shaders.position(); i < shaders.limit(); i++) {
+ gl.glDetachShader(program, shaders.get(i));
+ }
+ }
+
+ public void deleteShader(GL _gl, IntBuffer shaders)
+ {
+ GL2ES2 gl = _gl.getGL2ES2();
+ for (int i = shaders.position(); i < shaders.limit(); i++) {
+ gl.glDeleteShader(shaders.get(i));
+
+ }
+ }
+ }
+
+ public static String getShaderInfoLog(GL gl, int shaderObj) {
+ return getImpl(gl).getShaderInfoLog(gl, shaderObj);
+ }
+
+ public static String getProgramInfoLog(GL gl, int programObj) {
+ return getImpl(gl).getProgramInfoLog(gl, programObj);
+ }
+
+ public static boolean isShaderStatusValid(GL gl, int shaderObj, int name) {
+ return getImpl(gl).isShaderStatusValid(gl, shaderObj, name);
+ }
+
+ public static boolean isShaderStatusValid(GL gl, int shaderObj, int name, PrintStream verboseOut) {
+ return getImpl(gl).isShaderStatusValid(gl, shaderObj, name, verboseOut);
+ }
+
+ public static boolean isShaderStatusValid(GL gl, IntBuffer shaders, int name) {
+ return getImpl(gl).isShaderStatusValid(gl, shaders, name);
+ }
+
+ public static boolean isShaderStatusValid(GL gl, IntBuffer shaders, int name, PrintStream verboseOut) {
+ return getImpl(gl).isShaderStatusValid(gl, shaders, name, verboseOut);
+ }
+
+ public static boolean isProgramStatusValid(GL gl, int programObj, int name) {
+ return getImpl(gl).isProgramStatusValid(gl, programObj, name);
+ }
+
+ public static boolean isProgramValid(GL gl, int programObj) {
+ return getImpl(gl).isProgramValid(gl, programObj);
+ }
+
+ public static boolean isProgramValid(GL gl, int programObj, PrintStream verboseOut) {
+ return getImpl(gl).isProgramValid(gl, programObj, verboseOut);
+ }
+
+ public static void createShader(GL gl, int type, IntBuffer shaders) {
+ getImpl(gl).createShader(gl, type, shaders);
+ }
+
+ public static Set getShaderBinaryFormats(GL gl) {
+ return getImpl(gl).getShaderBinaryFormats(gl);
+ }
+
+ public static boolean isShaderCompilerAvailable(GL gl) {
+ return getImpl(gl).isShaderCompilerAvailable(gl);
+ }
+
+ public static void shaderSource(GL gl, int shader, java.lang.String[] source) {
+ getImpl(gl).shaderSource(gl, shader, source);
+ }
+
+ public static void shaderSource(GL gl, IntBuffer shaders, java.lang.String[][] sources) {
+ getImpl(gl).shaderSource(gl, shaders, sources);
+ }
+
+ public static void shaderBinary(GL gl, IntBuffer shaders, int binFormat, java.nio.Buffer bin) {
+ getImpl(gl).shaderBinary(gl, shaders, binFormat, bin);
+ }
+
+ public static void compileShader(GL gl, IntBuffer shaders) {
+ getImpl(gl).compileShader(gl, shaders);
+ }
+
+ public static void attachShader(GL gl, int program, IntBuffer shaders) {
+ getImpl(gl).attachShader(gl, program, shaders);
+ }
+
+ public static void detachShader(GL gl, int program, IntBuffer shaders) {
+ getImpl(gl).detachShader(gl, program, shaders);
+ }
+
+ public static void deleteShader(GL gl, IntBuffer shaders) {
+ getImpl(gl).deleteShader(gl, shaders);
+ }
+
+ private static Impl getImpl(GL _gl) {
+ GL2ES2 gl = _gl.getGL2ES2();
+ GLContext context = gl.getContext();
+ Impl impl = (Impl) context.getAttachedObject(ShaderUtil.class.getName());
+ if (impl == null) {
+ impl = new GL2ES2Impl();
+ context.putAttachedObject(ShaderUtil.class.getName(), impl);
+ }
+ return impl;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
new file mode 100644
index 000000000..9c8a65173
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package com.sun.opengl.util.glsl.fixedfunc;
+
+import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.*;
+
+import com.sun.opengl.util.glsl.fixedfunc.impl.*;
+
+/**
+ * Tool to pipeline GL2ES2 into a fixed function emulation implementing GL2ES1.
+ */
+public class FixedFuncUtil {
+ /**
+ * @return If gl is a GL2ES1, return the type cast object,
+ * otherwise create a fixed function emulation pipeline with the GL2ES2 impl.
+ * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2
+ */
+ public static final GL2ES1 getFixedFuncImpl(GL gl) {
+ if(gl.isGL2ES1()) {
+ return gl.getGL2ES1();
+ } else if(gl.isGL2ES2()) {
+ GL2ES2 es2 = gl.getGL2ES2();
+ FixedFuncHook hook = new FixedFuncHook(es2);
+ FixedFuncImpl impl = new FixedFuncImpl(es2, hook);
+ gl.getContext().setGL(impl);
+ return impl;
+ }
+ throw new GLException("GL Object is neither GL2ES1 nor GL2ES2");
+ }
+
+ /**
+ * Mapping fixed function (client) array indices to
+ * GLSL array attribute names.
+ *
+ * Useful for uniq mapping of canonical array index names as listed.
+ *
+ * @see #mgl_Vertex
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_VERTEX_ARRAY
+ * @see #mgl_Normal
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_NORMAL_ARRAY
+ * @see #mgl_Color
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_COLOR_ARRAY
+ * @see #mgl_MultiTexCoord
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#GL_TEXTURE_COORD_ARRAY
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#glEnableClientState
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#glVertexPointer
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#glColorPointer
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#glNormalPointer
+ * @see javax.media.opengl.fixedfunc.GLPointerFunc#glTexCoordPointer
+ */
+ public static String getPredefinedArrayIndexName(int glArrayIndex) {
+ return FixedFuncPipeline.getPredefinedArrayIndexName(glArrayIndex);
+ }
+
+ /**
+ * String name for
+ * @see javax.media.opengl.GL#GL_VERTEX_ARRAY
+ */
+ public static final String mgl_Vertex = FixedFuncPipeline.mgl_Vertex;
+
+ /**
+ * String name for
+ * @see javax.media.opengl.GL#GL_NORMAL_ARRAY
+ */
+ public static final String mgl_Normal = FixedFuncPipeline.mgl_Normal;
+
+ /**
+ * String name for
+ * @see javax.media.opengl.GL#GL_COLOR_ARRAY
+ */
+ public static final String mgl_Color = FixedFuncPipeline.mgl_Color;
+
+ /**
+ * String name for
+ * @see javax.media.opengl.GL#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/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java
new file mode 100755
index 000000000..6f44f10b7
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncHook.java
@@ -0,0 +1,331 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package com.sun.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 java.nio.*;
+
+public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFunc {
+ public static final int MAX_TEXTURE_UNITS = 8;
+
+ protected FixedFuncPipeline fixedFunction=null;
+ protected PMVMatrix pmvMatrix=null;
+ protected GL2ES2 gl=null;
+
+ public FixedFuncHook (GL2ES2 gl) {
+ this(gl, null);
+ }
+
+ public FixedFuncHook (GL2ES2 gl, PMVMatrix matrix) {
+ this.gl = gl;
+ pmvMatrix = (null!=matrix)?matrix:new PMVMatrix();
+
+ fixedFunction = new FixedFuncPipeline(gl, pmvMatrix);
+ }
+
+ public FixedFuncHook(GL2ES2 gl, PMVMatrix matrix,
+ Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
+ String vertexColorFile,
+ String vertexColorLightFile,
+ String fragmentColorFile,
+ String fragmentColorTextureFile) {
+ this.gl = gl;
+ pmvMatrix = matrix;
+
+ fixedFunction = new FixedFuncPipeline(gl, pmvMatrix,
+ shaderRootClass, shaderSrcRoot, shaderBinRoot,
+ vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
+ }
+
+ public void destroy() {
+ fixedFunction.destroy(gl);
+ fixedFunction = null;
+ }
+
+ public PMVMatrix getMatrix() { return pmvMatrix; }
+
+ //
+ // FixedFuncHookIf - hooks
+ //
+ public void glDrawArrays(int mode, int first, int count) {
+ fixedFunction.validate(gl);
+ gl.glDrawArrays(mode, first, count);
+ }
+ public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
+ fixedFunction.validate(gl);
+ gl.glDrawElements(mode, count, type, indices);
+ }
+ public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
+ fixedFunction.validate(gl);
+ gl.glDrawElements(mode, count, type, indices_buffer_offset);
+ }
+
+ public void glActiveTexture(int texture) {
+ fixedFunction.glActiveTexture(gl, texture);
+ gl.glActiveTexture(texture);
+ }
+ public void glEnable(int cap) {
+ if(fixedFunction.glEnable(gl, cap, true)) {
+ gl.glEnable(cap);
+ }
+ }
+ public void glDisable(int cap) {
+ if(fixedFunction.glEnable(gl, cap, false)) {
+ gl.glDisable(cap);
+ }
+ }
+ public void glCullFace(int faceName) {
+ fixedFunction.glCullFace(gl, faceName);
+ gl.glCullFace(faceName);
+ }
+
+ public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
+ if(pmvMatrix.isMatrixGetName(pname)) {
+ pmvMatrix.glGetFloatv(pname, params);
+ return;
+ }
+ gl.glGetFloatv(pname, params);
+ }
+ public void glGetFloatv(int pname, float[] params, int params_offset) {
+ if(pmvMatrix.isMatrixGetName(pname)) {
+ pmvMatrix.glGetFloatv(pname, params, params_offset);
+ return;
+ }
+ gl.glGetFloatv(pname, params, params_offset);
+ }
+ public void glGetIntegerv(int pname, IntBuffer params) {
+ if(pmvMatrix.isMatrixGetName(pname)) {
+ pmvMatrix.glGetIntegerv(pname, params);
+ return;
+ }
+ gl.glGetIntegerv(pname, params);
+ }
+ public void glGetIntegerv(int pname, int[] params, int params_offset) {
+ if(pmvMatrix.isMatrixGetName(pname)) {
+ pmvMatrix.glGetIntegerv(pname, params, params_offset);
+ return;
+ }
+ gl.glGetIntegerv(pname, params, params_offset);
+ }
+
+ //
+ // MatrixIf
+ //
+ public int glGetMatrixMode() {
+ return pmvMatrix.glGetMatrixMode();
+ }
+ public void glMatrixMode(int mode) {
+ pmvMatrix.glMatrixMode(mode);
+ }
+ public void glLoadMatrixf(java.nio.FloatBuffer m) {
+ pmvMatrix.glLoadMatrixf(m);
+ }
+ public void glLoadMatrixf(float[] m, int m_offset) {
+ glLoadMatrixf(BufferUtil.newFloatBuffer(m, m_offset));
+ }
+ public void glPopMatrix() {
+ pmvMatrix.glPopMatrix();
+ }
+ public void glPushMatrix() {
+ pmvMatrix.glPushMatrix();
+ }
+ public void glLoadIdentity() {
+ pmvMatrix.glLoadIdentity();
+ }
+ public void glMultMatrixf(java.nio.FloatBuffer m) {
+ pmvMatrix.glMultMatrixf(m);
+ }
+ public void glMultMatrixf(float[] m, int m_offset) {
+ glMultMatrixf(BufferUtil.newFloatBuffer(m, m_offset));
+ }
+ public void glTranslatef(float x, float y, float z) {
+ pmvMatrix.glTranslatef(x, y, z);
+ }
+ public void glRotatef(float angdeg, float x, float y, float z) {
+ pmvMatrix.glRotatef(angdeg, x, y, z);
+ }
+ public void glScalef(float x, float y, float z) {
+ pmvMatrix.glScalef(x, y, z);
+ }
+ public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
+ pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
+ }
+ public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
+ pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
+ }
+
+ //
+ // LightingIf
+ //
+ public void glColor4f(float red, float green, float blue, float alpha) {
+ fixedFunction.glColor4fv(gl, BufferUtil.newFloatBuffer(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));
+ }
+ 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));
+ }
+ public void glMaterialf(int face, int pname, float param) {
+ glMaterialfv(face, pname, BufferUtil.newFloatBuffer(new float[] { param }));
+ }
+ public void glShadeModel(int mode) {
+ fixedFunction.glShadeModel(gl, mode);
+ }
+
+ //
+ // PointerIf
+ //
+ public void glEnableClientState(int glArrayIndex) {
+ fixedFunction.glEnableClientState(gl, glArrayIndex);
+ }
+ public void glDisableClientState(int glArrayIndex) {
+ fixedFunction.glDisableClientState(gl, glArrayIndex);
+ }
+
+ public void glVertexPointer(GLArrayData array) {
+ if(array.isVBO()) {
+ if(!gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not enabled: "+array);
+ }
+ } else {
+ if(gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not disabled: "+array);
+ }
+ BufferFactory.rangeCheck(array.getBuffer(), 1);
+ if (!BufferFactory.isDirect(array.getBuffer())) {
+ throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+ }
+ fixedFunction.glVertexPointer(gl, array);
+ }
+
+ public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+ glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false, stride, pointer, 0, 0));
+ }
+ public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
+ int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+ if(vboName==0) {
+ throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+ }
+ glVertexPointer(GLArrayDataWrapper.createFixed(gl, GL_VERTEX_ARRAY, size, type, false,
+ stride, null, vboName, pointer_buffer_offset));
+ }
+
+ public void glColorPointer(GLArrayData array) {
+ if(array.isVBO()) {
+ if(!gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not enabled: "+array);
+ }
+ } else {
+ if(gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not disabled: "+array);
+ }
+ BufferFactory.rangeCheck(array.getBuffer(), 1);
+ if (!BufferFactory.isDirect(array.getBuffer())) {
+ throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+ }
+ fixedFunction.glColorPointer(gl, array);
+ }
+ public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+ glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false,
+ stride, pointer, 0, 0));
+ }
+ public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
+ int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+ if(vboName==0) {
+ throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+ }
+ glColorPointer(GLArrayDataWrapper.createFixed(gl, GL_COLOR_ARRAY, size, type, false,
+ stride, null, vboName, pointer_buffer_offset));
+ }
+
+ public void glNormalPointer(GLArrayData array) {
+ if(array.getComponentNumber()!=3) {
+ throw new GLException("Only 3 components per normal allowed");
+ }
+ if(array.isVBO()) {
+ if(!gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not enabled: "+array);
+ }
+ } else {
+ if(gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not disabled: "+array);
+ }
+ BufferFactory.rangeCheck(array.getBuffer(), 1);
+ if (!BufferFactory.isDirect(array.getBuffer())) {
+ throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+ }
+ fixedFunction.glNormalPointer(gl, array);
+ }
+ public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
+ glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false,
+ stride, pointer, 0, 0));
+ }
+ public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
+ int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+ if(vboName==0) {
+ throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+ }
+ glNormalPointer(GLArrayDataWrapper.createFixed(gl, GL_NORMAL_ARRAY, 3, type, false,
+ stride, null, vboName, pointer_buffer_offset));
+ }
+
+ public void glTexCoordPointer(GLArrayData array) {
+ if(array.isVBO()) {
+ if(!gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not enabled: "+array);
+ }
+ } else {
+ if(gl.glIsVBOArrayEnabled()) {
+ throw new GLException("VBO array is not disabled: "+array);
+ }
+ BufferFactory.rangeCheck(array.getBuffer(), 1);
+ if (!BufferFactory.isDirect(array.getBuffer())) {
+ throw new GLException("Argument \"pointer\" was not a direct buffer"); }
+ }
+ fixedFunction.glTexCoordPointer(gl, array);
+ }
+ public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+ glTexCoordPointer(
+ GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false, stride, pointer, 0,0));
+ }
+ public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
+ int vboName = gl.glGetBoundBuffer(GL.GL_ARRAY_BUFFER);
+ if(vboName==0) {
+ throw new GLException("no GL_ARRAY_BUFFER VBO bound");
+ }
+ glTexCoordPointer(
+ GLArrayDataWrapper.createFixed(gl, GL_TEXTURE_COORD_ARRAY, size, type, false,
+ stride, null, vboName, pointer_buffer_offset) );
+ }
+
+ public final String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append(getClass().getName()+" (");
+ if(null!=pmvMatrix) {
+ buf.append(", matrixDirty: "+pmvMatrix.isDirty());
+ }
+ buf.append("\n\t, FixedFunction: "+fixedFunction);
+ buf.append(gl);
+ buf.append(" )");
+
+ return buf.toString();
+ }
+
+}
+
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java
new file mode 100644
index 000000000..1b8dd1f11
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/FixedFuncPipeline.java
@@ -0,0 +1,554 @@
+
+package com.sun.opengl.util.glsl.fixedfunc.impl;
+
+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 java.nio.*;
+
+public class FixedFuncPipeline {
+ public static final int MAX_TEXTURE_UNITS = 8;
+ public static final int MAX_LIGHTS = 8;
+
+ // We can't have any dependencies on the FixedFuncUtil class for build bootstrapping reasons
+ public static final String mgl_Vertex = "mgl_Vertex";
+ public static final String mgl_Normal = "mgl_Normal";
+ public static final String mgl_Color = "mgl_Color";
+ public static final String mgl_MultiTexCoord = "mgl_MultiTexCoord" ;
+
+ public static String getPredefinedArrayIndexName(int glArrayIndex) {
+ switch(glArrayIndex) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ return mgl_Vertex;
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ return mgl_Normal;
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ return mgl_Color;
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ return mgl_MultiTexCoord;
+ }
+ return null;
+ }
+
+ public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix) {
+ init(gl, pmvMatrix, FixedFuncPipeline.class, shaderSrcRootDef, shaderBinRootDef,
+ vertexColorFileDef, vertexColorLightFileDef, fragmentColorFileDef, fragmentColorTextureFileDef);
+ }
+ public FixedFuncPipeline(GL2ES2 gl, PMVMatrix pmvMatrix, Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
+ String vertexColorFile,
+ String vertexColorLightFile,
+ String fragmentColorFile,
+ String fragmentColorTextureFile) {
+ init(gl, pmvMatrix, shaderRootClass, shaderSrcRoot, shaderBinRoot,
+ vertexColorFile, vertexColorLightFile, fragmentColorFile, fragmentColorTextureFile);
+ }
+
+ public boolean verbose() { return verbose; }
+
+ public void setVerbose(boolean v) { verbose=v; }
+
+ public boolean isValid() {
+ return shaderState.linked();
+ }
+
+ public ShaderState getShaderState() {
+ return shaderState;
+ }
+
+ public int getActiveTextureUnit() {
+ return activeTextureUnit;
+ }
+
+ public String getArrayIndexName(int glArrayIndex) {
+ String name = getPredefinedArrayIndexName(glArrayIndex);
+ switch(glArrayIndex) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ break;
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ name = name + activeTextureUnit;
+ }
+ return name;
+ }
+
+ public void destroy(GL2ES2 gl) {
+ shaderProgramColor.release(gl, true);
+ shaderProgramColorLight.release(gl, true);
+ shaderProgramColorTexture.release(gl, true);
+ shaderProgramColorTextureLight.release(gl, true);
+ shaderState.destroy(gl);
+ }
+
+ public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
+ shaderState.glUseProgram(gl, true);
+
+ shaderState.glEnableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
+ // textureCoordsEnabled |= (1 << activeTextureUnit);
+ if ( textureCoordsEnabled.get(activeTextureUnit) != 1 ) {
+ textureCoordsEnabled.put(activeTextureUnit, 1);
+ textureCoordsEnabledDirty = true;
+ }
+ }
+
+ public void glDisableClientState(GL2ES2 gl, int glArrayIndex) {
+ shaderState.glUseProgram(gl, true);
+
+ shaderState.glDisableVertexAttribArray(gl, getArrayIndexName(glArrayIndex));
+ // textureCoordsEnabled &= ~(1 << activeTextureUnit);
+ if ( textureCoordsEnabled.get(activeTextureUnit) != 0 ) {
+ textureCoordsEnabled.put(activeTextureUnit, 0);
+ textureCoordsEnabledDirty = true;
+ }
+ }
+
+ public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
+ shaderState.glUseProgram(gl, true);
+ shaderState.glVertexAttribPointer(gl, data);
+ }
+
+ public void glColorPointer(GL2ES2 gl, GLArrayData data) {
+ shaderState.glUseProgram(gl, true);
+ shaderState.glVertexAttribPointer(gl, data);
+ }
+
+ public void glColor4fv(GL2ES2 gl, FloatBuffer data ) {
+ shaderState.glUseProgram(gl, true);
+ GLUniformData ud = shaderState.getUniform(mgl_ColorStatic);
+ if(null!=ud) {
+ ud.setData(data);
+ shaderState.glUniform(gl, ud);
+ }
+ }
+
+ public void glNormalPointer(GL2ES2 gl, GLArrayData data) {
+ shaderState.glUseProgram(gl, true);
+ shaderState.glVertexAttribPointer(gl, data);
+ }
+
+ public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) {
+ shaderState.glUseProgram(gl, true);
+ data.setName( getArrayIndexName(data.getIndex()) );
+ shaderState.glVertexAttribPointer(gl, data);
+ }
+
+ public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
+ shaderState.glUseProgram(gl, true);
+ light -=GLLightingFunc.GL_LIGHT0;
+ if(0 <= light && light < MAX_LIGHTS) {
+ GLUniformData ud = null;
+ switch(pname) {
+ case GLLightingFunc.GL_AMBIENT:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].ambient");
+ break;
+ case GLLightingFunc.GL_DIFFUSE:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].diffuse");
+ break;
+ case GLLightingFunc.GL_SPECULAR:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].specular");
+ break;
+ case GLLightingFunc.GL_POSITION:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].position");
+ break;
+ case GLLightingFunc.GL_SPOT_DIRECTION:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotDirection");
+ break;
+ case GLLightingFunc.GL_SPOT_EXPONENT:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotExponent");
+ break;
+ case GLLightingFunc.GL_SPOT_CUTOFF:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].spotCutoff");
+ break;
+ case GLLightingFunc.GL_CONSTANT_ATTENUATION:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].constantAttenuation");
+ break;
+ case GLLightingFunc.GL_LINEAR_ATTENUATION:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].linearAttenuation");
+ break;
+ case GLLightingFunc.GL_QUADRATIC_ATTENUATION:
+ ud = shaderState.getUniform(mgl_LightSource+"["+light+"].quadraticAttenuation");
+ break;
+ default:
+ if(verbose) {
+ System.err.println("glLightfv pname not within [GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_POSITION GL_SPOT_DIRECTION]: "+pname);
+ }
+ return;
+ }
+ if(null!=ud) {
+ ud.setData(params);
+ shaderState.glUniform(gl, ud);
+ }
+ } else if(verbose) {
+ System.err.println("glLightfv light not within [0.."+MAX_LIGHTS+"]: "+light);
+ }
+ }
+
+ public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) {
+ shaderState.glUseProgram(gl, true);
+
+ switch (face) {
+ case GL.GL_FRONT:
+ case GL.GL_FRONT_AND_BACK:
+ break;
+ case GL.GL_BACK:
+ if(verbose) {
+ System.err.println("glMaterialfv face GL_BACK currently not supported");
+ }
+ break;
+ default:
+ }
+
+ GLUniformData ud = null;
+ switch(pname) {
+ case GLLightingFunc.GL_AMBIENT:
+ ud = shaderState.getUniform(mgl_FrontMaterial+".ambient");
+ break;
+ case GLLightingFunc.GL_AMBIENT_AND_DIFFUSE:
+ glMaterialfv(gl, face, GLLightingFunc.GL_AMBIENT, params);
+ // fall through intended ..
+ case GLLightingFunc.GL_DIFFUSE:
+ ud = shaderState.getUniform(mgl_FrontMaterial+".diffuse");
+ break;
+ case GLLightingFunc.GL_SPECULAR:
+ ud = shaderState.getUniform(mgl_FrontMaterial+".specular");
+ break;
+ case GLLightingFunc.GL_EMISSION:
+ ud = shaderState.getUniform(mgl_FrontMaterial+".emission");
+ break;
+ case GLLightingFunc.GL_SHININESS:
+ ud = shaderState.getUniform(mgl_FrontMaterial+".shininess");
+ break;
+ default:
+ if(verbose) {
+ System.err.println("glMaterialfv pname not within [GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_EMISSION GL_SHININESS]: "+pname);
+ }
+ return;
+ }
+ if(null!=ud) {
+ ud.setData(params);
+ shaderState.glUniform(gl, ud);
+ }
+ }
+
+ public void glShadeModel(GL2ES2 gl, int mode) {
+ shaderState.glUseProgram(gl, true);
+ GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
+ if(null!=ud) {
+ ud.setData(mode);
+ shaderState.glUniform(gl, ud);
+ }
+ }
+
+ public void glActiveTexture(GL2ES2 gl, int textureUnit) {
+ textureUnit -= GL.GL_TEXTURE0;
+ if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) {
+ shaderState.glUseProgram(gl, true);
+ GLUniformData ud;
+ ud = shaderState.getUniform(mgl_ActiveTexture);
+ if(null!=ud) {
+ ud.setData(textureUnit);
+ shaderState.glUniform(gl, ud);
+ }
+ ud = shaderState.getUniform(mgl_ActiveTextureIdx);
+ if(null!=ud) {
+ ud.setData(textureUnit);
+ shaderState.glUniform(gl, ud);
+ }
+ activeTextureUnit = textureUnit;
+ } else {
+ throw new GLException("glActivateTexture textureUnit not within GL_TEXTURE0 + [0.."+MAX_TEXTURE_UNITS+"]: "+textureUnit);
+ }
+ }
+
+ /**
+ * @return false if digested in regard to GL2ES2 spec,
+ * eg this call must not be passed to an underlying ES2 implementation.
+ * true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well.
+ */
+ public boolean glEnable(GL2ES2 gl, int cap, boolean enable) {
+ switch(cap) {
+ case GL.GL_TEXTURE_2D:
+ textureEnabled=enable;
+ return true;
+ case GLLightingFunc.GL_LIGHTING:
+ lightingEnabled=enable;
+ return false;
+ case GL.GL_CULL_FACE:
+ cullFace=Math.abs(cullFace);
+ if(!enable) {
+ cullFace*=-1;
+ }
+ return true;
+ }
+
+ int light = cap - GLLightingFunc.GL_LIGHT0;
+ if(0 <= light && light < MAX_LIGHTS) {
+ if ( (lightsEnabled.get(light)==1) != enable ) {
+ lightsEnabled.put(light, enable?1:0);
+ lightsEnabledDirty = true;
+ return false;
+ }
+ }
+ return true; // pass it on ..
+ }
+
+ public void glCullFace(GL2ES2 gl, int faceName) {
+ switch(faceName) {
+ case GL.GL_FRONT:
+ faceName = 1; break;
+ case GL.GL_BACK:
+ faceName = 2; break;
+ case GL.GL_FRONT_AND_BACK:
+ faceName = 3; break;
+ }
+ if(0>cullFace) {
+ faceName *= -1;
+ }
+ cullFace = faceName;
+ }
+
+ public void validate(GL2ES2 gl) {
+ shaderState.glUseProgram(gl, true);
+ GLUniformData ud;
+ if(pmvMatrix.update()) {
+ ud = shaderState.getUniform(mgl_PMVMatrix);
+ if(null!=ud) {
+ // same data object ..
+ shaderState.glUniform(gl, ud);
+ } else {
+ throw new GLException("Failed to update: mgl_PMVMatrix");
+ }
+ ud = shaderState.getUniform(mgl_NormalMatrix);
+ if(null!=ud) {
+ // same data object ..
+ shaderState.glUniform(gl, ud);
+ }
+ }
+ ud = shaderState.getUniform(mgl_ColorEnabled);
+ if(null!=ud) {
+ int ca = (shaderState.isVertexAttribArrayEnabled(mgl_Color)==true)?1:0;
+ if(ca!=ud.intValue()) {
+ ud.setData(ca);
+ shaderState.glUniform(gl, ud);
+ }
+ }
+ ud = shaderState.getUniform(mgl_CullFace);
+ if(null!=ud) {
+ if(cullFace!=ud.intValue()) {
+ ud.setData(cullFace);
+ shaderState.glUniform(gl, ud);
+ }
+ }
+
+ if(lightsEnabledDirty) {
+ ud = shaderState.getUniform(mgl_LightsEnabled);
+ if(null!=ud) {
+ // same data object
+ shaderState.glUniform(gl, ud);
+ }
+ lightsEnabledDirty=false;
+ }
+
+ if(textureCoordsEnabledDirty) {
+ ud = shaderState.getUniform(mgl_TexCoordEnabled);
+ if(null!=ud) {
+ // same data object
+ shaderState.glUniform(gl, ud);
+ }
+ textureCoordsEnabledDirty=false;
+ }
+
+ if(textureEnabled) {
+ if(lightingEnabled) {
+ shaderState.attachShaderProgram(gl, shaderProgramColorTextureLight);
+ } else {
+ shaderState.attachShaderProgram(gl, shaderProgramColorTexture);
+ }
+ } else {
+ if(lightingEnabled) {
+ shaderState.attachShaderProgram(gl, shaderProgramColorLight);
+ } else {
+ shaderState.attachShaderProgram(gl, shaderProgramColor);
+ }
+ }
+ if(DEBUG) {
+ System.err.println("validate: "+this);
+ }
+ }
+
+ public String toString() {
+ return "FixedFuncPipeline[pmv: "+pmvMatrix+
+ ", textureEnabled: "+textureEnabled+
+ ", textureCoordsEnabled: "+textureCoordsEnabled+
+ ", lightingEnabled: "+lightingEnabled+
+ ", lightsEnabled: "+lightsEnabled+
+ "\n\t, shaderProgramColor: "+shaderProgramColor+
+ "\n\t, shaderProgramColorTexture: "+shaderProgramColorTexture+
+ "\n\t, shaderProgramColorLight: "+shaderProgramColorLight+
+ "\n\t, shaderProgramColorTextureLight: "+shaderProgramColorTextureLight+
+ "\n\t, ShaderState: "+shaderState+
+ "]";
+ }
+
+ protected void init(GL2ES2 gl, PMVMatrix pmvMatrix, Class shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
+ String vertexColorFile,
+ String vertexColorLightFile,
+ String fragmentColorFile,
+ String fragmentColorTextureFile)
+ {
+ if(null==pmvMatrix) {
+ throw new GLException("PMVMatrix is null");
+ }
+ this.pmvMatrix=pmvMatrix;
+ this.shaderState=new ShaderState();
+ this.shaderState.setVerbose(verbose);
+ ShaderCode vertexColor, vertexColorLight, fragmentColor, fragmentColorTexture;
+
+ vertexColor = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass,
+ shaderSrcRoot, shaderBinRoot, vertexColorFile);
+
+ vertexColorLight = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass,
+ shaderSrcRoot, shaderBinRoot, vertexColorLightFile);
+
+ fragmentColor = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass,
+ shaderSrcRoot, shaderBinRoot, fragmentColorFile);
+
+ fragmentColorTexture = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass,
+ shaderSrcRoot, shaderBinRoot, fragmentColorTextureFile);
+
+ shaderProgramColor = new ShaderProgram();
+ shaderProgramColor.add(vertexColor);
+ shaderProgramColor.add(fragmentColor);
+ if(!shaderProgramColor.link(gl, System.err)) {
+ throw new GLException("Couldn't link VertexColor program: "+shaderProgramColor);
+ }
+
+ shaderProgramColorTexture = new ShaderProgram();
+ shaderProgramColorTexture.add(vertexColor);
+ shaderProgramColorTexture.add(fragmentColorTexture);
+ if(!shaderProgramColorTexture.link(gl, System.err)) {
+ throw new GLException("Couldn't link VertexColorTexture program: "+shaderProgramColorTexture);
+ }
+
+ shaderProgramColorLight = new ShaderProgram();
+ shaderProgramColorLight.add(vertexColorLight);
+ shaderProgramColorLight.add(fragmentColor);
+ if(!shaderProgramColorLight.link(gl, System.err)) {
+ throw new GLException("Couldn't link VertexColorLight program: "+shaderProgramColorLight);
+ }
+
+ shaderProgramColorTextureLight = new ShaderProgram();
+ shaderProgramColorTextureLight.add(vertexColorLight);
+ shaderProgramColorTextureLight.add(fragmentColorTexture);
+ if(!shaderProgramColorTextureLight.link(gl, System.err)) {
+ throw new GLException("Couldn't link VertexColorLight program: "+shaderProgramColorTextureLight);
+ }
+
+ shaderState.attachShaderProgram(gl, shaderProgramColor);
+ shaderState.glUseProgram(gl, true);
+
+ // mandatory ..
+ if(!shaderState.glUniform(gl, new GLUniformData(mgl_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMviMatrixf()))) {
+ throw new GLException("Error setting PMVMatrix in shader: "+this);
+ }
+
+ // optional parameter ..
+ shaderState.glUniform(gl, new GLUniformData(mgl_NormalMatrix, 3, 3, pmvMatrix.glGetNormalMatrixf()));
+
+ shaderState.glUniform(gl, new GLUniformData(mgl_ColorEnabled, 0));
+ shaderState.glUniform(gl, new GLUniformData(mgl_ColorStatic, 4, zero4f));
+ shaderState.glUniform(gl, new GLUniformData(mgl_TexCoordEnabled, 1, textureCoordsEnabled));
+ shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTexture, activeTextureUnit));
+ shaderState.glUniform(gl, new GLUniformData(mgl_ActiveTextureIdx, activeTextureUnit));
+ shaderState.glUniform(gl, new GLUniformData(mgl_ShadeModel, 0));
+ shaderState.glUniform(gl, new GLUniformData(mgl_CullFace, cullFace));
+ for(int i=0; i<MAX_LIGHTS; i++) {
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].ambient", 4, defAmbient));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].diffuse", 4, defDiffuse));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].specular", 4, defSpecular));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].position", 4, defPosition));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotDirection", 3, defSpotDir));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotExponent", defSpotExponent));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].spotCutoff", defSpotCutoff));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].constantAttenuation", defConstantAtten));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].linearAttenuation", defLinearAtten));
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightSource+"["+i+"].quadraticAttenuation", defQuadraticAtten));
+ }
+ shaderState.glUniform(gl, new GLUniformData(mgl_LightsEnabled, 1, lightsEnabled));
+ shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".ambient", 4, defMatAmbient));
+ shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".diffuse", 4, defMatDiffuse));
+ shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".specular", 4, defMatSpecular));
+ shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".emission", 4, defMatEmission));
+ shaderState.glUniform(gl, new GLUniformData(mgl_FrontMaterial+".shininess", defMatShininess));
+
+ shaderState.glUseProgram(gl, false);
+ }
+
+ protected static final boolean DEBUG=false;
+ protected boolean verbose=false;
+
+ protected boolean textureEnabled=false;
+ protected IntBuffer textureCoordsEnabled = BufferUtil.newIntBuffer(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 boolean lightsEnabledDirty = false;
+
+ protected PMVMatrix pmvMatrix;
+ protected ShaderState shaderState;
+ protected ShaderProgram shaderProgramColor;
+ protected ShaderProgram shaderProgramColorTexture;
+ protected ShaderProgram shaderProgramColorLight;
+ protected ShaderProgram shaderProgramColorTextureLight;
+
+ // uniforms ..
+ protected static final String mgl_PMVMatrix = "mgl_PMVMatrix"; // m4fv[3]
+ protected static final String mgl_NormalMatrix = "mgl_NormalMatrix"; // m4fv
+ protected static final String mgl_ColorEnabled = "mgl_ColorEnabled"; // 1i
+ protected static final String mgl_ColorStatic = "mgl_ColorStatic"; // 4fv
+
+ protected static final String mgl_LightSource = "mgl_LightSource"; // struct mgl_LightSourceParameters[MAX_LIGHTS]
+ protected static final String mgl_FrontMaterial = "mgl_FrontMaterial"; // struct mgl_MaterialParameters
+ protected static final String mgl_LightsEnabled = "mgl_LightsEnabled"; // int mgl_LightsEnabled[MAX_LIGHTS];
+
+ protected static final String mgl_ShadeModel = "mgl_ShadeModel"; // 1i
+
+ protected static final String mgl_TexCoordEnabled = "mgl_TexCoordEnabled"; // int mgl_TexCoordEnabled[MAX_TEXTURE_UNITS];
+ protected static final String mgl_ActiveTexture = "mgl_ActiveTexture"; // 1i
+ protected static final String mgl_ActiveTextureIdx = "mgl_ActiveTextureIdx";// 1i
+
+ protected static final String mgl_CullFace = "mgl_CullFace"; // 1i
+
+ protected static final FloatBuffer zero4f = BufferUtil.newFloatBuffer(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 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 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 float defMatShininess = 0f;
+
+ protected static final String vertexColorFileDef = "FixedFuncColor";
+ protected static final String vertexColorLightFileDef = "FixedFuncColorLight";
+ protected static final String fragmentColorFileDef = "FixedFuncColor";
+ protected static final String fragmentColorTextureFileDef = "FixedFuncColorTexture";
+ protected static final String shaderSrcRootDef = "shaders" ;
+ protected static final String shaderBinRootDef = "shaders/bin" ;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp
new file mode 100644
index 000000000..408ff7251
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.fp
@@ -0,0 +1,16 @@
+#include es_precision.glsl
+
+#include mgl_uniform.glsl
+#include mgl_varying.glsl
+
+void main (void)
+{
+ if( mgl_CullFace > 0 &&
+ ( ( mgl_CullFace == 1 && gl_FrontFacing ) ||
+ ( mgl_CullFace == 2 && !gl_FrontFacing ) ||
+ ( mgl_CullFace == 3 ) ) ) {
+ discard;
+ }
+ gl_FragColor = frontColor;
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp
new file mode 100644
index 000000000..346e40196
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColor.vp
@@ -0,0 +1,22 @@
+#include es_precision.glsl
+
+#include mgl_const.glsl
+#include mgl_uniform.glsl
+#include mgl_attribute.glsl
+#include mgl_varying.glsl
+
+#include mgl_settexcoord.vp
+
+void main(void)
+{
+ if(mgl_ColorEnabled>0) {
+ frontColor=mgl_Color;
+ } else {
+ frontColor=mgl_ColorStatic;
+ }
+
+ gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex;
+
+ setTexCoord(gl_Position);
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp
new file mode 100644
index 000000000..ce203cfb9
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorLight.vp
@@ -0,0 +1,70 @@
+#include es_precision.glsl
+#include mgl_lightdef.glsl
+
+#include mgl_const.glsl
+#include mgl_uniform.glsl
+#include mgl_uniform_light.glsl
+#include mgl_attribute.glsl
+#include mgl_varying.glsl
+
+#include mgl_settexcoord.vp
+
+void main(void)
+{
+ vec4 position;
+ vec3 normal, lightDir, cameraDir, halfDir;
+ vec4 ambient, diffuse, specular;
+ float NdotL, NdotHV, dist, attenuation;
+ int i;
+
+ position = mgl_PMVMatrix[1] * mgl_Vertex; // vertex eye position
+
+ normal = normalize(mgl_NormalMatrix * mgl_Normal);
+ // cameraPosition: (mgl_PMVMatrix[2] * vec4(0,0,0,1.0)).xyz
+ cameraDir = normalize( (mgl_PMVMatrix[2] * vec4(0,0,0,1.0)).xyz - mgl_Vertex.xyz );
+
+ ambient = vec4(0,0,0,0);
+ diffuse = vec4(0,0,0,0);
+ specular = vec4(0,0,0,0);
+
+ bool lightEnabled = false;
+
+ for(i=0; i<MAX_LIGHTS; i++) {
+ if( 0!= mgl_LightsEnabled[i] ) {
+ lightEnabled = true;
+ ambient += mgl_LightSource[i].ambient;
+ lightDir = mgl_LightSource[i].position.xyz - position.xyz;
+ dist = length(lightDir);
+ lightDir = normalize(lightDir);
+ attenuation = 1.0 / (
+ mgl_LightSource[i].constantAttenuation+
+ mgl_LightSource[i].linearAttenuation * dist +
+ mgl_LightSource[i].quadraticAttenuation * dist * dist );
+ NdotL = max(0.0, dot(normal, lightDir));
+ diffuse += mgl_LightSource[i].diffuse * NdotL * attenuation;
+ if (NdotL != 0.0) {
+ halfDir = normalize (lightDir + cameraDir);
+ NdotHV = max(0.0, dot(normal, halfDir));
+ specular += mgl_LightSource[i].specular *
+ pow(NdotHV,mgl_FrontMaterial.shininess) * attenuation;
+ }
+ }
+ }
+ ambient += mgl_FrontMaterial.ambient;
+ diffuse *= mgl_FrontMaterial.diffuse;
+ specular *= mgl_FrontMaterial.specular;
+
+ if(mgl_ColorEnabled>0) {
+ frontColor=mgl_Color;
+ } else {
+ frontColor=mgl_ColorStatic;
+ }
+ if( lightEnabled ) {
+ frontColor *= ambient + diffuse + specular;
+ }
+
+ gl_Position = mgl_PMVMatrix[0] * position;
+
+ setTexCoord(gl_Position);
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp
new file mode 100644
index 000000000..86e6ace73
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/FixedFuncColorTexture.fp
@@ -0,0 +1,47 @@
+
+#include es_precision.glsl
+#include mgl_lightdef.glsl
+
+#include mgl_const.glsl
+#include mgl_uniform.glsl
+#include mgl_varying.glsl
+
+vec4 getTexColor(in sampler2D tex, in int idx) {
+ vec4 coord;
+ if(idx==0) {
+ coord= mgl_TexCoords[0];
+ } else if(idx==1) {
+ coord= mgl_TexCoords[1];
+ } else if(idx==2) {
+ coord= mgl_TexCoords[2];
+ } else if(idx==3) {
+ coord= mgl_TexCoords[3];
+ } else if(idx==4) {
+ coord= mgl_TexCoords[4];
+ } else if(idx==5) {
+ coord= mgl_TexCoords[5];
+ } else if(idx==6) {
+ coord= mgl_TexCoords[6];
+ } else {
+ coord= mgl_TexCoords[7];
+ }
+ return texture2D(tex, coord.st);
+}
+
+void main (void)
+{
+ if( mgl_CullFace > 0 &&
+ ( ( mgl_CullFace == 1 && gl_FrontFacing ) ||
+ ( mgl_CullFace == 2 && !gl_FrontFacing ) ||
+ ( mgl_CullFace == 3 ) ) ) {
+ discard;
+ }
+
+ vec4 texColor = getTexColor(mgl_ActiveTexture,mgl_ActiveTextureIdx);
+
+ if(length(texColor.rgb)>0.0) {
+ gl_FragColor = vec4(frontColor.rgb*texColor.rgb, frontColor.a) ;
+ } else {
+ gl_FragColor = frontColor;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp
new file mode 100755
index 000000000..3ebaaee1d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bfp
Binary files differ
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp
new file mode 100755
index 000000000..279ef72c7
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColor.bvp
Binary files differ
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp
new file mode 100755
index 000000000..5a9deea71
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorLight.bvp
Binary files differ
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp
new file mode 100755
index 000000000..ce1397fe1
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/bin/nvidia/FixedFuncColorTexture.bfp
Binary files differ
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl
new file mode 100644
index 000000000..fd6abe54e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/es_precision.glsl
@@ -0,0 +1,14 @@
+#ifndef es_precision_glsl
+#define es_precision_glsl
+
+#ifdef GL_ES
+ #define MEDIUMP mediump
+ #define HIGHP highp
+ #define LOWP lowp
+#else
+ #define MEDIUMP
+ #define HIGHP
+ #define LOWP
+#endif
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl
new file mode 100644
index 000000000..b09bdb05a
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_attribute.glsl
@@ -0,0 +1,19 @@
+
+#ifndef mgl_attribute_glsl
+#define mgl_attribute_glsl
+
+#include es_precision.glsl
+
+attribute HIGHP vec4 mgl_Vertex;
+attribute HIGHP vec3 mgl_Normal;
+attribute HIGHP vec4 mgl_Color;
+attribute HIGHP vec4 mgl_MultiTexCoord0;
+attribute HIGHP vec4 mgl_MultiTexCoord1;
+attribute HIGHP vec4 mgl_MultiTexCoord2;
+attribute HIGHP vec4 mgl_MultiTexCoord3;
+attribute HIGHP vec4 mgl_MultiTexCoord4;
+attribute HIGHP vec4 mgl_MultiTexCoord5;
+attribute HIGHP vec4 mgl_MultiTexCoord6;
+attribute HIGHP vec4 mgl_MultiTexCoord7;
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl
new file mode 100644
index 000000000..1a464a1cb
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_const.glsl
@@ -0,0 +1,10 @@
+
+#ifndef mgl_const_glsl
+#define mgl_const_glsl
+
+#include es_precision.glsl
+
+const LOWP int MAX_TEXTURE_UNITS = 8; // <=gl_MaxTextureImageUnits
+const LOWP int MAX_LIGHTS = 8;
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl
new file mode 100644
index 000000000..98e214139
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_lightdef.glsl
@@ -0,0 +1,26 @@
+#ifndef mgl_lightdef_glsl
+#define mgl_lightdef_glsl
+
+struct mgl_LightSourceParameters {
+ vec4 ambient;
+ vec4 diffuse;
+ vec4 specular;
+ vec4 position;
+ // vec4 halfVector; // is computed here
+ vec3 spotDirection;
+ float spotExponent;
+ float spotCutoff; // (range: [0.0,90.0], 180.0)
+ //float spotCosCutoff; // (range: [1.0,0.0],-1.0)
+ float constantAttenuation;
+ float linearAttenuation;
+ float quadraticAttenuation;
+};
+struct mgl_MaterialParameters {
+ vec4 ambient;
+ vec4 diffuse;
+ vec4 specular;
+ vec4 emission;
+ float shininess;
+};
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp
new file mode 100644
index 000000000..1efe328d0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_settexcoord.vp
@@ -0,0 +1,35 @@
+#ifndef mgl_settexcoord_vp
+#define mgl_settexcoord_vp
+
+#include es_precision.glsl
+
+#include mgl_const.glsl
+#include mgl_uniform.glsl
+#include mgl_attribute.glsl
+#include mgl_varying.glsl
+
+void setTexCoord(in vec4 defpos) {
+ /**
+ * bitwise operator not supported on APX 2500 ES 2.0
+ *
+ mgl_TexCoords[0] = ( 0 != (mgl_TexCoordEnabled & 1) ) ? mgl_MultiTexCoord0 : defpos;
+ mgl_TexCoords[1] = ( 0 != (mgl_TexCoordEnabled & 2) ) ? mgl_MultiTexCoord1 : defpos;
+ mgl_TexCoords[2] = ( 0 != (mgl_TexCoordEnabled & 4) ) ? mgl_MultiTexCoord2 : defpos;
+ mgl_TexCoords[3] = ( 0 != (mgl_TexCoordEnabled & 8) ) ? mgl_MultiTexCoord3 : defpos;
+ mgl_TexCoords[4] = ( 0 != (mgl_TexCoordEnabled & 16) ) ? mgl_MultiTexCoord4 : defpos;
+ mgl_TexCoords[5] = ( 0 != (mgl_TexCoordEnabled & 32) ) ? mgl_MultiTexCoord5 : defpos;
+ mgl_TexCoords[6] = ( 0 != (mgl_TexCoordEnabled & 64) ) ? mgl_MultiTexCoord6 : defpos;
+ mgl_TexCoords[7] = ( 0 != (mgl_TexCoordEnabled & 128) ) ? mgl_MultiTexCoord7 : defpos;
+ */
+
+ mgl_TexCoords[0] = ( 0 != mgl_TexCoordEnabled[0] ) ? mgl_MultiTexCoord0 : defpos;
+ mgl_TexCoords[1] = ( 0 != mgl_TexCoordEnabled[1] ) ? mgl_MultiTexCoord1 : defpos;
+ mgl_TexCoords[2] = ( 0 != mgl_TexCoordEnabled[2] ) ? mgl_MultiTexCoord2 : defpos;
+ mgl_TexCoords[3] = ( 0 != mgl_TexCoordEnabled[3] ) ? mgl_MultiTexCoord3 : defpos;
+ mgl_TexCoords[4] = ( 0 != mgl_TexCoordEnabled[4] ) ? mgl_MultiTexCoord4 : defpos;
+ mgl_TexCoords[5] = ( 0 != mgl_TexCoordEnabled[5] ) ? mgl_MultiTexCoord5 : defpos;
+ mgl_TexCoords[6] = ( 0 != mgl_TexCoordEnabled[6] ) ? mgl_MultiTexCoord6 : defpos;
+ mgl_TexCoords[7] = ( 0 != mgl_TexCoordEnabled[7] ) ? mgl_MultiTexCoord7 : defpos;
+}
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl
new file mode 100644
index 000000000..d8b3c7f95
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform.glsl
@@ -0,0 +1,18 @@
+
+#ifndef mgl_uniform_glsl
+#define mgl_uniform_glsl
+
+#include es_precision.glsl
+
+#include mgl_const.glsl
+
+uniform HIGHP mat4 mgl_PMVMatrix[3]; // P, Mv, and Mvi
+uniform HIGHP mat3 mgl_NormalMatrix; // transpose(inverse(ModelView)).3x3
+uniform LOWP int mgl_ColorEnabled;
+uniform HIGHP vec4 mgl_ColorStatic;
+uniform LOWP int mgl_TexCoordEnabled[MAX_TEXTURE_UNITS];
+uniform sampler2D mgl_ActiveTexture;
+uniform LOWP int mgl_ActiveTextureIdx;
+uniform LOWP int mgl_CullFace;
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl
new file mode 100644
index 000000000..0dedb5d5d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_uniform_light.glsl
@@ -0,0 +1,15 @@
+
+#ifndef mgl_uniform_light_glsl
+#define mgl_uniform_light_glsl
+
+#include es_precision.glsl
+
+#include mgl_const.glsl
+#include mgl_lightdef.glsl
+
+uniform LOWP int mgl_LightsEnabled[MAX_LIGHTS];
+
+uniform mgl_LightSourceParameters mgl_LightSource[MAX_LIGHTS];
+uniform mgl_MaterialParameters mgl_FrontMaterial;
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl
new file mode 100644
index 000000000..fc9f735d1
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/mgl_varying.glsl
@@ -0,0 +1,12 @@
+
+#ifndef mgl_varying_glsl
+#define mgl_varying_glsl
+
+#include es_precision.glsl
+
+#include mgl_const.glsl
+
+varying vec4 frontColor;
+varying vec4 mgl_TexCoords[MAX_TEXTURE_UNITS];
+
+#endif // 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/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat
new file mode 100755
index 000000000..002dca8ef
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc-ff.bat
@@ -0,0 +1,9 @@
+REM
+REM You have to call it from the 'shaders' directory, e.g.:
+REM scripts\nvidia-apx\glslc-ff.bat
+REM
+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
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat
new file mode 100755
index 000000000..9b5a4b39c
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/fixedfunc/impl/shaders/scripts/nvidia-apx/glslc.bat
@@ -0,0 +1,9 @@
+REM
+REM You have to call it from the 'shaders' directory, e.g.:
+REM scripts\nvidia-apx\glslc.bat <FileName>
+REM
+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
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java
new file mode 100755
index 000000000..f18005feb
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShader.java
@@ -0,0 +1,184 @@
+package com.sun.opengl.util.glsl.sdk;
+
+import javax.media.opengl.*;
+import com.sun.opengl.util.*;
+import com.sun.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
+ */
+
+public abstract class CompileShader {
+
+ public abstract int getBinaryFormat();
+
+ public abstract File getSDKCompilerDir();
+
+ public abstract String getVertexShaderCompiler();
+
+ public abstract String getFragmentShaderCompiler();
+
+ public void processOneShader(String resourceName)
+ throws IOException, UnsupportedEncodingException, InterruptedException
+ {
+ int type = -1;
+ String outName=null;
+ int suffixLen = -1;
+ if(resourceName.endsWith(ShaderCode.getFileSuffix(false, GL2ES2.GL_FRAGMENT_SHADER))) {
+ suffixLen = 2;
+ type = GL2ES2.GL_FRAGMENT_SHADER;
+ } else if(resourceName.endsWith(".frag")) {
+ suffixLen = 4;
+ type = GL2ES2.GL_FRAGMENT_SHADER;
+ } else if(resourceName.endsWith(ShaderCode.getFileSuffix(false, GL2ES2.GL_VERTEX_SHADER))) {
+ suffixLen = 2;
+ type = GL2ES2.GL_VERTEX_SHADER;
+ } else if(resourceName.endsWith(".vert")) {
+ suffixLen = 4;
+ type = GL2ES2.GL_VERTEX_SHADER;
+ }
+ String justName = basename(resourceName);
+ outName = justName.substring(0, justName.length() - suffixLen) +
+ ShaderCode.getFileSuffix(true, type);
+ URL resourceURL = Locator.getResource(null, resourceName);
+ String dirName = dirname(resourceURL.getPath());
+
+ outName = dirName + File.separator + "bin" + File.separator +
+ ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator +
+ outName;
+ processOneShader(resourceName, outName, type);
+ }
+
+ public void processOneShader(String resourceName, String outName, int type)
+ throws IOException, UnsupportedEncodingException, InterruptedException
+ {
+ URL resourceURL = Locator.getResource(null, resourceName);
+ String dirName = dirname(resourceURL.getPath());
+
+ String shader = ShaderCode.readShaderSource(null, resourceName);
+ if(null==shader) {
+ System.err.println("Can't find shader source " + resourceName + " - ignored");
+ return;
+ }
+ System.err.println("Preprocessing: "+ resourceName+", in dir: "+dirName);
+ String justName = basename(resourceName);
+ String processor;
+ switch (type) {
+ case GL2ES2.GL_VERTEX_SHADER:
+ processor = getVertexShaderCompiler();
+ break;
+ case GL2ES2.GL_FRAGMENT_SHADER:
+ processor = getFragmentShaderCompiler();
+ break;
+ default:
+ throw new GLException("Unknown shader type: "+type);
+ }
+ File outputFile = new File(outName);
+
+ // Write shader to a file in java.io.tmpdir
+ File tmpDir = new File(dirName+File.separator+"tmp");
+ tmpDir.mkdirs();
+ File tmpFile = new File(tmpDir, justName);
+ Writer writer = new BufferedWriter(new FileWriter(tmpFile));
+ writer.write(shader, 0, shader.length());
+ writer.flush();
+ writer.close();
+ System.err.println("Preprocessed: "+ tmpFile.getAbsolutePath());
+
+ File processorDir = getSDKCompilerDir();
+
+ System.err.println("SDK: "+ processorDir.getAbsolutePath() + ", compiler: "+processor);
+
+ System.err.println("Output: "+ outputFile.getAbsolutePath());
+
+ // Run the tool
+ Process process = Runtime.getRuntime().exec(new String[] {
+ processorDir.getAbsolutePath() + File.separator + processor,
+ tmpFile.getAbsolutePath(),
+ outputFile.getAbsolutePath()
+ }); // , null, processorDir);
+ new StreamMonitor(process.getInputStream());
+ new StreamMonitor(process.getErrorStream());
+ process.waitFor();
+ // Delete the temporary file
+ // tmpFile.delete();
+ }
+
+ protected static String basename(String path) {
+ int lastSlash = path.lastIndexOf("/");
+ if (lastSlash < 0) {
+ lastSlash = path.lastIndexOf("\\");
+ }
+ String basename;
+ if (lastSlash < 0) {
+ basename = path;
+ } else {
+ basename = path.substring(lastSlash + 1);
+ }
+ return basename;
+ }
+
+ protected static String dirname(String path) {
+ int lastSlash = path.lastIndexOf("/");
+ if (lastSlash < 0) {
+ lastSlash = path.lastIndexOf("\\");
+ }
+ String dirname;
+ if (lastSlash < 0) {
+ dirname = new String();
+ } else {
+ dirname = path.substring(0, lastSlash + 1);
+ }
+ return dirname;
+ }
+
+ public void run(String[] args) {
+ try {
+ for (int i = 0; i < args.length; i++) {
+ processOneShader(args[i]);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static class StreamMonitor implements Runnable {
+ private InputStream istream;
+ public StreamMonitor(InputStream stream) {
+ istream = stream;
+ new Thread(this, "Output Reader Thread").start();
+ }
+
+ public void run()
+ {
+ byte[] buffer = new byte[4096];
+ try {
+ int numRead = 0;
+ do {
+ numRead = istream.read(buffer);
+ if (numRead > 0) {
+ System.out.write(buffer, 0, numRead);
+ System.out.flush();
+ }
+ } while (numRead >= 0);
+ }
+ catch (IOException e) {
+ try {
+ istream.close();
+ } catch (IOException e2) {
+ }
+ // Should allow clean exit when process shuts down
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java b/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java
new file mode 100755
index 000000000..387ccf732
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/glsl/sdk/CompileShaderNVidia.java
@@ -0,0 +1,53 @@
+package com.sun.opengl.util.glsl.sdk;
+
+import javax.media.opengl.*;
+
+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". */
+
+public class CompileShaderNVidia extends CompileShader {
+ private static final String NVAPSDK;
+
+ static {
+ String nvapSDKProp = System.getProperty("NVAPSDK");
+ if (nvapSDKProp != null) {
+ NVAPSDK = nvapSDKProp;
+ } else {
+ NVAPSDK = "C:\\nvap_sdk_0_3_x";
+ }
+ }
+
+ public int getBinaryFormat() {
+ return GLES2.GL_NVIDIA_PLATFORM_BINARY_NV;
+ }
+
+ public File getSDKCompilerDir() {
+ File compilerDir = new File( NVAPSDK + File.separator + "tools" + File.separator );
+ File compilerFile = new File( compilerDir, getVertexShaderCompiler());
+ if(!compilerFile.exists()) {
+ compilerDir = new File( NVAPSDK );
+ compilerFile = new File( compilerDir, getVertexShaderCompiler());
+ }
+ if(!compilerFile.exists()) {
+ throw new GLException("Can't find compiler: "+getVertexShaderCompiler() + " in : " +
+ NVAPSDK+", "+NVAPSDK + File.separator + "tools");
+ }
+ return compilerDir;
+ }
+
+ public String getVertexShaderCompiler() {
+ return "glslv.bat";
+ }
+
+ public String getFragmentShaderCompiler() {
+ return "glslf.bat";
+ }
+
+ public static void main(String[] args) {
+ new CompileShaderNVidia().run(args);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java b/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java
new file mode 100755
index 000000000..754ba2757
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/BackingStoreManager.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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
+ RectanglePacker. It is used both when a full re-layout must be
+ done as well as when the data in the backing store must be copied
+ to a new one. */
+
+public interface BackingStoreManager {
+ public Object allocateBackingStore(int w, int h);
+ public void deleteBackingStore(Object backingStore);
+
+ /** Indication whether this BackingStoreManager supports compaction;
+ in other words, the allocation of a new backing store and
+ movement of the contents of the backing store from the old to
+ the new one. If it does not, then RectanglePacker.add() may
+ throw an exception if additionFailed() can not make enough room
+ available. If an implementation returns false, this also implies
+ that the backing store can not grow, so that preExpand() will
+ never be called. */
+ public boolean canCompact();
+
+ /** Notification that expansion of the backing store is about to be
+ done due to addition of the given rectangle. Gives the manager a
+ chance to do some compaction and potentially remove old entries
+ from the backing store, if it acts like a least-recently-used
+ cache. This method receives as argument the number of attempts
+ so far to add the given rectangle. Manager should return true if
+ the RectanglePacker should retry the addition (which may result
+ in this method being called again, with an increased attempt
+ number) or false if the RectanglePacker should just expand the
+ backing store. The caller should not call RectanglePacker.add()
+ in its preExpand() method. */
+ public boolean preExpand(Rect cause, int attemptNumber);
+
+ /** Notification that addition of the given Rect failed because a
+ maximum size was set in the RectanglePacker and the backing
+ store could not be expanded, or because compaction (and,
+ therefore, implicitly expansion) was not supported. Should
+ return false if the manager can do nothing more to handle the
+ failed addition, which will cause a RuntimeException to be
+ thrown from the RectanglePacker. */
+ public boolean additionFailed(Rect cause, int attemptNumber);
+
+ /** Notification that movement is starting. */
+ public void beginMovement(Object oldBackingStore, Object newBackingStore);
+
+ /** Tells the manager to move the contents of the given rect from
+ the old location on the old backing store to the new location on
+ the new backing store. The backing stores can be identical in
+ the case of compacting the existing backing store instead of
+ reallocating it. */
+ public void move(Object oldBackingStore,
+ Rect oldLocation,
+ Object newBackingStore,
+ Rect newLocation);
+
+ /** Notification that movement is ending. */
+ public void endMovement(Object oldBackingStore, Object newBackingStore);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/Level.java b/src/jogl/classes/com/sun/opengl/util/packrect/Level.java
new file mode 100755
index 000000000..3dae4301d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/Level.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.packrect;
+
+import java.util.*;
+
+public class Level {
+ private int width;
+ private int height;
+ private int yPos;
+ private LevelSet holder;
+
+ private List/*<Rect>*/ rects = new ArrayList/*<Rect>*/();
+ private List/*<Rect>*/ freeList;
+ private int nextAddX;
+
+ static class RectXComparator implements Comparator {
+ public int compare(Object o1, Object o2) {
+ Rect r1 = (Rect) o1;
+ Rect r2 = (Rect) o2;
+ return r1.x() - r2.x();
+ }
+
+ public boolean equals(Object obj) {
+ return this == obj;
+ }
+ }
+ private static final Comparator rectXComparator = new RectXComparator();
+
+ public Level(int width, int height, int yPos, LevelSet holder) {
+ this.width = width;
+ this.height = height;
+ this.yPos = yPos;
+ this.holder = holder;
+ }
+
+ public int w() { return width; }
+ public int h() { return height; }
+ public int yPos() { return yPos; }
+
+ /** Tries to add the given rectangle to this level only allowing
+ non-disruptive changes like trivial expansion of the last level
+ in the RectanglePacker and allocation from the free list. More
+ disruptive changes like compaction of the level must be
+ requested explicitly. */
+ public boolean add(Rect rect) {
+ if (rect.h() > height) {
+ // See whether it's worth trying to expand vertically
+ if (nextAddX + rect.w() > width) {
+ return false;
+ }
+
+ // See whether we're the last level and can expand
+ if (!holder.canExpand(this, rect.h())) {
+ return false;
+ }
+
+ // Trivially expand and try the allocation
+ holder.expand(this, height, rect.h());
+ height = rect.h();
+ }
+
+ // See whether we can add at the end
+ if (nextAddX + rect.w() <= width) {
+ rect.setPosition(nextAddX, yPos);
+ rects.add(rect);
+ nextAddX += rect.w();
+ return true;
+ }
+
+ // See whether we can add from the free list
+ if (freeList != null) {
+ Rect candidate = null;
+ for (Iterator iter = freeList.iterator(); iter.hasNext(); ) {
+ Rect cur = (Rect) iter.next();
+ if (cur.canContain(rect)) {
+ candidate = cur;
+ break;
+ }
+ }
+
+ if (candidate != null) {
+ // Remove the candidate from the free list
+ freeList.remove(candidate);
+ // Set up and add the real rect
+ rect.setPosition(candidate.x(), candidate.y());
+ rects.add(rect);
+ // Re-add any remaining free space
+ if (candidate.w() > rect.w()) {
+ candidate.setPosition(candidate.x() + rect.w(), candidate.y());
+ candidate.setSize(candidate.w() - rect.w(), height);
+ freeList.add(candidate);
+ }
+
+ coalesceFreeList();
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /** Removes the given Rect from this Level. */
+ public boolean remove(Rect rect) {
+ if (!rects.remove(rect))
+ return false;
+
+ // If this is the rightmost rectangle, instead of adding its space
+ // to the free list, we can just decrease the nextAddX
+ if (rect.maxX() + 1 == nextAddX) {
+ nextAddX -= rect.w();
+ } else {
+ if (freeList == null) {
+ freeList = new ArrayList/*<Rect>*/();
+ }
+ freeList.add(new Rect(rect.x(), rect.y(), rect.w(), height, null));
+ coalesceFreeList();
+ }
+
+ return true;
+ }
+
+ /** Indicates whether this Level contains no rectangles. */
+ public boolean isEmpty() {
+ return rects.isEmpty();
+ }
+
+ /** Indicates whether this Level could satisfy an allocation request
+ if it were compacted. */
+ public boolean couldAllocateIfCompacted(Rect rect) {
+ if (rect.h() > height)
+ return false;
+ if (freeList == null)
+ return false;
+ int freeListWidth = 0;
+ for (Iterator iter = freeList.iterator(); iter.hasNext(); ) {
+ Rect cur = (Rect) iter.next();
+ freeListWidth += cur.w();
+ }
+ // Add on the remaining space at the end
+ freeListWidth += (width - nextAddX);
+ return (freeListWidth >= rect.w());
+ }
+
+ public void compact(Object backingStore, BackingStoreManager manager) {
+ Collections.sort(rects, rectXComparator);
+ int nextCompactionDest = 0;
+ manager.beginMovement(backingStore, backingStore);
+ for (Iterator iter = rects.iterator(); iter.hasNext(); ) {
+ Rect cur = (Rect) iter.next();
+ if (cur.x() != nextCompactionDest) {
+ manager.move(backingStore, cur,
+ backingStore, new Rect(nextCompactionDest, cur.y(), cur.w(), cur.h(), null));
+ cur.setPosition(nextCompactionDest, cur.y());
+ }
+ nextCompactionDest += cur.w();
+ }
+ nextAddX = nextCompactionDest;
+ freeList.clear();
+ manager.endMovement(backingStore, backingStore);
+ }
+
+ public Iterator iterator() {
+ return rects.iterator();
+ }
+
+ /** Visits all Rects contained in this Level. */
+ public void visit(RectVisitor visitor) {
+ for (Iterator iter = rects.iterator(); iter.hasNext(); ) {
+ Rect rect = (Rect) iter.next();
+ visitor.visit(rect);
+ }
+ }
+
+ /** Updates the references to the Rect objects in this Level with
+ the "next locations" of those Rects. This is actually used to
+ update the new Rects in a newly laid-out LevelSet with the
+ original Rects. */
+ public void updateRectangleReferences() {
+ for (int i = 0; i < rects.size(); i++) {
+ Rect cur = (Rect) rects.get(i);
+ Rect next = cur.getNextLocation();
+ next.setPosition(cur.x(), cur.y());
+ if (cur.w() != next.w() || cur.h() != next.h())
+ throw new RuntimeException("Unexpected disparity in rectangle sizes during updateRectangleReferences");
+ rects.set(i, next);
+ }
+ }
+
+ private void coalesceFreeList() {
+ if (freeList == null)
+ return;
+ if (freeList.isEmpty())
+ return;
+
+ // Try to coalesce adjacent free blocks in the free list
+ Collections.sort(freeList, rectXComparator);
+ int i = 0;
+ while (i < freeList.size() - 1) {
+ Rect r1 = (Rect) freeList.get(i);
+ Rect r2 = (Rect) freeList.get(i+1);
+ if (r1.maxX() + 1 == r2.x()) {
+ // Coalesce r1 and r2 into one block
+ freeList.remove(i+1);
+ r1.setSize(r1.w() + r2.w(), r1.h());
+ } else {
+ ++i;
+ }
+ }
+ // See whether the last block bumps up against the addition point
+ Rect last = (Rect) freeList.get(freeList.size() - 1);
+ if (last.maxX() + 1 == nextAddX) {
+ nextAddX -= last.w();
+ freeList.remove(freeList.size() - 1);
+ }
+ if (freeList.isEmpty()) {
+ freeList = null;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Debugging functionality
+ //
+
+ public void dumpFreeSpace() {
+ int freeListWidth = 0;
+ for (Iterator iter = freeList.iterator(); iter.hasNext(); ) {
+ Rect cur = (Rect) iter.next();
+ System.err.println(" Free rectangle at " + cur);
+ freeListWidth += cur.w();
+ }
+ // Add on the remaining space at the end
+ System.err.println(" Remaining free space " + (width - nextAddX));
+ freeListWidth += (width - nextAddX);
+ System.err.println(" Total free space " + freeListWidth);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java b/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java
new file mode 100755
index 000000000..973980fdc
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/LevelSet.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.packrect;
+
+import java.util.*;
+
+/** Manages a list of Levels; this is the core data structure
+ contained within the RectanglePacker and encompasses the storage
+ algorithm for the contained Rects. */
+
+public class LevelSet {
+ // Maintained in sorted order by increasing Y coordinate
+ private List/*<Level>*/ levels = new ArrayList/*<Level>*/();
+ private int nextAddY;
+ private int w;
+ private int h;
+
+ /** A LevelSet manages all of the backing store for a region of a
+ specified width and height. */
+ public LevelSet(int w, int h) {
+ this.w = w;
+ this.h = h;
+ }
+
+ public int w() { return w; }
+ public int h() { return h; }
+
+ /** Returns true if the given rectangle was successfully added to
+ the LevelSet given its current dimensions, false if not. Caller
+ is responsible for performing compaction, expansion, etc. as a
+ consequence. */
+ public boolean add(Rect rect) {
+ if (rect.w() > w)
+ return false;
+
+ // Go in reverse order through the levels seeing whether we can
+ // trivially satisfy the allocation request
+ for (int i = levels.size() - 1; i >= 0; --i) {
+ Level level = (Level) levels.get(i);
+ if (level.add(rect))
+ return true;
+ }
+
+ // See whether compaction could satisfy this allocation. This
+ // increases the computational complexity of the addition process,
+ // but prevents us from expanding unnecessarily.
+ for (int i = levels.size() - 1; i >= 0; --i) {
+ Level level = (Level) levels.get(i);
+ if (level.couldAllocateIfCompacted(rect))
+ return false;
+ }
+
+ // OK, we need to either add a new Level or expand the backing
+ // store. Try to add a new Level.
+ if (nextAddY + rect.h() > h)
+ return false;
+
+ Level newLevel = new Level(w, rect.h(), nextAddY, this);
+ levels.add(newLevel);
+ nextAddY += rect.h();
+ boolean res = newLevel.add(rect);
+ if (!res)
+ throw new RuntimeException("Unexpected failure in addition to new Level");
+ return true;
+ }
+
+ /** Removes the given Rect from this LevelSet. */
+ public boolean remove(Rect rect) {
+ for (int i = levels.size() - 1; i >= 0; --i) {
+ Level level = (Level) levels.get(i);
+ if (level.remove(rect))
+ return true;
+ }
+
+ return false;
+ }
+
+ /** Allocates the given Rectangle, performing compaction of a Level
+ if necessary. This is the correct fallback path to {@link
+ #add(Rect)} above. Returns true if allocated successfully, false
+ otherwise (indicating the need to expand the backing store). */
+ public boolean compactAndAdd(Rect rect,
+ Object backingStore,
+ BackingStoreManager manager) {
+ for (int i = levels.size() - 1; i >= 0; --i) {
+ Level level = (Level) levels.get(i);
+ if (level.couldAllocateIfCompacted(rect)) {
+ level.compact(backingStore, manager);
+ boolean res = level.add(rect);
+ if (!res)
+ throw new RuntimeException("Unexpected failure to add after compaction");
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /** Indicates whether it's legal to trivially increase the height of
+ the given Level. This is only possible if it's the last Level
+ added and there's enough room in the backing store. */
+ public boolean canExpand(Level level, int height) {
+ if (levels.isEmpty())
+ return false; // Should not happen
+ if (levels.get(levels.size() - 1) == level &&
+ (h - nextAddY >= height - level.h()))
+ return true;
+ return false;
+ }
+
+ public void expand(Level level, int oldHeight, int newHeight) {
+ nextAddY += (newHeight - oldHeight);
+ }
+
+ /** Gets the used height of the levels in this LevelSet. */
+ public int getUsedHeight() {
+ return nextAddY;
+ }
+
+ /** Sets the height of this LevelSet. It is only legal to reduce the
+ height to greater than or equal to the currently used height. */
+ public void setHeight(int height) throws IllegalArgumentException {
+ if (height < getUsedHeight()) {
+ throw new IllegalArgumentException("May not reduce height below currently used height");
+ }
+ h = height;
+ }
+
+ /** Returns the vertical fragmentation ratio of this LevelSet. This
+ is defined as the ratio of the sum of the heights of all
+ completely empty Levels divided by the overall used height of
+ the LevelSet. A high vertical fragmentation ratio indicates that
+ it may be profitable to perform a compaction. */
+ public float verticalFragmentationRatio() {
+ int freeHeight = 0;
+ int usedHeight = getUsedHeight();
+ if (usedHeight == 0)
+ return 0.0f;
+ for (Iterator iter = iterator(); iter.hasNext(); ) {
+ Level level = (Level) iter.next();
+ if (level.isEmpty()) {
+ freeHeight += level.h();
+ }
+ }
+ return (float) freeHeight / (float) usedHeight;
+ }
+
+ public Iterator iterator() {
+ return levels.iterator();
+ }
+
+ /** Visits all Rects contained in this LevelSet. */
+ public void visit(RectVisitor visitor) {
+ for (Iterator iter = levels.iterator(); iter.hasNext(); ) {
+ Level level = (Level) iter.next();
+ level.visit(visitor);
+ }
+ }
+
+ /** Updates the references to the Rect objects in this LevelSet with
+ the "next locations" of those Rects. This is actually used to
+ update the new Rects in a newly laid-out LevelSet with the
+ original Rects. */
+ public void updateRectangleReferences() {
+ for (Iterator iter = levels.iterator(); iter.hasNext(); ) {
+ Level level = (Level) iter.next();
+ level.updateRectangleReferences();
+ }
+ }
+
+ /** Clears out all Levels stored in this LevelSet. */
+ public void clear() {
+ levels.clear();
+ nextAddY = 0;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java b/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java
new file mode 100755
index 000000000..2f12981a6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/Rect.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.packrect;
+
+/** Represents a rectangular region on the backing store. The edges of
+ the rectangle are the infinitely thin region between adjacent
+ pixels on the screen. The origin of the rectangle is its
+ upper-left corner. It is inclusive of the pixels on the top and
+ left edges and exclusive of the pixels on the bottom and right
+ edges. For example, a rect at position (0, 0) and of size (1, 1)
+ would include only the pixel at (0, 0). <P>
+
+ Negative coordinates and sizes are not supported, since they make
+ no sense in the context of the packer, which deals only with
+ positively sized regions. <P>
+
+ This class contains a user data field for efficient hookup to
+ external data structures as well as enough other hooks to
+ efficiently plug into the rectangle packer. */
+
+public class Rect {
+ private int x;
+ private int y;
+ private int w;
+ private int h;
+
+ // The level we're currently installed in in the parent
+ // RectanglePacker, or null if not hooked in to the table yet
+ private Level level;
+
+ // The user's object this rectangle represents.
+ private Object userData;
+
+ // Used transiently during re-layout of the backing store (when
+ // there is no room left due either to fragmentation or just being
+ // out of space)
+ private Rect nextLocation;
+
+ public Rect() {
+ this(null);
+ }
+
+ public Rect(Object userData) {
+ this(0, 0, 0, 0, userData);
+ }
+
+ public Rect(int x, int y, int w, int h, Object userData) {
+ setPosition(x, y);
+ setSize(w, h);
+ setUserData(userData);
+ }
+
+ public int x() { return x; }
+ public int y() { return y; }
+ public int w() { return w; }
+ public int h() { return h; }
+ public Object getUserData() { return userData; }
+ public Rect getNextLocation() { return nextLocation; }
+
+ public void setPosition(int x, int y) {
+ if (x < 0)
+ throw new IllegalArgumentException("Negative x");
+ if (y < 0)
+ throw new IllegalArgumentException("Negative y");
+ this.x = x;
+ this.y = y;
+ }
+
+ public void setSize(int w, int h) throws IllegalArgumentException {
+ if (w < 0)
+ throw new IllegalArgumentException("Negative width");
+ if (h < 0)
+ throw new IllegalArgumentException("Negative height");
+ this.w = w;
+ this.h = h;
+ }
+
+ public void setUserData(Object obj) { userData = obj; }
+ public void setNextLocation(Rect nextLocation) { this.nextLocation = nextLocation; }
+
+ // Helpers for computations.
+
+ /** Returns the maximum x-coordinate contained within this
+ rectangle. Note that this returns a different result than Java
+ 2D's rectangles; for a rectangle of position (0, 0) and size (1,
+ 1) this will return 0, not 1. Returns -1 if the width of this
+ rectangle is 0. */
+ public int maxX() {
+ if (w() < 1)
+ return -1;
+ return x() + w() - 1;
+ }
+
+ /** Returns the maximum y-coordinate contained within this
+ rectangle. Note that this returns a different result than Java
+ 2D's rectangles; for a rectangle of position (0, 0) and size (1,
+ 1) this will return 0, not 1. Returns -1 if the height of this
+ rectangle is 0. */
+ public int maxY() {
+ if (h() < 1)
+ return -1;
+ return y() + h() - 1;
+ }
+
+ public boolean canContain(Rect other) {
+ return (w() >= other.w() &&
+ h() >= other.h());
+ }
+
+ public String toString() {
+ return "[Rect x: " + x() + " y: " + y() + " w: " + w() + " h: " + h() + "]";
+ }
+
+ // Unclear whether it's a good idea to override hashCode and equals
+ // for these objects
+ /*
+ public boolean equals(Object other) {
+ if (other == null || (!(other instanceof Rect))) {
+ return false;
+ }
+
+ Rect r = (Rect) other;
+ return (this.x() == r.x() &&
+ this.y() == r.y() &&
+ this.w() == r.w() &&
+ this.h() == r.h());
+ }
+
+ public int hashCode() {
+ return (x + y * 13 + w * 17 + h * 23);
+ }
+ */
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java b/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java
new file mode 100755
index 000000000..8f395ed99
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/RectVisitor.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.packrect;
+
+/** Iteration construct without exposing the internals of the
+ RectanglePacker and without implementing a complex Iterator. */
+
+public interface RectVisitor {
+ public void visit(Rect rect);
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java
new file mode 100755
index 000000000..51e6842c0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/RectanglePacker.java
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.packrect;
+
+import java.util.*;
+
+/** Packs rectangles supplied by the user (typically representing
+ image regions) into a larger backing store rectangle (typically
+ representing a large texture). Supports automatic compaction of
+ the space on the backing store, and automatic expansion of the
+ backing store, when necessary. */
+
+public class RectanglePacker {
+ private BackingStoreManager manager;
+ private Object backingStore;
+ private LevelSet levels;
+ private float EXPANSION_FACTOR = 0.5f;
+ private float SHRINK_FACTOR = 0.3f;
+
+ private int initialWidth;
+ private int initialHeight;
+
+ private int maxWidth = -1;
+ private int maxHeight = -1;
+
+ static class RectHComparator implements Comparator {
+ public int compare(Object o1, Object o2) {
+ Rect r1 = (Rect) o1;
+ Rect r2 = (Rect) o2;
+ return r2.h() - r1.h();
+ }
+
+ public boolean equals(Object obj) {
+ return this == obj;
+ }
+ }
+ private static final Comparator rectHComparator = new RectHComparator();
+
+ public RectanglePacker(BackingStoreManager manager,
+ int initialWidth,
+ int initialHeight) {
+ this.manager = manager;
+ levels = new LevelSet(initialWidth, initialHeight);
+ this.initialWidth = initialWidth;
+ this.initialHeight = initialHeight;
+ }
+
+ public Object getBackingStore() {
+ if (backingStore == null) {
+ backingStore = manager.allocateBackingStore(levels.w(), levels.h());
+ }
+
+ return backingStore;
+ }
+
+ /** Sets up a maximum width and height for the backing store. These
+ are optional and if not specified the backing store will grow as
+ necessary. Setting up a maximum width and height introduces the
+ possibility that additions will fail; these are handled with the
+ BackingStoreManager's allocationFailed notification. */
+ public void setMaxSize(int maxWidth, int maxHeight) {
+ this.maxWidth = maxWidth;
+ this.maxHeight = maxHeight;
+ }
+
+ /** Decides upon an (x, y) position for the given rectangle (leaving
+ its width and height unchanged) and places it on the backing
+ store. May provoke re-layout of other Rects already added. If
+ the BackingStoreManager does not support compaction, and {@link
+ BackingStoreManager#preExpand BackingStoreManager.preExpand}
+ does not clear enough space for the incoming rectangle, then
+ this method will throw a RuntimeException. */
+ public void add(Rect rect) throws RuntimeException {
+ // Allocate backing store if we don't have any yet
+ if (backingStore == null)
+ backingStore = manager.allocateBackingStore(levels.w(), levels.h());
+
+ int attemptNumber = 0;
+ boolean tryAgain = false;
+
+ do {
+ // Try to allocate
+ if (levels.add(rect))
+ return;
+
+ if (manager.canCompact()) {
+ // Try to allocate with horizontal compaction
+ if (levels.compactAndAdd(rect, backingStore, manager))
+ return;
+ // Let the manager have a chance at potentially evicting some entries
+ tryAgain = manager.preExpand(rect, attemptNumber++);
+ } else {
+ tryAgain = manager.additionFailed(rect, attemptNumber++);
+ }
+ } while (tryAgain);
+
+ if (!manager.canCompact()) {
+ throw new RuntimeException("BackingStoreManager does not support compaction or expansion, and didn't clear space for new rectangle");
+ }
+
+ compactImpl(rect);
+
+ // Retry the addition of the incoming rectangle
+ add(rect);
+ // Done
+ }
+
+ /** Removes the given rectangle from this RectanglePacker. */
+ public void remove(Rect rect) {
+ levels.remove(rect);
+ }
+
+ /** Visits all Rects contained in this RectanglePacker. */
+ public void visit(RectVisitor visitor) {
+ levels.visit(visitor);
+ }
+
+ /** Returns the vertical fragmentation ratio of this
+ RectanglePacker. This is defined as the ratio of the sum of the
+ heights of all completely empty Levels divided by the overall
+ used height of the LevelSet. A high vertical fragmentation ratio
+ indicates that it may be profitable to perform a compaction. */
+ public float verticalFragmentationRatio() {
+ return levels.verticalFragmentationRatio();
+ }
+
+ /** Forces a compaction cycle, which typically results in allocating
+ a new backing store and copying all entries to it. */
+ public void compact() {
+ compactImpl(null);
+ }
+
+ // The "cause" rect may be null
+ private void compactImpl(Rect cause) {
+ // Have to either expand, compact or both. Need to figure out what
+ // direction to go. Prefer to expand vertically. Expand
+ // horizontally only if rectangle being added is too wide. FIXME:
+ // may want to consider rebalancing the width and height to be
+ // more equal if it turns out we keep expanding in the vertical
+ // direction.
+ boolean done = false;
+ int newWidth = levels.w();
+ int newHeight = levels.h();
+ LevelSet nextLevelSet = null;
+ int attemptNumber = 0;
+ boolean needAdditionFailureNotification = false;
+
+ while (!done) {
+ if (cause != null) {
+ if (cause.w() > newWidth) {
+ newWidth = cause.w();
+ } else {
+ newHeight = (int) (newHeight * (1.0f + EXPANSION_FACTOR));
+ }
+ }
+
+ // Clamp to maximum values
+ needAdditionFailureNotification = false;
+ if (maxWidth > 0 && newWidth > maxWidth) {
+ newWidth = maxWidth;
+ needAdditionFailureNotification = true;
+ }
+ if (maxHeight > 0 && newHeight > maxHeight) {
+ newHeight = maxHeight;
+ needAdditionFailureNotification = true;
+ }
+
+ nextLevelSet = new LevelSet(newWidth, newHeight);
+
+ // Make copies of all existing rectangles
+ List/*<Rect>*/ newRects = new ArrayList/*<Rect>*/();
+ for (Iterator i1 = levels.iterator(); i1.hasNext(); ) {
+ Level level = (Level) i1.next();
+ for (Iterator i2 = level.iterator(); i2.hasNext(); ) {
+ Rect cur = (Rect) i2.next();
+ Rect newRect = new Rect(0, 0, cur.w(), cur.h(), null);
+ cur.setNextLocation(newRect);
+ // Hook up the reverse mapping too for easier replacement
+ newRect.setNextLocation(cur);
+ newRects.add(newRect);
+ }
+ }
+ // Sort them by decreasing height (note: this isn't really
+ // guaranteed to improve the chances of a successful layout)
+ Collections.sort(newRects, rectHComparator);
+ // Try putting all of these rectangles into the new level set
+ done = true;
+ for (Iterator iter = newRects.iterator(); iter.hasNext(); ) {
+ if (!nextLevelSet.add((Rect) iter.next())) {
+ done = false;
+ break;
+ }
+ }
+
+ if (done && cause != null) {
+ // Try to add the new rectangle as well
+ if (nextLevelSet.add(cause)) {
+ // We're OK
+ } else {
+ done = false;
+ }
+ }
+
+ // Don't send addition failure notifications if we're only doing
+ // a compaction
+ if (!done && needAdditionFailureNotification && cause != null) {
+ manager.additionFailed(cause, attemptNumber);
+ }
+ ++attemptNumber;
+ }
+
+ // See whether the implicit compaction that just occurred has
+ // yielded excess empty space.
+ if (nextLevelSet.getUsedHeight() > 0 &&
+ nextLevelSet.getUsedHeight() < nextLevelSet.h() * SHRINK_FACTOR) {
+ int shrunkHeight = Math.max(initialHeight,
+ (int) (nextLevelSet.getUsedHeight() * (1.0f + EXPANSION_FACTOR)));
+ if (maxHeight > 0 && shrunkHeight > maxHeight) {
+ shrunkHeight = maxHeight;
+ }
+ nextLevelSet.setHeight(shrunkHeight);
+ }
+
+ // If we temporarily added the new rectangle to the new LevelSet,
+ // take it out since we don't "really" add it here but in add(), above
+ if (cause != null) {
+ nextLevelSet.remove(cause);
+ }
+
+ // OK, now we have a new layout and a mapping from the old to the
+ // new locations of rectangles on the backing store. Allocate a
+ // new backing store, move the contents over and deallocate the
+ // old one.
+ Object newBackingStore = manager.allocateBackingStore(nextLevelSet.w(),
+ nextLevelSet.h());
+ manager.beginMovement(backingStore, newBackingStore);
+ for (Iterator i1 = levels.iterator(); i1.hasNext(); ) {
+ Level level = (Level) i1.next();
+ for (Iterator i2 = level.iterator(); i2.hasNext(); ) {
+ Rect cur = (Rect) i2.next();
+ manager.move(backingStore, cur,
+ newBackingStore, cur.getNextLocation());
+ }
+ }
+ // Replace references to temporary rectangles with original ones
+ nextLevelSet.updateRectangleReferences();
+ manager.endMovement(backingStore, newBackingStore);
+ // Now delete the old backing store
+ manager.deleteBackingStore(backingStore);
+ // Update to new versions of backing store and LevelSet
+ backingStore = newBackingStore;
+ levels = nextLevelSet;
+ }
+
+ /** Clears all Rects contained in this RectanglePacker. */
+ public void clear() {
+ levels.clear();
+ }
+
+ /** Disposes the backing store allocated by the
+ BackingStoreManager. This RectanglePacker may no longer be used
+ after calling this method. */
+ public void dispose() {
+ if (backingStore != null)
+ manager.deleteBackingStore(backingStore);
+ backingStore = null;
+ levels = null;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/packrect/package.html b/src/jogl/classes/com/sun/opengl/util/packrect/package.html
new file mode 100755
index 000000000..7f2522244
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/packrect/package.html
@@ -0,0 +1,7 @@
+This package implements a rectangle packing algorithm suitable for
+tracking the placement of multiple rectangles inside a larger one. It
+is useful for cases such as placing the contents of multiple windows
+on a larger backing store texture for a compositing window manager;
+placing multiple rasterized strings in a texture map for quick
+rendering to the screen; and many other situations where it is useful
+to carve up a larger texture into smaller pieces dynamically. <P>
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/Texture.java b/src/jogl/classes/com/sun/opengl/util/texture/Texture.java
new file mode 100755
index 000000000..776045f41
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/Texture.java
@@ -0,0 +1,1109 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.util.texture;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import com.sun.opengl.impl.*;
+import com.sun.opengl.util.texture.*;
+import com.sun.opengl.util.texture.spi.*;
+
+/**
+ * Represents an OpenGL texture object. Contains convenience routines
+ * for enabling/disabling OpenGL texture state, binding this texture,
+ * and computing texture coordinates for both the entire image as well
+ * as a sub-image.
+ *
+ * <p><a name="nonpow2"><b>Non-power-of-two restrictions</b></a>
+ * <br> When creating an OpenGL texture object, the Texture class will
+ * attempt to leverage the <a
+ * href="http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt">GL_ARB_texture_non_power_of_two</a>
+ * and <a
+ * href="http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt">GL_ARB_texture_rectangle</a>
+ * extensions (in that order) whenever possible. If neither extension
+ * is available, the Texture class will simply upload a non-pow2-sized
+ * image into a standard pow2-sized texture (without any special
+ * scaling). Since the choice of extension (or whether one is used at
+ * all) depends on the user's machine configuration, developers are
+ * recommended to use {@link #getImageTexCoords} and {@link
+ * #getSubImageTexCoords}, as those methods will calculate the
+ * appropriate texture coordinates for the situation.
+ *
+ * <p>One caveat in this approach is that certain texture wrap modes
+ * (e.g. <code>GL_REPEAT</code>) are not legal when the GL_ARB_texture_rectangle
+ * extension is in use. Another issue to be aware of is that in the
+ * default pow2 scenario, if the original image does not have pow2
+ * dimensions, then wrapping may not work as one might expect since
+ * the image does not extend to the edges of the pow2 texture. If
+ * texture wrapping is important, it is recommended to use only
+ * pow2-sized images with the Texture class.
+ *
+ * <p><a name="perftips"><b>Performance Tips</b></a>
+ * <br> For best performance, try to avoid calling {@link #enable} /
+ * {@link #bind} / {@link #disable} any more than necessary. For
+ * example, applications using many Texture objects in the same scene
+ * may want to reduce the number of calls to both {@link #enable} and
+ * {@link #disable}. To do this it is necessary to call {@link
+ * #getTarget} to make sure the OpenGL texture target is the same for
+ * all of the Texture objects in use; non-power-of-two textures using
+ * the GL_ARB_texture_rectangle extension use a different target than
+ * power-of-two textures using the GL_TEXTURE_2D target. Note that
+ * when switching between textures it is necessary to call {@link
+ * #bind}, but when drawing many triangles all using the same texture,
+ * for best performance only one call to {@link #bind} should be made.
+ *
+ * <p><a name="premult"><b>Alpha premultiplication and blending</b></a>
+ * <br> The mathematically correct way to perform blending in OpenGL
+ * (with the SrcOver "source over destination" mode, or any other
+ * Porter-Duff rule) is to use "premultiplied color components", which
+ * means the R/G/ B color components have already been multiplied by
+ * the alpha value. To make things easier for developers, the Texture
+ * class will automatically convert non-premultiplied image data into
+ * premultiplied data when storing it into an OpenGL texture. As a
+ * result, it is important to use the correct blending function; for
+ * example, the SrcOver rule is expressed as:
+<pre>
+ gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+</pre>
+ * Also, when using a texture function like <code>GL_MODULATE</code> where
+ * the current color plays a role, it is important to remember to make
+ * sure that the color is specified in a premultiplied form, for
+ * example:
+<pre>
+ float a = ...;
+ float r = r * a;
+ float g = g * a;
+ float b = b * a;
+ gl.glColor4f(r, g, b, a);
+</pre>
+ *
+ * For reference, here is a list of the Porter-Duff compositing rules
+ * and the associated OpenGL blend functions (source and destination
+ * factors) to use in the face of premultiplied alpha:
+ *
+<CENTER>
+<TABLE WIDTH="75%">
+<TR> <TD> Rule <TD> Source <TD> Dest
+<TR> <TD> Clear <TD> GL_ZERO <TD> GL_ZERO
+<TR> <TD> Src <TD> GL_ONE <TD> GL_ZERO
+<TR> <TD> SrcOver <TD> GL_ONE <TD> GL_ONE_MINUS_SRC_ALPHA
+<TR> <TD> DstOver <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_ONE
+<TR> <TD> SrcIn <TD> GL_DST_ALPHA <TD> GL_ZERO
+<TR> <TD> DstIn <TD> GL_ZERO <TD> GL_SRC_ALPHA
+<TR> <TD> SrcOut <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_ZERO
+<TR> <TD> DstOut <TD> GL_ZERO <TD> GL_ONE_MINUS_SRC_ALPHA
+<TR> <TD> Dst <TD> GL_ZERO <TD> GL_ONE
+<TR> <TD> SrcAtop <TD> GL_DST_ALPHA <TD> GL_ONE_MINUS_SRC_ALPHA
+<TR> <TD> DstAtop <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_SRC_ALPHA
+<TR> <TD> AlphaXor <TD> GL_ONE_MINUS_DST_ALPHA <TD> GL_ONE_MINUS_SRC_ALPHA
+</TABLE>
+</CENTER>
+ *
+ * @author Chris Campbell
+ * @author Kenneth Russell
+ */
+public class Texture {
+ /** The GL target type. */
+ private int target;
+ /** The GL texture ID. */
+ private int texID;
+ /** The width of the texture. */
+ private int texWidth;
+ /** The height of the texture. */
+ private int texHeight;
+ /** The width of the image. */
+ private int imgWidth;
+ /** The height of the image. */
+ private int imgHeight;
+ /** The original aspect ratio of the image, before any rescaling
+ that might have occurred due to using the GLU mipmap routines. */
+ private float aspectRatio;
+ /** Indicates whether the TextureData requires a vertical flip of
+ the texture coords. */
+ private boolean mustFlipVertically;
+ /** Indicates whether we're using automatic mipmap generation
+ support (GL_GENERATE_MIPMAP). */
+ private boolean usingAutoMipmapGeneration;
+
+ /** The texture coordinates corresponding to the entire image. */
+ private TextureCoords coords;
+
+ /** An estimate of the amount of texture memory this texture consumes. */
+ private int estimatedMemorySize;
+
+ private static final boolean DEBUG = Debug.debug("Texture");
+ private static final boolean VERBOSE = Debug.verbose();
+
+ // For testing alternate code paths on more capable hardware
+ private static final boolean disableNPOT = Debug.isPropertyDefined("jogl.texture.nonpot");
+ private static final boolean disableTexRect = Debug.isPropertyDefined("jogl.texture.notexrect");
+
+ public Texture(TextureData data) throws GLException {
+ GL gl = GLContext.getCurrentGL();
+ texID = createTextureID(gl);
+
+ updateImage(data);
+ }
+
+ // Constructor for use when creating e.g. cube maps, where there is
+ // no initial texture data
+ public Texture(int target) throws GLException {
+ GL gl = GLContext.getCurrentGL();
+ texID = createTextureID(gl);
+ this.target = target;
+ }
+
+ // Package-private constructor for creating a texture object which wraps
+ // an existing texture ID from another package
+ Texture(int textureID,
+ int target,
+ int texWidth,
+ int texHeight,
+ int imgWidth,
+ int imgHeight,
+ boolean mustFlipVertically) {
+ this.texID = textureID;
+ this.target = target;
+ this.mustFlipVertically = mustFlipVertically;
+ this.texWidth = texWidth;
+ this.texHeight = texHeight;
+ setImageSize(imgWidth, imgHeight, target);
+ }
+
+ /**
+ * Enables this texture's target (e.g., GL_TEXTURE_2D) in the
+ * current GL context's state. This method is a shorthand equivalent
+ * of the following OpenGL code:
+ <pre>
+ gl.glEnable(texture.getTarget());
+ </pre>
+ *
+ * See the <a href="#perftips">performance tips</a> above for hints
+ * on how to maximize performance when using many Texture objects.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void enable() throws GLException {
+ GLContext.getCurrentGL().glEnable(target);
+ }
+
+ /**
+ * Disables this texture's target (e.g., GL_TEXTURE_2D) in the
+ * current GL context's state. This method is a shorthand equivalent
+ * of the following OpenGL code:
+ <pre>
+ gl.glDisable(texture.getTarget());
+ </pre>
+ *
+ * See the <a href="#perftips">performance tips</a> above for hints
+ * on how to maximize performance when using many Texture objects.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void disable() throws GLException {
+ GLContext.getCurrentGL().glDisable(target);
+ }
+
+ /**
+ * Binds this texture to the current GL context. This method is a
+ * shorthand equivalent of the following OpenGL code:
+ <pre>
+ gl.glBindTexture(texture.getTarget(), texture.getTextureObject());
+ </pre>
+ *
+ * See the <a href="#perftips">performance tips</a> above for hints
+ * on how to maximize performance when using many Texture objects.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void bind() throws GLException {
+ GLContext.getCurrentGL().glBindTexture(target, texID);
+ }
+
+ /**
+ * Disposes the native resources used by this texture object.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ * @deprecated use destroy(GL)
+ */
+ public void dispose() throws GLException {
+ destroy(GLContext.getCurrentGL());
+ }
+
+ /**
+ * Disposes the native resources used by this texture object.
+ *
+ * @throws GLException if any OpenGL-related errors occurred
+ * @deprecated use destroy(GL)
+ */
+ public void dispose(GL gl) throws GLException {
+ destroy(gl);
+ }
+
+ /**
+ * Destroys the native resources used by this texture object.
+ *
+ * @throws GLException if any OpenGL-related errors occurred
+ */
+ public void destroy(GL gl) throws GLException {
+ gl.glDeleteTextures(1, new int[] {texID}, 0);
+ texID = 0;
+ }
+
+ /**
+ * Returns the OpenGL "target" of this texture.
+ *
+ * @return the OpenGL target of this texture
+ * @see javax.media.opengl.GL#GL_TEXTURE_2D
+ * @see javax.media.opengl.GL2#GL_TEXTURE_RECTANGLE_ARB
+ */
+ public int getTarget() {
+ return target;
+ }
+
+ /**
+ * Returns the width of the allocated OpenGL texture in pixels.
+ * Note that the texture width will be greater than or equal to the
+ * width of the image contained within.
+ *
+ * @return the width of the texture
+ */
+ public int getWidth() {
+ return texWidth;
+ }
+
+ /**
+ * Returns the height of the allocated OpenGL texture in pixels.
+ * Note that the texture height will be greater than or equal to the
+ * height of the image contained within.
+ *
+ * @return the height of the texture
+ */
+ public int getHeight() {
+ return texHeight;
+ }
+
+ /**
+ * Returns the width of the image contained within this texture.
+ * Note that for non-power-of-two textures in particular this may
+ * not be equal to the result of {@link #getWidth}. It is
+ * recommended that applications call {@link #getImageTexCoords} and
+ * {@link #getSubImageTexCoords} rather than using this API
+ * directly.
+ *
+ * @return the width of the image
+ */
+ public int getImageWidth() {
+ return imgWidth;
+ }
+
+ /**
+ * Returns the height of the image contained within this texture.
+ * Note that for non-power-of-two textures in particular this may
+ * not be equal to the result of {@link #getHeight}. It is
+ * recommended that applications call {@link #getImageTexCoords} and
+ * {@link #getSubImageTexCoords} rather than using this API
+ * directly.
+ *
+ * @return the height of the image
+ */
+ public int getImageHeight() {
+ return imgHeight;
+ }
+
+ /**
+ * Returns the original aspect ratio of the image, defined as (image
+ * width) / (image height), before any scaling that might have
+ * occurred as a result of using the GLU mipmap routines.
+ */
+ public float getAspectRatio() {
+ return aspectRatio;
+ }
+
+ /**
+ * Returns the set of texture coordinates corresponding to the
+ * entire image. If the TextureData indicated that the texture
+ * coordinates must be flipped vertically, the returned
+ * TextureCoords will take that into account.
+ *
+ * @return the texture coordinates corresponding to the entire image
+ */
+ public TextureCoords getImageTexCoords() {
+ return coords;
+ }
+
+ /**
+ * Returns the set of texture coordinates corresponding to the
+ * specified sub-image. The (x1, y1) and (x2, y2) points are
+ * specified in terms of pixels starting from the lower-left of the
+ * image. (x1, y1) should specify the lower-left corner of the
+ * sub-image and (x2, y2) the upper-right corner of the sub-image.
+ * If the TextureData indicated that the texture coordinates must be
+ * flipped vertically, the returned TextureCoords will take that
+ * into account; this should not be handled by the end user in the
+ * specification of the y1 and y2 coordinates.
+ *
+ * @return the texture coordinates corresponding to the specified sub-image
+ */
+ public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) {
+ if (target == GL2.GL_TEXTURE_RECTANGLE_ARB) {
+ if (mustFlipVertically) {
+ return new TextureCoords(x1, texHeight - y1, x2, texHeight - y2);
+ } else {
+ return new TextureCoords(x1, y1, x2, y2);
+ }
+ } else {
+ float tx1 = (float)x1 / (float)texWidth;
+ float ty1 = (float)y1 / (float)texHeight;
+ float tx2 = (float)x2 / (float)texWidth;
+ float ty2 = (float)y2 / (float)texHeight;
+ if (mustFlipVertically) {
+ float yMax = (float) imgHeight / (float) texHeight;
+ return new TextureCoords(tx1, yMax - ty1, tx2, yMax - ty2);
+ } else {
+ return new TextureCoords(tx1, ty1, tx2, ty2);
+ }
+ }
+ }
+
+ /**
+ * Updates the entire content area of this texture using the data in
+ * the given image.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void updateImage(TextureData data) throws GLException {
+ updateImage(data, 0);
+ }
+
+ /**
+ * Indicates whether this texture's texture coordinates must be
+ * flipped vertically in order to properly display the texture. This
+ * is handled automatically by {@link #getImageTexCoords
+ * getImageTexCoords} and {@link #getSubImageTexCoords
+ * getSubImageTexCoords}, but applications may generate or otherwise
+ * produce texture coordinates which must be corrected.
+ */
+ public boolean getMustFlipVertically() {
+ return mustFlipVertically;
+ }
+
+ /**
+ * Updates the content area of the specified target of this texture
+ * using the data in the given image. In general this is intended
+ * for construction of cube maps.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void updateImage(TextureData data, int target) throws GLException {
+ GL gl = GLContext.getCurrentGL();
+
+ imgWidth = data.getWidth();
+ imgHeight = data.getHeight();
+ aspectRatio = (float) imgWidth / (float) imgHeight;
+ mustFlipVertically = data.getMustFlipVertically();
+
+ int texTarget = 0;
+ int texParamTarget = this.target;
+
+ // See whether we have automatic mipmap generation support
+ boolean haveAutoMipmapGeneration =
+ (gl.isExtensionAvailable("GL_VERSION_1_4") ||
+ gl.isExtensionAvailable("GL_SGIS_generate_mipmap"));
+
+ // Indicate to the TextureData what functionality is available
+ data.setHaveEXTABGR(gl.isExtensionAvailable("GL_EXT_abgr"));
+ data.setHaveGL12(gl.isExtensionAvailable("GL_VERSION_1_2"));
+
+ // Indicates whether both width and height are power of two
+ boolean isPOT = isPowerOfTwo(imgWidth) && isPowerOfTwo(imgHeight);
+
+ // Note that automatic mipmap generation doesn't work for
+ // GL_ARB_texture_rectangle
+ if (!isPOT && !haveNPOT(gl)) {
+ haveAutoMipmapGeneration = false;
+ }
+
+ boolean expandingCompressedTexture = false;
+ boolean done = false;
+ if (data.getMipmap() && !haveAutoMipmapGeneration) {
+ // GLU always scales the texture's dimensions to be powers of
+ // two. It also doesn't really matter exactly what the texture
+ // width and height are because the texture coords are always
+ // between 0.0 and 1.0.
+ imgWidth = nextPowerOfTwo(imgWidth);
+ imgHeight = nextPowerOfTwo(imgHeight);
+ texWidth = imgWidth;
+ texHeight = imgHeight;
+ texTarget = GL.GL_TEXTURE_2D;
+ done = true;
+ }
+
+ if (!done && preferTexRect(gl) && !isPOT &&
+ haveTexRect(gl) && !data.isDataCompressed() && gl.isGL2()) {
+ // GL_ARB_texture_rectangle does not work for compressed textures
+ if (DEBUG) {
+ System.err.println("Using GL_ARB_texture_rectangle preferentially on this hardware");
+ }
+
+ texWidth = imgWidth;
+ texHeight = imgHeight;
+ texTarget = GL2.GL_TEXTURE_RECTANGLE_ARB;
+ done = true;
+ }
+
+ if (!done && (isPOT || haveNPOT(gl))) {
+ if (DEBUG) {
+ if (isPOT) {
+ System.err.println("Power-of-two texture");
+ } else {
+ System.err.println("Using GL_ARB_texture_non_power_of_two");
+ }
+ }
+
+ texWidth = imgWidth;
+ texHeight = imgHeight;
+ texTarget = GL.GL_TEXTURE_2D;
+ done = true;
+ }
+
+ if (!done && haveTexRect(gl) && !data.isDataCompressed() && gl.isGL2()) {
+ // GL_ARB_texture_rectangle does not work for compressed textures
+ if (DEBUG) {
+ System.err.println("Using GL_ARB_texture_rectangle");
+ }
+
+ texWidth = imgWidth;
+ texHeight = imgHeight;
+ texTarget = GL2.GL_TEXTURE_RECTANGLE_ARB;
+ done = true;
+ }
+
+ if (!done) {
+ // If we receive non-power-of-two compressed texture data and
+ // don't have true hardware support for compressed textures, we
+ // can fake this support by producing an empty "compressed"
+ // texture image, using glCompressedTexImage2D with that to
+ // allocate the texture, and glCompressedTexSubImage2D with the
+ // incoming data.
+ if (data.isDataCompressed()) {
+ if (data.getMipmapData() != null) {
+
+ // We don't currently support expanding of compressed,
+ // mipmapped non-power-of-two textures to the nearest power
+ // of two; the obvious port of the non-mipmapped code didn't
+ // work
+ throw new GLException("Mipmapped non-power-of-two compressed textures only supported on OpenGL 2.0 hardware (GL_ARB_texture_non_power_of_two)");
+ }
+
+ expandingCompressedTexture = true;
+ }
+
+ if (DEBUG) {
+ System.err.println("Expanding texture to power-of-two dimensions");
+ }
+
+ if (data.getBorder() != 0) {
+ throw new RuntimeException("Scaling up a non-power-of-two texture which has a border won't work");
+ }
+ texWidth = nextPowerOfTwo(imgWidth);
+ texHeight = nextPowerOfTwo(imgHeight);
+ texTarget = GL.GL_TEXTURE_2D;
+ }
+
+ texParamTarget = texTarget;
+ setImageSize(imgWidth, imgHeight, texTarget);
+
+ if (target != 0) {
+ // Allow user to override auto detection and skip bind step (for
+ // cubemap construction)
+ texTarget = target;
+ if (this.target == 0) {
+ throw new GLException("Override of target failed; no target specified yet");
+ }
+ texParamTarget = this.target;
+ gl.glBindTexture(texParamTarget, texID);
+ } else {
+ gl.glBindTexture(texTarget, texID);
+ }
+
+ if (data.getMipmap() && !haveAutoMipmapGeneration) {
+ int[] align = new int[1];
+ gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, align, 0); // save alignment
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment());
+
+ if (data.isDataCompressed()) {
+ throw new GLException("May not request mipmap generation for compressed textures");
+ }
+
+ try {
+ // FIXME: may need check for GLUnsupportedException
+ GLU glu = GLU.createGLU(gl);
+ glu.gluBuild2DMipmaps(texTarget, data.getInternalFormat(),
+ data.getWidth(), data.getHeight(),
+ data.getPixelFormat(), data.getPixelType(), data.getBuffer());
+ } finally {
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, align[0]); // restore alignment
+ }
+ } else {
+ checkCompressedTextureExtensions(data);
+ Buffer[] mipmapData = data.getMipmapData();
+ if (mipmapData != null) {
+ int width = texWidth;
+ int height = texHeight;
+ for (int i = 0; i < mipmapData.length; i++) {
+ if (data.isDataCompressed()) {
+ // Need to use glCompressedTexImage2D directly to allocate and fill this image
+ // Avoid spurious memory allocation when possible
+ gl.glCompressedTexImage2D(texTarget, i, data.getInternalFormat(),
+ width, height, data.getBorder(),
+ mipmapData[i].remaining(), mipmapData[i]);
+ } else {
+ // Allocate texture image at this level
+ gl.glTexImage2D(texTarget, i, data.getInternalFormat(),
+ width, height, data.getBorder(),
+ data.getPixelFormat(), data.getPixelType(), null);
+ updateSubImageImpl(data, texTarget, i, 0, 0, 0, 0, data.getWidth(), data.getHeight());
+ }
+
+ width = Math.max(width / 2, 1);
+ height = Math.max(height / 2, 1);
+ }
+ } else {
+ if (data.isDataCompressed()) {
+ if (!expandingCompressedTexture) {
+ // Need to use glCompressedTexImage2D directly to allocate and fill this image
+ // Avoid spurious memory allocation when possible
+ gl.glCompressedTexImage2D(texTarget, 0, data.getInternalFormat(),
+ texWidth, texHeight, data.getBorder(),
+ data.getBuffer().capacity(), data.getBuffer());
+ } else {
+ ByteBuffer buf = DDSImage.allocateBlankBuffer(texWidth,
+ texHeight,
+ data.getInternalFormat());
+ gl.glCompressedTexImage2D(texTarget, 0, data.getInternalFormat(),
+ texWidth, texHeight, data.getBorder(),
+ buf.capacity(), buf);
+ updateSubImageImpl(data, texTarget, 0, 0, 0, 0, 0, data.getWidth(), data.getHeight());
+ }
+ } else {
+ if (data.getMipmap() && haveAutoMipmapGeneration && gl.isGL2ES1()) {
+ // For now, only use hardware mipmapping for uncompressed 2D
+ // textures where the user hasn't explicitly specified
+ // mipmap data; don't know about interactions between
+ // GL_GENERATE_MIPMAP and glCompressedTexImage2D
+ gl.glTexParameteri(texParamTarget, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE);
+ usingAutoMipmapGeneration = true;
+ }
+
+ gl.glTexImage2D(texTarget, 0, data.getInternalFormat(),
+ texWidth, texHeight, data.getBorder(),
+ data.getPixelFormat(), data.getPixelType(), null);
+ updateSubImageImpl(data, texTarget, 0, 0, 0, 0, 0, data.getWidth(), data.getHeight());
+ }
+ }
+ }
+
+ int minFilter = (data.getMipmap() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR);
+ int magFilter = GL.GL_LINEAR;
+ int wrapMode = (gl.isExtensionAvailable("GL_VERSION_1_2") || !gl.isGL2()) ? GL.GL_CLAMP_TO_EDGE : GL2.GL_CLAMP;
+
+ // REMIND: figure out what to do for GL_TEXTURE_RECTANGLE_ARB
+ if (texTarget != GL2.GL_TEXTURE_RECTANGLE_ARB) {
+ gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_MIN_FILTER, minFilter);
+ gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_MAG_FILTER, magFilter);
+ gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_S, wrapMode);
+ gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_T, wrapMode);
+ if (this.target == GL2.GL_TEXTURE_CUBE_MAP) {
+ gl.glTexParameteri(texParamTarget, GL2.GL_TEXTURE_WRAP_R, wrapMode);
+ }
+ }
+
+ // Don't overwrite target if we're loading e.g. faces of a cube
+ // map
+ if ((this.target == 0) ||
+ (this.target == GL.GL_TEXTURE_2D) ||
+ (this.target == GL2.GL_TEXTURE_RECTANGLE_ARB)) {
+ this.target = texTarget;
+ }
+
+ // This estimate will be wrong for cube maps
+ estimatedMemorySize = data.getEstimatedMemorySize();
+ }
+
+ /**
+ * Updates a subregion of the content area of this texture using the
+ * given data. If automatic mipmap generation is in use (see {@link
+ * #isUsingAutoMipmapGeneration isUsingAutoMipmapGeneration}),
+ * updates to the base (level 0) mipmap will cause the lower-level
+ * mipmaps to be regenerated, and updates to other mipmap levels
+ * will be ignored. Otherwise, if automatic mipmap generation is not
+ * in use, only updates the specified mipmap level and does not
+ * re-generate mipmaps if they were originally produced or loaded.
+ *
+ * @param data the image data to be uploaded to this texture
+ * @param mipmapLevel the mipmap level of the texture to set. If
+ * this is non-zero and the TextureData contains mipmap data, the
+ * appropriate mipmap level will be selected.
+ * @param x the x offset (in pixels) relative to the lower-left corner
+ * of this texture
+ * @param y the y offset (in pixels) relative to the lower-left corner
+ * of this texture
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void updateSubImage(TextureData data, int mipmapLevel, int x, int y) throws GLException {
+ if (usingAutoMipmapGeneration && mipmapLevel != 0) {
+ // When we're using mipmap generation via GL_GENERATE_MIPMAP, we
+ // don't need to update other mipmap levels
+ return;
+ }
+ bind();
+ updateSubImageImpl(data, target, mipmapLevel, x, y, 0, 0, data.getWidth(), data.getHeight());
+ }
+
+ /**
+ * Updates a subregion of the content area of this texture using the
+ * specified sub-region of the given data. If automatic mipmap
+ * generation is in use (see {@link #isUsingAutoMipmapGeneration
+ * isUsingAutoMipmapGeneration}), updates to the base (level 0)
+ * mipmap will cause the lower-level mipmaps to be regenerated, and
+ * updates to other mipmap levels will be ignored. Otherwise, if
+ * automatic mipmap generation is not in use, only updates the
+ * specified mipmap level and does not re-generate mipmaps if they
+ * were originally produced or loaded. This method is only supported
+ * for uncompressed TextureData sources.
+ *
+ * @param data the image data to be uploaded to this texture
+ * @param mipmapLevel the mipmap level of the texture to set. If
+ * this is non-zero and the TextureData contains mipmap data, the
+ * appropriate mipmap level will be selected.
+ * @param dstx the x offset (in pixels) relative to the lower-left corner
+ * of this texture where the update will be applied
+ * @param dsty the y offset (in pixels) relative to the lower-left corner
+ * of this texture where the update will be applied
+ * @param srcx the x offset (in pixels) relative to the lower-left corner
+ * of the supplied TextureData from which to fetch the update rectangle
+ * @param srcy the y offset (in pixels) relative to the lower-left corner
+ * of the supplied TextureData from which to fetch the update rectangle
+ * @param width the width (in pixels) of the rectangle to be updated
+ * @param height the height (in pixels) of the rectangle to be updated
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void updateSubImage(TextureData data, int mipmapLevel,
+ int dstx, int dsty,
+ int srcx, int srcy,
+ int width, int height) throws GLException {
+ if (data.isDataCompressed()) {
+ throw new GLException("updateSubImage specifying a sub-rectangle is not supported for compressed TextureData");
+ }
+ if (usingAutoMipmapGeneration && mipmapLevel != 0) {
+ // When we're using mipmap generation via GL_GENERATE_MIPMAP, we
+ // don't need to update other mipmap levels
+ return;
+ }
+ bind();
+ updateSubImageImpl(data, target, mipmapLevel, dstx, dsty, srcx, srcy, width, height);
+ }
+
+ /**
+ * Sets the OpenGL floating-point texture parameter for the
+ * texture's target. This gives control over parameters such as
+ * GL_TEXTURE_MAX_ANISOTROPY_EXT. Causes this texture to be bound to
+ * the current texture state.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void setTexParameterf(int parameterName,
+ float value) {
+ bind();
+ GL gl = GLContext.getCurrentGL();
+ gl.glTexParameterf(target, parameterName, value);
+ }
+
+ /**
+ * Sets the OpenGL multi-floating-point texture parameter for the
+ * texture's target. Causes this texture to be bound to the current
+ * texture state.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void setTexParameterfv(int parameterName,
+ FloatBuffer params) {
+ bind();
+ GL gl = GLContext.getCurrentGL();
+ gl.glTexParameterfv(target, parameterName, params);
+ }
+
+ /**
+ * Sets the OpenGL multi-floating-point texture parameter for the
+ * texture's target. Causes this texture to be bound to the current
+ * texture state.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void setTexParameterfv(int parameterName,
+ float[] params, int params_offset) {
+ bind();
+ GL gl = GLContext.getCurrentGL();
+ gl.glTexParameterfv(target, parameterName, params, params_offset);
+ }
+
+ /**
+ * Sets the OpenGL integer texture parameter for the texture's
+ * target. This gives control over parameters such as
+ * GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, which by default are set
+ * to GL_CLAMP_TO_EDGE if OpenGL 1.2 is supported on the current
+ * platform and GL_CLAMP if not. Causes this texture to be bound to
+ * the current texture state.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void setTexParameteri(int parameterName,
+ int value) {
+ bind();
+ GL gl = GLContext.getCurrentGL();
+ gl.glTexParameteri(target, parameterName, value);
+ }
+
+ /**
+ * Sets the OpenGL multi-integer texture parameter for the texture's
+ * target. Causes this texture to be bound to the current texture
+ * state.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void setTexParameteriv(int parameterName,
+ IntBuffer params) {
+ bind();
+ GL gl = GLContext.getCurrentGL();
+ gl.glTexParameteriv(target, parameterName, params);
+ }
+
+ /**
+ * Sets the OpenGL multi-integer texture parameter for the texture's
+ * target. Causes this texture to be bound to the current texture
+ * state.
+ *
+ * @throws GLException if no OpenGL context was current or if any
+ * OpenGL-related errors occurred
+ */
+ public void setTexParameteriv(int parameterName,
+ int[] params, int params_offset) {
+ bind();
+ GL gl = GLContext.getCurrentGL();
+ gl.glTexParameteriv(target, parameterName, params, params_offset);
+ }
+
+ /**
+ * Returns the underlying OpenGL texture object for this texture.
+ * Most applications will not need to access this, since it is
+ * handled automatically by the bind() and dispose() APIs.
+ */
+ public int getTextureObject() {
+ return texID;
+ }
+
+ /** Returns an estimate of the amount of texture memory in bytes
+ this Texture consumes. It should only be treated as an estimate;
+ most applications should not need to query this but instead let
+ the OpenGL implementation page textures in and out as
+ necessary. */
+ public int getEstimatedMemorySize() {
+ return estimatedMemorySize;
+ }
+
+ /** Indicates whether this Texture is using automatic mipmap
+ generation (via the OpenGL texture parameter
+ GL_GENERATE_MIPMAP). This will automatically be used when
+ mipmapping is requested via the TextureData and either OpenGL
+ 1.4 or the GL_SGIS_generate_mipmap extension is available. If
+ so, updates to the base image (mipmap level 0) will
+ automatically propagate down to the lower mipmap levels. Manual
+ updates of the mipmap data at these lower levels will be
+ ignored. */
+ public boolean isUsingAutoMipmapGeneration() {
+ return usingAutoMipmapGeneration;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ /**
+ * Returns true if the given value is a power of two.
+ *
+ * @return true if the given value is a power of two, false otherwise
+ */
+ private static boolean isPowerOfTwo(int val) {
+ return ((val & (val - 1)) == 0);
+ }
+
+ /**
+ * Returns the nearest power of two that is larger than the given value.
+ * If the given value is already a power of two, this method will simply
+ * return that value.
+ *
+ * @param val the value
+ * @return the next power of two
+ */
+ private static int nextPowerOfTwo(int val) {
+ int ret = 1;
+ while (ret < val) {
+ ret <<= 1;
+ }
+ return ret;
+ }
+
+ /**
+ * Updates the actual image dimensions; usually only called from
+ * <code>updateImage</code>.
+ */
+ private void setImageSize(int width, int height, int target) {
+ imgWidth = width;
+ imgHeight = height;
+ if (target == GL2.GL_TEXTURE_RECTANGLE_ARB) {
+ if (mustFlipVertically) {
+ coords = new TextureCoords(0, imgHeight, imgWidth, 0);
+ } else {
+ coords = new TextureCoords(0, 0, imgWidth, imgHeight);
+ }
+ } else {
+ if (mustFlipVertically) {
+ coords = new TextureCoords(0, (float) imgHeight / (float) texHeight,
+ (float) imgWidth / (float) texWidth, 0);
+ } else {
+ coords = new TextureCoords(0, 0,
+ (float) imgWidth / (float) texWidth,
+ (float) imgHeight / (float) texHeight);
+ }
+ }
+ }
+
+ private void updateSubImageImpl(TextureData data, int newTarget, int mipmapLevel,
+ int dstx, int dsty,
+ int srcx, int srcy, int width, int height) throws GLException {
+ GL gl = GLContext.getCurrentGL();
+ data.setHaveEXTABGR(gl.isExtensionAvailable("GL_EXT_abgr"));
+ data.setHaveGL12(gl.isExtensionAvailable("GL_VERSION_1_2"));
+
+ Buffer buffer = data.getBuffer();
+ if (buffer == null && data.getMipmapData() == null) {
+ // Assume user just wanted to get the Texture object allocated
+ return;
+ }
+
+ int rowlen = data.getRowLength();
+ int dataWidth = data.getWidth();
+ int dataHeight = data.getHeight();
+ if (data.getMipmapData() != null) {
+ // Compute the width, height and row length at the specified mipmap level
+ // Note we do not support specification of the row length for
+ // mipmapped textures at this point
+ for (int i = 0; i < mipmapLevel; i++) {
+ width = Math.max(width / 2, 1);
+ height = Math.max(height / 2, 1);
+
+ dataWidth = Math.max(dataWidth / 2, 1);
+ dataHeight = Math.max(dataHeight / 2, 1);
+ }
+ rowlen = 0;
+ buffer = data.getMipmapData()[mipmapLevel];
+ }
+
+ // Clip incoming rectangles to what is available both on this
+ // texture and in the incoming TextureData
+ if (srcx < 0) {
+ width += srcx;
+ srcx = 0;
+ }
+ if (srcy < 0) {
+ height += srcy;
+ srcy = 0;
+ }
+ // NOTE: not sure whether the following two are the correct thing to do
+ if (dstx < 0) {
+ width += dstx;
+ dstx = 0;
+ }
+ if (dsty < 0) {
+ height += dsty;
+ dsty = 0;
+ }
+
+ if (srcx + width > dataWidth) {
+ width = dataWidth - srcx;
+ }
+ if (srcy + height > dataHeight) {
+ height = dataHeight - srcy;
+ }
+ if (dstx + width > texWidth) {
+ width = texWidth - dstx;
+ }
+ if (dsty + height > texHeight) {
+ height = texHeight - dsty;
+ }
+
+ checkCompressedTextureExtensions(data);
+
+ if (data.isDataCompressed()) {
+ gl.glCompressedTexSubImage2D(newTarget, mipmapLevel,
+ dstx, dsty, width, height,
+ data.getInternalFormat(),
+ buffer.remaining(), buffer);
+ } else {
+ int[] align = { 0 };
+ int[] rowLength = { 0 };
+ 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
+ }
+ gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment());
+ if (DEBUG && VERBOSE) {
+ System.out.println("Row length = " + rowlen);
+ System.out.println("skip pixels = " + srcx);
+ System.out.println("skip rows = " + srcy);
+ System.out.println("dstx = " + dstx);
+ System.out.println("dsty = " + dsty);
+ 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);
+ } else {
+ if ( rowlen!=0 && rowlen!=width &&
+ srcy!=0 && srcx!=0 ) {
+ throw new GLException("rowlen and/or x/y offset only available for GL2");
+ }
+ }
+
+ gl.glTexSubImage2D(newTarget, mipmapLevel,
+ dstx, dsty, width, height,
+ 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
+ }
+ }
+ }
+
+ private void checkCompressedTextureExtensions(TextureData data) {
+ GL gl = GLContext.getCurrentGL();
+ if (data.isDataCompressed()) {
+ switch (data.getInternalFormat()) {
+ case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ if (!gl.isExtensionAvailable("GL_EXT_texture_compression_s3tc") &&
+ !gl.isExtensionAvailable("GL_NV_texture_compression_vtc")) {
+ throw new GLException("DXTn compressed textures not supported by this graphics card");
+ }
+ break;
+ default:
+ // FI1027GXME: should test availability of more texture
+ // compression extensions here
+ break;
+ }
+ }
+ }
+
+ /**
+ * Creates a new texture ID.
+ *
+ * @param gl the GL object associated with the current OpenGL context
+ * @return a new texture ID
+ */
+ private static int createTextureID(GL gl) {
+ int[] tmp = new int[1];
+ gl.glGenTextures(1, tmp, 0);
+ return tmp[0];
+ }
+
+ // Helper routines for disabling certain codepaths
+ private static boolean haveNPOT(GL gl) {
+ return (!disableNPOT &&
+ ( gl.isGLES2() ||
+ gl.isExtensionAvailable("GL_ARB_texture_non_power_of_two") ) );
+ }
+
+ private static boolean haveTexRect(GL gl) {
+ return (!disableTexRect &&
+ TextureIO.isTexRectEnabled() &&
+ gl.isExtensionAvailable("GL_ARB_texture_rectangle"));
+ }
+
+ private static boolean preferTexRect(GL gl) {
+ // Prefer GL_ARB_texture_rectangle on ATI hardware on Mac OS X
+ // due to software fallbacks
+
+ String osName = System.getProperty("os.name").toLowerCase();
+ if (osName.startsWith("mac os x")) {
+ String vendor = gl.glGetString(GL.GL_VENDOR);
+ if (vendor != null && vendor.startsWith("ATI")) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java
new file mode 100755
index 000000000..51710e077
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/TextureCoords.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.util.texture;
+
+/** Specifies texture coordinates for a rectangular area of a
+ texture. Note that some textures are inherently flipped vertically
+ from OpenGL's standard coordinate system. This class takes care of
+ this vertical flip so that the "bottom" and "top" coordinates may
+ sometimes be reversed. From the point of view of code rendering
+ textured polygons, it can always map the bottom and left texture
+ coordinates from the TextureCoords to the lower left point of the
+ textured polygon and achieve correct results. */
+
+public class TextureCoords {
+ // These represent the lower-left point
+ private float left;
+ private float bottom;
+ // These represent the upper-right point
+ private float right;
+ private float top;
+
+ public TextureCoords(float left, float bottom,
+ float right, float top) {
+ this.left = left;
+ this.bottom = bottom;
+ this.right = right;
+ this.top = top;
+ }
+
+ /** Returns the leftmost (x) texture coordinate of this
+ rectangle. */
+ public float left() { return left; }
+
+ /** Returns the rightmost (x) texture coordinate of this
+ rectangle. */
+ public float right() { return right; }
+
+ /** Returns the bottommost (y) texture coordinate of this
+ rectangle. */
+ public float bottom() { return bottom; }
+
+ /** Returns the topmost (y) texture coordinate of this
+ rectangle. */
+ public float top() { return top; }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureData.java b/src/jogl/classes/com/sun/opengl/util/texture/TextureData.java
new file mode 100755
index 000000000..8ac4b9b84
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/TextureData.java
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.util.texture;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+import com.sun.opengl.util.*;
+
+/**
+ * Represents the data for an OpenGL texture. This is separated from
+ * the notion of a Texture to support things like streaming in of
+ * textures in a background thread without requiring an OpenGL context
+ * to be current on that thread.
+ *
+ * @author Chris Campbell
+ * @author Kenneth Russell
+ */
+
+public class TextureData {
+ protected int width;
+ protected int height;
+ private int border;
+ protected int pixelFormat;
+ protected int pixelType;
+ protected int internalFormat; // perhaps inferred from pixelFormat?
+ protected boolean mipmap; // indicates whether mipmaps should be generated
+ // (ignored if mipmaps are supplied from the file)
+ private boolean dataIsCompressed;
+ protected boolean mustFlipVertically; // Must flip texture coordinates
+ // vertically to get OpenGL output
+ // to look correct
+ protected Buffer buffer; // the actual data...
+ private Buffer[] mipmapData; // ...or a series of mipmaps
+ private Flusher flusher;
+ protected int rowLength;
+ protected int alignment; // 1, 2, or 4 bytes
+ protected int estimatedMemorySize;
+
+ // These booleans are a concession to the AWTTextureData subclass
+ protected boolean haveEXTABGR;
+ protected boolean haveGL12;
+
+ /**
+ * Constructs a new TextureData object with the specified parameters
+ * and data contained in the given Buffer. The optional Flusher can
+ * be used to clean up native resources associated with this
+ * TextureData when processing is complete; for example, closing of
+ * memory-mapped files that might otherwise require a garbage
+ * collection to reclaim and close.
+ *
+ * @param internalFormat the OpenGL internal format for the
+ * resulting texture; must be specified, may
+ * not be 0
+ * @param width the width in pixels of the texture
+ * @param height the height in pixels of the texture
+ * @param border the number of pixels of border this texture
+ * data has (0 or 1)
+ * @param pixelFormat the OpenGL pixel format for the
+ * resulting texture; must be specified, may
+ * not be 0
+ * @param pixelType the OpenGL type of the pixels of the texture
+ * @param mipmap indicates whether mipmaps should be
+ * autogenerated (using GLU) for the resulting
+ * texture. Currently if mipmap is true then
+ * dataIsCompressed may not be true.
+ * @param dataIsCompressed indicates whether the texture data is in
+ * compressed form
+ * (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
+ * @param mustFlipVertically indicates whether the texture
+ * coordinates must be flipped vertically
+ * in order to properly display the
+ * texture
+ * @param buffer the buffer containing the texture data
+ * @param flusher optional flusher to perform cleanup tasks
+ * upon call to flush()
+ *
+ * @throws IllegalArgumentException if any parameters of the texture
+ * data were invalid, such as requesting mipmap generation for a
+ * compressed texture
+ */
+ public TextureData(int internalFormat,
+ int width,
+ int height,
+ int border,
+ int pixelFormat,
+ int pixelType,
+ boolean mipmap,
+ boolean dataIsCompressed,
+ boolean mustFlipVertically,
+ Buffer buffer,
+ Flusher flusher) throws IllegalArgumentException {
+ if (mipmap && dataIsCompressed) {
+ throw new IllegalArgumentException("Can not generate mipmaps for compressed textures");
+ }
+
+ this.width = width;
+ this.height = height;
+ this.border = border;
+ this.pixelFormat = pixelFormat;
+ this.pixelType = pixelType;
+ this.internalFormat = internalFormat;
+ this.mipmap = mipmap;
+ this.dataIsCompressed = dataIsCompressed;
+ this.mustFlipVertically = mustFlipVertically;
+ this.buffer = buffer;
+ this.flusher = flusher;
+ alignment = 1; // FIXME: is this correct enough in all situations?
+ estimatedMemorySize = estimatedMemorySize(buffer);
+ }
+
+ /**
+ * Constructs a new TextureData object with the specified parameters
+ * and data for multiple mipmap levels contained in the given array
+ * of Buffers. The optional Flusher can be used to clean up native
+ * resources associated with this TextureData when processing is
+ * complete; for example, closing of memory-mapped files that might
+ * otherwise require a garbage collection to reclaim and close.
+ *
+ * @param internalFormat the OpenGL internal format for the
+ * resulting texture; must be specified, may
+ * not be 0
+ * @param width the width in pixels of the topmost mipmap
+ * level of the texture
+ * @param height the height in pixels of the topmost mipmap
+ * level of the texture
+ * @param border the number of pixels of border this texture
+ * data has (0 or 1)
+ * @param pixelFormat the OpenGL pixel format for the
+ * resulting texture; must be specified, may
+ * not be 0
+ * @param pixelType the OpenGL type of the pixels of the texture
+ * @param dataIsCompressed indicates whether the texture data is in
+ * compressed form
+ * (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
+ * @param mustFlipVertically indicates whether the texture
+ * coordinates must be flipped vertically
+ * in order to properly display the
+ * texture
+ * @param mipmapData the buffers containing all mipmap levels
+ * of the texture's data
+ * @param flusher optional flusher to perform cleanup tasks
+ * upon call to flush()
+ *
+ * @throws IllegalArgumentException if any parameters of the texture
+ * data were invalid, such as requesting mipmap generation for a
+ * compressed texture
+ */
+ public TextureData(int internalFormat,
+ int width,
+ int height,
+ int border,
+ int pixelFormat,
+ int pixelType,
+ boolean dataIsCompressed,
+ boolean mustFlipVertically,
+ Buffer[] mipmapData,
+ Flusher flusher) throws IllegalArgumentException {
+ this.width = width;
+ this.height = height;
+ this.border = border;
+ this.pixelFormat = pixelFormat;
+ this.pixelType = pixelType;
+ this.internalFormat = internalFormat;
+ this.dataIsCompressed = dataIsCompressed;
+ this.mustFlipVertically = mustFlipVertically;
+ this.mipmapData = (Buffer[]) mipmapData.clone();
+ this.flusher = flusher;
+ alignment = 1; // FIXME: is this correct enough in all situations?
+ for (int i = 0; i < mipmapData.length; i++) {
+ estimatedMemorySize += estimatedMemorySize(mipmapData[i]);
+ }
+ }
+
+ /** Used only by subclasses */
+ protected TextureData() {
+ }
+
+ /** 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; }
+ /** Returns the intended OpenGL pixel format of the texture data. */
+ public int getPixelFormat() {
+ return pixelFormat;
+ }
+ /** Returns the intended OpenGL pixel type of the texture data. */
+ public int getPixelType() {
+ return pixelType;
+ }
+ /** Returns the intended OpenGL internal format of the texture data. */
+ public int getInternalFormat() { return internalFormat; }
+ /** Returns whether mipmaps should be generated for the texture data. */
+ public boolean getMipmap() { return mipmap; }
+ /** Indicates whether the texture data is in compressed form. */
+ public boolean isDataCompressed() { return dataIsCompressed; }
+ /** Indicates whether the texture coordinates must be flipped
+ vertically for proper display. */
+ 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; }
+ /** Returns the required byte alignment for the texture data. */
+ 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; }
+
+ /** Sets the width in pixels of the texture data. */
+ public void setWidth(int width) { this.width = width; }
+ /** Sets the height in pixels of the texture data. */
+ public void setHeight(int height) { this.height = height; }
+ /** Sets the border in pixels of the texture data. */
+ public void setBorder(int border) { this.border = border; }
+ /** Sets the intended OpenGL pixel format of the texture data. */
+ public void setPixelFormat(int pixelFormat) { this.pixelFormat = pixelFormat; }
+ /** Sets the intended OpenGL pixel type of the texture data. */
+ public void setPixelType(int pixelType) { this.pixelType = pixelType; }
+ /** Sets the intended OpenGL internal format of the texture data. */
+ public void setInternalFormat(int internalFormat) { this.internalFormat = internalFormat; }
+ /** Sets whether mipmaps should be generated for the texture data. */
+ public void setMipmap(boolean mipmap) { this.mipmap = mipmap; }
+ /** Sets whether the texture data is in compressed form. */
+ public void setIsDataCompressed(boolean compressed) { this.dataIsCompressed = compressed; }
+ /** Sets whether the texture coordinates must be flipped vertically
+ for proper display. */
+ public void setMustFlipVertically(boolean mustFlipVertically) { this.mustFlipVertically = mustFlipVertically; }
+ /** Sets the texture data. */
+ public void setBuffer(Buffer buffer) {
+ this.buffer = buffer;
+ estimatedMemorySize = estimatedMemorySize(buffer);
+ }
+ /** Sets the required byte alignment for the texture data. */
+ public void setAlignment(int alignment) { this.alignment = alignment; }
+ /** Sets the row length needed for correct GL_UNPACK_ROW_LENGTH
+ specification. This is currently only supported for
+ non-mipmapped, non-compressed textures. */
+ public void setRowLength(int rowLength) { this.rowLength = rowLength; }
+ /** Indicates to this TextureData whether the GL_EXT_abgr extension
+ is available. Used for optimization along some code paths to
+ avoid data copies. */
+ public void setHaveEXTABGR(boolean haveEXTABGR) {
+ this.haveEXTABGR = haveEXTABGR;
+ }
+ /** Indicates to this TextureData whether OpenGL version 1.2 is
+ available. If not, falls back to relatively inefficient code
+ paths for several input data types (several kinds of packed
+ pixel formats, in particular). */
+ public void setHaveGL12(boolean haveGL12) {
+ this.haveGL12 = haveGL12;
+ }
+
+ /** 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
+ not need to query this but instead let the OpenGL implementation
+ page textures in and out as necessary. */
+ public int getEstimatedMemorySize() {
+ return estimatedMemorySize;
+ }
+
+ /** Flushes resources associated with this TextureData by calling
+ Flusher.flush(). */
+ public void flush() {
+ if (flusher != null) {
+ flusher.flush();
+ flusher = null;
+ }
+ }
+
+ /** Calls flush()
+ * @see #flush()
+ */
+ public void destroy() {
+ flush();
+ }
+
+ /** Defines a callback mechanism to allow the user to explicitly
+ deallocate native resources (memory-mapped files, etc.)
+ associated with a particular TextureData. */
+ public static interface Flusher {
+ /** Flushes any native resources associated with this
+ TextureData. */
+ public void flush();
+ }
+
+ public String toString() {
+ return "TextureData["+width+"x"+height+", internFormat "+internalFormat+", pixelFormat "+pixelFormat+", pixelType "+pixelType+", border "+border+", estSize "+estimatedMemorySize+", alignment "+alignment+", rowlen "+rowLength;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ protected static int estimatedMemorySize(Buffer buffer) {
+ if (buffer == null) {
+ return 0;
+ }
+ return buffer.capacity() * BufferUtil.sizeOfBufferElem(buffer);
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp
new file mode 100755
index 000000000..1f6b89c7e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javame_cdc_fp
@@ -0,0 +1,1232 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture;
+
+import java.io.*;
+import java.net.*;
+import java.nio.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import com.sun.opengl.impl.Debug;
+import com.sun.opengl.util.*;
+import com.sun.opengl.util.texture.spi.*;
+
+/** <P> Provides input and output facilities for both loading OpenGL
+ textures from disk and streams as well as writing textures already
+ in memory back to disk. </P>
+
+ <P> The TextureIO class supports an arbitrary number of plug-in
+ readers and writers via TextureProviders and TextureWriters.
+ TextureProviders know how to produce TextureData objects from
+ files, InputStreams and URLs. TextureWriters know how to write
+ TextureData objects to disk in various file formats. The
+ TextureData class represents the raw data of the texture before it
+ has been converted to an OpenGL texture object. The Texture class
+ represents the OpenGL texture object and provides easy facilities
+ for using the texture. </P>
+
+ <P> There are several built-in TextureProviders and TextureWriters
+ supplied with the TextureIO implementation. The most basic
+ provider uses the platform's Image I/O facilities to read in a
+ BufferedImage and convert it to a texture. This is the baseline
+ provider and is registered so that it is the last one consulted.
+ All others are asked first to open a given file. </P>
+
+ <P> There are three other providers registered by default as of
+ the time of this writing. One handles SGI RGB (".sgi", ".rgb")
+ images from both files and streams. One handles DirectDraw Surface
+ (".dds") images read from files, though can not read these images
+ from streams. One handles Targa (".tga") images read from both
+ files and streams. These providers are executed in an arbitrary
+ order. Some of these providers require the file's suffix to either
+ be specified via the newTextureData methods or for the file to be
+ named with the appropriate suffix. In general a file suffix should
+ be provided to the newTexture and newTextureData methods if at all
+ possible. </P>
+
+ <P> Note that additional TextureProviders, if reading images from
+ InputStreams, must use the mark()/reset() methods on InputStream
+ when probing for e.g. magic numbers at the head of the file to
+ make sure not to disturb the state of the InputStream for
+ downstream TextureProviders. </P>
+
+ <P> There are analogous TextureWriters provided for writing
+ textures back to disk if desired. As of this writing, there are
+ four TextureWriters registered by default: one for Targa files,
+ one for SGI RGB files, one for DirectDraw surface (.dds) files,
+ and one for ImageIO-supplied formats such as .jpg and .png. Some
+ of these writers have certain limitations such as only being able
+ to write out textures stored in GL_RGB or GL_RGBA format. The DDS
+ writer supports fetching and writing to disk of texture data in
+ DXTn compressed format. Whether this will occur is dependent on
+ whether the texture's internal format is one of the DXTn
+ compressed formats and whether the target file is .dds format.
+*/
+
+public class TextureIO {
+ /** Constant which can be used as a file suffix to indicate a
+ DirectDraw Surface file. */
+ public static final String DDS = "dds";
+
+ /** Constant which can be used as a file suffix to indicate an SGI
+ RGB file. */
+ public static final String SGI = "sgi";
+
+ /** Constant which can be used as a file suffix to indicate an SGI
+ RGB file. */
+ public static final String SGI_RGB = "rgb";
+
+ /** Constant which can be used as a file suffix to indicate a GIF
+ file. */
+ public static final String GIF = "gif";
+
+ /** Constant which can be used as a file suffix to indicate a JPEG
+ file. */
+ public static final String JPG = "jpg";
+
+ /** Constant which can be used as a file suffix to indicate a PNG
+ file. */
+ public static final String PNG = "png";
+
+ /** Constant which can be used as a file suffix to indicate a Targa
+ file. */
+ public static final String TGA = "tga";
+
+ /** Constant which can be used as a file suffix to indicate a TIFF
+ file. */
+ public static final String TIFF = "tiff";
+
+ private static final boolean DEBUG = Debug.debug("TextureIO");
+
+ // For manually disabling the use of the texture rectangle
+ // extensions so you know the texture target is GL_TEXTURE_2D; this
+ // is useful for shader writers (thanks to Chris Campbell for this
+ // observation)
+ private static boolean texRectEnabled = true;
+
+ //----------------------------------------------------------------------
+ // methods that *do not* require a current context
+ // These methods assume RGB or RGBA textures.
+ // Some texture providers may not recognize the file format unless
+ // the fileSuffix is specified, so it is strongly recommended to
+ // specify it wherever it is known.
+ // Some texture providers may also only support one kind of input,
+ // i.e., reading from a file as opposed to a stream.
+
+ /**
+ * Creates a TextureData from the given file. Does no OpenGL work.
+ *
+ * @param file the file from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the file, or null if none of the
+ * registered texture providers could read the file
+ * @throws IOException if an error occurred while reading the file
+ */
+ public static TextureData newTextureData(File file,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(file);
+ }
+ return newTextureDataImpl(file, 0, 0, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given stream. Does no OpenGL work.
+ *
+ * @param stream the stream from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the stream, or null if none of the
+ * registered texture providers could read the stream
+ * @throws IOException if an error occurred while reading the stream
+ */
+ public static TextureData newTextureData(InputStream stream,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ return newTextureDataImpl(stream, 0, 0, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given URL. Does no OpenGL work.
+ *
+ * @param url the URL from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the URL, or null if none of the
+ * registered texture providers could read the URL
+ * @throws IOException if an error occurred while reading the URL
+ */
+ public static TextureData newTextureData(URL url,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(url.getPath());
+ }
+ return newTextureDataImpl(url, 0, 0, mipmap, fileSuffix);
+ }
+
+ //----------------------------------------------------------------------
+ // These methods make no assumption about the OpenGL internal format
+ // or pixel format of the texture; they must be specified by the
+ // user. It is not allowed to supply 0 (indicating no preference)
+ // for either the internalFormat or the pixelFormat;
+ // IllegalArgumentException will be thrown in this case.
+
+ /**
+ * Creates a TextureData from the given file, using the specified
+ * OpenGL internal format and pixel format for the texture which
+ * will eventually result. The internalFormat and pixelFormat must
+ * be specified and may not be zero; to use default values, use the
+ * variant of this method which does not take these arguments. Does
+ * no OpenGL work.
+ *
+ * @param file the file from which to read the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the file, or null if none of the
+ * registered texture providers could read the file
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ * @throws IOException if an error occurred while reading the file
+ */
+ public static TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException, IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(file);
+ }
+
+ return newTextureDataImpl(file, internalFormat, pixelFormat, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given stream, using the specified
+ * OpenGL internal format and pixel format for the texture which
+ * will eventually result. The internalFormat and pixelFormat must
+ * be specified and may not be zero; to use default values, use the
+ * variant of this method which does not take these arguments. Does
+ * no OpenGL work.
+ *
+ * @param stream the stream from which to read the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the stream, or null if none of the
+ * registered texture providers could read the stream
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ * @throws IOException if an error occurred while reading the stream
+ */
+ public static TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException, IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ return newTextureDataImpl(stream, internalFormat, pixelFormat, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given URL, using the specified
+ * OpenGL internal format and pixel format for the texture which
+ * will eventually result. The internalFormat and pixelFormat must
+ * be specified and may not be zero; to use default values, use the
+ * variant of this method which does not take these arguments. Does
+ * no OpenGL work.
+ *
+ * @param url the URL from which to read the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the URL, or null if none of the
+ * registered texture providers could read the URL
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ * @throws IOException if an error occurred while reading the URL
+ */
+ public static TextureData newTextureData(URL url,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException, IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(url.getPath());
+ }
+
+ return newTextureDataImpl(url, internalFormat, pixelFormat, mipmap, fileSuffix);
+ }
+
+ //----------------------------------------------------------------------
+ // methods that *do* require a current context
+ //
+
+ /**
+ * Creates an OpenGL texture object from the specified TextureData
+ * using the current OpenGL context.
+ *
+ * @param data the texture data to turn into an OpenGL texture
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ * @throws IllegalArgumentException if the passed TextureData was null
+ */
+ public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
+ if (data == null) {
+ throw new IllegalArgumentException("Null TextureData");
+ }
+ return new Texture(data);
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified file using
+ * the current OpenGL context.
+ *
+ * @param file the file from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @throws IOException if an error occurred while reading the file
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
+ TextureData data = newTextureData(file, mipmap, FileUtil.getFileSuffix(file));
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified stream using
+ * the current OpenGL context.
+ *
+ * @param stream the stream from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @throws IOException if an error occurred while reading the stream
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
+ TextureData data = newTextureData(stream, mipmap, fileSuffix);
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified URL using the
+ * current OpenGL context.
+ *
+ * @param url the URL from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @throws IOException if an error occurred while reading the URL
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(url.getPath());
+ }
+ TextureData data = newTextureData(url, mipmap, fileSuffix);
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ /**
+ * Creates an OpenGL texture object associated with the given OpenGL
+ * texture target using the current OpenGL context. The texture has
+ * no initial data. This is used, for example, to construct cube
+ * maps out of multiple TextureData objects.
+ *
+ * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
+ * GL.GL_TEXTURE_RECTANGLE_ARB
+ *
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(int target) throws GLException {
+ return new Texture(target);
+ }
+
+ /**
+ * Wraps an OpenGL texture ID from an external library and allows
+ * some of the base methods from the Texture class, such as
+ * binding and querying of texture coordinates, to be used with
+ * it. Attempts to update such textures' contents will yield
+ * undefined results.
+ *
+ * @param textureID the OpenGL texture object to wrap
+ * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
+ * GL2.GL_TEXTURE_RECTANGLE
+ * @param texWidth the width of the texture in pixels
+ * @param texHeight the height of the texture in pixels
+ * @param imgWidth the width of the image within the texture in
+ * pixels (if the content is a sub-rectangle in the upper
+ * left corner); otherwise, pass in texWidth
+ * @param imgHeight the height of the image within the texture in
+ * pixels (if the content is a sub-rectangle in the upper
+ * left corner); otherwise, pass in texHeight
+ * @param mustFlipVertically indicates whether the texture
+ * coordinates must be flipped vertically
+ * in order to properly display the
+ * texture
+ */
+ public static Texture newTexture(int textureID,
+ int target,
+ int texWidth,
+ int texHeight,
+ int imgWidth,
+ int imgHeight,
+ boolean mustFlipVertically) {
+ return new Texture(textureID,
+ target,
+ texWidth,
+ texHeight,
+ imgWidth,
+ imgHeight,
+ mustFlipVertically);
+ }
+
+ /**
+ * Writes the given texture to a file. The type of the file is
+ * inferred from its suffix. An OpenGL context must be current in
+ * order to fetch the texture data back from the OpenGL pipeline.
+ * This method causes the specified Texture to be bound to the
+ * GL_TEXTURE_2D state. If no suitable writer for the requested file
+ * format was found, throws an IOException. <P>
+ *
+ * Reasonable attempts are made to produce good results in the
+ * resulting images. The Targa, SGI and ImageIO writers produce
+ * results in the correct vertical orientation for those file
+ * formats. The DDS writer performs no vertical flip of the data,
+ * even in uncompressed mode. (It is impossible to perform such a
+ * vertical flip with compressed data.) Applications should keep
+ * this in mind when using this routine to save textures to disk for
+ * later re-loading. <P>
+ *
+ * Any mipmaps for the specified texture are currently discarded
+ * when it is written to disk, regardless of whether the underlying
+ * file format supports multiple mipmaps in a given file.
+ *
+ * @throws IOException if an error occurred during writing or no
+ * suitable writer was found
+ * @throws GLException if no OpenGL context was current or an
+ * OpenGL-related error occurred
+ */
+ public static void write(Texture texture, File file) throws IOException, GLException {
+ if (texture.getTarget() != GL.GL_TEXTURE_2D) {
+ throw new GLException("Only GL_TEXTURE_2D textures are supported");
+ }
+
+ // First fetch the texture data
+ GL _gl = GLContext.getCurrentGL();
+ if (!_gl.isGL2()) {
+ throw new GLException("Only GL2 supports fetching compressed images, GL: " + _gl);
+ }
+ GL2 gl = _gl.getGL2();
+
+ texture.bind();
+ int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
+ int width = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
+ int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
+ int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
+ TextureData data = null;
+ if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
+ internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
+ internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
+ internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
+ // Fetch using glGetCompressedTexImage
+ int size = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
+ ByteBuffer res = ByteBuffer.wrap(new byte[size]);
+ gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
+ data = new TextureData(internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
+ false, true, true, res, null);
+ } else {
+ int bytesPerPixel = 0;
+ int fetchedFormat = 0;
+ switch (internalFormat) {
+ case GL.GL_RGB:
+ case GL2.GL_BGR:
+ case GL.GL_RGB8:
+ bytesPerPixel = 3;
+ fetchedFormat = GL.GL_RGB;
+ break;
+ case GL.GL_RGBA:
+ case GL2.GL_BGRA:
+ case GL2.GL_ABGR_EXT:
+ case GL.GL_RGBA8:
+ bytesPerPixel = 4;
+ fetchedFormat = GL.GL_RGBA;
+ break;
+ default:
+ throw new IOException("Unsupported texture internal format 0x" + Integer.toHexString(internalFormat));
+ }
+
+ // Fetch using glGetTexImage
+ int packAlignment = glGetInteger(GL.GL_PACK_ALIGNMENT);
+ int packRowLength = glGetInteger(GL2.GL_PACK_ROW_LENGTH);
+ int packSkipRows = glGetInteger(GL2.GL_PACK_SKIP_ROWS);
+ int packSkipPixels = glGetInteger(GL2.GL_PACK_SKIP_PIXELS);
+ int packSwapBytes = glGetInteger(GL2.GL_PACK_SWAP_BYTES);
+
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
+
+ ByteBuffer res = ByteBuffer.wrap(new byte[(width + (2 * border)) *
+ (height + (2 * border)) *
+ bytesPerPixel]);
+ if (DEBUG) {
+ System.out.println("Allocated buffer of size " + res.remaining() + " for fetched image (" +
+ ((fetchedFormat == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA") + ")");
+ }
+ gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
+
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
+
+ data = new TextureData(internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
+ false, false, false, res, null);
+
+ if (DEBUG) {
+ System.out.println("data.getPixelFormat() = " +
+ ((data.getPixelFormat() == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA"));
+ }
+ }
+
+ for (Iterator iter = textureWriters.iterator(); iter.hasNext(); ) {
+ TextureWriter writer = (TextureWriter) iter.next();
+ if (writer.write(file, data)) {
+ return;
+ }
+ }
+
+ throw new IOException("No suitable texture writer found");
+ }
+
+ //----------------------------------------------------------------------
+ // SPI support
+ //
+
+ /** Adds a TextureProvider to support reading of a new file
+ format. */
+ public static void addTextureProvider(TextureProvider provider) {
+ // Must always add at the front so the ImageIO provider is last,
+ // so we don't accidentally use it instead of a user's possibly
+ // more optimal provider
+ textureProviders.add(0, provider);
+ }
+
+ /** Adds a TextureWriter to support writing of a new file
+ format. */
+ public static void addTextureWriter(TextureWriter writer) {
+ // Must always add at the front so the ImageIO writer is last,
+ // so we don't accidentally use it instead of a user's possibly
+ // more optimal writer
+ textureWriters.add(0, writer);
+ }
+
+ //---------------------------------------------------------------------------
+ // Global disabling of texture rectangle extension
+ //
+
+ /** Toggles the use of the GL_ARB_texture_rectangle extension by the
+ TextureIO classes. By default, on hardware supporting this
+ extension, the TextureIO classes may use the
+ GL_ARB_texture_rectangle extension for non-power-of-two
+ textures. (If the hardware supports the
+ GL_ARB_texture_non_power_of_two extension, that one is
+ preferred.) In some situations, for example when writing
+ shaders, it is advantageous to force the texture target to
+ always be GL_TEXTURE_2D in order to have one version of the
+ shader, even at the expense of texture memory in the case where
+ NPOT textures are not supported. This method allows the use of
+ the GL_ARB_texture_rectangle extension to be turned off globally
+ for this purpose. The default is that the use of the extension
+ is enabled. */
+ public static void setTexRectEnabled(boolean enabled) {
+ texRectEnabled = enabled;
+ }
+
+ /** Indicates whether the GL_ARB_texture_rectangle extension is
+ allowed to be used for non-power-of-two textures; see {@link
+ #setTexRectEnabled setTexRectEnabled}. */
+ public static boolean isTexRectEnabled() {
+ return texRectEnabled;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static List/*<TextureProvider>*/ textureProviders = new ArrayList/*<TextureProvider>*/();
+ private static List/*<TextureWriter>*/ textureWriters = new ArrayList/*<TextureWriter>*/();
+
+ static {
+ /*
+ // ImageIO provider, the fall-back, must be the first one added
+ 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();
+ addTextureProvider(provider);
+ } catch (Exception e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
+ }
+ */
+
+ // Other special-case providers
+ addTextureProvider(new DDSTextureProvider());
+ addTextureProvider(new SGITextureProvider());
+ addTextureProvider(new TGATextureProvider());
+
+ /*
+ // ImageIO writer, the fall-back, must be the first one added
+ 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();
+ addTextureWriter(writer);
+ } catch (Exception e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
+ }
+ */
+
+ // Other special-case writers
+ addTextureWriter(new DDSTextureWriter());
+ addTextureWriter(new SGITextureWriter());
+ addTextureWriter(new TGATextureWriter());
+ }
+
+ // Implementation methods
+ private static TextureData newTextureDataImpl(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (file == null) {
+ throw new IOException("File was null");
+ }
+
+ fileSuffix = toLowerCase(fileSuffix);
+
+ for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+ TextureProvider provider = (TextureProvider) iter.next();
+ TextureData data = provider.newTextureData(file,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ fileSuffix);
+ if (data != null) {
+ return data;
+ }
+ }
+
+ throw new IOException("No suitable reader for given file");
+ }
+
+ private static TextureData newTextureDataImpl(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (stream == null) {
+ throw new IOException("Stream was null");
+ }
+
+ fileSuffix = toLowerCase(fileSuffix);
+
+ // Note: use of BufferedInputStream works around 4764639/4892246
+ if (!(stream instanceof BufferedInputStream)) {
+ stream = new BufferedInputStream(stream);
+ }
+
+ for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+ TextureProvider provider = (TextureProvider) iter.next();
+ TextureData data = provider.newTextureData(stream,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ fileSuffix);
+ if (data != null) {
+ return data;
+ }
+ }
+
+ throw new IOException("No suitable reader for given stream");
+ }
+
+ private static TextureData newTextureDataImpl(URL url,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (url == null) {
+ throw new IOException("URL was null");
+ }
+
+ fileSuffix = toLowerCase(fileSuffix);
+
+ for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+ TextureProvider provider = (TextureProvider) iter.next();
+ TextureData data = provider.newTextureData(url,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ fileSuffix);
+ if (data != null) {
+ return data;
+ }
+ }
+
+ throw new IOException("No suitable reader for given URL");
+ }
+
+ //----------------------------------------------------------------------
+ // DDS provider -- supports files only for now
+ static class DDSTextureProvider implements TextureProvider {
+ public TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (DDS.equals(fileSuffix) ||
+ DDS.equals(FileUtil.getFileSuffix(file))) {
+ DDSImage image = DDSImage.read(file);
+ return newTextureData(image, internalFormat, pixelFormat, mipmap);
+ }
+
+ return null;
+ }
+
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (DDS.equals(fileSuffix) ||
+ DDSImage.isDDSImage(stream)) {
+ DDSImage image = DDSImage.read(stream);
+ return newTextureData(image, internalFormat, pixelFormat, mipmap);
+ }
+
+ return null;
+ }
+
+ public TextureData newTextureData(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);
+ } finally {
+ stream.close();
+ }
+ }
+
+ private TextureData newTextureData(final DDSImage image,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap) {
+ DDSImage.ImageInfo info = image.getMipMap(0);
+ if (pixelFormat == 0) {
+ switch (image.getPixelFormat()) {
+ case DDSImage.D3DFMT_R8G8B8:
+ pixelFormat = GL.GL_RGB;
+ break;
+ default:
+ pixelFormat = GL.GL_RGBA;
+ break;
+ }
+ }
+ if (info.isCompressed()) {
+ switch (info.getCompressionFormat()) {
+ case DDSImage.D3DFMT_DXT1:
+ internalFormat = GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ break;
+ case DDSImage.D3DFMT_DXT3:
+ internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ break;
+ case DDSImage.D3DFMT_DXT5:
+ internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ break;
+ default:
+ throw new RuntimeException("Unsupported DDS compression format \"" +
+ DDSImage.getCompressionFormatName(info.getCompressionFormat()) + "\"");
+ }
+ }
+ if (internalFormat == 0) {
+ switch (image.getPixelFormat()) {
+ case DDSImage.D3DFMT_R8G8B8:
+ pixelFormat = GL.GL_RGB;
+ break;
+ default:
+ pixelFormat = GL.GL_RGBA;
+ break;
+ }
+ }
+ TextureData.Flusher flusher = new TextureData.Flusher() {
+ public void flush() {
+ image.close();
+ }
+ };
+ TextureData data;
+ if (mipmap && image.getNumMipMaps() > 0) {
+ Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
+ for (int i = 0; i < image.getNumMipMaps(); i++) {
+ mipmapData[i] = image.getMipMap(i).getData();
+ }
+ data = new TextureData(internalFormat,
+ info.getWidth(),
+ info.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ info.isCompressed(),
+ true,
+ mipmapData,
+ flusher);
+ } else {
+ // Fix this up for the end user because we can't generate
+ // mipmaps for compressed textures
+ mipmap = false;
+ data = new TextureData(internalFormat,
+ info.getWidth(),
+ info.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ mipmap,
+ info.isCompressed(),
+ true,
+ info.getData(),
+ flusher);
+ }
+ return data;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Base class for SGI RGB and TGA image providers
+ static abstract class StreamBasedTextureProvider implements TextureProvider {
+ public TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ InputStream inStream = new BufferedInputStream(new FileInputStream(file));
+ try {
+ // The SGIImage and TGAImage implementations use InputStreams
+ // anyway so there isn't much point in having a separate code
+ // path for files
+ return newTextureData(inStream,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ ((fileSuffix != null) ? fileSuffix : FileUtil.getFileSuffix(file)));
+ } finally {
+ inStream.close();
+ }
+ }
+
+ public TextureData newTextureData(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);
+ } finally {
+ stream.close();
+ }
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // SGI RGB image provider
+ static class SGITextureProvider extends StreamBasedTextureProvider {
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (SGI.equals(fileSuffix) ||
+ SGI_RGB.equals(fileSuffix) ||
+ SGIImage.isSGIImage(stream)) {
+ SGIImage image = SGIImage.read(stream);
+ if (pixelFormat == 0) {
+ pixelFormat = image.getFormat();
+ }
+ if (internalFormat == 0) {
+ internalFormat = image.getFormat();
+ }
+ return new TextureData(internalFormat,
+ image.getWidth(),
+ image.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ mipmap,
+ false,
+ false,
+ ByteBuffer.wrap(image.getData()),
+ null);
+ }
+
+ return null;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // TGA (Targa) image provider
+ static class TGATextureProvider extends StreamBasedTextureProvider {
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (TGA.equals(fileSuffix)) {
+ TGAImage image = TGAImage.read(stream);
+ if (pixelFormat == 0) {
+ pixelFormat = image.getGLFormat();
+ }
+ if (internalFormat == 0) {
+ GL gl = GLContext.getCurrentGL();
+ if(gl.isGL2()) {
+ internalFormat = GL.GL_RGBA8;
+ } else {
+ internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
+ }
+ }
+ return new TextureData(internalFormat,
+ image.getWidth(),
+ image.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ mipmap,
+ false,
+ false,
+ image.getData(),
+ null);
+ }
+
+ return null;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // DDS texture writer
+ //
+ static class DDSTextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ if (DDS.equals(FileUtil.getFileSuffix(file))) {
+ // See whether the DDS writer can handle this TextureData
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if (pixelType != GL.GL_BYTE &&
+ pixelType != GL.GL_UNSIGNED_BYTE) {
+ throw new IOException("DDS writer only supports byte / unsigned byte textures");
+ }
+
+ int d3dFormat = 0;
+ // FIXME: some of these are probably not completely correct and would require swizzling
+ switch (pixelFormat) {
+ case GL.GL_RGB: d3dFormat = DDSImage.D3DFMT_R8G8B8; break;
+ case GL.GL_RGBA: d3dFormat = DDSImage.D3DFMT_A8R8G8B8; break;
+ case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT: d3dFormat = DDSImage.D3DFMT_DXT1; break;
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: throw new IOException("RGBA DXT1 not yet supported");
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: d3dFormat = DDSImage.D3DFMT_DXT3; break;
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
+ default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
+ }
+
+ ByteBuffer[] mipmaps = null;
+ if (data.getMipmapData() != null) {
+ mipmaps = new ByteBuffer[data.getMipmapData().length];
+ for (int i = 0; i < mipmaps.length; i++) {
+ mipmaps[i] = (ByteBuffer) data.getMipmapData()[i];
+ }
+ } else {
+ mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
+ }
+
+ DDSImage image = DDSImage.createFromData(d3dFormat,
+ data.getWidth(),
+ data.getHeight(),
+ mipmaps);
+ image.write(file);
+ return true;
+ }
+
+ return false;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // SGI (rgb) texture writer
+ //
+ static class SGITextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ String fileSuffix = FileUtil.getFileSuffix(file);
+ if (SGI.equals(fileSuffix) ||
+ SGI_RGB.equals(fileSuffix)) {
+ // See whether the SGI writer can handle this TextureData
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if ((pixelFormat == GL.GL_RGB ||
+ pixelFormat == GL.GL_RGBA) &&
+ (pixelType == GL.GL_BYTE ||
+ pixelType == GL.GL_UNSIGNED_BYTE)) {
+ ByteBuffer buf = ((data.getBuffer() != null) ?
+ (ByteBuffer) data.getBuffer() :
+ (ByteBuffer) data.getMipmapData()[0]);
+ byte[] bytes;
+ if (buf.hasArray()) {
+ bytes = buf.array();
+ } else {
+ buf.rewind();
+ bytes = new byte[buf.remaining()];
+ buf.get(bytes);
+ buf.rewind();
+ }
+
+ SGIImage image = SGIImage.createFromData(data.getWidth(),
+ data.getHeight(),
+ (pixelFormat == GL.GL_RGBA),
+ bytes);
+ image.write(file, false);
+ return true;
+ }
+
+ throw new IOException("SGI writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+ }
+
+ return false;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // TGA (Targa) texture writer
+
+ static class TGATextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ if (TGA.equals(FileUtil.getFileSuffix(file))) {
+ // See whether the TGA writer can handle this TextureData
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if ((pixelFormat == GL.GL_RGB ||
+ pixelFormat == GL.GL_RGBA) &&
+ (pixelType == GL.GL_BYTE ||
+ pixelType == GL.GL_UNSIGNED_BYTE)) {
+ ByteBuffer buf = ((data.getBuffer() != null) ?
+ (ByteBuffer) data.getBuffer() :
+ (ByteBuffer) data.getMipmapData()[0]);
+ // Must reverse order of red and blue channels to get correct results
+ int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
+ for (int i = 0; i < buf.remaining(); i += skip) {
+ byte red = buf.get(i + 0);
+ byte blue = buf.get(i + 2);
+ buf.put(i + 0, blue);
+ buf.put(i + 2, red);
+ }
+
+ TGAImage image = TGAImage.createFromData(data.getWidth(),
+ data.getHeight(),
+ (pixelFormat == GL.GL_RGBA),
+ false,
+ ((data.getBuffer() != null) ?
+ (ByteBuffer) data.getBuffer() :
+ (ByteBuffer) data.getMipmapData()[0]));
+ image.write(file);
+ return true;
+ }
+
+ throw new IOException("TGA writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+ }
+
+ return false;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Helper routines
+ //
+
+ private static int glGetInteger(int pname) {
+ int[] tmp = new int[1];
+ GL gl = GLContext.getCurrentGL();
+ gl.glGetIntegerv(pname, tmp, 0);
+ return tmp[0];
+ }
+
+ private static int glGetTexLevelParameteri(GL2 gl, int target, int level, int pname) {
+ int[] tmp = new int[1];
+ gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
+ return tmp[0];
+ }
+
+ private static String toLowerCase(String arg) {
+ if (arg == null) {
+ return null;
+ }
+
+ return arg.toLowerCase();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase b/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase
new file mode 100755
index 000000000..2b2f123a0
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/TextureIO.java.javase
@@ -0,0 +1,1234 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture;
+
+import java.io.*;
+import java.net.*;
+import java.nio.*;
+import java.util.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import com.sun.opengl.impl.Debug;
+import com.sun.opengl.util.*;
+import com.sun.opengl.util.texture.spi.*;
+
+/** <P> Provides input and output facilities for both loading OpenGL
+ textures from disk and streams as well as writing textures already
+ in memory back to disk. </P>
+
+ <P> The TextureIO class supports an arbitrary number of plug-in
+ readers and writers via TextureProviders and TextureWriters.
+ TextureProviders know how to produce TextureData objects from
+ files, InputStreams and URLs. TextureWriters know how to write
+ TextureData objects to disk in various file formats. The
+ TextureData class represents the raw data of the texture before it
+ has been converted to an OpenGL texture object. The Texture class
+ represents the OpenGL texture object and provides easy facilities
+ for using the texture. </P>
+
+ <P> There are several built-in TextureProviders and TextureWriters
+ supplied with the TextureIO implementation. The most basic
+ provider uses the platform's Image I/O facilities to read in a
+ BufferedImage and convert it to a texture. This is the baseline
+ provider and is registered so that it is the last one consulted.
+ All others are asked first to open a given file. </P>
+
+ <P> There are three other providers registered by default as of
+ the time of this writing. One handles SGI RGB (".sgi", ".rgb")
+ images from both files and streams. One handles DirectDraw Surface
+ (".dds") images read from files, though can not read these images
+ from streams. One handles Targa (".tga") images read from both
+ files and streams. These providers are executed in an arbitrary
+ order. Some of these providers require the file's suffix to either
+ be specified via the newTextureData methods or for the file to be
+ named with the appropriate suffix. In general a file suffix should
+ be provided to the newTexture and newTextureData methods if at all
+ possible. </P>
+
+ <P> Note that additional TextureProviders, if reading images from
+ InputStreams, must use the mark()/reset() methods on InputStream
+ when probing for e.g. magic numbers at the head of the file to
+ make sure not to disturb the state of the InputStream for
+ downstream TextureProviders. </P>
+
+ <P> There are analogous TextureWriters provided for writing
+ textures back to disk if desired. As of this writing, there are
+ four TextureWriters registered by default: one for Targa files,
+ one for SGI RGB files, one for DirectDraw surface (.dds) files,
+ and one for ImageIO-supplied formats such as .jpg and .png. Some
+ of these writers have certain limitations such as only being able
+ to write out textures stored in GL_RGB or GL_RGBA format. The DDS
+ writer supports fetching and writing to disk of texture data in
+ DXTn compressed format. Whether this will occur is dependent on
+ whether the texture's internal format is one of the DXTn
+ compressed formats and whether the target file is .dds format.
+*/
+
+public class TextureIO {
+ /** Constant which can be used as a file suffix to indicate a
+ DirectDraw Surface file. */
+ public static final String DDS = "dds";
+
+ /** Constant which can be used as a file suffix to indicate an SGI
+ RGB file. */
+ public static final String SGI = "sgi";
+
+ /** Constant which can be used as a file suffix to indicate an SGI
+ RGB file. */
+ public static final String SGI_RGB = "rgb";
+
+ /** Constant which can be used as a file suffix to indicate a GIF
+ file. */
+ public static final String GIF = "gif";
+
+ /** Constant which can be used as a file suffix to indicate a JPEG
+ file. */
+ public static final String JPG = "jpg";
+
+ /** Constant which can be used as a file suffix to indicate a PNG
+ file. */
+ public static final String PNG = "png";
+
+ /** Constant which can be used as a file suffix to indicate a Targa
+ file. */
+ public static final String TGA = "tga";
+
+ /** Constant which can be used as a file suffix to indicate a TIFF
+ file. */
+ public static final String TIFF = "tiff";
+
+ private static final boolean DEBUG = Debug.debug("TextureIO");
+
+ // For manually disabling the use of the texture rectangle
+ // extensions so you know the texture target is GL_TEXTURE_2D; this
+ // is useful for shader writers (thanks to Chris Campbell for this
+ // observation)
+ private static boolean texRectEnabled = true;
+
+ //----------------------------------------------------------------------
+ // methods that *do not* require a current context
+ // These methods assume RGB or RGBA textures.
+ // Some texture providers may not recognize the file format unless
+ // the fileSuffix is specified, so it is strongly recommended to
+ // specify it wherever it is known.
+ // Some texture providers may also only support one kind of input,
+ // i.e., reading from a file as opposed to a stream.
+
+ /**
+ * Creates a TextureData from the given file. Does no OpenGL work.
+ *
+ * @param file the file from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the file, or null if none of the
+ * registered texture providers could read the file
+ * @throws IOException if an error occurred while reading the file
+ */
+ public static TextureData newTextureData(File file,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(file);
+ }
+ return newTextureDataImpl(file, 0, 0, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given stream. Does no OpenGL work.
+ *
+ * @param stream the stream from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the stream, or null if none of the
+ * registered texture providers could read the stream
+ * @throws IOException if an error occurred while reading the stream
+ */
+ public static TextureData newTextureData(InputStream stream,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ return newTextureDataImpl(stream, 0, 0, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given URL. Does no OpenGL work.
+ *
+ * @param url the URL from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the URL, or null if none of the
+ * registered texture providers could read the URL
+ * @throws IOException if an error occurred while reading the URL
+ */
+ public static TextureData newTextureData(URL url,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(url.getPath());
+ }
+ return newTextureDataImpl(url, 0, 0, mipmap, fileSuffix);
+ }
+
+ //----------------------------------------------------------------------
+ // These methods make no assumption about the OpenGL internal format
+ // or pixel format of the texture; they must be specified by the
+ // user. It is not allowed to supply 0 (indicating no preference)
+ // for either the internalFormat or the pixelFormat;
+ // IllegalArgumentException will be thrown in this case.
+
+ /**
+ * Creates a TextureData from the given file, using the specified
+ * OpenGL internal format and pixel format for the texture which
+ * will eventually result. The internalFormat and pixelFormat must
+ * be specified and may not be zero; to use default values, use the
+ * variant of this method which does not take these arguments. Does
+ * no OpenGL work.
+ *
+ * @param file the file from which to read the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the file, or null if none of the
+ * registered texture providers could read the file
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ * @throws IOException if an error occurred while reading the file
+ */
+ public static TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException, IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(file);
+ }
+
+ return newTextureDataImpl(file, internalFormat, pixelFormat, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given stream, using the specified
+ * OpenGL internal format and pixel format for the texture which
+ * will eventually result. The internalFormat and pixelFormat must
+ * be specified and may not be zero; to use default values, use the
+ * variant of this method which does not take these arguments. Does
+ * no OpenGL work.
+ *
+ * @param stream the stream from which to read the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the stream, or null if none of the
+ * registered texture providers could read the stream
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ * @throws IOException if an error occurred while reading the stream
+ */
+ public static TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException, IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ return newTextureDataImpl(stream, internalFormat, pixelFormat, mipmap, fileSuffix);
+ }
+
+ /**
+ * Creates a TextureData from the given URL, using the specified
+ * OpenGL internal format and pixel format for the texture which
+ * will eventually result. The internalFormat and pixelFormat must
+ * be specified and may not be zero; to use default values, use the
+ * variant of this method which does not take these arguments. Does
+ * no OpenGL work.
+ *
+ * @param url the URL from which to read the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @return the texture data from the URL, or null if none of the
+ * registered texture providers could read the URL
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ * @throws IOException if an error occurred while reading the URL
+ */
+ public static TextureData newTextureData(URL url,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException, IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(url.getPath());
+ }
+
+ return newTextureDataImpl(url, internalFormat, pixelFormat, mipmap, fileSuffix);
+ }
+
+ //----------------------------------------------------------------------
+ // methods that *do* require a current context
+ //
+
+ /**
+ * Creates an OpenGL texture object from the specified TextureData
+ * using the current OpenGL context.
+ *
+ * @param data the texture data to turn into an OpenGL texture
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ * @throws IllegalArgumentException if the passed TextureData was null
+ */
+ public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
+ if (data == null) {
+ throw new IllegalArgumentException("Null TextureData");
+ }
+ return new Texture(data);
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified file using
+ * the current OpenGL context.
+ *
+ * @param file the file from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @throws IOException if an error occurred while reading the file
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
+ TextureData data = newTextureData(file, mipmap, FileUtil.getFileSuffix(file));
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified stream using
+ * the current OpenGL context.
+ *
+ * @param stream the stream from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @throws IOException if an error occurred while reading the stream
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
+ TextureData data = newTextureData(stream, mipmap, fileSuffix);
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified URL using the
+ * current OpenGL context.
+ *
+ * @param url the URL from which to read the texture data
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @param fileSuffix the suffix of the file name to be used as a
+ * hint of the file format to the underlying
+ * texture provider, or null if none and should be
+ * auto-detected (some texture providers do not
+ * support this)
+ * @throws IOException if an error occurred while reading the URL
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
+ if (fileSuffix == null) {
+ fileSuffix = FileUtil.getFileSuffix(url.getPath());
+ }
+ TextureData data = newTextureData(url, mipmap, fileSuffix);
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ /**
+ * Creates an OpenGL texture object associated with the given OpenGL
+ * texture target using the current OpenGL context. The texture has
+ * no initial data. This is used, for example, to construct cube
+ * maps out of multiple TextureData objects.
+ *
+ * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
+ * GL.GL_TEXTURE_RECTANGLE_ARB
+ *
+ * @throws GLException if no OpenGL context is current or if an
+ * OpenGL error occurred
+ */
+ public static Texture newTexture(int target) throws GLException {
+ return new Texture(target);
+ }
+
+ /**
+ * Wraps an OpenGL texture ID from an external library and allows
+ * some of the base methods from the Texture class, such as
+ * binding and querying of texture coordinates, to be used with
+ * it. Attempts to update such textures' contents will yield
+ * undefined results.
+ *
+ * @param textureID the OpenGL texture object to wrap
+ * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
+ * GL2.GL_TEXTURE_RECTANGLE
+ * @param texWidth the width of the texture in pixels
+ * @param texHeight the height of the texture in pixels
+ * @param imgWidth the width of the image within the texture in
+ * pixels (if the content is a sub-rectangle in the upper
+ * left corner); otherwise, pass in texWidth
+ * @param imgHeight the height of the image within the texture in
+ * pixels (if the content is a sub-rectangle in the upper
+ * left corner); otherwise, pass in texHeight
+ * @param mustFlipVertically indicates whether the texture
+ * coordinates must be flipped vertically
+ * in order to properly display the
+ * texture
+ */
+ public static Texture newTexture(int textureID,
+ int target,
+ int texWidth,
+ int texHeight,
+ int imgWidth,
+ int imgHeight,
+ boolean mustFlipVertically) {
+ return new Texture(textureID,
+ target,
+ texWidth,
+ texHeight,
+ imgWidth,
+ imgHeight,
+ mustFlipVertically);
+ }
+
+ /**
+ * Writes the given texture to a file. The type of the file is
+ * inferred from its suffix. An OpenGL context must be current in
+ * order to fetch the texture data back from the OpenGL pipeline.
+ * This method causes the specified Texture to be bound to the
+ * GL_TEXTURE_2D state. If no suitable writer for the requested file
+ * format was found, throws an IOException. <P>
+ *
+ * Reasonable attempts are made to produce good results in the
+ * resulting images. The Targa, SGI and ImageIO writers produce
+ * results in the correct vertical orientation for those file
+ * formats. The DDS writer performs no vertical flip of the data,
+ * even in uncompressed mode. (It is impossible to perform such a
+ * vertical flip with compressed data.) Applications should keep
+ * this in mind when using this routine to save textures to disk for
+ * later re-loading. <P>
+ *
+ * Any mipmaps for the specified texture are currently discarded
+ * when it is written to disk, regardless of whether the underlying
+ * file format supports multiple mipmaps in a given file.
+ *
+ * @throws IOException if an error occurred during writing or no
+ * suitable writer was found
+ * @throws GLException if no OpenGL context was current or an
+ * OpenGL-related error occurred
+ */
+ public static void write(Texture texture, File file) throws IOException, GLException {
+ if (texture.getTarget() != GL.GL_TEXTURE_2D) {
+ throw new GLException("Only GL_TEXTURE_2D textures are supported");
+ }
+
+ // First fetch the texture data
+ GL _gl = GLContext.getCurrentGL();
+ if (!_gl.isGL2()) {
+ throw new GLException("Only GL2 supports fetching compressed images, GL: " + _gl);
+ }
+ GL2 gl = _gl.getGL2();
+
+ texture.bind();
+ int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
+ int width = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
+ int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
+ int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
+ TextureData data = null;
+ if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
+ internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
+ internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
+ internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
+ // Fetch using glGetCompressedTexImage
+ int size = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
+ ByteBuffer res = ByteBuffer.allocate(size);
+ gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
+ data = new TextureData(internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
+ false, true, true, res, null);
+ } else {
+ int bytesPerPixel = 0;
+ int fetchedFormat = 0;
+ switch (internalFormat) {
+ case GL.GL_RGB:
+ case GL2.GL_BGR:
+ case GL.GL_RGB8:
+ bytesPerPixel = 3;
+ fetchedFormat = GL.GL_RGB;
+ break;
+ case GL.GL_RGBA:
+ case GL2.GL_BGRA:
+ case GL2.GL_ABGR_EXT:
+ case GL.GL_RGBA8:
+ bytesPerPixel = 4;
+ fetchedFormat = GL.GL_RGBA;
+ break;
+ default:
+ throw new IOException("Unsupported texture internal format 0x" + Integer.toHexString(internalFormat));
+ }
+
+ // Fetch using glGetTexImage
+ int packAlignment = glGetInteger(GL.GL_PACK_ALIGNMENT);
+ int packRowLength = glGetInteger(GL2.GL_PACK_ROW_LENGTH);
+ int packSkipRows = glGetInteger(GL2.GL_PACK_SKIP_ROWS);
+ int packSkipPixels = glGetInteger(GL2.GL_PACK_SKIP_PIXELS);
+ int packSwapBytes = glGetInteger(GL2.GL_PACK_SWAP_BYTES);
+
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
+
+ ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
+ (height + (2 * border)) *
+ bytesPerPixel);
+ if (DEBUG) {
+ System.out.println("Allocated buffer of size " + res.remaining() + " for fetched image (" +
+ ((fetchedFormat == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA") + ")");
+ }
+ gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
+
+ gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
+
+ data = new TextureData(internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
+ false, false, false, res, null);
+
+ if (DEBUG) {
+ System.out.println("data.getPixelFormat() = " +
+ ((data.getPixelFormat() == GL.GL_RGB) ? "GL_RGB" : "GL_RGBA"));
+ }
+ }
+
+ for (Iterator iter = textureWriters.iterator(); iter.hasNext(); ) {
+ TextureWriter writer = (TextureWriter) iter.next();
+ if (writer.write(file, data)) {
+ return;
+ }
+ }
+
+ throw new IOException("No suitable texture writer found");
+ }
+
+ //----------------------------------------------------------------------
+ // SPI support
+ //
+
+ /** Adds a TextureProvider to support reading of a new file
+ format. */
+ public static void addTextureProvider(TextureProvider provider) {
+ // Must always add at the front so the ImageIO provider is last,
+ // so we don't accidentally use it instead of a user's possibly
+ // more optimal provider
+ textureProviders.add(0, provider);
+ }
+
+ /** Adds a TextureWriter to support writing of a new file
+ format. */
+ public static void addTextureWriter(TextureWriter writer) {
+ // Must always add at the front so the ImageIO writer is last,
+ // so we don't accidentally use it instead of a user's possibly
+ // more optimal writer
+ textureWriters.add(0, writer);
+ }
+
+ //---------------------------------------------------------------------------
+ // Global disabling of texture rectangle extension
+ //
+
+ /** Toggles the use of the GL_ARB_texture_rectangle extension by the
+ TextureIO classes. By default, on hardware supporting this
+ extension, the TextureIO classes may use the
+ GL_ARB_texture_rectangle extension for non-power-of-two
+ textures. (If the hardware supports the
+ GL_ARB_texture_non_power_of_two extension, that one is
+ preferred.) In some situations, for example when writing
+ shaders, it is advantageous to force the texture target to
+ always be GL_TEXTURE_2D in order to have one version of the
+ shader, even at the expense of texture memory in the case where
+ NPOT textures are not supported. This method allows the use of
+ the GL_ARB_texture_rectangle extension to be turned off globally
+ for this purpose. The default is that the use of the extension
+ is enabled. */
+ public static void setTexRectEnabled(boolean enabled) {
+ texRectEnabled = enabled;
+ }
+
+ /** Indicates whether the GL_ARB_texture_rectangle extension is
+ allowed to be used for non-power-of-two textures; see {@link
+ #setTexRectEnabled setTexRectEnabled}. */
+ public static boolean isTexRectEnabled() {
+ return texRectEnabled;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static List/*<TextureProvider>*/ textureProviders = new ArrayList/*<TextureProvider>*/();
+ private static List/*<TextureWriter>*/ textureWriters = new ArrayList/*<TextureWriter>*/();
+
+ static {
+ // ImageIO provider, the fall-back, must be the first one added
+ 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();
+ addTextureProvider(provider);
+ } catch (Exception e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
+ }
+
+ // Other special-case providers
+ addTextureProvider(new DDSTextureProvider());
+ addTextureProvider(new SGITextureProvider());
+ addTextureProvider(new TGATextureProvider());
+
+ // ImageIO writer, the fall-back, must be the first one added
+ 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();
+ addTextureWriter(writer);
+ } catch (Exception e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
+ } catch (Error e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
+ }
+
+ // Other special-case writers
+ addTextureWriter(new DDSTextureWriter());
+ addTextureWriter(new SGITextureWriter());
+ addTextureWriter(new TGATextureWriter());
+ }
+
+ // Implementation methods
+ private static TextureData newTextureDataImpl(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (file == null) {
+ throw new IOException("File was null");
+ }
+
+ fileSuffix = toLowerCase(fileSuffix);
+
+ for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+ TextureProvider provider = (TextureProvider) iter.next();
+ TextureData data = provider.newTextureData(file,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ fileSuffix);
+ if (data != null) {
+ return data;
+ }
+ }
+
+ throw new IOException("No suitable reader for given file");
+ }
+
+ private static TextureData newTextureDataImpl(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (stream == null) {
+ throw new IOException("Stream was null");
+ }
+
+ fileSuffix = toLowerCase(fileSuffix);
+
+ // Note: use of BufferedInputStream works around 4764639/4892246
+ if (!(stream instanceof BufferedInputStream)) {
+ stream = new BufferedInputStream(stream);
+ }
+
+ for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+ TextureProvider provider = (TextureProvider) iter.next();
+ TextureData data = provider.newTextureData(stream,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ fileSuffix);
+ if (data != null) {
+ return data;
+ }
+ }
+
+ throw new IOException("No suitable reader for given stream");
+ }
+
+ private static TextureData newTextureDataImpl(URL url,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (url == null) {
+ throw new IOException("URL was null");
+ }
+
+ fileSuffix = toLowerCase(fileSuffix);
+
+ for (Iterator iter = textureProviders.iterator(); iter.hasNext(); ) {
+ TextureProvider provider = (TextureProvider) iter.next();
+ TextureData data = provider.newTextureData(url,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ fileSuffix);
+ if (data != null) {
+ return data;
+ }
+ }
+
+ throw new IOException("No suitable reader for given URL");
+ }
+
+ //----------------------------------------------------------------------
+ // DDS provider -- supports files only for now
+ static class DDSTextureProvider implements TextureProvider {
+ public TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (DDS.equals(fileSuffix) ||
+ DDS.equals(FileUtil.getFileSuffix(file))) {
+ DDSImage image = DDSImage.read(file);
+ return newTextureData(image, internalFormat, pixelFormat, mipmap);
+ }
+
+ return null;
+ }
+
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (DDS.equals(fileSuffix) ||
+ DDSImage.isDDSImage(stream)) {
+ byte[] data = StreamUtil.readAll2Array(stream);
+ ByteBuffer buf = ByteBuffer.wrap(data);
+ DDSImage image = DDSImage.read(buf);
+ return newTextureData(image, internalFormat, pixelFormat, mipmap);
+ }
+
+ return null;
+ }
+
+ public TextureData newTextureData(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);
+ } finally {
+ stream.close();
+ }
+ }
+
+ private TextureData newTextureData(final DDSImage image,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap) {
+ DDSImage.ImageInfo info = image.getMipMap(0);
+ if (pixelFormat == 0) {
+ switch (image.getPixelFormat()) {
+ case DDSImage.D3DFMT_R8G8B8:
+ pixelFormat = GL.GL_RGB;
+ break;
+ default:
+ pixelFormat = GL.GL_RGBA;
+ break;
+ }
+ }
+ if (info.isCompressed()) {
+ switch (info.getCompressionFormat()) {
+ case DDSImage.D3DFMT_DXT1:
+ internalFormat = GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ break;
+ case DDSImage.D3DFMT_DXT3:
+ internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ break;
+ case DDSImage.D3DFMT_DXT5:
+ internalFormat = GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ break;
+ default:
+ throw new RuntimeException("Unsupported DDS compression format \"" +
+ DDSImage.getCompressionFormatName(info.getCompressionFormat()) + "\"");
+ }
+ }
+ if (internalFormat == 0) {
+ switch (image.getPixelFormat()) {
+ case DDSImage.D3DFMT_R8G8B8:
+ pixelFormat = GL.GL_RGB;
+ break;
+ default:
+ pixelFormat = GL.GL_RGBA;
+ break;
+ }
+ }
+ TextureData.Flusher flusher = new TextureData.Flusher() {
+ public void flush() {
+ image.close();
+ }
+ };
+ TextureData data;
+ if (mipmap && image.getNumMipMaps() > 0) {
+ Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
+ for (int i = 0; i < image.getNumMipMaps(); i++) {
+ mipmapData[i] = image.getMipMap(i).getData();
+ }
+ data = new TextureData(internalFormat,
+ info.getWidth(),
+ info.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ info.isCompressed(),
+ true,
+ mipmapData,
+ flusher);
+ } else {
+ // Fix this up for the end user because we can't generate
+ // mipmaps for compressed textures
+ mipmap = false;
+ data = new TextureData(internalFormat,
+ info.getWidth(),
+ info.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ mipmap,
+ info.isCompressed(),
+ true,
+ info.getData(),
+ flusher);
+ }
+ return data;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Base class for SGI RGB and TGA image providers
+ static abstract class StreamBasedTextureProvider implements TextureProvider {
+ public TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ InputStream inStream = new BufferedInputStream(new FileInputStream(file));
+ try {
+ // The SGIImage and TGAImage implementations use InputStreams
+ // anyway so there isn't much point in having a separate code
+ // path for files
+ return newTextureData(inStream,
+ internalFormat,
+ pixelFormat,
+ mipmap,
+ ((fileSuffix != null) ? fileSuffix : FileUtil.getFileSuffix(file)));
+ } finally {
+ inStream.close();
+ }
+ }
+
+ public TextureData newTextureData(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);
+ } finally {
+ stream.close();
+ }
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // SGI RGB image provider
+ static class SGITextureProvider extends StreamBasedTextureProvider {
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (SGI.equals(fileSuffix) ||
+ SGI_RGB.equals(fileSuffix) ||
+ SGIImage.isSGIImage(stream)) {
+ SGIImage image = SGIImage.read(stream);
+ if (pixelFormat == 0) {
+ pixelFormat = image.getFormat();
+ }
+ if (internalFormat == 0) {
+ internalFormat = image.getFormat();
+ }
+ return new TextureData(internalFormat,
+ image.getWidth(),
+ image.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ mipmap,
+ false,
+ false,
+ ByteBuffer.wrap(image.getData()),
+ null);
+ }
+
+ return null;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // TGA (Targa) image provider
+ static class TGATextureProvider extends StreamBasedTextureProvider {
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ if (TGA.equals(fileSuffix)) {
+ TGAImage image = TGAImage.read(stream);
+ if (pixelFormat == 0) {
+ pixelFormat = image.getGLFormat();
+ }
+ if (internalFormat == 0) {
+ GL gl = GLContext.getCurrentGL();
+ if(gl.isGL2()) {
+ internalFormat = GL.GL_RGBA8;
+ } else {
+ internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
+ }
+ }
+ return new TextureData(internalFormat,
+ image.getWidth(),
+ image.getHeight(),
+ 0,
+ pixelFormat,
+ GL.GL_UNSIGNED_BYTE,
+ mipmap,
+ false,
+ false,
+ image.getData(),
+ null);
+ }
+
+ return null;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // DDS texture writer
+ //
+ static class DDSTextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ if (DDS.equals(FileUtil.getFileSuffix(file))) {
+ // See whether the DDS writer can handle this TextureData
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if (pixelType != GL.GL_BYTE &&
+ pixelType != GL.GL_UNSIGNED_BYTE) {
+ throw new IOException("DDS writer only supports byte / unsigned byte textures");
+ }
+
+ int d3dFormat = 0;
+ // FIXME: some of these are probably not completely correct and would require swizzling
+ switch (pixelFormat) {
+ case GL.GL_RGB: d3dFormat = DDSImage.D3DFMT_R8G8B8; break;
+ case GL.GL_RGBA: d3dFormat = DDSImage.D3DFMT_A8R8G8B8; break;
+ case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT: d3dFormat = DDSImage.D3DFMT_DXT1; break;
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: throw new IOException("RGBA DXT1 not yet supported");
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: d3dFormat = DDSImage.D3DFMT_DXT3; break;
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: d3dFormat = DDSImage.D3DFMT_DXT5; break;
+ default: throw new IOException("Unsupported pixel format 0x" + Integer.toHexString(pixelFormat) + " by DDS writer");
+ }
+
+ ByteBuffer[] mipmaps = null;
+ if (data.getMipmapData() != null) {
+ mipmaps = new ByteBuffer[data.getMipmapData().length];
+ for (int i = 0; i < mipmaps.length; i++) {
+ mipmaps[i] = (ByteBuffer) data.getMipmapData()[i];
+ }
+ } else {
+ mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
+ }
+
+ DDSImage image = DDSImage.createFromData(d3dFormat,
+ data.getWidth(),
+ data.getHeight(),
+ mipmaps);
+ image.write(file);
+ return true;
+ }
+
+ return false;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // SGI (rgb) texture writer
+ //
+ static class SGITextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ String fileSuffix = FileUtil.getFileSuffix(file);
+ if (SGI.equals(fileSuffix) ||
+ SGI_RGB.equals(fileSuffix)) {
+ // See whether the SGI writer can handle this TextureData
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if ((pixelFormat == GL.GL_RGB ||
+ pixelFormat == GL.GL_RGBA) &&
+ (pixelType == GL.GL_BYTE ||
+ pixelType == GL.GL_UNSIGNED_BYTE)) {
+ ByteBuffer buf = ((data.getBuffer() != null) ?
+ (ByteBuffer) data.getBuffer() :
+ (ByteBuffer) data.getMipmapData()[0]);
+ byte[] bytes;
+ if (buf.hasArray()) {
+ bytes = buf.array();
+ } else {
+ buf.rewind();
+ bytes = new byte[buf.remaining()];
+ buf.get(bytes);
+ buf.rewind();
+ }
+
+ SGIImage image = SGIImage.createFromData(data.getWidth(),
+ data.getHeight(),
+ (pixelFormat == GL.GL_RGBA),
+ bytes);
+ image.write(file, false);
+ return true;
+ }
+
+ throw new IOException("SGI writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+ }
+
+ return false;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // TGA (Targa) texture writer
+
+ static class TGATextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ if (TGA.equals(FileUtil.getFileSuffix(file))) {
+ // See whether the TGA writer can handle this TextureData
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if ((pixelFormat == GL.GL_RGB ||
+ pixelFormat == GL.GL_RGBA) &&
+ (pixelType == GL.GL_BYTE ||
+ pixelType == GL.GL_UNSIGNED_BYTE)) {
+ ByteBuffer buf = ((data.getBuffer() != null) ?
+ (ByteBuffer) data.getBuffer() :
+ (ByteBuffer) data.getMipmapData()[0]);
+ // Must reverse order of red and blue channels to get correct results
+ int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
+ for (int i = 0; i < buf.remaining(); i += skip) {
+ byte red = buf.get(i + 0);
+ byte blue = buf.get(i + 2);
+ buf.put(i + 0, blue);
+ buf.put(i + 2, red);
+ }
+
+ TGAImage image = TGAImage.createFromData(data.getWidth(),
+ data.getHeight(),
+ (pixelFormat == GL.GL_RGBA),
+ false,
+ ((data.getBuffer() != null) ?
+ (ByteBuffer) data.getBuffer() :
+ (ByteBuffer) data.getMipmapData()[0]));
+ image.write(file);
+ return true;
+ }
+
+ throw new IOException("TGA writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+ }
+
+ return false;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Helper routines
+ //
+
+ private static int glGetInteger(int pname) {
+ int[] tmp = new int[1];
+ GL gl = GLContext.getCurrentGL();
+ gl.glGetIntegerv(pname, tmp, 0);
+ return tmp[0];
+ }
+
+ private static int glGetTexLevelParameteri(GL2 gl, int target, int level, int pname) {
+ int[] tmp = new int[1];
+ gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
+ return tmp[0];
+ }
+
+ private static String toLowerCase(String arg) {
+ if (arg == null) {
+ return null;
+ }
+
+ return arg.toLowerCase();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java
new file mode 100755
index 000000000..b3cf537f6
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureData.java
@@ -0,0 +1,493 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.opengl.util.texture.awt;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Transparency;
+import java.awt.color.*;
+import java.awt.image.*;
+import java.nio.*;
+
+import javax.media.opengl.*;
+import com.sun.opengl.util.texture.*;
+
+public class AWTTextureData extends TextureData {
+ // Mechanism for lazily converting input BufferedImages with custom
+ // ColorModels to standard ones for uploading to OpenGL, as well as
+ // backing off from the optimizations of hoping that either
+ // GL_EXT_abgr or OpenGL 1.2 are present
+ private BufferedImage imageForLazyCustomConversion;
+ private boolean expectingEXTABGR;
+ private boolean expectingGL12;
+
+ private static final ColorModel rgbaColorModel =
+ new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ new int[] {8, 8, 8, 8}, true, true,
+ Transparency.TRANSLUCENT,
+ DataBuffer.TYPE_BYTE);
+ private static final ColorModel rgbColorModel =
+ new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ new int[] {8, 8, 8, 0}, false, false,
+ Transparency.OPAQUE,
+ DataBuffer.TYPE_BYTE);
+
+
+ /**
+ * Constructs a new TextureData object with the specified parameters
+ * and data contained in the given BufferedImage. The resulting
+ * TextureData "wraps" the contents of the BufferedImage, so if a
+ * modification is made to the BufferedImage between the time the
+ * TextureData is constructed and when a Texture is made from the
+ * TextureData, that modification will be visible in the resulting
+ * Texture.
+ *
+ * @param internalFormat the OpenGL internal format for the
+ * resulting texture; may be 0, in which case
+ * it is inferred from the image's type
+ * @param pixelFormat the OpenGL internal format for the
+ * resulting texture; may be 0, in which case
+ * it is inferred from the image's type (note:
+ * this argument is currently always ignored)
+ * @param mipmap indicates whether mipmaps should be
+ * autogenerated (using GLU) for the resulting
+ * texture
+ * @param image the image containing the texture data
+ */
+ public AWTTextureData(int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ BufferedImage image) {
+ super();
+ if (internalFormat == 0) {
+ this.internalFormat = image.getColorModel().hasAlpha() ? GL.GL_RGBA : GL.GL_RGB;
+ } else {
+ this.internalFormat = internalFormat;
+ }
+ createFromImage(image);
+ this.mipmap = mipmap;
+ if (buffer != null) {
+ estimatedMemorySize = estimatedMemorySize(buffer);
+ } else {
+ // In the lazy custom conversion case we don't yet have a buffer
+ if (imageForLazyCustomConversion != null) {
+ estimatedMemorySize = estimatedMemorySize(wrapImageDataBuffer(imageForLazyCustomConversion));
+ }
+ }
+ }
+
+ /** Returns the intended OpenGL pixel format of the texture data. */
+ public int getPixelFormat() {
+ if (imageForLazyCustomConversion != null) {
+ if (!((expectingEXTABGR && haveEXTABGR) ||
+ (expectingGL12 && haveGL12))) {
+ revertPixelFormatAndType();
+ }
+ }
+ return pixelFormat;
+ }
+ /** Returns the intended OpenGL pixel type of the texture data. */
+ public int getPixelType() {
+ if (imageForLazyCustomConversion != null) {
+ if (!((expectingEXTABGR && haveEXTABGR) ||
+ (expectingGL12 && haveGL12))) {
+ revertPixelFormatAndType();
+ }
+ }
+ return pixelType;
+ }
+
+ /** Returns the texture data, or null if it is specified as a set of mipmaps. */
+ public Buffer getBuffer() {
+ if (imageForLazyCustomConversion != null) {
+ if (!((expectingEXTABGR && haveEXTABGR) ||
+ (expectingGL12 && haveGL12))) {
+ revertPixelFormatAndType();
+ // Must present the illusion to the end user that we are simply
+ // wrapping the input BufferedImage
+ createFromCustom(imageForLazyCustomConversion);
+ }
+ }
+ return buffer;
+ }
+
+ private void createFromImage(BufferedImage image) {
+ pixelType = 0; // Determine from image
+ mustFlipVertically = true;
+
+ width = image.getWidth();
+ height = image.getHeight();
+
+ int scanlineStride;
+ SampleModel sm = image.getRaster().getSampleModel();
+ if (sm instanceof SinglePixelPackedSampleModel) {
+ scanlineStride =
+ ((SinglePixelPackedSampleModel)sm).getScanlineStride();
+ } else if (sm instanceof MultiPixelPackedSampleModel) {
+ scanlineStride =
+ ((MultiPixelPackedSampleModel)sm).getScanlineStride();
+ } else if (sm instanceof ComponentSampleModel) {
+ scanlineStride =
+ ((ComponentSampleModel)sm).getScanlineStride();
+ } else {
+ // This will only happen for TYPE_CUSTOM anyway
+ setupLazyCustomConversion(image);
+ return;
+ }
+
+ GLProfile glp = GLContext.getCurrentGL().getGLProfile();
+
+ if (glp.isGL2()) {
+ switch (image.getType()) {
+ case BufferedImage.TYPE_INT_RGB:
+ pixelFormat = GL2.GL_BGRA;
+ pixelType = GL2.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;
+ rowLength = scanlineStride;
+ alignment = 4;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_INT_BGR:
+ pixelFormat = GL.GL_RGBA;
+ pixelType = GL2.GL_UNSIGNED_INT_8_8_8_8_REV;
+ rowLength = scanlineStride;
+ alignment = 4;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_3BYTE_BGR:
+ {
+ // 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;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride / 3;
+ alignment = 1;
+ } else {
+ setupLazyCustomConversion(image);
+ return;
+ }
+ }
+ break;
+ case BufferedImage.TYPE_4BYTE_ABGR_PRE:
+ {
+ // we can pass the image data directly to OpenGL only if
+ // we have an integral number of pixels in each scanline
+ // and only if the GL_EXT_abgr extension is present
+
+ // NOTE: disabling this code path for now as it appears it's
+ // buggy at least on some NVidia drivers and doesn't perform
+ // the necessary byte swapping (FIXME: needs more
+ // investigation)
+ if ((scanlineStride % 4) == 0 && false) {
+ pixelFormat = GL2.GL_ABGR_EXT;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride / 4;
+ alignment = 4;
+
+ // Store a reference to the original image for later in
+ // case it turns out that we don't have GL_EXT_abgr at the
+ // time we're going to do the texture upload to OpenGL
+ setupLazyCustomConversion(image);
+ expectingEXTABGR = true;
+ break;
+ } else {
+ setupLazyCustomConversion(image);
+ return;
+ }
+ }
+ case BufferedImage.TYPE_USHORT_565_RGB:
+ pixelFormat = GL.GL_RGB;
+ pixelType = GL.GL_UNSIGNED_SHORT_5_6_5;
+ rowLength = scanlineStride;
+ alignment = 2;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_USHORT_555_RGB:
+ pixelFormat = GL2.GL_BGRA;
+ pixelType = GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV;
+ rowLength = scanlineStride;
+ alignment = 2;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_BYTE_GRAY:
+ pixelFormat = GL.GL_LUMINANCE;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride;
+ alignment = 1;
+ break;
+ case BufferedImage.TYPE_USHORT_GRAY:
+ pixelFormat = GL.GL_LUMINANCE;
+ pixelType = GL.GL_UNSIGNED_SHORT;
+ rowLength = scanlineStride;
+ alignment = 2;
+ break;
+ // Note: TYPE_INT_ARGB and TYPE_4BYTE_ABGR images go down the
+ // custom code path to satisfy the invariant that images with an
+ // alpha channel always go down with premultiplied alpha.
+ case BufferedImage.TYPE_INT_ARGB:
+ case BufferedImage.TYPE_4BYTE_ABGR:
+ case BufferedImage.TYPE_BYTE_BINARY:
+ case BufferedImage.TYPE_BYTE_INDEXED:
+ case BufferedImage.TYPE_CUSTOM:
+ default:
+ ColorModel cm = image.getColorModel();
+ if (cm.equals(rgbColorModel)) {
+ pixelFormat = GL.GL_RGB;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride / 3;
+ alignment = 1;
+ } else if (cm.equals(rgbaColorModel)) {
+ pixelFormat = GL.GL_RGBA;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride / 4; // FIXME: correct?
+ alignment = 4;
+ } else {
+ setupLazyCustomConversion(image);
+ return;
+ }
+ break;
+ }
+ } else {
+ switch (image.getType()) {
+ case BufferedImage.TYPE_INT_RGB:
+ pixelFormat = GL.GL_RGB;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride;
+ alignment = 3;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_INT_ARGB_PRE:
+ throw new GLException("INT_ARGB_PRE n.a.");
+ case BufferedImage.TYPE_INT_BGR:
+ throw new GLException("INT_BGR n.a.");
+ case BufferedImage.TYPE_3BYTE_BGR:
+ throw new GLException("INT_BGR n.a.");
+ case BufferedImage.TYPE_4BYTE_ABGR_PRE:
+ throw new GLException("INT_BGR n.a.");
+ case BufferedImage.TYPE_USHORT_565_RGB:
+ pixelFormat = GL.GL_RGB;
+ pixelType = GL.GL_UNSIGNED_SHORT_5_6_5;
+ rowLength = scanlineStride;
+ alignment = 2;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_USHORT_555_RGB:
+ pixelFormat = GL.GL_RGBA;
+ pixelType = GL.GL_UNSIGNED_SHORT_5_5_5_1;
+ rowLength = scanlineStride;
+ alignment = 2;
+ expectingGL12 = true;
+ setupLazyCustomConversion(image);
+ break;
+ case BufferedImage.TYPE_BYTE_GRAY:
+ pixelFormat = GL.GL_LUMINANCE;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride;
+ alignment = 1;
+ break;
+ case BufferedImage.TYPE_USHORT_GRAY:
+ throw new GLException("USHORT_GRAY n.a.");
+ // Note: TYPE_INT_ARGB and TYPE_4BYTE_ABGR images go down the
+ // custom code path to satisfy the invariant that images with an
+ // alpha channel always go down with premultiplied alpha.
+ case BufferedImage.TYPE_INT_ARGB:
+ case BufferedImage.TYPE_4BYTE_ABGR:
+ case BufferedImage.TYPE_BYTE_BINARY:
+ case BufferedImage.TYPE_BYTE_INDEXED:
+ case BufferedImage.TYPE_CUSTOM:
+ default:
+ ColorModel cm = image.getColorModel();
+ if (cm.equals(rgbColorModel)) {
+ pixelFormat = GL.GL_RGB;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride / 3;
+ alignment = 1;
+ } else if (cm.equals(rgbaColorModel)) {
+ pixelFormat = GL.GL_RGBA;
+ pixelType = GL.GL_UNSIGNED_BYTE;
+ rowLength = scanlineStride / 4; // FIXME: correct?
+ alignment = 4;
+ } else {
+ setupLazyCustomConversion(image);
+ return;
+ }
+ break;
+ }
+ }
+
+ createNIOBufferFromImage(image);
+ }
+
+ private void setupLazyCustomConversion(BufferedImage image) {
+ imageForLazyCustomConversion = image;
+ boolean hasAlpha = image.getColorModel().hasAlpha();
+ if (pixelFormat == 0) {
+ pixelFormat = hasAlpha ? GL.GL_RGBA : GL.GL_RGB;
+ }
+ alignment = 1; // FIXME: do we need better?
+ rowLength = width; // FIXME: correct in all cases?
+
+ // Allow previously-selected pixelType (if any) to override that
+ // we can infer from the DataBuffer
+ DataBuffer data = image.getRaster().getDataBuffer();
+ if (data instanceof DataBufferByte || isPackedInt(image)) {
+ // Don't use GL_UNSIGNED_INT for BufferedImage packed int images
+ if (pixelType == 0) pixelType = GL.GL_UNSIGNED_BYTE;
+ } else if (data instanceof DataBufferDouble) {
+ throw new RuntimeException("DataBufferDouble rasters not supported by OpenGL");
+ } else if (data instanceof DataBufferFloat) {
+ 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;
+ } else if (data instanceof DataBufferShort) {
+ if (pixelType == 0) pixelType = GL.GL_SHORT;
+ } else if (data instanceof DataBufferUShort) {
+ if (pixelType == 0) pixelType = GL.GL_UNSIGNED_SHORT;
+ } else {
+ throw new RuntimeException("Unexpected DataBuffer type?");
+ }
+ }
+
+ private void createFromCustom(BufferedImage image) {
+ int width = image.getWidth();
+ int height = image.getHeight();
+
+ // create a temporary image that is compatible with OpenGL
+ boolean hasAlpha = image.getColorModel().hasAlpha();
+ ColorModel cm = null;
+ int dataBufferType = image.getRaster().getDataBuffer().getDataType();
+ // Don't use integer components for packed int images
+ if (isPackedInt(image)) {
+ dataBufferType = DataBuffer.TYPE_BYTE;
+ }
+ if (dataBufferType == DataBuffer.TYPE_BYTE) {
+ cm = hasAlpha ? rgbaColorModel : rgbColorModel;
+ } else {
+ if (hasAlpha) {
+ cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ null, true, true,
+ Transparency.TRANSLUCENT,
+ dataBufferType);
+ } else {
+ cm = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB),
+ null, false, false,
+ Transparency.OPAQUE,
+ dataBufferType);
+ }
+ }
+
+ boolean premult = cm.isAlphaPremultiplied();
+ WritableRaster raster =
+ cm.createCompatibleWritableRaster(width, height);
+ BufferedImage texImage = new BufferedImage(cm, raster, premult, null);
+
+ // copy the source image into the temporary image
+ Graphics2D g = texImage.createGraphics();
+ g.setComposite(AlphaComposite.Src);
+ g.drawImage(image, 0, 0, null);
+ g.dispose();
+
+ // Wrap the buffer from the temporary image
+ createNIOBufferFromImage(texImage);
+ }
+
+ private boolean isPackedInt(BufferedImage image) {
+ int imgType = image.getType();
+ return (imgType == BufferedImage.TYPE_INT_RGB ||
+ imgType == BufferedImage.TYPE_INT_BGR ||
+ imgType == BufferedImage.TYPE_INT_ARGB ||
+ imgType == BufferedImage.TYPE_INT_ARGB_PRE);
+ }
+
+ private void revertPixelFormatAndType() {
+ // Knowing we don't have e.g. OpenGL 1.2 functionality available,
+ // and knowing we're in the process of doing the fallback code
+ // path, re-infer a vanilla pixel format and type compatible with
+ // OpenGL 1.1
+ pixelFormat = 0;
+ pixelType = 0;
+ setupLazyCustomConversion(imageForLazyCustomConversion);
+ }
+
+ private void createNIOBufferFromImage(BufferedImage image) {
+ buffer = wrapImageDataBuffer(image);
+ }
+
+ private Buffer wrapImageDataBuffer(BufferedImage image) {
+ //
+ // Note: Grabbing the DataBuffer will defeat Java2D's image
+ // management mechanism (as of JDK 5/6, at least). This shouldn't
+ // be a problem for most JOGL apps, but those that try to upload
+ // the image into an OpenGL texture and then use the same image in
+ // Java2D rendering might find the 2D rendering is not as fast as
+ // it could be.
+ //
+
+ DataBuffer data = image.getRaster().getDataBuffer();
+ if (data instanceof DataBufferByte) {
+ return ByteBuffer.wrap(((DataBufferByte) data).getData());
+ } else if (data instanceof DataBufferDouble) {
+ throw new RuntimeException("DataBufferDouble rasters not supported by OpenGL");
+ } else if (data instanceof DataBufferFloat) {
+ return FloatBuffer.wrap(((DataBufferFloat) data).getData());
+ } else if (data instanceof DataBufferInt) {
+ return IntBuffer.wrap(((DataBufferInt) data).getData());
+ } else if (data instanceof DataBufferShort) {
+ return ShortBuffer.wrap(((DataBufferShort) data).getData());
+ } else if (data instanceof DataBufferUShort) {
+ return ShortBuffer.wrap(((DataBufferUShort) data).getData());
+ } else {
+ throw new RuntimeException("Unexpected DataBuffer type?");
+ }
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java
new file mode 100644
index 000000000..490d150cc
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/awt/AWTTextureIO.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.awt;
+
+import java.awt.image.*;
+
+import javax.media.opengl.*;
+import com.sun.opengl.util.texture.*;
+
+public class AWTTextureIO extends TextureIO {
+ /**
+ * Creates a TextureData from the given BufferedImage. Does no
+ * OpenGL work.
+ *
+ * @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
+ */
+ public static TextureData newTextureData(BufferedImage image,
+ boolean mipmap) {
+ return newTextureDataImpl(image, 0, 0, mipmap);
+ }
+
+ /**
+ * Creates a TextureData from the given BufferedImage, using the
+ * specified OpenGL internal format and pixel format for the texture
+ * which will eventually result. The internalFormat and pixelFormat
+ * must be specified and may not be zero; to use default values, use
+ * the variant of this method which does not take these
+ * arguments. Does no OpenGL work.
+ *
+ * @param image the BufferedImage containing the texture data
+ * @param internalFormat the OpenGL internal format of the texture
+ * which will eventually result from the TextureData
+ * @param pixelFormat the OpenGL pixel format of the texture
+ * which will eventually result from the TextureData
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ * @return the texture data from the image
+ * @throws IllegalArgumentException if either internalFormat or
+ * pixelFormat was 0
+ */
+ public static TextureData newTextureData(BufferedImage image,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap) throws IllegalArgumentException {
+ if ((internalFormat == 0) || (pixelFormat == 0)) {
+ throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
+ }
+
+ return newTextureDataImpl(image, internalFormat, pixelFormat, mipmap);
+ }
+
+ /**
+ * Creates an OpenGL texture object from the specified BufferedImage
+ * using the current OpenGL context.
+ *
+ * @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);
+ Texture texture = newTexture(data);
+ data.flush();
+ return texture;
+ }
+
+ private static TextureData newTextureDataImpl(BufferedImage image,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap) {
+ return new AWTTextureData(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/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp
new file mode 100755
index 000000000..eadae84f8
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javame_cdc_fp
@@ -0,0 +1,890 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi;
+
+import java.io.*;
+import java.nio.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.util.*;
+import com.sun.opengl.impl.io.*;
+import com.sun.opengl.util.texture.*;
+
+/** A reader and writer for DirectDraw Surface (.dds) files, which are
+ used to describe textures. These files can contain multiple mipmap
+ levels in one file. This class is currently minimal and does not
+ support all of the possible file formats. */
+
+public class DDSImage {
+
+ /** Simple class describing images and data; does not encapsulate
+ image format information. User is responsible for transmitting
+ that information in another way. */
+
+ public static class ImageInfo {
+ private ByteBuffer data;
+ private int width;
+ private int height;
+ private boolean isCompressed;
+ private int compressionFormat;
+
+ public ImageInfo(ByteBuffer data, int width, int height, boolean compressed, int compressionFormat) {
+ this.data = data; this.width = width; this.height = height;
+ this.isCompressed = compressed; this.compressionFormat = compressionFormat;
+ }
+ public int getWidth() { return width; }
+ public int getHeight() { return height; }
+ public ByteBuffer getData() { return data; }
+ public boolean isCompressed() { return isCompressed; }
+ public int getCompressionFormat() {
+ if (!isCompressed())
+ throw new RuntimeException("Should not call unless compressed");
+ return compressionFormat;
+ }
+ }
+
+ private ByteBuffer buf;
+ private Header header;
+
+ //
+ // Selected bits in header flags
+ //
+
+ public static final int DDSD_CAPS = 0x00000001; // Capacities are valid
+ public static final int DDSD_HEIGHT = 0x00000002; // Height is valid
+ public static final int DDSD_WIDTH = 0x00000004; // Width is valid
+ public static final int DDSD_PITCH = 0x00000008; // Pitch is valid
+ public static final int DDSD_BACKBUFFERCOUNT = 0x00000020; // Back buffer count is valid
+ public static final int DDSD_ZBUFFERBITDEPTH = 0x00000040; // Z-buffer bit depth is valid (shouldn't be used in DDSURFACEDESC2)
+ public static final int DDSD_ALPHABITDEPTH = 0x00000080; // Alpha bit depth is valid
+ public static final int DDSD_LPSURFACE = 0x00000800; // lpSurface is valid
+ public static final int DDSD_PIXELFORMAT = 0x00001000; // ddpfPixelFormat is valid
+ public static final int DDSD_MIPMAPCOUNT = 0x00020000; // Mip map count is valid
+ public static final int DDSD_LINEARSIZE = 0x00080000; // dwLinearSize is valid
+ public static final int DDSD_DEPTH = 0x00800000; // dwDepth is valid
+
+ public static final int DDPF_ALPHAPIXELS = 0x00000001; // Alpha channel is present
+ public static final int DDPF_ALPHA = 0x00000002; // Only contains alpha information
+ public static final int DDPF_FOURCC = 0x00000004; // FourCC code is valid
+ public static final int DDPF_PALETTEINDEXED4 = 0x00000008; // Surface is 4-bit color indexed
+ public static final int DDPF_PALETTEINDEXEDTO8 = 0x00000010; // Surface is indexed into a palette which stores indices
+ // into the destination surface's 8-bit palette
+ public static final int DDPF_PALETTEINDEXED8 = 0x00000020; // Surface is 8-bit color indexed
+ public static final int DDPF_RGB = 0x00000040; // RGB data is present
+ public static final int DDPF_COMPRESSED = 0x00000080; // Surface will accept pixel data in the format specified
+ // and compress it during the write
+ public static final int DDPF_RGBTOYUV = 0x00000100; // Surface will accept RGB data and translate it during
+ // the write to YUV data. The format of the data to be written
+ // will be contained in the pixel format structure. The DDPF_RGB
+ // flag will be set.
+ public static final int DDPF_YUV = 0x00000200; // Pixel format is YUV - YUV data in pixel format struct is valid
+ public static final int DDPF_ZBUFFER = 0x00000400; // Pixel format is a z buffer only surface
+ public static final int DDPF_PALETTEINDEXED1 = 0x00000800; // Surface is 1-bit color indexed
+ public static final int DDPF_PALETTEINDEXED2 = 0x00001000; // Surface is 2-bit color indexed
+ public static final int DDPF_ZPIXELS = 0x00002000; // Surface contains Z information in the pixels
+
+ // Selected bits in DDS capabilities flags
+ public static final int DDSCAPS_TEXTURE = 0x00001000; // Can be used as a texture
+ public static final int DDSCAPS_MIPMAP = 0x00400000; // Is one level of a mip-map
+ public static final int DDSCAPS_COMPLEX = 0x00000008; // Complex surface structure, such as a cube map
+
+ // Selected bits in DDS extended capabilities flags
+ public static final int DDSCAPS2_CUBEMAP = 0x00000200;
+ public static final int DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400;
+ public static final int DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800;
+ public static final int DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000;
+ public static final int DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000;
+ public static final int DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000;
+ public static final int DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000;
+
+ // Known pixel formats
+ public static final int D3DFMT_UNKNOWN = 0;
+ public static final int D3DFMT_R8G8B8 = 20;
+ public static final int D3DFMT_A8R8G8B8 = 21;
+ public static final int D3DFMT_X8R8G8B8 = 22;
+ // The following are also valid FourCC codes
+ public static final int D3DFMT_DXT1 = 0x31545844;
+ public static final int D3DFMT_DXT2 = 0x32545844;
+ public static final int D3DFMT_DXT3 = 0x33545844;
+ public static final int D3DFMT_DXT4 = 0x34545844;
+ public static final int D3DFMT_DXT5 = 0x35545844;
+
+ /** Reads a DirectDraw surface from the specified file name,
+ returning the resulting DDSImage.
+
+ @param filename File name
+ @return DDS image object
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static DDSImage read(String filename) throws IOException {
+ return read(new File(filename));
+ }
+
+ /** Reads a DirectDraw surface from the specified file, returning
+ the resulting DDSImage.
+
+ @param file File object
+ @return DDS image object
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static DDSImage read(File file) throws IOException {
+ DDSImage image = new DDSImage();
+ image.readFromFile(file);
+ return image;
+ }
+
+ /** Reads a DirectDraw surface from the specified InputStream, returning
+ the resulting DDSImage.
+
+ @param input Input stream
+ @return DDS image object
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static DDSImage read(InputStream input) throws IOException {
+ DDSImage image = new DDSImage();
+ image.readFromStream(input);
+ return image;
+ }
+
+ /** Closes open files and resources associated with the open
+ DDSImage. No other methods may be called on this object once
+ this is called. */
+ public void close() {
+ }
+
+ /**
+ * Creates a new DDSImage from data supplied by the user. The
+ * resulting DDSImage can be written to disk using the write()
+ * method.
+ *
+ * @param d3dFormat the D3DFMT_ constant describing the data; it is
+ * assumed that it is packed tightly
+ * @param width the width in pixels of the topmost mipmap image
+ * @param height the height in pixels of the topmost mipmap image
+ * @param mipmapData the data for each mipmap level of the resulting
+ * DDSImage; either only one mipmap level should
+ * be specified, or they all must be
+ * @throws IllegalArgumentException if the data does not match the
+ * specified arguments
+ * @return DDS image object
+ */
+ public static DDSImage createFromData(int d3dFormat,
+ int width,
+ int height,
+ ByteBuffer[] mipmapData) throws IllegalArgumentException {
+ DDSImage image = new DDSImage();
+ image.initFromData(d3dFormat, width, height, mipmapData);
+ return image;
+ }
+
+ /** Determines from the magic number whether the given InputStream
+ points to a DDS image. The given InputStream must return true
+ from markSupported() and support a minimum of four bytes of
+ read-ahead.
+
+ @param in Stream to check
+ @return true if input stream is DDS image or false otherwise
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static boolean isDDSImage(InputStream in) throws IOException {
+ if (!(in instanceof BufferedInputStream)) {
+ in = new BufferedInputStream(in);
+ }
+ if (!in.markSupported()) {
+ throw new IOException("Can not test non-destructively whether given InputStream is a DDS image");
+ }
+ in.mark(4);
+ int magic = 0;
+ for (int i = 0; i < 4; i++) {
+ int tmp = in.read();
+ if (tmp < 0) {
+ in.reset();
+ return false;
+ }
+ magic = ((magic >>> 8) | (tmp << 24));
+ }
+ in.reset();
+ return (magic == MAGIC);
+ }
+
+ /**
+ * Writes this DDSImage to the specified file name.
+ * @param filename File name to write to
+ * @throws java.io.IOException if an I/O exception occurred
+ */
+ public void write(String filename) throws IOException {
+ write(new File(filename));
+ }
+
+ /**
+ * Writes this DDSImage to the specified file name.
+ * @param file File object to write to
+ * @throws java.io.IOException if an I/O exception occurred
+ */
+ public void write(File file) throws IOException {
+ LEDataOutputStream output =
+ new LEDataOutputStream(new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))));
+ header.write(output);
+ output.write(buf.array());
+ output.close();
+ }
+
+ /** Test for presence/absence of surface description flags (DDSD_*)
+ * @param flag DDSD_* flags set to test
+ * @return true if flag present or false otherwise
+ */
+ public boolean isSurfaceDescFlagSet(int flag) {
+ return ((header.flags & flag) != 0);
+ }
+
+ /** Test for presence/absence of pixel format flags (DDPF_*) */
+ public boolean isPixelFormatFlagSet(int flag) {
+ return ((header.pfFlags & flag) != 0);
+ }
+
+ /** Gets the pixel format of this texture (D3DFMT_*) based on some
+ heuristics. Returns D3DFMT_UNKNOWN if could not recognize the
+ pixel format. */
+ public int getPixelFormat() {
+ if (isCompressed()) {
+ return getCompressionFormat();
+ } else if (isPixelFormatFlagSet(DDPF_RGB)) {
+ if (isPixelFormatFlagSet(DDPF_ALPHAPIXELS)) {
+ if (getDepth() == 32 &&
+ header.pfRBitMask == 0x00FF0000 &&
+ header.pfGBitMask == 0x0000FF00 &&
+ header.pfBBitMask == 0x000000FF &&
+ header.pfABitMask == 0xFF000000) {
+ return D3DFMT_A8R8G8B8;
+ }
+ } else {
+ if (getDepth() == 24 &&
+ header.pfRBitMask == 0x00FF0000 &&
+ header.pfGBitMask == 0x0000FF00 &&
+ header.pfBBitMask == 0x000000FF) {
+ return D3DFMT_R8G8B8;
+ } else if (getDepth() == 32 &&
+ header.pfRBitMask == 0x00FF0000 &&
+ header.pfGBitMask == 0x0000FF00 &&
+ header.pfBBitMask == 0x000000FF) {
+ return D3DFMT_X8R8G8B8;
+ }
+ }
+ }
+
+ return D3DFMT_UNKNOWN;
+ }
+
+ /**
+ * Indicates whether this texture is cubemap
+ * @return true if cubemap or false otherwise
+ */
+ public boolean isCubemap() {
+ return ((header.ddsCaps1 & DDSCAPS_COMPLEX) != 0) && ((header.ddsCaps2 & DDSCAPS2_CUBEMAP) != 0);
+ }
+
+ /**
+ * Indicates whethe this cubemap side present
+ * @param side Side to test
+ * @return true if side present or false otherwise
+ */
+ public boolean isCubemapSidePresent(int side) {
+ return isCubemap() && (header.ddsCaps2 & side) != 0;
+ }
+
+ /** Indicates whether this texture is compressed. */
+ public boolean isCompressed() {
+ return (isPixelFormatFlagSet(DDPF_FOURCC));
+ }
+
+ /** If this surface is compressed, returns the kind of compression
+ used (DXT1..DXT5). */
+ public int getCompressionFormat() {
+ return header.pfFourCC;
+ }
+
+ /** Width of the texture (or the top-most mipmap if mipmaps are
+ present) */
+ public int getWidth() {
+ return header.width;
+ }
+
+ /** Height of the texture (or the top-most mipmap if mipmaps are
+ present) */
+ public int getHeight() {
+ return header.height;
+ }
+
+ /** Total number of bits per pixel. Only valid if DDPF_RGB is
+ present. For A8R8G8B8, would be 32. */
+ public int getDepth() {
+ return header.pfRGBBitCount;
+ }
+
+ /** Number of mip maps in the texture */
+ public int getNumMipMaps() {
+ if (!isSurfaceDescFlagSet(DDSD_MIPMAPCOUNT)) {
+ return 0;
+ }
+ return header.mipMapCountOrAux;
+ }
+
+ /** Gets the <i>i</i>th mipmap data (0..getNumMipMaps() - 1)
+ * @param map Mipmap index
+ * @return Image object
+ */
+ public ImageInfo getMipMap(int map) {
+ return getMipMap( 0, map );
+ }
+
+ /**
+ * Gets the <i>i</i>th mipmap data (0..getNumMipMaps() - 1)
+ * @param side Cubemap side or 0 for 2D texture
+ * @param map Mipmap index
+ * @return Image object
+ */
+ public ImageInfo getMipMap(int side, int map) {
+ if (!isCubemap() && (side != 0)) {
+ throw new RuntimeException( "Illegal side for 2D texture: " + side );
+ }
+ if (isCubemap() && !isCubemapSidePresent(side)) {
+ throw new RuntimeException( "Illegal side, side not present: " + side );
+ }
+ if (getNumMipMaps() > 0 &&
+ ((map < 0) || (map >= getNumMipMaps()))) {
+ throw new RuntimeException("Illegal mipmap number " + map + " (0.." + (getNumMipMaps() - 1) + ")");
+ }
+
+ // Figure out how far to seek
+ int seek = 0;
+ if (isCubemap()) {
+ seek += sideShiftInBytes(side);
+ }
+ for (int i = 0; i < map; i++) {
+ seek += mipMapSizeInBytes(i);
+ }
+ buf.limit(seek + mipMapSizeInBytes(map));
+ buf.position(seek);
+ ByteBuffer next = buf.slice();
+ buf.position(0);
+ buf.limit(buf.capacity());
+ return new ImageInfo(next, mipMapWidth(map), mipMapHeight(map), isCompressed(), getCompressionFormat());
+ }
+
+ /** Returns an array of ImageInfos corresponding to all mipmap
+ levels of this DDS file.
+ @return Mipmap image objects set
+ */
+ public ImageInfo[] getAllMipMaps() {
+ return getAllMipMaps(0);
+ }
+
+ /**
+ * Returns an array of ImageInfos corresponding to all mipmap
+ * levels of this DDS file.
+ * @param side Cubemap side or 0 for 2D texture
+ * @return Mipmap image objects set
+ */
+ public ImageInfo[] getAllMipMaps( int side ) {
+ int numLevels = getNumMipMaps();
+ if (numLevels == 0) {
+ numLevels = 1;
+ }
+ ImageInfo[] result = new ImageInfo[numLevels];
+ for (int i = 0; i < numLevels; i++) {
+ result[i] = getMipMap(side, i);
+ }
+ return result;
+ }
+
+ /** Converts e.g. DXT1 compression format constant (see {@link
+ #getCompressionFormat}) into "DXT1".
+ @param compressionFormat Compression format constant
+ @return String format code
+ */
+ public static String getCompressionFormatName(int compressionFormat) {
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < 4; i++) {
+ char c = (char) (compressionFormat & 0xFF);
+ buf.append(c);
+ compressionFormat = compressionFormat >> 8;
+ }
+ return buf.toString();
+ }
+
+ /** Allocates a temporary, empty ByteBuffer suitable for use in a
+ call to glCompressedTexImage2D. This is used by the Texture
+ class to expand non-power-of-two DDS compressed textures to
+ power-of-two sizes on hardware not supporting OpenGL 2.0 and the
+ NPOT texture extension. The specified OpenGL internal format
+ must be one of GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, or
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
+ */
+ public static ByteBuffer allocateBlankBuffer(int width,
+ int height,
+ int openGLInternalFormat) {
+ int size = width * height;
+ switch (openGLInternalFormat) {
+ case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ size /= 2;
+ break;
+
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ break;
+
+ default:
+ throw new IllegalArgumentException("Illegal OpenGL texture internal format " +
+ openGLInternalFormat);
+ }
+ if (size == 0)
+ size = 1;
+ return BufferUtil.newByteBuffer(size);
+ }
+
+ public void debugPrint() {
+ PrintStream tty = System.err;
+ tty.println("Compressed texture: " + isCompressed());
+ if (isCompressed()) {
+ int fmt = getCompressionFormat();
+ String name = getCompressionFormatName(fmt);
+ tty.println("Compression format: 0x" + Integer.toHexString(fmt) + " (" + name + ")");
+ }
+ tty.println("Width: " + header.width + " Height: " + header.height);
+ tty.println("header.pitchOrLinearSize: " + header.pitchOrLinearSize);
+ tty.println("header.pfRBitMask: 0x" + Integer.toHexString(header.pfRBitMask));
+ tty.println("header.pfGBitMask: 0x" + Integer.toHexString(header.pfGBitMask));
+ tty.println("header.pfBBitMask: 0x" + Integer.toHexString(header.pfBBitMask));
+ tty.println("SurfaceDesc flags:");
+ boolean recognizedAny = false;
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_CAPS, "DDSD_CAPS");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_HEIGHT, "DDSD_HEIGHT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_WIDTH, "DDSD_WIDTH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_PITCH, "DDSD_PITCH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_BACKBUFFERCOUNT, "DDSD_BACKBUFFERCOUNT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_ALPHABITDEPTH, "DDSD_ALPHABITDEPTH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_LPSURFACE, "DDSD_LPSURFACE");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_PIXELFORMAT, "DDSD_PIXELFORMAT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_MIPMAPCOUNT, "DDSD_MIPMAPCOUNT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_LINEARSIZE, "DDSD_LINEARSIZE");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_DEPTH, "DDSD_DEPTH");
+ if (!recognizedAny) {
+ tty.println("(none)");
+ }
+ tty.println("Raw SurfaceDesc flags: 0x" + Integer.toHexString(header.flags));
+ tty.println("Pixel format flags:");
+ recognizedAny = false;
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ALPHAPIXELS, "DDPF_ALPHAPIXELS");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ALPHA, "DDPF_ALPHA");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_FOURCC, "DDPF_FOURCC");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED4, "DDPF_PALETTEINDEXED4");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXEDTO8, "DDPF_PALETTEINDEXEDTO8");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED8, "DDPF_PALETTEINDEXED8");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_RGB, "DDPF_RGB");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_COMPRESSED, "DDPF_COMPRESSED");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_RGBTOYUV, "DDPF_RGBTOYUV");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_YUV, "DDPF_YUV");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ZBUFFER, "DDPF_ZBUFFER");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED1, "DDPF_PALETTEINDEXED1");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED2, "DDPF_PALETTEINDEXED2");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ZPIXELS, "DDPF_ZPIXELS");
+ if (!recognizedAny) {
+ tty.println("(none)");
+ }
+ tty.println("Raw pixel format flags: 0x" + Integer.toHexString(header.pfFlags));
+ tty.println("Depth: " + getDepth());
+ tty.println("Number of mip maps: " + getNumMipMaps());
+ int fmt = getPixelFormat();
+ tty.print("Pixel format: ");
+ switch (fmt) {
+ case D3DFMT_R8G8B8: tty.println("D3DFMT_R8G8B8"); break;
+ case D3DFMT_A8R8G8B8: tty.println("D3DFMT_A8R8G8B8"); break;
+ case D3DFMT_X8R8G8B8: tty.println("D3DFMT_X8R8G8B8"); break;
+ case D3DFMT_DXT1: tty.println("D3DFMT_DXT1"); break;
+ case D3DFMT_DXT2: tty.println("D3DFMT_DXT2"); break;
+ case D3DFMT_DXT3: tty.println("D3DFMT_DXT3"); break;
+ case D3DFMT_DXT4: tty.println("D3DFMT_DXT4"); break;
+ case D3DFMT_DXT5: tty.println("D3DFMT_DXT5"); break;
+ case D3DFMT_UNKNOWN: tty.println("D3DFMT_UNKNOWN"); break;
+ default: tty.println("(unknown pixel format " + fmt + ")"); break;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static final int MAGIC = 0x20534444;
+
+ static class Header {
+ int size; // size of the DDSURFACEDESC structure
+ int flags; // determines what fields are valid
+ int height; // height of surface to be created
+ int width; // width of input surface
+ int pitchOrLinearSize;
+ int backBufferCountOrDepth;
+ int mipMapCountOrAux; // number of mip-map levels requested (in this context)
+ int alphaBitDepth; // depth of alpha buffer requested
+ int reserved1; // reserved
+ int surface; // pointer to the associated surface memory
+ // NOTE: following two entries are from DDCOLORKEY data structure
+ // Are overlaid with color for empty cubemap faces (unused in this reader)
+ int colorSpaceLowValue;
+ int colorSpaceHighValue;
+ int destBltColorSpaceLowValue;
+ int destBltColorSpaceHighValue;
+ int srcOverlayColorSpaceLowValue;
+ int srcOverlayColorSpaceHighValue;
+ int srcBltColorSpaceLowValue;
+ int srcBltColorSpaceHighValue;
+ // NOTE: following entries are from DDPIXELFORMAT data structure
+ // Are overlaid with flexible vertex format description of vertex
+ // buffers (unused in this reader)
+ int pfSize; // size of DDPIXELFORMAT structure
+ int pfFlags; // pixel format flags
+ int pfFourCC; // (FOURCC code)
+ // Following five entries have multiple interpretations, not just
+ // RGBA (but that's all we support right now)
+ int pfRGBBitCount; // how many bits per pixel
+ int pfRBitMask; // mask for red bits
+ int pfGBitMask; // mask for green bits
+ int pfBBitMask; // mask for blue bits
+ int pfABitMask; // mask for alpha channel
+ int ddsCaps1; // Texture and mip-map flags
+ int ddsCaps2; // Advanced capabilities including cubemap support
+ int ddsCapsReserved1;
+ int ddsCapsReserved2;
+ int textureStage; // stage in multitexture cascade
+
+ void read(LEDataInputStream input) throws IOException {
+ int magic = input.readInt();
+ if (magic != MAGIC) {
+ throw new IOException("Incorrect magic number 0x" +
+ Integer.toHexString(magic) +
+ " (expected " + MAGIC + ")");
+ }
+
+ size = input.readInt();
+ flags = input.readInt();
+ height = input.readInt();
+ width = input.readInt();
+ pitchOrLinearSize = input.readInt();
+ backBufferCountOrDepth = input.readInt();
+ mipMapCountOrAux = input.readInt();
+ alphaBitDepth = input.readInt();
+ reserved1 = input.readInt();
+ surface = input.readInt();
+ colorSpaceLowValue = input.readInt();
+ colorSpaceHighValue = input.readInt();
+ destBltColorSpaceLowValue = input.readInt();
+ destBltColorSpaceHighValue = input.readInt();
+ srcOverlayColorSpaceLowValue = input.readInt();
+ srcOverlayColorSpaceHighValue = input.readInt();
+ srcBltColorSpaceLowValue = input.readInt();
+ srcBltColorSpaceHighValue = input.readInt();
+ pfSize = input.readInt();
+ pfFlags = input.readInt();
+ pfFourCC = input.readInt();
+ pfRGBBitCount = input.readInt();
+ pfRBitMask = input.readInt();
+ pfGBitMask = input.readInt();
+ pfBBitMask = input.readInt();
+ pfABitMask = input.readInt();
+ ddsCaps1 = input.readInt();
+ ddsCaps2 = input.readInt();
+ ddsCapsReserved1 = input.readInt();
+ ddsCapsReserved2 = input.readInt();
+ textureStage = input.readInt();
+ }
+
+ // buf must be in little-endian byte order
+ void write(LEDataOutputStream output) throws IOException {
+ output.writeInt(MAGIC);
+ output.writeInt(size);
+ output.writeInt(flags);
+ output.writeInt(height);
+ output.writeInt(width);
+ output.writeInt(pitchOrLinearSize);
+ output.writeInt(backBufferCountOrDepth);
+ output.writeInt(mipMapCountOrAux);
+ output.writeInt(alphaBitDepth);
+ output.writeInt(reserved1);
+ output.writeInt(surface);
+ output.writeInt(colorSpaceLowValue);
+ output.writeInt(colorSpaceHighValue);
+ output.writeInt(destBltColorSpaceLowValue);
+ output.writeInt(destBltColorSpaceHighValue);
+ output.writeInt(srcOverlayColorSpaceLowValue);
+ output.writeInt(srcOverlayColorSpaceHighValue);
+ output.writeInt(srcBltColorSpaceLowValue);
+ output.writeInt(srcBltColorSpaceHighValue);
+ output.writeInt(pfSize);
+ output.writeInt(pfFlags);
+ output.writeInt(pfFourCC);
+ output.writeInt(pfRGBBitCount);
+ output.writeInt(pfRBitMask);
+ output.writeInt(pfGBitMask);
+ output.writeInt(pfBBitMask);
+ output.writeInt(pfABitMask);
+ output.writeInt(ddsCaps1);
+ output.writeInt(ddsCaps2);
+ output.writeInt(ddsCapsReserved1);
+ output.writeInt(ddsCapsReserved2);
+ output.writeInt(textureStage);
+ }
+
+ private static int size() {
+ return 124;
+ }
+
+ private static int pfSize() {
+ return 32;
+ }
+
+ private static int writtenSize() {
+ return 128;
+ }
+ }
+
+ private DDSImage() {
+ }
+
+ private void readFromFile(File file) throws IOException {
+ readFromStream(new BufferedInputStream(new FileInputStream(file)));
+ }
+
+ private void readFromStream(InputStream input) throws IOException {
+ LEDataInputStream leInput = new LEDataInputStream(input);
+ header = new Header();
+ header.read(leInput);
+ fixupHeader();
+ buf = StreamUtil.readAll2Buffer(input);
+ }
+
+ private void initFromData(int d3dFormat,
+ int width,
+ int height,
+ ByteBuffer[] mipmapData) throws IllegalArgumentException {
+ // Check size of mipmap data compared against format, width and
+ // height
+ int topmostMipmapSize = width * height;
+ int pitchOrLinearSize = width;
+ boolean isCompressed = false;
+ switch (d3dFormat) {
+ case D3DFMT_R8G8B8: topmostMipmapSize *= 3; pitchOrLinearSize *= 3; break;
+ case D3DFMT_A8R8G8B8: topmostMipmapSize *= 4; pitchOrLinearSize *= 4; break;
+ case D3DFMT_X8R8G8B8: topmostMipmapSize *= 4; pitchOrLinearSize *= 4; break;
+ case D3DFMT_DXT1:
+ case D3DFMT_DXT2:
+ case D3DFMT_DXT3:
+ case D3DFMT_DXT4:
+ case D3DFMT_DXT5:
+ topmostMipmapSize = computeCompressedBlockSize(width, height, 1, d3dFormat);
+ pitchOrLinearSize = topmostMipmapSize;
+ isCompressed = true;
+ break;
+ default:
+ throw new IllegalArgumentException("d3dFormat must be one of the known formats");
+ }
+
+ // Now check the mipmaps against this size
+ int curSize = topmostMipmapSize;
+ int totalSize = 0;
+ for (int i = 0; i < mipmapData.length; i++) {
+ if (mipmapData[i].remaining() != curSize) {
+ throw new IllegalArgumentException("Mipmap level " + i +
+ " didn't match expected data size (expected " + curSize + ", got " +
+ mipmapData[i].remaining() + ")");
+ }
+ curSize /= 4;
+ totalSize += mipmapData[i].remaining();
+ }
+
+ // OK, create one large byte array to hold all of the mipmap data
+ byte[] data = new byte[totalSize];
+ ByteBuffer buf = ByteBuffer.wrap(data);
+ for (int i = 0; i < mipmapData.length; i++) {
+ buf.put(mipmapData[i]);
+ }
+ this.buf = buf;
+
+ // Allocate and initialize a Header
+ header = new Header();
+ header.size = Header.size();
+ header.flags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT;
+ if (mipmapData.length > 1) {
+ header.flags |= DDSD_MIPMAPCOUNT;
+ header.mipMapCountOrAux = mipmapData.length;
+ }
+ header.width = width;
+ header.height = height;
+ if (isCompressed) {
+ header.flags |= DDSD_LINEARSIZE;
+ header.pfFlags |= DDPF_FOURCC;
+ header.pfFourCC = d3dFormat;
+ } else {
+ header.flags |= DDSD_PITCH;
+ // Figure out the various settings from the pixel format
+ header.pfFlags |= DDPF_RGB;
+ switch (d3dFormat) {
+ case D3DFMT_R8G8B8: header.pfRGBBitCount = 24; break;
+ case D3DFMT_A8R8G8B8: header.pfRGBBitCount = 32; header.pfFlags |= DDPF_ALPHAPIXELS; break;
+ case D3DFMT_X8R8G8B8: header.pfRGBBitCount = 32; break;
+ }
+ header.pfRBitMask = 0x00FF0000;
+ header.pfGBitMask = 0x0000FF00;
+ header.pfBBitMask = 0x000000FF;
+ if (d3dFormat == D3DFMT_A8R8G8B8) {
+ header.pfABitMask = 0xFF000000;
+ }
+ }
+ header.pitchOrLinearSize = pitchOrLinearSize;
+ header.pfSize = Header.pfSize();
+ // Not sure whether we can get away with leaving the rest of the
+ // header blank
+ }
+
+ // Microsoft doesn't follow their own specifications and the
+ // simplest conversion using the DxTex tool to e.g. a DXT3 texture
+ // results in an illegal .dds file without either DDSD_PITCH or
+ // DDSD_LINEARSIZE set in the header's flags. This code, adapted
+ // from the DevIL library, fixes up the header in these situations.
+ private void fixupHeader() {
+ if (isCompressed() && !isSurfaceDescFlagSet(DDSD_LINEARSIZE)) {
+ // Figure out how big the linear size should be
+ int depth = header.backBufferCountOrDepth;
+ if (depth == 0) {
+ depth = 1;
+ }
+
+ header.pitchOrLinearSize = computeCompressedBlockSize(getWidth(), getHeight(), depth, getCompressionFormat());
+ header.flags |= DDSD_LINEARSIZE;
+ }
+ }
+
+ private static int computeCompressedBlockSize(int width,
+ int height,
+ int depth,
+ int compressionFormat) {
+ int blockSize = ((width + 3)/4) * ((height + 3)/4) * ((depth + 3)/4);
+ switch (compressionFormat) {
+ case D3DFMT_DXT1: blockSize *= 8; break;
+ default: blockSize *= 16; break;
+ }
+ return blockSize;
+ }
+
+ private int mipMapWidth(int map) {
+ int width = getWidth();
+ for (int i = 0; i < map; i++) {
+ width >>= 1;
+ }
+ return Math.max(width, 1);
+ }
+
+ private int mipMapHeight(int map) {
+ int height = getHeight();
+ for (int i = 0; i < map; i++) {
+ height >>= 1;
+ }
+ return Math.max(height, 1);
+ }
+
+ private int mipMapSizeInBytes(int map) {
+ int width = mipMapWidth(map);
+ int height = mipMapHeight(map);
+ if (isCompressed()) {
+ int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
+ return ((width+3)/4)*((height+3)/4)*blockSize;
+ } else {
+ return width * height * (getDepth() / 8);
+ }
+ }
+
+ private int sideSizeInBytes() {
+ int numLevels = getNumMipMaps();
+ if (numLevels == 0) {
+ numLevels = 1;
+ }
+
+ int size = 0;
+ for (int i = 0; i < numLevels; i++) {
+ size += mipMapSizeInBytes(i);
+ }
+
+ return size;
+ }
+
+ private int sideShiftInBytes(int side) {
+ int[] sides = {
+ DDSCAPS2_CUBEMAP_POSITIVEX,
+ DDSCAPS2_CUBEMAP_NEGATIVEX,
+ DDSCAPS2_CUBEMAP_POSITIVEY,
+ DDSCAPS2_CUBEMAP_NEGATIVEY,
+ DDSCAPS2_CUBEMAP_POSITIVEZ,
+ DDSCAPS2_CUBEMAP_NEGATIVEZ
+ };
+
+ int shift = 0;
+ int sideSize = sideSizeInBytes();
+ for (int i = 0; i < sides.length; i++) {
+ int temp = sides[i];
+ if ((temp & side) != 0) {
+ return shift;
+ }
+
+ shift += sideSize;
+ }
+
+ throw new RuntimeException("Illegal side: " + side);
+ }
+
+ private boolean printIfRecognized(PrintStream tty, int flags, int flag, String what) {
+ if ((flags & flag) != 0) {
+ tty.println(what);
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase b/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase
new file mode 100755
index 000000000..8a3e1c4be
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/DDSImage.java.javase
@@ -0,0 +1,919 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.*;
+
+/** A reader and writer for DirectDraw Surface (.dds) files, which are
+ used to describe textures. These files can contain multiple mipmap
+ levels in one file. This class is currently minimal and does not
+ support all of the possible file formats. */
+
+public class DDSImage {
+
+ /** Simple class describing images and data; does not encapsulate
+ image format information. User is responsible for transmitting
+ that information in another way. */
+
+ public static class ImageInfo {
+ private ByteBuffer data;
+ private int width;
+ private int height;
+ private boolean isCompressed;
+ private int compressionFormat;
+
+ public ImageInfo(ByteBuffer data, int width, int height, boolean compressed, int compressionFormat) {
+ this.data = data; this.width = width; this.height = height;
+ this.isCompressed = compressed; this.compressionFormat = compressionFormat;
+ }
+ public int getWidth() { return width; }
+ public int getHeight() { return height; }
+ public ByteBuffer getData() { return data; }
+ public boolean isCompressed() { return isCompressed; }
+ public int getCompressionFormat() {
+ if (!isCompressed())
+ throw new RuntimeException("Should not call unless compressed");
+ return compressionFormat;
+ }
+ }
+
+ private FileInputStream fis;
+ private FileChannel chan;
+ private ByteBuffer buf;
+ private Header header;
+
+ //
+ // Selected bits in header flags
+ //
+
+ public static final int DDSD_CAPS = 0x00000001; // Capacities are valid
+ public static final int DDSD_HEIGHT = 0x00000002; // Height is valid
+ public static final int DDSD_WIDTH = 0x00000004; // Width is valid
+ public static final int DDSD_PITCH = 0x00000008; // Pitch is valid
+ public static final int DDSD_BACKBUFFERCOUNT = 0x00000020; // Back buffer count is valid
+ public static final int DDSD_ZBUFFERBITDEPTH = 0x00000040; // Z-buffer bit depth is valid (shouldn't be used in DDSURFACEDESC2)
+ public static final int DDSD_ALPHABITDEPTH = 0x00000080; // Alpha bit depth is valid
+ public static final int DDSD_LPSURFACE = 0x00000800; // lpSurface is valid
+ public static final int DDSD_PIXELFORMAT = 0x00001000; // ddpfPixelFormat is valid
+ public static final int DDSD_MIPMAPCOUNT = 0x00020000; // Mip map count is valid
+ public static final int DDSD_LINEARSIZE = 0x00080000; // dwLinearSize is valid
+ public static final int DDSD_DEPTH = 0x00800000; // dwDepth is valid
+
+ public static final int DDPF_ALPHAPIXELS = 0x00000001; // Alpha channel is present
+ public static final int DDPF_ALPHA = 0x00000002; // Only contains alpha information
+ public static final int DDPF_FOURCC = 0x00000004; // FourCC code is valid
+ public static final int DDPF_PALETTEINDEXED4 = 0x00000008; // Surface is 4-bit color indexed
+ public static final int DDPF_PALETTEINDEXEDTO8 = 0x00000010; // Surface is indexed into a palette which stores indices
+ // into the destination surface's 8-bit palette
+ public static final int DDPF_PALETTEINDEXED8 = 0x00000020; // Surface is 8-bit color indexed
+ public static final int DDPF_RGB = 0x00000040; // RGB data is present
+ public static final int DDPF_COMPRESSED = 0x00000080; // Surface will accept pixel data in the format specified
+ // and compress it during the write
+ public static final int DDPF_RGBTOYUV = 0x00000100; // Surface will accept RGB data and translate it during
+ // the write to YUV data. The format of the data to be written
+ // will be contained in the pixel format structure. The DDPF_RGB
+ // flag will be set.
+ public static final int DDPF_YUV = 0x00000200; // Pixel format is YUV - YUV data in pixel format struct is valid
+ public static final int DDPF_ZBUFFER = 0x00000400; // Pixel format is a z buffer only surface
+ public static final int DDPF_PALETTEINDEXED1 = 0x00000800; // Surface is 1-bit color indexed
+ public static final int DDPF_PALETTEINDEXED2 = 0x00001000; // Surface is 2-bit color indexed
+ public static final int DDPF_ZPIXELS = 0x00002000; // Surface contains Z information in the pixels
+
+ // Selected bits in DDS capabilities flags
+ public static final int DDSCAPS_TEXTURE = 0x00001000; // Can be used as a texture
+ public static final int DDSCAPS_MIPMAP = 0x00400000; // Is one level of a mip-map
+ public static final int DDSCAPS_COMPLEX = 0x00000008; // Complex surface structure, such as a cube map
+
+ // Selected bits in DDS extended capabilities flags
+ public static final int DDSCAPS2_CUBEMAP = 0x00000200;
+ public static final int DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400;
+ public static final int DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800;
+ public static final int DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000;
+ public static final int DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000;
+ public static final int DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000;
+ public static final int DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000;
+
+ // Known pixel formats
+ public static final int D3DFMT_UNKNOWN = 0;
+ public static final int D3DFMT_R8G8B8 = 20;
+ public static final int D3DFMT_A8R8G8B8 = 21;
+ public static final int D3DFMT_X8R8G8B8 = 22;
+ // The following are also valid FourCC codes
+ public static final int D3DFMT_DXT1 = 0x31545844;
+ public static final int D3DFMT_DXT2 = 0x32545844;
+ public static final int D3DFMT_DXT3 = 0x33545844;
+ public static final int D3DFMT_DXT4 = 0x34545844;
+ public static final int D3DFMT_DXT5 = 0x35545844;
+
+ /** Reads a DirectDraw surface from the specified file name,
+ returning the resulting DDSImage.
+
+ @param filename File name
+ @return DDS image object
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static DDSImage read(String filename) throws IOException {
+ return read(new File(filename));
+ }
+
+ /** Reads a DirectDraw surface from the specified file, returning
+ the resulting DDSImage.
+
+ @param file File object
+ @return DDS image object
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static DDSImage read(File file) throws IOException {
+ DDSImage image = new DDSImage();
+ image.readFromFile(file);
+ return image;
+ }
+
+ /** Reads a DirectDraw surface from the specified ByteBuffer, returning
+ the resulting DDSImage.
+
+ @param buf Input data
+ @return DDS image object
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static DDSImage read(ByteBuffer buf) throws IOException {
+ DDSImage image = new DDSImage();
+ image.readFromBuffer(buf);
+ return image;
+ }
+
+ /** Closes open files and resources associated with the open
+ DDSImage. No other methods may be called on this object once
+ this is called. */
+ public void close() {
+ try {
+ if (chan != null) {
+ chan.close();
+ chan = null;
+ }
+ if (fis != null) {
+ fis.close();
+ fis = null;
+ }
+ buf = null;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Creates a new DDSImage from data supplied by the user. The
+ * resulting DDSImage can be written to disk using the write()
+ * method.
+ *
+ * @param d3dFormat the D3DFMT_ constant describing the data; it is
+ * assumed that it is packed tightly
+ * @param width the width in pixels of the topmost mipmap image
+ * @param height the height in pixels of the topmost mipmap image
+ * @param mipmapData the data for each mipmap level of the resulting
+ * DDSImage; either only one mipmap level should
+ * be specified, or they all must be
+ * @throws IllegalArgumentException if the data does not match the
+ * specified arguments
+ * @return DDS image object
+ */
+ public static DDSImage createFromData(int d3dFormat,
+ int width,
+ int height,
+ ByteBuffer[] mipmapData) throws IllegalArgumentException {
+ DDSImage image = new DDSImage();
+ image.initFromData(d3dFormat, width, height, mipmapData);
+ return image;
+ }
+
+ /** Determines from the magic number whether the given InputStream
+ points to a DDS image. The given InputStream must return true
+ from markSupported() and support a minimum of four bytes of
+ read-ahead.
+
+ @param in Stream to check
+ @return true if input stream is DDS image or false otherwise
+ @throws java.io.IOException if an I/O exception occurred
+ */
+ public static boolean isDDSImage(InputStream in) throws IOException {
+ if (!(in instanceof BufferedInputStream)) {
+ in = new BufferedInputStream(in);
+ }
+ if (!in.markSupported()) {
+ throw new IOException("Can not test non-destructively whether given InputStream is a DDS image");
+ }
+ in.mark(4);
+ int magic = 0;
+ for (int i = 0; i < 4; i++) {
+ int tmp = in.read();
+ if (tmp < 0) {
+ in.reset();
+ return false;
+ }
+ magic = ((magic >>> 8) | (tmp << 24));
+ }
+ in.reset();
+ return (magic == MAGIC);
+ }
+
+ /**
+ * Writes this DDSImage to the specified file name.
+ * @param filename File name to write to
+ * @throws java.io.IOException if an I/O exception occurred
+ */
+ public void write(String filename) throws IOException {
+ write(new File(filename));
+ }
+
+ /**
+ * Writes this DDSImage to the specified file name.
+ * @param file File object to write to
+ * @throws java.io.IOException if an I/O exception occurred
+ */
+ public void write(File file) throws IOException {
+ FileOutputStream stream = new FileOutputStream(file);
+ FileChannel chan = stream.getChannel();
+ // Create ByteBuffer for header in case the start of our
+ // ByteBuffer isn't actually memory-mapped
+ ByteBuffer hdr = ByteBuffer.allocate(Header.writtenSize());
+ hdr.order(ByteOrder.LITTLE_ENDIAN);
+ header.write(hdr);
+ hdr.rewind();
+ chan.write(hdr);
+ buf.position(Header.writtenSize());
+ chan.write(buf);
+ chan.force(true);
+ chan.close();
+ stream.close();
+ }
+
+ /** Test for presence/absence of surface description flags (DDSD_*)
+ * @param flag DDSD_* flags set to test
+ * @return true if flag present or false otherwise
+ */
+ public boolean isSurfaceDescFlagSet(int flag) {
+ return ((header.flags & flag) != 0);
+ }
+
+ /** Test for presence/absence of pixel format flags (DDPF_*) */
+ public boolean isPixelFormatFlagSet(int flag) {
+ return ((header.pfFlags & flag) != 0);
+ }
+
+ /** Gets the pixel format of this texture (D3DFMT_*) based on some
+ heuristics. Returns D3DFMT_UNKNOWN if could not recognize the
+ pixel format. */
+ public int getPixelFormat() {
+ if (isCompressed()) {
+ return getCompressionFormat();
+ } else if (isPixelFormatFlagSet(DDPF_RGB)) {
+ if (isPixelFormatFlagSet(DDPF_ALPHAPIXELS)) {
+ if (getDepth() == 32 &&
+ header.pfRBitMask == 0x00FF0000 &&
+ header.pfGBitMask == 0x0000FF00 &&
+ header.pfBBitMask == 0x000000FF &&
+ header.pfABitMask == 0xFF000000) {
+ return D3DFMT_A8R8G8B8;
+ }
+ } else {
+ if (getDepth() == 24 &&
+ header.pfRBitMask == 0x00FF0000 &&
+ header.pfGBitMask == 0x0000FF00 &&
+ header.pfBBitMask == 0x000000FF) {
+ return D3DFMT_R8G8B8;
+ } else if (getDepth() == 32 &&
+ header.pfRBitMask == 0x00FF0000 &&
+ header.pfGBitMask == 0x0000FF00 &&
+ header.pfBBitMask == 0x000000FF) {
+ return D3DFMT_X8R8G8B8;
+ }
+ }
+ }
+
+ return D3DFMT_UNKNOWN;
+ }
+
+ /**
+ * Indicates whether this texture is cubemap
+ * @return true if cubemap or false otherwise
+ */
+ public boolean isCubemap() {
+ return ((header.ddsCaps1 & DDSCAPS_COMPLEX) != 0) && ((header.ddsCaps2 & DDSCAPS2_CUBEMAP) != 0);
+ }
+
+ /**
+ * Indicates whethe this cubemap side present
+ * @param side Side to test
+ * @return true if side present or false otherwise
+ */
+ public boolean isCubemapSidePresent(int side) {
+ return isCubemap() && (header.ddsCaps2 & side) != 0;
+ }
+
+ /** Indicates whether this texture is compressed. */
+ public boolean isCompressed() {
+ return (isPixelFormatFlagSet(DDPF_FOURCC));
+ }
+
+ /** If this surface is compressed, returns the kind of compression
+ used (DXT1..DXT5). */
+ public int getCompressionFormat() {
+ return header.pfFourCC;
+ }
+
+ /** Width of the texture (or the top-most mipmap if mipmaps are
+ present) */
+ public int getWidth() {
+ return header.width;
+ }
+
+ /** Height of the texture (or the top-most mipmap if mipmaps are
+ present) */
+ public int getHeight() {
+ return header.height;
+ }
+
+ /** Total number of bits per pixel. Only valid if DDPF_RGB is
+ present. For A8R8G8B8, would be 32. */
+ public int getDepth() {
+ return header.pfRGBBitCount;
+ }
+
+ /** Number of mip maps in the texture */
+ public int getNumMipMaps() {
+ if (!isSurfaceDescFlagSet(DDSD_MIPMAPCOUNT)) {
+ return 0;
+ }
+ return header.mipMapCountOrAux;
+ }
+
+ /** Gets the <i>i</i>th mipmap data (0..getNumMipMaps() - 1)
+ * @param map Mipmap index
+ * @return Image object
+ */
+ public ImageInfo getMipMap(int map) {
+ return getMipMap( 0, map );
+ }
+
+ /**
+ * Gets the <i>i</i>th mipmap data (0..getNumMipMaps() - 1)
+ * @param side Cubemap side or 0 for 2D texture
+ * @param map Mipmap index
+ * @return Image object
+ */
+ public ImageInfo getMipMap(int side, int map) {
+ if (!isCubemap() && (side != 0)) {
+ throw new RuntimeException( "Illegal side for 2D texture: " + side );
+ }
+ if (isCubemap() && !isCubemapSidePresent(side)) {
+ throw new RuntimeException( "Illegal side, side not present: " + side );
+ }
+ if (getNumMipMaps() > 0 &&
+ ((map < 0) || (map >= getNumMipMaps()))) {
+ throw new RuntimeException("Illegal mipmap number " + map + " (0.." + (getNumMipMaps() - 1) + ")");
+ }
+
+ // Figure out how far to seek
+ int seek = Header.writtenSize();
+ if (isCubemap()) {
+ seek += sideShiftInBytes(side);
+ }
+ for (int i = 0; i < map; i++) {
+ seek += mipMapSizeInBytes(i);
+ }
+ buf.limit(seek + mipMapSizeInBytes(map));
+ buf.position(seek);
+ ByteBuffer next = buf.slice();
+ buf.position(0);
+ buf.limit(buf.capacity());
+ return new ImageInfo(next, mipMapWidth(map), mipMapHeight(map), isCompressed(), getCompressionFormat());
+ }
+
+ /** Returns an array of ImageInfos corresponding to all mipmap
+ levels of this DDS file.
+ @return Mipmap image objects set
+ */
+ public ImageInfo[] getAllMipMaps() {
+ return getAllMipMaps(0);
+ }
+
+ /**
+ * Returns an array of ImageInfos corresponding to all mipmap
+ * levels of this DDS file.
+ * @param side Cubemap side or 0 for 2D texture
+ * @return Mipmap image objects set
+ */
+ public ImageInfo[] getAllMipMaps( int side ) {
+ int numLevels = getNumMipMaps();
+ if (numLevels == 0) {
+ numLevels = 1;
+ }
+ ImageInfo[] result = new ImageInfo[numLevels];
+ for (int i = 0; i < numLevels; i++) {
+ result[i] = getMipMap(side, i);
+ }
+ return result;
+ }
+
+ /** Converts e.g. DXT1 compression format constant (see {@link
+ #getCompressionFormat}) into "DXT1".
+ @param compressionFormat Compression format constant
+ @return String format code
+ */
+ public static String getCompressionFormatName(int compressionFormat) {
+ StringBuffer buf = new StringBuffer();
+ for (int i = 0; i < 4; i++) {
+ char c = (char) (compressionFormat & 0xFF);
+ buf.append(c);
+ compressionFormat = compressionFormat >> 8;
+ }
+ return buf.toString();
+ }
+
+ /** Allocates a temporary, empty ByteBuffer suitable for use in a
+ call to glCompressedTexImage2D. This is used by the Texture
+ class to expand non-power-of-two DDS compressed textures to
+ power-of-two sizes on hardware not supporting OpenGL 2.0 and the
+ NPOT texture extension. The specified OpenGL internal format
+ must be one of GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
+ GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,
+ GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, or
+ GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
+ */
+ public static ByteBuffer allocateBlankBuffer(int width,
+ int height,
+ int openGLInternalFormat) {
+ int size = width * height;
+ switch (openGLInternalFormat) {
+ case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ size /= 2;
+ break;
+
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ case GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ break;
+
+ default:
+ throw new IllegalArgumentException("Illegal OpenGL texture internal format " +
+ openGLInternalFormat);
+ }
+ if (size == 0)
+ size = 1;
+ return BufferUtil.newByteBuffer(size);
+ }
+
+ public void debugPrint() {
+ PrintStream tty = System.err;
+ tty.println("Compressed texture: " + isCompressed());
+ if (isCompressed()) {
+ int fmt = getCompressionFormat();
+ String name = getCompressionFormatName(fmt);
+ tty.println("Compression format: 0x" + Integer.toHexString(fmt) + " (" + name + ")");
+ }
+ tty.println("Width: " + header.width + " Height: " + header.height);
+ tty.println("header.pitchOrLinearSize: " + header.pitchOrLinearSize);
+ tty.println("header.pfRBitMask: 0x" + Integer.toHexString(header.pfRBitMask));
+ tty.println("header.pfGBitMask: 0x" + Integer.toHexString(header.pfGBitMask));
+ tty.println("header.pfBBitMask: 0x" + Integer.toHexString(header.pfBBitMask));
+ tty.println("SurfaceDesc flags:");
+ boolean recognizedAny = false;
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_CAPS, "DDSD_CAPS");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_HEIGHT, "DDSD_HEIGHT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_WIDTH, "DDSD_WIDTH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_PITCH, "DDSD_PITCH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_BACKBUFFERCOUNT, "DDSD_BACKBUFFERCOUNT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_ZBUFFERBITDEPTH, "DDSD_ZBUFFERBITDEPTH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_ALPHABITDEPTH, "DDSD_ALPHABITDEPTH");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_LPSURFACE, "DDSD_LPSURFACE");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_PIXELFORMAT, "DDSD_PIXELFORMAT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_MIPMAPCOUNT, "DDSD_MIPMAPCOUNT");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_LINEARSIZE, "DDSD_LINEARSIZE");
+ recognizedAny |= printIfRecognized(tty, header.flags, DDSD_DEPTH, "DDSD_DEPTH");
+ if (!recognizedAny) {
+ tty.println("(none)");
+ }
+ tty.println("Raw SurfaceDesc flags: 0x" + Integer.toHexString(header.flags));
+ tty.println("Pixel format flags:");
+ recognizedAny = false;
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ALPHAPIXELS, "DDPF_ALPHAPIXELS");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ALPHA, "DDPF_ALPHA");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_FOURCC, "DDPF_FOURCC");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED4, "DDPF_PALETTEINDEXED4");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXEDTO8, "DDPF_PALETTEINDEXEDTO8");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED8, "DDPF_PALETTEINDEXED8");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_RGB, "DDPF_RGB");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_COMPRESSED, "DDPF_COMPRESSED");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_RGBTOYUV, "DDPF_RGBTOYUV");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_YUV, "DDPF_YUV");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ZBUFFER, "DDPF_ZBUFFER");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED1, "DDPF_PALETTEINDEXED1");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_PALETTEINDEXED2, "DDPF_PALETTEINDEXED2");
+ recognizedAny |= printIfRecognized(tty, header.pfFlags, DDPF_ZPIXELS, "DDPF_ZPIXELS");
+ if (!recognizedAny) {
+ tty.println("(none)");
+ }
+ tty.println("Raw pixel format flags: 0x" + Integer.toHexString(header.pfFlags));
+ tty.println("Depth: " + getDepth());
+ tty.println("Number of mip maps: " + getNumMipMaps());
+ int fmt = getPixelFormat();
+ tty.print("Pixel format: ");
+ switch (fmt) {
+ case D3DFMT_R8G8B8: tty.println("D3DFMT_R8G8B8"); break;
+ case D3DFMT_A8R8G8B8: tty.println("D3DFMT_A8R8G8B8"); break;
+ case D3DFMT_X8R8G8B8: tty.println("D3DFMT_X8R8G8B8"); break;
+ case D3DFMT_DXT1: tty.println("D3DFMT_DXT1"); break;
+ case D3DFMT_DXT2: tty.println("D3DFMT_DXT2"); break;
+ case D3DFMT_DXT3: tty.println("D3DFMT_DXT3"); break;
+ case D3DFMT_DXT4: tty.println("D3DFMT_DXT4"); break;
+ case D3DFMT_DXT5: tty.println("D3DFMT_DXT5"); break;
+ case D3DFMT_UNKNOWN: tty.println("D3DFMT_UNKNOWN"); break;
+ default: tty.println("(unknown pixel format " + fmt + ")"); break;
+ }
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private static final int MAGIC = 0x20534444;
+
+ static class Header {
+ int size; // size of the DDSURFACEDESC structure
+ int flags; // determines what fields are valid
+ int height; // height of surface to be created
+ int width; // width of input surface
+ int pitchOrLinearSize;
+ int backBufferCountOrDepth;
+ int mipMapCountOrAux; // number of mip-map levels requested (in this context)
+ int alphaBitDepth; // depth of alpha buffer requested
+ int reserved1; // reserved
+ int surface; // pointer to the associated surface memory
+ // NOTE: following two entries are from DDCOLORKEY data structure
+ // Are overlaid with color for empty cubemap faces (unused in this reader)
+ int colorSpaceLowValue;
+ int colorSpaceHighValue;
+ int destBltColorSpaceLowValue;
+ int destBltColorSpaceHighValue;
+ int srcOverlayColorSpaceLowValue;
+ int srcOverlayColorSpaceHighValue;
+ int srcBltColorSpaceLowValue;
+ int srcBltColorSpaceHighValue;
+ // NOTE: following entries are from DDPIXELFORMAT data structure
+ // Are overlaid with flexible vertex format description of vertex
+ // buffers (unused in this reader)
+ int pfSize; // size of DDPIXELFORMAT structure
+ int pfFlags; // pixel format flags
+ int pfFourCC; // (FOURCC code)
+ // Following five entries have multiple interpretations, not just
+ // RGBA (but that's all we support right now)
+ int pfRGBBitCount; // how many bits per pixel
+ int pfRBitMask; // mask for red bits
+ int pfGBitMask; // mask for green bits
+ int pfBBitMask; // mask for blue bits
+ int pfABitMask; // mask for alpha channel
+ int ddsCaps1; // Texture and mip-map flags
+ int ddsCaps2; // Advanced capabilities including cubemap support
+ int ddsCapsReserved1;
+ int ddsCapsReserved2;
+ int textureStage; // stage in multitexture cascade
+
+ void read(ByteBuffer buf) throws IOException {
+ int magic = buf.getInt();
+ if (magic != MAGIC) {
+ throw new IOException("Incorrect magic number 0x" +
+ Integer.toHexString(magic) +
+ " (expected " + MAGIC + ")");
+ }
+
+ size = buf.getInt();
+ flags = buf.getInt();
+ height = buf.getInt();
+ width = buf.getInt();
+ pitchOrLinearSize = buf.getInt();
+ backBufferCountOrDepth = buf.getInt();
+ mipMapCountOrAux = buf.getInt();
+ alphaBitDepth = buf.getInt();
+ reserved1 = buf.getInt();
+ surface = buf.getInt();
+ colorSpaceLowValue = buf.getInt();
+ colorSpaceHighValue = buf.getInt();
+ destBltColorSpaceLowValue = buf.getInt();
+ destBltColorSpaceHighValue = buf.getInt();
+ srcOverlayColorSpaceLowValue = buf.getInt();
+ srcOverlayColorSpaceHighValue = buf.getInt();
+ srcBltColorSpaceLowValue = buf.getInt();
+ srcBltColorSpaceHighValue = buf.getInt();
+ pfSize = buf.getInt();
+ pfFlags = buf.getInt();
+ pfFourCC = buf.getInt();
+ pfRGBBitCount = buf.getInt();
+ pfRBitMask = buf.getInt();
+ pfGBitMask = buf.getInt();
+ pfBBitMask = buf.getInt();
+ pfABitMask = buf.getInt();
+ ddsCaps1 = buf.getInt();
+ ddsCaps2 = buf.getInt();
+ ddsCapsReserved1 = buf.getInt();
+ ddsCapsReserved2 = buf.getInt();
+ textureStage = buf.getInt();
+ }
+
+ // buf must be in little-endian byte order
+ void write(ByteBuffer buf) {
+ buf.putInt(MAGIC);
+ buf.putInt(size);
+ buf.putInt(flags);
+ buf.putInt(height);
+ buf.putInt(width);
+ buf.putInt(pitchOrLinearSize);
+ buf.putInt(backBufferCountOrDepth);
+ buf.putInt(mipMapCountOrAux);
+ buf.putInt(alphaBitDepth);
+ buf.putInt(reserved1);
+ buf.putInt(surface);
+ buf.putInt(colorSpaceLowValue);
+ buf.putInt(colorSpaceHighValue);
+ buf.putInt(destBltColorSpaceLowValue);
+ buf.putInt(destBltColorSpaceHighValue);
+ buf.putInt(srcOverlayColorSpaceLowValue);
+ buf.putInt(srcOverlayColorSpaceHighValue);
+ buf.putInt(srcBltColorSpaceLowValue);
+ buf.putInt(srcBltColorSpaceHighValue);
+ buf.putInt(pfSize);
+ buf.putInt(pfFlags);
+ buf.putInt(pfFourCC);
+ buf.putInt(pfRGBBitCount);
+ buf.putInt(pfRBitMask);
+ buf.putInt(pfGBitMask);
+ buf.putInt(pfBBitMask);
+ buf.putInt(pfABitMask);
+ buf.putInt(ddsCaps1);
+ buf.putInt(ddsCaps2);
+ buf.putInt(ddsCapsReserved1);
+ buf.putInt(ddsCapsReserved2);
+ buf.putInt(textureStage);
+ }
+
+ private static int size() {
+ return 124;
+ }
+
+ private static int pfSize() {
+ return 32;
+ }
+
+ private static int writtenSize() {
+ return 128;
+ }
+ }
+
+ private DDSImage() {
+ }
+
+ private void readFromFile(File file) throws IOException {
+ fis = new FileInputStream(file);
+ chan = fis.getChannel();
+ ByteBuffer buf = chan.map(FileChannel.MapMode.READ_ONLY,
+ 0, (int) file.length());
+ readFromBuffer(buf);
+ }
+
+ private void readFromBuffer(ByteBuffer buf) throws IOException {
+ this.buf = buf;
+ buf.order(ByteOrder.LITTLE_ENDIAN);
+ header = new Header();
+ header.read(buf);
+ fixupHeader();
+ }
+
+ private void initFromData(int d3dFormat,
+ int width,
+ int height,
+ ByteBuffer[] mipmapData) throws IllegalArgumentException {
+ // Check size of mipmap data compared against format, width and
+ // height
+ int topmostMipmapSize = width * height;
+ int pitchOrLinearSize = width;
+ boolean isCompressed = false;
+ switch (d3dFormat) {
+ case D3DFMT_R8G8B8: topmostMipmapSize *= 3; pitchOrLinearSize *= 3; break;
+ case D3DFMT_A8R8G8B8: topmostMipmapSize *= 4; pitchOrLinearSize *= 4; break;
+ case D3DFMT_X8R8G8B8: topmostMipmapSize *= 4; pitchOrLinearSize *= 4; break;
+ case D3DFMT_DXT1:
+ case D3DFMT_DXT2:
+ case D3DFMT_DXT3:
+ case D3DFMT_DXT4:
+ case D3DFMT_DXT5:
+ topmostMipmapSize = computeCompressedBlockSize(width, height, 1, d3dFormat);
+ pitchOrLinearSize = topmostMipmapSize;
+ isCompressed = true;
+ break;
+ default:
+ throw new IllegalArgumentException("d3dFormat must be one of the known formats");
+ }
+
+ // Now check the mipmaps against this size
+ int curSize = topmostMipmapSize;
+ int totalSize = 0;
+ for (int i = 0; i < mipmapData.length; i++) {
+ if (mipmapData[i].remaining() != curSize) {
+ throw new IllegalArgumentException("Mipmap level " + i +
+ " didn't match expected data size (expected " + curSize + ", got " +
+ mipmapData[i].remaining() + ")");
+ }
+ curSize /= 4;
+ totalSize += mipmapData[i].remaining();
+ }
+
+ // OK, create one large ByteBuffer to hold all of the mipmap data
+ totalSize += Header.writtenSize();
+ ByteBuffer buf = ByteBuffer.allocate(totalSize);
+ buf.position(Header.writtenSize());
+ for (int i = 0; i < mipmapData.length; i++) {
+ buf.put(mipmapData[i]);
+ }
+ this.buf = buf;
+
+ // Allocate and initialize a Header
+ header = new Header();
+ header.size = Header.size();
+ header.flags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT;
+ if (mipmapData.length > 1) {
+ header.flags |= DDSD_MIPMAPCOUNT;
+ header.mipMapCountOrAux = mipmapData.length;
+ }
+ header.width = width;
+ header.height = height;
+ if (isCompressed) {
+ header.flags |= DDSD_LINEARSIZE;
+ header.pfFlags |= DDPF_FOURCC;
+ header.pfFourCC = d3dFormat;
+ } else {
+ header.flags |= DDSD_PITCH;
+ // Figure out the various settings from the pixel format
+ header.pfFlags |= DDPF_RGB;
+ switch (d3dFormat) {
+ case D3DFMT_R8G8B8: header.pfRGBBitCount = 24; break;
+ case D3DFMT_A8R8G8B8: header.pfRGBBitCount = 32; header.pfFlags |= DDPF_ALPHAPIXELS; break;
+ case D3DFMT_X8R8G8B8: header.pfRGBBitCount = 32; break;
+ }
+ header.pfRBitMask = 0x00FF0000;
+ header.pfGBitMask = 0x0000FF00;
+ header.pfBBitMask = 0x000000FF;
+ if (d3dFormat == D3DFMT_A8R8G8B8) {
+ header.pfABitMask = 0xFF000000;
+ }
+ }
+ header.pitchOrLinearSize = pitchOrLinearSize;
+ header.pfSize = Header.pfSize();
+ // Not sure whether we can get away with leaving the rest of the
+ // header blank
+ }
+
+ // Microsoft doesn't follow their own specifications and the
+ // simplest conversion using the DxTex tool to e.g. a DXT3 texture
+ // results in an illegal .dds file without either DDSD_PITCH or
+ // DDSD_LINEARSIZE set in the header's flags. This code, adapted
+ // from the DevIL library, fixes up the header in these situations.
+ private void fixupHeader() {
+ if (isCompressed() && !isSurfaceDescFlagSet(DDSD_LINEARSIZE)) {
+ // Figure out how big the linear size should be
+ int depth = header.backBufferCountOrDepth;
+ if (depth == 0) {
+ depth = 1;
+ }
+
+ header.pitchOrLinearSize = computeCompressedBlockSize(getWidth(), getHeight(), depth, getCompressionFormat());
+ header.flags |= DDSD_LINEARSIZE;
+ }
+ }
+
+ private static int computeCompressedBlockSize(int width,
+ int height,
+ int depth,
+ int compressionFormat) {
+ int blockSize = ((width + 3)/4) * ((height + 3)/4) * ((depth + 3)/4);
+ switch (compressionFormat) {
+ case D3DFMT_DXT1: blockSize *= 8; break;
+ default: blockSize *= 16; break;
+ }
+ return blockSize;
+ }
+
+ private int mipMapWidth(int map) {
+ int width = getWidth();
+ for (int i = 0; i < map; i++) {
+ width >>= 1;
+ }
+ return Math.max(width, 1);
+ }
+
+ private int mipMapHeight(int map) {
+ int height = getHeight();
+ for (int i = 0; i < map; i++) {
+ height >>= 1;
+ }
+ return Math.max(height, 1);
+ }
+
+ private int mipMapSizeInBytes(int map) {
+ int width = mipMapWidth(map);
+ int height = mipMapHeight(map);
+ if (isCompressed()) {
+ int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
+ return ((width+3)/4)*((height+3)/4)*blockSize;
+ } else {
+ return width * height * (getDepth() / 8);
+ }
+ }
+
+ private int sideSizeInBytes() {
+ int numLevels = getNumMipMaps();
+ if (numLevels == 0) {
+ numLevels = 1;
+ }
+
+ int size = 0;
+ for (int i = 0; i < numLevels; i++) {
+ size += mipMapSizeInBytes(i);
+ }
+
+ return size;
+ }
+
+ private int sideShiftInBytes(int side) {
+ int[] sides = {
+ DDSCAPS2_CUBEMAP_POSITIVEX,
+ DDSCAPS2_CUBEMAP_NEGATIVEX,
+ DDSCAPS2_CUBEMAP_POSITIVEY,
+ DDSCAPS2_CUBEMAP_NEGATIVEY,
+ DDSCAPS2_CUBEMAP_POSITIVEZ,
+ DDSCAPS2_CUBEMAP_NEGATIVEZ
+ };
+
+ int shift = 0;
+ int sideSize = sideSizeInBytes();
+ for (int i = 0; i < sides.length; i++) {
+ int temp = sides[i];
+ if ((temp & side) != 0) {
+ return shift;
+ }
+
+ shift += sideSize;
+ }
+
+ throw new RuntimeException("Illegal side: " + side);
+ }
+
+ private boolean printIfRecognized(PrintStream tty, int flags, int flag, String what) {
+ if ((flags & flag) != 0) {
+ tty.println(what);
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java
new file mode 100755
index 000000000..b2b1226bd
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataInputStream.java
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi;
+
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.FilterInputStream;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.EOFException;
+import java.io.IOException;
+
+/**
+ * Little Endian Data Input Stream.
+ *
+ * This class implements an input stream filter to allow reading
+ * of java native datatypes from an input stream which has those
+ * native datatypes stored in a little endian byte order.<p>
+ *
+ * This is the sister class of the DataInputStream which allows
+ * for reading of java native datatypes from an input stream with
+ * the datatypes stored in big endian byte order.<p>
+ *
+ * This class implements the minimum required and calls DataInputStream
+ * for some of the required methods for DataInput.<p>
+ *
+ * Not all methods are implemented due to lack of immediatte requirement
+ * for that functionality. It is not clear if it is ever going to be
+ * functionally required to be able to read UTF data in a LittleEndianManner<p>
+ *
+ * @author Robin Luiten
+ * @version 1.1 15/Dec/1997
+ */
+public class LEDataInputStream extends FilterInputStream implements DataInput
+{
+ /**
+ * To reuse some of the non endian dependent methods from
+ * DataInputStreams methods.
+ */
+ DataInputStream dataIn;
+
+ public LEDataInputStream(InputStream in)
+ {
+ super(in);
+ dataIn = new DataInputStream(in);
+ }
+
+ public void close() throws IOException
+ {
+ dataIn.close(); // better close as we create it.
+ // this will close underlying as well.
+ }
+
+ public synchronized final int read(byte b[]) throws IOException
+ {
+ return dataIn.read(b, 0, b.length);
+ }
+
+ public synchronized final int read(byte b[], int off, int len) throws IOException
+ {
+ int rl = dataIn.read(b, off, len);
+ return rl;
+ }
+
+ public final void readFully(byte b[]) throws IOException
+ {
+ dataIn.readFully(b, 0, b.length);
+ }
+
+ public final void readFully(byte b[], int off, int len) throws IOException
+ {
+ dataIn.readFully(b, off, len);
+ }
+
+ public final int skipBytes(int n) throws IOException
+ {
+ return dataIn.skipBytes(n);
+ }
+
+ public final boolean readBoolean() throws IOException
+ {
+ int ch = dataIn.read();
+ if (ch < 0)
+ throw new EOFException();
+ return (ch != 0);
+ }
+
+ public final byte readByte() throws IOException
+ {
+ int ch = dataIn.read();
+ if (ch < 0)
+ throw new EOFException();
+ return (byte)(ch);
+ }
+
+ public final int readUnsignedByte() throws IOException
+ {
+ int ch = dataIn.read();
+ if (ch < 0)
+ throw new EOFException();
+ return ch;
+ }
+
+ public final short readShort() throws IOException
+ {
+ int ch1 = dataIn.read();
+ int ch2 = dataIn.read();
+ if ((ch1 | ch2) < 0)
+ throw new EOFException();
+ return (short)((ch1 << 0) + (ch2 << 8));
+ }
+
+ public final int readUnsignedShort() throws IOException
+ {
+ int ch1 = dataIn.read();
+ int ch2 = dataIn.read();
+ if ((ch1 | ch2) < 0)
+ throw new EOFException();
+ return (ch1 << 0) + (ch2 << 8);
+ }
+
+ public final char readChar() throws IOException
+ {
+ int ch1 = dataIn.read();
+ int ch2 = dataIn.read();
+ if ((ch1 | ch2) < 0)
+ throw new EOFException();
+ return (char)((ch1 << 0) + (ch2 << 8));
+ }
+
+ public final int readInt() throws IOException
+ {
+ int ch1 = dataIn.read();
+ int ch2 = dataIn.read();
+ int ch3 = dataIn.read();
+ int ch4 = dataIn.read();
+ if ((ch1 | ch2 | ch3 | ch4) < 0)
+ throw new EOFException();
+ return ((ch1 << 0) + (ch2 << 8) + (ch3 << 16) + (ch4 << 24));
+ }
+
+ public final long readLong() throws IOException
+ {
+ int i1 = readInt();
+ int i2 = readInt();
+ return ((long)(i1) & 0xFFFFFFFFL) + (i2 << 32);
+ }
+
+ public final float readFloat() throws IOException
+ {
+ return Float.intBitsToFloat(readInt());
+ }
+
+ public final double readDouble() throws IOException
+ {
+ return Double.longBitsToDouble(readLong());
+ }
+
+ /**
+ * dont call this it is not implemented.
+ * @return empty new string
+ **/
+ public final String readLine() throws IOException
+ {
+ return new String();
+ }
+
+ /**
+ * dont call this it is not implemented
+ * @return empty new string
+ **/
+ public final String readUTF() throws IOException
+ {
+ return new String();
+ }
+
+ /**
+ * dont call this it is not implemented
+ * @return empty new string
+ **/
+ public final static String readUTF(DataInput in) throws IOException
+ {
+ return new String();
+ }
+}
+
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java
new file mode 100755
index 000000000..730ec0dbd
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/LEDataOutputStream.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi;
+
+import java.io.DataOutput;
+import java.io.DataOutputStream;
+import java.io.FilterOutputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * Little Endian Data Output Stream.
+ *
+ * This class implements an output stream filter to allow writing
+ * of java native datatypes to an output stream which has those
+ * native datatypes stored in a little endian byte order.<p>
+ *
+ * This is the sister class of the DataOutputStream which allows
+ * for writing of java native datatypes to an output stream with
+ * the datatypes stored in big endian byte order.<p>
+ *
+ * This class implements the minimum required and calls DataOutputStream
+ * for some of the required methods for DataOutput.<p>
+ *
+ * Not all methods are implemented due to lack of immediate requirement
+ * for that functionality. It is not clear if it is ever going to be
+ * functionally required to be able to read UTF data in a LittleEndianManner<p>
+ *
+ */
+public class LEDataOutputStream extends FilterOutputStream implements DataOutput
+{
+ /**
+ * To reuse some of the non endian dependent methods from
+ * DataOutputStream's methods.
+ */
+ DataOutputStream dataOut;
+
+ public LEDataOutputStream(OutputStream out)
+ {
+ super(out);
+ dataOut = new DataOutputStream(out);
+ }
+
+ public void close() throws IOException
+ {
+ dataOut.close(); // better close as we create it.
+ // this will close underlying as well.
+ }
+
+ public synchronized final void write(byte b[]) throws IOException
+ {
+ dataOut.write(b, 0, b.length);
+ }
+
+ public synchronized final void write(byte b[], int off, int len) throws IOException
+ {
+ dataOut.write(b, off, len);
+ }
+
+ public final void write(int b) throws IOException
+ {
+ dataOut.write(b);
+ }
+
+ public final void writeBoolean(boolean v) throws IOException
+ {
+ dataOut.writeBoolean(v);
+ }
+
+ public final void writeByte(int v) throws IOException
+ {
+ dataOut.writeByte(v);
+ }
+
+ /** Don't call this -- not implemented */
+ public final void writeBytes(String s) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public final void writeChar(int v) throws IOException
+ {
+ dataOut.writeChar(((v >> 8) & 0xff) |
+ ((v & 0xff) << 8));
+ }
+
+ /** Don't call this -- not implemented */
+ public final void writeChars(String s) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public final void writeDouble(double v) throws IOException
+ {
+ writeLong(Double.doubleToRawLongBits(v));
+ }
+
+ public final void writeFloat(float v) throws IOException
+ {
+ writeInt(Float.floatToRawIntBits(v));
+ }
+
+ public final void writeInt(int v) throws IOException
+ {
+ dataOut.writeInt((v >>> 24) |
+ ((v >>> 8) & 0xff00) |
+ ((v << 8) & 0x00ff00) |
+ (v << 24));
+ }
+
+ public final void writeLong(long v) throws IOException
+ {
+ writeInt((int) v);
+ writeInt((int) (v >>> 32));
+ }
+
+ public final void writeShort(int v) throws IOException
+ {
+ dataOut.writeShort(((v >> 8) & 0xff) |
+ ((v & 0xff) << 8));
+ }
+
+ /** Don't call this -- not implemented */
+ public final void writeUTF(String s) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java
new file mode 100755
index 000000000..284fa64bd
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/SGIImage.java
@@ -0,0 +1,670 @@
+/*
+ * Portions Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi;
+
+import java.io.*;
+import javax.media.opengl.*;
+import com.sun.opengl.util.*;
+
+/** <p> Reads and writes SGI RGB/RGBA images. </p>
+
+ <p> Written from <a href =
+ "http://astronomy.swin.edu.au/~pbourke/dataformats/sgirgb/">Paul
+ Bourke's adaptation</a> of the <a href =
+ "http://astronomy.swin.edu.au/~pbourke/dataformats/sgirgb/sgiversion.html">SGI
+ specification</a>. </p>
+*/
+
+public class SGIImage {
+ private Header header;
+ private int format;
+ private byte[] data;
+ // Used for decoding RLE-compressed images
+ private int[] rowStart;
+ private int[] rowSize;
+ private int rleEnd;
+ private byte[] tmpData;
+ private byte[] tmpRead;
+
+ private static final int MAGIC = 474;
+
+ static class Header {
+ short magic; // IRIS image file magic number
+ // This should be decimal 474
+ byte storage; // Storage format
+ // 0 for uncompressed
+ // 1 for RLE compression
+ byte bpc; // Number of bytes per pixel channel
+ // Legally 1 or 2
+ short dimension; // Number of dimensions
+ // Legally 1, 2, or 3
+ // 1 means a single row, XSIZE long
+ // 2 means a single 2D image
+ // 3 means multiple 2D images
+ short xsize; // X size in pixels
+ short ysize; // Y size in pixels
+ short zsize; // Number of channels
+ // 1 indicates greyscale
+ // 3 indicates RGB
+ // 4 indicates RGB and Alpha
+ int pixmin; // Minimum pixel value
+ // This is the lowest pixel value in the image
+ int pixmax; // Maximum pixel value
+ // This is the highest pixel value in the image
+ int dummy; // Ignored
+ // Normally set to 0
+ String imagename; // Image name; 80 bytes long
+ // Must be null terminated, therefore at most 79 bytes
+ int colormap; // Colormap ID
+ // 0 - normal mode
+ // 1 - dithered, 3 mits for red and green, 2 for blue, obsolete
+ // 2 - index colour, obsolete
+ // 3 - not an image but a colourmap
+ // 404 bytes char DUMMY Ignored
+ // Should be set to 0, makes the header 512 bytes.
+
+ Header() {
+ magic = MAGIC;
+ }
+
+ Header(DataInputStream in) throws IOException {
+ magic = in.readShort();
+ storage = in.readByte();
+ bpc = in.readByte();
+ dimension = in.readShort();
+ xsize = in.readShort();
+ ysize = in.readShort();
+ zsize = in.readShort();
+ pixmin = in.readInt();
+ pixmax = in.readInt();
+ dummy = in.readInt();
+ byte[] tmpname = new byte[80];
+ in.read(tmpname);
+ int numChars = 0;
+ while (tmpname[numChars++] != 0);
+ imagename = new String(tmpname, 0, numChars);
+ colormap = in.readInt();
+ byte[] tmp = new byte[404];
+ in.read(tmp);
+ }
+
+ public String toString() {
+ return ("magic: " + magic +
+ " storage: " + (int) storage +
+ " bpc: " + (int) bpc +
+ " dimension: " + dimension +
+ " xsize: " + xsize +
+ " ysize: " + ysize +
+ " zsize: " + zsize +
+ " pixmin: " + pixmin +
+ " pixmax: " + pixmax +
+ " imagename: " + imagename +
+ " colormap: " + colormap);
+ }
+ }
+
+ private SGIImage(Header header) {
+ this.header = header;
+ }
+
+ /** Reads an SGI image from the specified file. */
+ public static SGIImage read(String filename) throws IOException {
+ return read(new FileInputStream(filename));
+ }
+
+ /** Reads an SGI image from the specified InputStream. */
+ public static SGIImage read(InputStream in) throws IOException {
+ DataInputStream dIn = new DataInputStream(new BufferedInputStream(in));
+
+ Header header = new Header(dIn);
+ SGIImage res = new SGIImage(header);
+ res.decodeImage(dIn);
+ return res;
+ }
+
+ /** Writes this SGIImage to the specified file name. If
+ flipVertically is set, outputs the scanlines from top to bottom
+ rather than the default bottom to top order. */
+ public void write(String filename, boolean flipVertically) throws IOException {
+ write(new File(filename), flipVertically);
+ }
+
+ /** Writes this SGIImage to the specified file. If flipVertically is
+ set, outputs the scanlines from top to bottom rather than the
+ default bottom to top order. */
+ public void write(File file, boolean flipVertically) throws IOException {
+ writeImage(file, data, header.xsize, header.ysize, header.zsize, flipVertically);
+ }
+
+ /** Creates an SGIImage from the specified data in either RGB or
+ RGBA format. */
+ public static SGIImage createFromData(int width,
+ int height,
+ boolean hasAlpha,
+ byte[] data) {
+ Header header = new Header();
+ header.xsize = (short) width;
+ header.ysize = (short) height;
+ header.zsize = (short) (hasAlpha ? 4 : 3);
+ SGIImage image = new SGIImage(header);
+ image.data = data;
+ return image;
+ }
+
+ /** Determines from the magic number whether the given InputStream
+ points to an SGI RGB image. The given InputStream must return
+ true from markSupported() and support a minimum of two bytes
+ of read-ahead. */
+ public static boolean isSGIImage(InputStream in) throws IOException {
+ if (!(in instanceof BufferedInputStream)) {
+ in = new BufferedInputStream(in);
+ }
+ if (!in.markSupported()) {
+ throw new IOException("Can not test non-destructively whether given InputStream is an SGI RGB image");
+ }
+ DataInputStream dIn = new DataInputStream(in);
+ dIn.mark(4);
+ short magic = dIn.readShort();
+ dIn.reset();
+ return (magic == MAGIC);
+ }
+
+ /** Returns the width of the image. */
+ public int getWidth() {
+ return header.xsize;
+ }
+
+ /** Returns the height of the image. */
+ public int getHeight() {
+ return header.ysize;
+ }
+
+ /** Returns the OpenGL format for this texture; e.g. GL.GL_RGB or GL.GL_RGBA. */
+ public int getFormat() {
+ return format;
+ }
+
+ /** Returns the raw data for this texture in the correct
+ (bottom-to-top) order for calls to glTexImage2D. */
+ public byte[] getData() { return data; }
+
+ public String toString() {
+ return header.toString();
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void decodeImage(DataInputStream in) throws IOException {
+ if (header.storage == 1) {
+ // Read RLE compression data; row starts and sizes
+ int x = header.ysize * header.zsize;
+ rowStart = new int[x];
+ rowSize = new int[x];
+ rleEnd = 4 * 2 * x + 512;
+ for (int i = 0; i < x; i++) {
+ rowStart[i] = in.readInt();
+ }
+ for (int i = 0; i < x; i++) {
+ rowSize[i] = in.readInt();
+ }
+ tmpRead = new byte[header.xsize * 256];
+ }
+ tmpData = readAll(in);
+
+ int xsize = header.xsize;
+ int ysize = header.ysize;
+ int zsize = header.zsize;
+ int lptr = 0;
+
+ data = new byte[xsize * ysize * 4];
+ byte[] rbuf = new byte[xsize];
+ byte[] gbuf = new byte[xsize];
+ byte[] bbuf = new byte[xsize];
+ byte[] abuf = new byte[xsize];
+ for (int y = 0; y < ysize; y++) {
+ if (zsize >= 4) {
+ getRow(rbuf, y, 0);
+ getRow(gbuf, y, 1);
+ getRow(bbuf, y, 2);
+ getRow(abuf, y, 3);
+ rgbatorgba(rbuf, gbuf, bbuf, abuf, data, lptr);
+ } else if (zsize == 3) {
+ getRow(rbuf, y, 0);
+ getRow(gbuf, y, 1);
+ getRow(bbuf, y, 2);
+ rgbtorgba(rbuf, gbuf, bbuf, data, lptr);
+ } else if (zsize == 2) {
+ getRow(rbuf, y, 0);
+ getRow(abuf, y, 1);
+ latorgba(rbuf, abuf, data, lptr);
+ } else {
+ getRow(rbuf, y, 0);
+ bwtorgba(rbuf, data, lptr);
+ }
+ lptr += 4 * xsize;
+ }
+ rowStart = null;
+ rowSize = null;
+ tmpData = null;
+ tmpRead = null;
+ format = GL.GL_RGBA;
+ header.zsize = 4;
+ }
+
+ private void getRow(byte[] buf, int y, int z) {
+ if (header.storage == 1) {
+ int offs = rowStart[y + z * header.ysize] - rleEnd;
+ System.arraycopy(tmpData, offs, tmpRead, 0, rowSize[y + z * header.ysize]);
+ int iPtr = 0;
+ int oPtr = 0;
+ for (;;) {
+ byte pixel = tmpRead[iPtr++];
+ int count = (int) (pixel & 0x7F);
+ if (count == 0) {
+ return;
+ }
+ if ((pixel & 0x80) != 0) {
+ while ((count--) > 0) {
+ buf[oPtr++] = tmpRead[iPtr++];
+ }
+ } else {
+ pixel = tmpRead[iPtr++];
+ while ((count--) > 0) {
+ buf[oPtr++] = pixel;
+ }
+ }
+ }
+ } else {
+ int offs = (y * header.xsize) + (z * header.xsize * header.ysize);
+ System.arraycopy(tmpData, offs, buf, 0, header.xsize);
+ }
+ }
+
+ private void bwtorgba(byte[] b, byte[] dest, int lptr) {
+ for (int i = 0; i < b.length; i++) {
+ dest[4 * i + lptr + 0] = b[i];
+ dest[4 * i + lptr + 1] = b[i];
+ dest[4 * i + lptr + 2] = b[i];
+ dest[4 * i + lptr + 3] = (byte) 0xFF;
+ }
+ }
+
+ private void latorgba(byte[] b, byte[] a, byte[] dest, int lptr) {
+ for (int i = 0; i < b.length; i++) {
+ dest[4 * i + lptr + 0] = b[i];
+ dest[4 * i + lptr + 1] = b[i];
+ dest[4 * i + lptr + 2] = b[i];
+ dest[4 * i + lptr + 3] = a[i];
+ }
+ }
+
+ private void rgbtorgba(byte[] r, byte[] g, byte[] b, byte[] dest, int lptr) {
+ for (int i = 0; i < b.length; i++) {
+ dest[4 * i + lptr + 0] = r[i];
+ dest[4 * i + lptr + 1] = g[i];
+ dest[4 * i + lptr + 2] = b[i];
+ dest[4 * i + lptr + 3] = (byte) 0xFF;
+ }
+ }
+
+ private void rgbatorgba(byte[] r, byte[] g, byte[] b, byte[] a, byte[] dest, int lptr) {
+ for (int i = 0; i < b.length; i++) {
+ dest[4 * i + lptr + 0] = r[i];
+ dest[4 * i + lptr + 1] = g[i];
+ dest[4 * i + lptr + 2] = b[i];
+ dest[4 * i + lptr + 3] = a[i];
+ }
+ }
+
+ private static byte imgref(byte[] i,
+ int x,
+ int y,
+ int z,
+ int xs,
+ int ys,
+ int zs) {
+ return i[(xs*ys*z)+(xs*y)+x];
+ }
+
+
+ private void writeHeader(DataOutputStream stream,
+ int xsize, int ysize, int zsize, boolean rle) throws IOException {
+ // effects: outputs the 512-byte IRIS RGB header to STREAM, using xsize,
+ // ysize, and depth as the dimensions of the image. NOTE that
+ // the following defaults are used:
+ // STORAGE = 1 (storage format = RLE)
+ // BPC = 1 (# bytes/channel)
+ // DIMENSION = 3
+ // PIXMIN = 0
+ // PIXMAX = 255
+ // IMAGENAME = <80 nulls>
+ // COLORMAP = 0
+ // See ftp://ftp.sgi.com/pub/sgi/SGIIMAGESPEC for more details.
+
+ // write out MAGIC, STORAGE, BPC
+ stream.writeShort(474);
+ stream.write((rle ? 1 : 0));
+ stream.write(1);
+
+ // write out DIMENSION
+ stream.writeShort(3);
+
+ // write XSIZE, YSIZE, ZSIZE
+ stream.writeShort(xsize);
+ stream.writeShort(ysize);
+ stream.writeShort(zsize);
+
+ // write PIXMIN, PIXMAX
+ stream.writeInt(0);
+ stream.writeInt(255);
+
+ // write DUMMY
+ stream.writeInt(0);
+
+ // write IMAGENAME
+ for (int i = 0; i < 80; i++)
+ stream.write(0);
+
+ // write COLORMAP
+ stream.writeInt(0);
+
+ // write DUMMY (404 bytes)
+ for (int i = 0; i < 404; i++)
+ stream.write(0);
+ }
+
+ private void writeImage(File file,
+ byte[] data,
+ int xsize,
+ int ysize,
+ int zsize,
+ boolean yflip) throws IOException {
+ // Input data is in RGBRGBRGB or RGBARGBARGBA format; first unswizzle it
+ byte[] tmpData = new byte[xsize * ysize * zsize];
+ int dest = 0;
+ for (int i = 0; i < zsize; i++) {
+ for (int j = i; j < (xsize * ysize * zsize); j += zsize) {
+ tmpData[dest++] = data[j];
+ }
+ }
+ data = tmpData;
+
+ // requires: DATA must be an array of size XSIZE * YSIZE * ZSIZE,
+ // indexed in the following manner:
+ // data[0] ...data[xsize-1] == first row of first channel
+ // data[xsize]...data[2*xsize-1] == second row of first channel
+ // ... data[(ysize - 1) * xsize]...data[(ysize * xsize) - 1] ==
+ // last row of first channel
+ // Later channels follow the same format.
+ // *** NOTE that "first row" is defined by the BOTTOM ROW of
+ // the image. That is, the origin is in the lower left corner.
+ // effects: writes out an SGI image to FILE, RLE-compressed, INCLUDING
+ // header, of dimensions (xsize, ysize, zsize), and containing
+ // the data in DATA. If YFLIP is set, outputs the data in DATA
+ // in reverse order vertically (equivalent to a flip about the
+ // x axis).
+
+ // Build the offset tables
+ int[] starttab = new int[ysize * zsize];
+ int[] lengthtab = new int[ysize * zsize];
+
+ // Temporary buffer for holding RLE data.
+ // Note that this makes the assumption that RLE-compressed data will
+ // never exceed twice the size of the input data.
+ // There are surely formal proofs about how big the RLE buffer should
+ // be, as well as what the optimal look-ahead size is (i.e. don't switch
+ // copy/repeat modes for less than N repeats). However, I'm going from
+ // empirical evidence here; the break-even point seems to be a look-
+ // ahead of 3. (That is, if the three values following this one are all
+ // the same as the current value, switch to repeat mode.)
+ int lookahead = 3;
+ byte[] rlebuf = new byte[2 * xsize * ysize * zsize];
+
+ int cur_loc = 0; // current offset location.
+ int ptr = 0;
+ int total_size = 0;
+ int ystart = 0;
+ int yincr = 1;
+ int yend = ysize;
+
+ if (yflip) {
+ ystart = ysize - 1;
+ yend = -1;
+ yincr = -1;
+ }
+
+ boolean DEBUG = false;
+
+ for (int z = 0; z < zsize; z++) {
+ for (int y = ystart; y != yend; y += yincr) {
+ // RLE-compress each row.
+
+ int x = 0;
+ byte count = 0;
+ boolean repeat_mode = false;
+ boolean should_switch = false;
+ int start_ptr = ptr;
+ int num_ptr = ptr++;
+ byte repeat_val = 0;
+
+ while (x < xsize) {
+ // see if we should switch modes
+ should_switch = false;
+ if (repeat_mode) {
+ if (imgref(data, x, y, z, xsize, ysize, zsize) != repeat_val) {
+ should_switch = true;
+ }
+ } else {
+ // look ahead to see if we should switch to repeat mode.
+ // stay within the scanline for the lookahead
+ if ((x + lookahead) < xsize) {
+ should_switch = true;
+ for (int i = 1; i <= lookahead; i++) {
+ if (DEBUG)
+ System.err.println("left side was " + ((int) imgref(data, x, y, z, xsize, ysize, zsize)) +
+ ", right side was " + (int)imgref(data, x+i, y, z, xsize, ysize, zsize));
+
+ if (imgref(data, x, y, z, xsize, ysize, zsize) !=
+ imgref(data, x+i, y, z, xsize, ysize, zsize))
+ should_switch = false;
+ }
+ }
+ }
+
+ if (should_switch || (count == 127)) {
+ // update the number of elements we repeated/copied
+ if (x > 0) {
+ if (repeat_mode)
+ rlebuf[num_ptr] = count;
+ else
+ rlebuf[num_ptr] = (byte) (count | 0x80);
+ }
+ // perform mode switch if necessary; output repeat_val if
+ // switching FROM repeat mode, and set it if switching
+ // TO repeat mode.
+ if (repeat_mode) {
+ if (should_switch)
+ repeat_mode = false;
+ rlebuf[ptr++] = repeat_val;
+ } else {
+ if (should_switch)
+ repeat_mode = true;
+ repeat_val = imgref(data, x, y, z, xsize, ysize, zsize);
+ }
+
+ if (x > 0) {
+ // reset the number pointer
+ num_ptr = ptr++;
+ // reset number of bytes copied
+ count = 0;
+ }
+ }
+
+ // if not in repeat mode, copy element to ptr
+ if (!repeat_mode) {
+ rlebuf[ptr++] = imgref(data, x, y, z, xsize, ysize, zsize);
+ }
+ count++;
+
+ if (x == xsize - 1) {
+ // Need to store the number of pixels we copied/repeated.
+ if (repeat_mode) {
+ rlebuf[num_ptr] = count;
+ // If we ended the row in repeat mode, store the
+ // repeated value
+ rlebuf[ptr++] = repeat_val;
+ }
+ else
+ rlebuf[num_ptr] = (byte) (count | 0x80);
+
+ // output zero counter for the last value in the row
+ rlebuf[ptr++] = 0;
+ }
+
+ x++;
+ }
+ // output this row's length into the length table
+ int rowlen = ptr - start_ptr;
+ if (yflip)
+ lengthtab[ysize*z+(ysize-y-1)] = rowlen;
+ else
+ lengthtab[ysize*z+y] = rowlen;
+ // add to the start table, and update the current offset
+ if (yflip)
+ starttab[ysize*z+(ysize-y-1)] = cur_loc;
+ else
+ starttab[ysize*z+y] = cur_loc;
+ cur_loc += rowlen;
+ }
+ }
+
+ // Now we have the offset tables computed, as well as the RLE data.
+ // Output this information to the file.
+ total_size = ptr;
+
+ if (DEBUG)
+ System.err.println("total_size was " + total_size);
+
+ DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
+
+ writeHeader(stream, xsize, ysize, zsize, true);
+
+ int SIZEOF_INT = 4;
+ for (int i = 0; i < (ysize * zsize); i++)
+ stream.writeInt(starttab[i] + 512 + (2 * ysize * zsize * SIZEOF_INT));
+ for (int i = 0; i < (ysize * zsize); i++)
+ stream.writeInt(lengthtab[i]);
+ for (int i = 0; i < total_size; i++)
+ stream.write(rlebuf[i]);
+
+ stream.close();
+ }
+
+ private byte[] readAll(DataInputStream in) throws IOException {
+ byte[] dest = new byte[16384];
+ int pos = 0;
+ int numRead = 0;
+
+ boolean done = false;
+
+ do {
+ numRead = in.read(dest, pos, dest.length - pos);
+ if (pos == dest.length) {
+ // Resize destination buffer
+ byte[] newDest = new byte[2 * dest.length];
+ System.arraycopy(dest, 0, newDest, 0, pos);
+ dest = newDest;
+ }
+ if (numRead > 0) {
+ pos += numRead;
+ }
+
+ done = ((numRead == -1) || (in.available() == 0));
+ } while (!done);
+
+ // Trim destination buffer
+ if (pos != dest.length) {
+ byte[] finalDest = new byte[pos];
+ System.arraycopy(dest, 0, finalDest, 0, pos);
+ dest = finalDest;
+ }
+
+ return dest;
+ }
+
+ // Test case
+ /*
+ import java.awt.image.*;
+ import javax.swing.*;
+
+ public static void main(String[] args) {
+ for (int i = 0; i < args.length; i++) {
+ try {
+ System.out.println(args[i] + ":");
+ SGIImage image = SGIImage.read(args[i]);
+ System.out.println(image);
+ BufferedImage img = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
+ WritableRaster raster = img.getRaster();
+ DataBufferByte db = (DataBufferByte) raster.getDataBuffer();
+ byte[] src = image.getData();
+ byte[] dest = db.getData();
+ for (int j = 0; j < src.length; j += 4) {
+ dest[j + 0] = src[j + 3];
+ dest[j + 1] = src[j + 2];
+ dest[j + 2] = src[j + 1];
+ dest[j + 3] = src[j + 0];
+ }
+ // System.arraycopy(src, 0, dest, 0, src.length);
+ ImageIcon icon = new ImageIcon(img);
+ JLabel label = new JLabel();
+ label.setIcon(icon);
+ JFrame frame = new JFrame(args[i]);
+ frame.getContentPane().add(label);
+ frame.pack();
+ frame.show();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ */
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp b/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp
new file mode 100755
index 000000000..c54713a5e
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javame_cdc_fp
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.*;
+
+/**
+ * Targa image reader and writer adapted from sources of the <a href =
+ * "http://java.sun.com/products/jimi/">Jimi</a> image I/O class library.
+ *
+ * <P>
+ *
+ * Image decoder for image data stored in TGA file format.
+ * Currently only the original TGA file format is supported. This is
+ * because the new TGA format has data at the end of the file, getting
+ * to the end of a file in an InputStream orient environment presents
+ * several difficulties which are avoided at the moment.
+ *
+ * <P>
+ *
+ * This is a simple decoder and is only setup to load a single image
+ * from the input stream
+ *
+ * <P>
+ *
+ * @author Robin Luiten
+ * @author Kenneth Russell
+ * @version $Revision: 1768 $
+ */
+
+public class TGAImage {
+ private Header header;
+ private int format;
+ private int bpp;
+ private ByteBuffer data;
+
+ private TGAImage(Header header) {
+ this.header = header;
+ }
+
+ /**
+ * This class reads in all of the TGA image header in addition it also
+ * reads in the imageID field as it is convenient to handle that here.
+ *
+ * @author Robin Luiten
+ * @version 1.1
+ */
+ public static class Header {
+ /** Set of possible file format TGA types */
+ public final static int TYPE_NEW = 0;
+ public final static int TYPE_OLD = 1;
+ public final static int TYPE_UNK = 2; // cant rewind stream so unknown for now.
+
+ /** Set of possible image types in TGA file */
+ public final static int NO_IMAGE = 0; // no image data
+ public final static int UCOLORMAPPED = 1; // uncompressed color mapped image
+ public final static int UTRUECOLOR = 2; // uncompressed true color image
+ public final static int UBLACKWHITE = 3; // uncompressed black and white image
+ public final static int COLORMAPPED = 9; // compressed color mapped image
+ public final static int TRUECOLOR = 10; // compressed true color image
+ public final static int BLACKWHITE = 11; // compressed black and white image
+
+ /** Field image descriptor bitfield values definitions */
+ public final static int ID_ATTRIBPERPIXEL = 0xF;
+ public final static int ID_RIGHTTOLEFT = 0x10;
+ public final static int ID_TOPTOBOTTOM = 0x20;
+ public final static int ID_INTERLEAVE = 0xC0;
+
+ /** Field image descriptor / interleave values */
+ public final static int I_NOTINTERLEAVED = 0;
+ public final static int I_TWOWAY = 1;
+ public final static int I_FOURWAY = 2;
+
+ /** Type of this TGA file format */
+ private int tgaType;
+
+ /** initial TGA image data fields */
+ private int idLength; // byte value
+ private int colorMapType; // byte value
+ private int imageType; // byte value
+
+ /** TGA image colour map fields */
+ private int firstEntryIndex;
+ private int colorMapLength;
+ private byte colorMapEntrySize;
+
+ /** TGA image specification fields */
+ private int xOrigin;
+ private int yOrigin;
+ private int width;
+ private int height;
+ private byte pixelDepth;
+ private byte imageDescriptor;
+
+ private byte[] imageIDbuf;
+ private String imageID;
+
+ // For construction from user data
+ Header() {
+ tgaType = TYPE_OLD; // dont try and get footer.
+ }
+
+ Header(LEDataInputStream in) throws IOException {
+ int ret;
+
+ tgaType = TYPE_OLD; // dont try and get footer.
+
+ // initial header fields
+ idLength = in.readUnsignedByte();
+ colorMapType = in.readUnsignedByte();
+ imageType = in.readUnsignedByte();
+
+ // color map header fields
+ firstEntryIndex = in.readUnsignedShort();
+ colorMapLength = in.readUnsignedShort();
+ colorMapEntrySize = in.readByte();
+
+ // TGA image specification fields
+ xOrigin = in.readUnsignedShort();
+ yOrigin = in.readUnsignedShort();
+ width = in.readUnsignedShort();
+ height = in.readUnsignedShort();
+ pixelDepth = in.readByte();
+ imageDescriptor = in.readByte();
+
+ if (idLength > 0) {
+ imageIDbuf = new byte[idLength];
+ in.read(imageIDbuf, 0, idLength);
+ imageID = new String(imageIDbuf, "US-ASCII");
+ }
+ }
+
+ public int tgaType() { return tgaType; }
+
+ /** initial TGA image data fields */
+ public int idLength() { return idLength; }
+ public int colorMapType() { return colorMapType; }
+ public int imageType() { return imageType; }
+
+ /** TGA image colour map fields */
+ public int firstEntryIndex() { return firstEntryIndex; }
+ public int colorMapLength() { return colorMapLength; }
+ public byte colorMapEntrySize() { return colorMapEntrySize; }
+
+ /** TGA image specification fields */
+ public int xOrigin() { return xOrigin; }
+ public int yOrigin() { return yOrigin; }
+ public int width() { return width; }
+ public int height() { return height; }
+ public byte pixelDepth() { return pixelDepth; }
+ public byte imageDescriptor() { return imageDescriptor; }
+
+ /** bitfields in imageDescriptor */
+ public byte attribPerPixel() { return (byte)(imageDescriptor & ID_ATTRIBPERPIXEL); }
+ public boolean rightToLeft() { return ((imageDescriptor & ID_RIGHTTOLEFT) != 0); }
+ public boolean topToBottom() { return ((imageDescriptor & ID_TOPTOBOTTOM) != 0); }
+ public byte interleave() { return (byte)((imageDescriptor & ID_INTERLEAVE) >> 6); }
+
+ public byte[] imageIDbuf() { return imageIDbuf; }
+ public String imageID() { return imageID; }
+
+ public String toString() {
+ return "TGA Header " +
+ " id length: " + idLength +
+ " color map type: "+ colorMapType +
+ " image type: "+ imageType +
+ " first entry index: " + firstEntryIndex +
+ " color map length: " + colorMapLength +
+ " color map entry size: " + colorMapEntrySize +
+ " x Origin: " + xOrigin +
+ " y Origin: " + yOrigin +
+ " width: "+ width +
+ " height: "+ height +
+ " pixel depth: "+ pixelDepth +
+ " image descriptor: "+ imageDescriptor +
+ (imageIDbuf == null ? "" : (" ID String: " + imageID));
+ }
+
+ public int size() { return 18 + idLength; }
+
+ private void write(LEDataOutputStream output) throws IOException {
+ output.write(idLength);
+ output.write(colorMapType);
+ output.write(imageType);
+ output.writeShort(firstEntryIndex);
+ output.writeShort(colorMapLength);
+ output.write(colorMapEntrySize);
+ output.writeShort(xOrigin);
+ output.writeShort(yOrigin);
+ output.writeShort(width);
+ output.writeShort(height);
+ output.write(pixelDepth);
+ output.write(imageDescriptor);
+ if (idLength > 0) {
+ try {
+ byte[] chars = imageID.getBytes("US-ASCII");
+ output.write(chars);
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Identifies the image type of the tga image data and loads
+ * it into the JimiImage structure. This was taken from the
+ * prototype and modified for the new Jimi structure
+ */
+ private void decodeImage(LEDataInputStream dIn) throws IOException {
+ switch (header.imageType()) {
+ case Header.UCOLORMAPPED:
+ throw new IOException("TGADecoder Uncompressed Colormapped images not supported");
+
+ case Header.UTRUECOLOR: // pixelDepth 15, 16, 24 and 32
+ switch (header.pixelDepth) {
+ case 16:
+ throw new IOException("TGADecoder Compressed 16-bit True Color images not supported");
+
+ case 24:
+ case 32:
+ decodeRGBImageU24_32(dIn);
+ break;
+ }
+ break;
+
+ case Header.UBLACKWHITE:
+ throw new IOException("TGADecoder Uncompressed Grayscale images not supported");
+
+ case Header.COLORMAPPED:
+ throw new IOException("TGADecoder Compressed Colormapped images not supported");
+
+ case Header.TRUECOLOR:
+ throw new IOException("TGADecoder Compressed True Color images not supported");
+
+ case Header.BLACKWHITE:
+ throw new IOException("TGADecoder Compressed Grayscale images not supported");
+ }
+ }
+
+ /**
+ * This assumes that the body is for a 24 bit or 32 bit for a
+ * RGB or ARGB image respectively.
+ */
+ private void decodeRGBImageU24_32(LEDataInputStream dIn) throws IOException {
+ int i; // row index
+ int j; // column index
+ int y; // output row index
+ int raw; // index through the raw input buffer
+ int rawWidth = header.width() * (header.pixelDepth() / 8);
+ byte[] rawBuf = new byte[rawWidth];
+ byte[] tmpData = new byte[rawWidth * header.height()];
+
+ for (i = 0; i < header.height(); ++i) {
+ dIn.readFully(rawBuf, 0, rawWidth);
+
+ if (header.topToBottom())
+ y = header.height - i - 1; // range 0 to (header.height - 1)
+ else
+ y = i;
+
+ System.arraycopy(rawBuf, 0, tmpData, y * rawWidth, rawBuf.length);
+ }
+
+ GL gl = GLContext.getCurrentGL();
+ if (header.pixelDepth() == 24) {
+ bpp=3;
+ if(gl.isGL2()) {
+ format = GL2.GL_BGR;
+ } else {
+ format = GL.GL_RGB;
+ swapBGR(tmpData, rawWidth, header.height(), bpp);
+ }
+ } else {
+ assert header.pixelDepth() == 32;
+ bpp=4;
+
+ if(gl.isGL2()) {
+ format = GL2.GL_BGRA;
+ } else {
+ format = GL.GL_RGBA;
+ swapBGR(tmpData, rawWidth, header.height(), bpp);
+ }
+ }
+
+ data = ByteBuffer.wrap(tmpData);
+ }
+
+ private static void swapBGR(byte[] data, int bWidth, int height, int bpp) {
+ byte r,b;
+ int k;
+ for(int i=0; i<height; ++i) {
+ for(int j=0; j<bWidth; j+=bpp) {
+ k=i*bWidth+j;
+ b=data[k+0];
+ r=data[k+2];
+ data[k+0]=r;
+ data[k+2]=b;
+ }
+ }
+ }
+
+ /** Returns the width of the image. */
+ public int getWidth() { return header.width(); }
+
+ /** Returns the height of the image. */
+ public int getHeight() { return header.height(); }
+
+ /** Returns the OpenGL format for this texture; e.g. GL.GL_BGR or GL.GL_BGRA. */
+ public int getGLFormat() { return format; }
+
+ /** Returns the bytes per pixel */
+ public int getBytesPerPixel() { return bpp; }
+
+ /** Returns the raw data for this texture in the correct
+ (bottom-to-top) order for calls to glTexImage2D. */
+ public ByteBuffer getData() { return data; }
+
+ /** Reads a Targa image from the specified file. */
+ public static TGAImage read(String filename) throws IOException {
+ return read(new FileInputStream(filename));
+ }
+
+ /** Reads a Targa image from the specified InputStream. */
+ public static TGAImage read(InputStream in) throws IOException {
+ LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
+
+ Header header = new Header(dIn);
+ TGAImage res = new TGAImage(header);
+ res.decodeImage(dIn);
+ return res;
+ }
+
+ /** Writes the image in Targa format to the specified file name. */
+ public void write(String filename) throws IOException {
+ write(new File(filename));
+ }
+
+ /** Writes the image in Targa format to the specified file. */
+ public void write(File file) throws IOException {
+ LEDataOutputStream output =
+ new LEDataOutputStream(new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file))));
+ header.write(output);
+ if (!data.isDirect()) {
+ output.write(data.array());
+ } else {
+ for (int i = 0; i < data.limit(); i++) {
+ output.write(data.get(i));
+ }
+ }
+ output.close();
+ }
+
+ /** Creates a TGAImage from data supplied by the end user. Shares
+ data with the passed ByteBuffer. Assumes the data is already in
+ the correct byte order for writing to disk, i.e., BGR or
+ BGRA. */
+ public static TGAImage createFromData(int width,
+ int height,
+ boolean hasAlpha,
+ boolean topToBottom,
+ ByteBuffer data) {
+ Header header = new Header();
+ header.imageType = Header.UTRUECOLOR;
+ header.width = width;
+ header.height = height;
+ header.pixelDepth = (byte) (hasAlpha ? 32 : 24);
+ header.imageDescriptor = (byte) (topToBottom ? Header.ID_TOPTOBOTTOM : 0);
+ // Note ID not supported
+ TGAImage ret = new TGAImage(header);
+ ret.data = data;
+ return ret;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase b/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase
new file mode 100755
index 000000000..1e78ef20d
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/TGAImage.java.javase
@@ -0,0 +1,420 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.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.*;
+
+/**
+ * Targa image reader and writer adapted from sources of the <a href =
+ * "http://java.sun.com/products/jimi/">Jimi</a> image I/O class library.
+ *
+ * <P>
+ *
+ * Image decoder for image data stored in TGA file format.
+ * Currently only the original TGA file format is supported. This is
+ * because the new TGA format has data at the end of the file, getting
+ * to the end of a file in an InputStream orient environment presents
+ * several difficulties which are avoided at the moment.
+ *
+ * <P>
+ *
+ * This is a simple decoder and is only setup to load a single image
+ * from the input stream
+ *
+ * <P>
+ *
+ * @author Robin Luiten
+ * @author Kenneth Russell
+ * @version $Revision: 1768 $
+ */
+
+public class TGAImage {
+ private Header header;
+ private int format;
+ private int bpp;
+ private ByteBuffer data;
+
+ private TGAImage(Header header) {
+ this.header = header;
+ }
+
+ /**
+ * This class reads in all of the TGA image header in addition it also
+ * reads in the imageID field as it is convenient to handle that here.
+ *
+ * @author Robin Luiten
+ * @version 1.1
+ */
+ public static class Header {
+ /** Set of possible file format TGA types */
+ public final static int TYPE_NEW = 0;
+ public final static int TYPE_OLD = 1;
+ public final static int TYPE_UNK = 2; // cant rewind stream so unknown for now.
+
+ /** Set of possible image types in TGA file */
+ public final static int NO_IMAGE = 0; // no image data
+ public final static int UCOLORMAPPED = 1; // uncompressed color mapped image
+ public final static int UTRUECOLOR = 2; // uncompressed true color image
+ public final static int UBLACKWHITE = 3; // uncompressed black and white image
+ public final static int COLORMAPPED = 9; // compressed color mapped image
+ public final static int TRUECOLOR = 10; // compressed true color image
+ public final static int BLACKWHITE = 11; // compressed black and white image
+
+ /** Field image descriptor bitfield values definitions */
+ public final static int ID_ATTRIBPERPIXEL = 0xF;
+ public final static int ID_RIGHTTOLEFT = 0x10;
+ public final static int ID_TOPTOBOTTOM = 0x20;
+ public final static int ID_INTERLEAVE = 0xC0;
+
+ /** Field image descriptor / interleave values */
+ public final static int I_NOTINTERLEAVED = 0;
+ public final static int I_TWOWAY = 1;
+ public final static int I_FOURWAY = 2;
+
+ /** Type of this TGA file format */
+ private int tgaType;
+
+ /** initial TGA image data fields */
+ private int idLength; // byte value
+ private int colorMapType; // byte value
+ private int imageType; // byte value
+
+ /** TGA image colour map fields */
+ private int firstEntryIndex;
+ private int colorMapLength;
+ private byte colorMapEntrySize;
+
+ /** TGA image specification fields */
+ private int xOrigin;
+ private int yOrigin;
+ private int width;
+ private int height;
+ private byte pixelDepth;
+ private byte imageDescriptor;
+
+ private byte[] imageIDbuf;
+ private String imageID;
+
+ // For construction from user data
+ Header() {
+ tgaType = TYPE_OLD; // dont try and get footer.
+ }
+
+ Header(LEDataInputStream in) throws IOException {
+ int ret;
+
+ tgaType = TYPE_OLD; // dont try and get footer.
+
+ // initial header fields
+ idLength = in.readUnsignedByte();
+ colorMapType = in.readUnsignedByte();
+ imageType = in.readUnsignedByte();
+
+ // color map header fields
+ firstEntryIndex = in.readUnsignedShort();
+ colorMapLength = in.readUnsignedShort();
+ colorMapEntrySize = in.readByte();
+
+ // TGA image specification fields
+ xOrigin = in.readUnsignedShort();
+ yOrigin = in.readUnsignedShort();
+ width = in.readUnsignedShort();
+ height = in.readUnsignedShort();
+ pixelDepth = in.readByte();
+ imageDescriptor = in.readByte();
+
+ if (idLength > 0) {
+ imageIDbuf = new byte[idLength];
+ in.read(imageIDbuf, 0, idLength);
+ imageID = new String(imageIDbuf, "US-ASCII");
+ }
+ }
+
+ public int tgaType() { return tgaType; }
+
+ /** initial TGA image data fields */
+ public int idLength() { return idLength; }
+ public int colorMapType() { return colorMapType; }
+ public int imageType() { return imageType; }
+
+ /** TGA image colour map fields */
+ public int firstEntryIndex() { return firstEntryIndex; }
+ public int colorMapLength() { return colorMapLength; }
+ public byte colorMapEntrySize() { return colorMapEntrySize; }
+
+ /** TGA image specification fields */
+ public int xOrigin() { return xOrigin; }
+ public int yOrigin() { return yOrigin; }
+ public int width() { return width; }
+ public int height() { return height; }
+ public byte pixelDepth() { return pixelDepth; }
+ public byte imageDescriptor() { return imageDescriptor; }
+
+ /** bitfields in imageDescriptor */
+ public byte attribPerPixel() { return (byte)(imageDescriptor & ID_ATTRIBPERPIXEL); }
+ public boolean rightToLeft() { return ((imageDescriptor & ID_RIGHTTOLEFT) != 0); }
+ public boolean topToBottom() { return ((imageDescriptor & ID_TOPTOBOTTOM) != 0); }
+ public byte interleave() { return (byte)((imageDescriptor & ID_INTERLEAVE) >> 6); }
+
+ public byte[] imageIDbuf() { return imageIDbuf; }
+ public String imageID() { return imageID; }
+
+ public String toString() {
+ return "TGA Header " +
+ " id length: " + idLength +
+ " color map type: "+ colorMapType +
+ " image type: "+ imageType +
+ " first entry index: " + firstEntryIndex +
+ " color map length: " + colorMapLength +
+ " color map entry size: " + colorMapEntrySize +
+ " x Origin: " + xOrigin +
+ " y Origin: " + yOrigin +
+ " width: "+ width +
+ " height: "+ height +
+ " pixel depth: "+ pixelDepth +
+ " image descriptor: "+ imageDescriptor +
+ (imageIDbuf == null ? "" : (" ID String: " + imageID));
+ }
+
+ public int size() { return 18 + idLength; }
+
+ // buf must be in little-endian byte order
+ private void write(ByteBuffer buf) {
+ buf.put((byte) idLength);
+ buf.put((byte) colorMapType);
+ buf.put((byte) imageType);
+ buf.putShort((short) firstEntryIndex);
+ buf.putShort((short) colorMapLength);
+ buf.put((byte) colorMapEntrySize);
+ buf.putShort((short) xOrigin);
+ buf.putShort((short) yOrigin);
+ buf.putShort((short) width);
+ buf.putShort((short) height);
+ buf.put((byte) pixelDepth);
+ buf.put((byte) imageDescriptor);
+ if (idLength > 0) {
+ try {
+ byte[] chars = imageID.getBytes("US-ASCII");
+ buf.put(chars);
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Identifies the image type of the tga image data and loads
+ * it into the JimiImage structure. This was taken from the
+ * prototype and modified for the new Jimi structure
+ */
+ private void decodeImage(LEDataInputStream dIn) throws IOException {
+ switch (header.imageType()) {
+ case Header.UCOLORMAPPED:
+ throw new IOException("TGADecoder Uncompressed Colormapped images not supported");
+
+ case Header.UTRUECOLOR: // pixelDepth 15, 16, 24 and 32
+ switch (header.pixelDepth) {
+ case 16:
+ throw new IOException("TGADecoder Compressed 16-bit True Color images not supported");
+
+ case 24:
+ case 32:
+ decodeRGBImageU24_32(dIn);
+ break;
+ }
+ break;
+
+ case Header.UBLACKWHITE:
+ throw new IOException("TGADecoder Uncompressed Grayscale images not supported");
+
+ case Header.COLORMAPPED:
+ throw new IOException("TGADecoder Compressed Colormapped images not supported");
+
+ case Header.TRUECOLOR:
+ throw new IOException("TGADecoder Compressed True Color images not supported");
+
+ case Header.BLACKWHITE:
+ throw new IOException("TGADecoder Compressed Grayscale images not supported");
+ }
+ }
+
+ /**
+ * This assumes that the body is for a 24 bit or 32 bit for a
+ * RGB or ARGB image respectively.
+ */
+ private void decodeRGBImageU24_32(LEDataInputStream dIn) throws IOException {
+ int i; // row index
+ int j; // column index
+ int y; // output row index
+ int raw; // index through the raw input buffer
+ int rawWidth = header.width() * (header.pixelDepth() / 8);
+ byte[] rawBuf = new byte[rawWidth];
+ byte[] tmpData = new byte[rawWidth * header.height()];
+
+ for (i = 0; i < header.height(); ++i) {
+ dIn.readFully(rawBuf, 0, rawWidth);
+
+ if (header.topToBottom())
+ y = header.height - i - 1; // range 0 to (header.height - 1)
+ else
+ y = i;
+
+ System.arraycopy(rawBuf, 0, tmpData, y * rawWidth, rawBuf.length);
+ }
+
+ GL gl = GLContext.getCurrentGL();
+ if (header.pixelDepth() == 24) {
+ bpp=3;
+ if(gl.isGL2()) {
+ format = GL2.GL_BGR;
+ } else {
+ format = GL.GL_RGB;
+ swapBGR(tmpData, rawWidth, header.height(), bpp);
+ }
+ } else {
+ assert header.pixelDepth() == 32;
+ bpp=4;
+
+ if(gl.isGL2()) {
+ format = GL2.GL_BGRA;
+ } else {
+ format = GL.GL_RGBA;
+ swapBGR(tmpData, rawWidth, header.height(), bpp);
+ }
+ }
+
+ data = ByteBuffer.wrap(tmpData);
+ }
+
+ private static void swapBGR(byte[] data, int bWidth, int height, int bpp) {
+ byte r,b;
+ int k;
+ for(int i=0; i<height; ++i) {
+ for(int j=0; j<bWidth; j+=bpp) {
+ k=i*bWidth+j;
+ b=data[k+0];
+ r=data[k+2];
+ data[k+0]=r;
+ data[k+2]=b;
+ }
+ }
+ }
+
+ /** Returns the width of the image. */
+ public int getWidth() { return header.width(); }
+
+ /** Returns the height of the image. */
+ public int getHeight() { return header.height(); }
+
+ /** Returns the OpenGL format for this texture; e.g. GL.GL_BGR or GL.GL_BGRA. */
+ public int getGLFormat() { return format; }
+
+ /** Returns the bytes per pixel */
+ public int getBytesPerPixel() { return bpp; }
+
+ /** Returns the raw data for this texture in the correct
+ (bottom-to-top) order for calls to glTexImage2D. */
+ public ByteBuffer getData() { return data; }
+
+ /** Reads a Targa image from the specified file. */
+ public static TGAImage read(String filename) throws IOException {
+ return read(new FileInputStream(filename));
+ }
+
+ /** Reads a Targa image from the specified InputStream. */
+ public static TGAImage read(InputStream in) throws IOException {
+ LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
+
+ Header header = new Header(dIn);
+ TGAImage res = new TGAImage(header);
+ res.decodeImage(dIn);
+ return res;
+ }
+
+ /** Writes the image in Targa format to the specified file name. */
+ public void write(String filename) throws IOException {
+ write(new File(filename));
+ }
+
+ /** Writes the image in Targa format to the specified file. */
+ public void write(File file) throws IOException {
+ FileOutputStream stream = new FileOutputStream(file);
+ FileChannel chan = stream.getChannel();
+ ByteBuffer buf = ByteBuffer.allocate(header.size());
+ buf.order(ByteOrder.LITTLE_ENDIAN);
+ header.write(buf);
+ buf.rewind();
+ chan.write(buf);
+ chan.write(data);
+ data.rewind();
+ chan.force(true);
+ chan.close();
+ stream.close();
+ }
+
+ /** Creates a TGAImage from data supplied by the end user. Shares
+ data with the passed ByteBuffer. Assumes the data is already in
+ the correct byte order for writing to disk, i.e., BGR or
+ BGRA. */
+ public static TGAImage createFromData(int width,
+ int height,
+ boolean hasAlpha,
+ boolean topToBottom,
+ ByteBuffer data) {
+ Header header = new Header();
+ header.imageType = Header.UTRUECOLOR;
+ header.width = width;
+ header.height = height;
+ header.pixelDepth = (byte) (hasAlpha ? 32 : 24);
+ header.imageDescriptor = (byte) (topToBottom ? Header.ID_TOPTOBOTTOM : 0);
+ // Note ID not supported
+ TGAImage ret = new TGAImage(header);
+ ret.data = data;
+ return ret;
+ }
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java
new file mode 100755
index 000000000..baa087289
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi;
+
+import java.io.*;
+import java.net.*;
+
+import com.sun.opengl.util.texture.*;
+
+/** Plug-in interface to TextureIO to support reading OpenGL textures
+ from new file formats. For all methods, either internalFormat or
+ pixelFormat may be 0 in which case they must be inferred as
+ e.g. RGB or RGBA depending on the file contents.
+*/
+
+public interface TextureProvider {
+
+ /**
+ * Produces a TextureData object from a file, or returns null if the
+ * file format was not supported by this TextureProvider. Does not
+ * do any OpenGL-related work. The resulting TextureData can be
+ * converted into an OpenGL texture in a later step.
+ *
+ * @param file the file from which to read the texture data
+ *
+ * @param internalFormat the OpenGL internal format to be used for
+ * the texture, or 0 if it should be inferred
+ * from the file's contents
+ *
+ * @param pixelFormat the OpenGL pixel format to be used for
+ * the texture, or 0 if it should be inferred
+ * from the file's contents
+ *
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ *
+ * @param fileSuffix the file suffix to be used as a hint to the
+ * provider to more quickly decide whether it
+ * can handle the file, or null if the
+ * provider should infer the type from the
+ * file's contents
+ *
+ * @throws IOException if an error occurred while reading the file
+ */
+ public TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException;
+
+ /**
+ * Produces a TextureData object from a stream, or returns null if
+ * the file format was not supported by this TextureProvider. Does
+ * not do any OpenGL-related work. The resulting TextureData can be
+ * converted into an OpenGL texture in a later step.
+ *
+ * @param stream the stream from which to read the texture data
+ *
+ * @param internalFormat the OpenGL internal format to be used for
+ * the texture, or 0 if it should be inferred
+ * from the file's contents
+ *
+ * @param pixelFormat the OpenGL pixel format to be used for
+ * the texture, or 0 if it should be inferred
+ * from the file's contents
+ *
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ *
+ * @param fileSuffix the file suffix to be used as a hint to the
+ * provider to more quickly decide whether it
+ * can handle the file, or null if the
+ * provider should infer the type from the
+ * file's contents
+ *
+ * @throws IOException if an error occurred while reading the stream
+ */
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException;
+
+ /**
+ * Produces a TextureData object from a URL, or returns null if the
+ * file format was not supported by this TextureProvider. Does not
+ * do any OpenGL-related work. The resulting TextureData can be
+ * converted into an OpenGL texture in a later step.
+ *
+ * @param url the URL from which to read the texture data
+ *
+ * @param internalFormat the OpenGL internal format to be used for
+ * the texture, or 0 if it should be inferred
+ * from the file's contents
+ *
+ * @param pixelFormat the OpenGL pixel format to be used for
+ * the texture, or 0 if it should be inferred
+ * from the file's contents
+ *
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ *
+ * @param fileSuffix the file suffix to be used as a hint to the
+ * provider to more quickly decide whether it
+ * can handle the file, or null if the
+ * provider should infer the type from the
+ * file's contents
+ *
+ * @throws IOException if an error occurred while reading the URL
+ */
+ public TextureData newTextureData(URL url,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException;
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java
new file mode 100755
index 000000000..cdad15bb2
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureWriter.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi;
+
+import java.io.*;
+
+import com.sun.opengl.util.texture.*;
+
+/** Plug-in interface to TextureIO to support writing OpenGL textures
+ to new file formats. */
+
+public interface TextureWriter {
+ /** Writes the given TextureData to the passed file. Returns true if
+ this TextureWriter successfully handled the writing of the file,
+ otherwise false. May throw IOException if either this writer did
+ not support certain parameters of the TextureData or if an I/O
+ error occurred. */
+ public boolean write(File file,
+ TextureData data) throws IOException;
+}
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java
new file mode 100644
index 000000000..0244db285
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi.awt;
+
+import java.awt.Graphics;
+import java.awt.image.*;
+import java.io.*;
+import java.net.*;
+import javax.imageio.*;
+
+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.*;
+
+public class IIOTextureProvider implements TextureProvider {
+ private static final boolean DEBUG = Debug.debug("TextureIO");
+
+ public TextureData newTextureData(File file,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ BufferedImage img = ImageIO.read(file);
+ if (img == null) {
+ return null;
+ }
+ if (DEBUG) {
+ System.out.println("TextureIO.newTextureData(): BufferedImage type for " + file + " = " +
+ img.getType());
+ }
+ return new AWTTextureData(internalFormat, pixelFormat, mipmap, img);
+ }
+
+ public TextureData newTextureData(InputStream stream,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ BufferedImage img = ImageIO.read(stream);
+ if (img == null) {
+ return null;
+ }
+ if (DEBUG) {
+ System.out.println("TextureIO.newTextureData(): BufferedImage type for stream = " +
+ img.getType());
+ }
+ return new AWTTextureData(internalFormat, pixelFormat, mipmap, img);
+ }
+
+ public TextureData newTextureData(URL url,
+ int internalFormat,
+ int pixelFormat,
+ boolean mipmap,
+ String fileSuffix) throws IOException {
+ InputStream stream = url.openStream();
+ try {
+ return newTextureData(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/sun/opengl/util/texture/spi/awt/IIOTextureWriter.java
new file mode 100644
index 000000000..db77572bf
--- /dev/null
+++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.opengl.util.texture.spi.awt;
+
+import java.awt.Graphics;
+import java.awt.image.*;
+import java.io.*;
+import java.net.*;
+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.*;
+
+public class IIOTextureWriter implements TextureWriter {
+ public boolean write(File file,
+ TextureData data) throws IOException {
+ int pixelFormat = data.getPixelFormat();
+ int pixelType = data.getPixelType();
+ if ((pixelFormat == GL.GL_RGB ||
+ pixelFormat == GL.GL_RGBA) &&
+ (pixelType == GL.GL_BYTE ||
+ pixelType == GL.GL_UNSIGNED_BYTE)) {
+ // Convert TextureData to appropriate BufferedImage
+ // FIXME: almost certainly not obeying correct pixel order
+ BufferedImage image = new BufferedImage(data.getWidth(), data.getHeight(),
+ (pixelFormat == GL.GL_RGB) ?
+ BufferedImage.TYPE_3BYTE_BGR :
+ BufferedImage.TYPE_4BYTE_ABGR);
+ byte[] imageData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
+ ByteBuffer buf = (ByteBuffer) data.getBuffer();
+ if (buf == null) {
+ buf = (ByteBuffer) data.getMipmapData()[0];
+ }
+ buf.rewind();
+ buf.get(imageData);
+ buf.rewind();
+
+ // Swizzle image components to be correct
+ if (pixelFormat == GL.GL_RGB) {
+ for (int i = 0; i < imageData.length; i += 3) {
+ byte red = imageData[i + 0];
+ byte blue = imageData[i + 2];
+ imageData[i + 0] = blue;
+ imageData[i + 2] = red;
+ }
+ } else {
+ for (int i = 0; i < imageData.length; i += 4) {
+ byte red = imageData[i + 0];
+ byte green = imageData[i + 1];
+ byte blue = imageData[i + 2];
+ byte alpha = imageData[i + 3];
+ imageData[i + 0] = alpha;
+ imageData[i + 1] = blue;
+ imageData[i + 2] = green;
+ imageData[i + 3] = red;
+ }
+ }
+
+ // Flip image vertically for the user's convenience
+ ImageUtil.flipImageVertically(image);
+
+ // Happened to notice that writing RGBA images to JPEGS is broken
+ if (TextureIO.JPG.equals(FileUtil.getFileSuffix(file)) &&
+ image.getType() == BufferedImage.TYPE_4BYTE_ABGR) {
+ BufferedImage tmpImage = new BufferedImage(image.getWidth(), image.getHeight(),
+ BufferedImage.TYPE_3BYTE_BGR);
+ Graphics g = tmpImage.getGraphics();
+ g.drawImage(image, 0, 0, null);
+ g.dispose();
+ image = tmpImage;
+ }
+
+ return ImageIO.write(image, FileUtil.getFileSuffix(file), file);
+ }
+
+ throw new IOException("ImageIO writer doesn't support this pixel format / type (only GL_RGB/A + bytes)");
+ }
+}
diff --git a/src/jogl/classes/com/sun/openmax/OMXEventListener.java b/src/jogl/classes/com/sun/openmax/OMXEventListener.java
new file mode 100644
index 000000000..ebbf7129f
--- /dev/null
+++ b/src/jogl/classes/com/sun/openmax/OMXEventListener.java
@@ -0,0 +1,14 @@
+
+package com.sun.openmax;
+
+public interface OMXEventListener {
+
+ static final int EVENT_CHANGE_SIZE = 1<<0;
+ static final int EVENT_CHANGE_FPS = 1<<1;
+ static final int EVENT_CHANGE_BPS = 1<<2;
+ static final int EVENT_CHANGE_LENGTH = 1<<3;
+
+ public void changedAttributes(OMXInstance omx, int event_mask);
+
+}
+
diff --git a/src/jogl/classes/com/sun/openmax/OMXInstance.java b/src/jogl/classes/com/sun/openmax/OMXInstance.java
new file mode 100644
index 000000000..2eff166d2
--- /dev/null
+++ b/src/jogl/classes/com/sun/openmax/OMXInstance.java
@@ -0,0 +1,509 @@
+
+package com.sun.openmax;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.GLU;
+import com.sun.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 java.net.URL;
+import java.nio.ByteBuffer;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.util.*;
+
+public class OMXInstance {
+ private long moviePtr = 0;
+
+ protected String path = null;
+ protected URL url = null;
+
+ // *** Texture impl
+ protected Texture texture = null; // holds the last fetched texture
+
+ protected float playSpeed = 1.0f;
+
+ /**
+ * The following data is set by the setStream function,
+ * and may be set by the native OMX implementation,
+ * in case the stream attributes changes (see attributesUpdated)
+ */
+ protected int width = 0;
+ protected int height = 0;
+ protected int fps = 0; // frames per seconds
+ protected long bps = 0; // bits per seconds
+ protected long totalFrames = 0; // duration in frames
+ protected String acodec = null;
+ protected String vcodec = null;
+
+ /**
+ * Old stream values, before the last attributesUpdated)
+ */
+ protected int o_width = 0;
+ protected int o_height = 0;
+ protected int o_fps = 0; // frames per seconds
+ protected long o_bps = 0; // bits per seconds
+ protected long o_totalFrames = 0; // duration in frames
+
+ static class EGLImageTexture {
+ public EGLImageTexture(com.sun.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 long image;
+ protected long sync;
+ }
+ private EGLImageTexture[] eglImgTexs=null;
+ private HashMap eglImgTexsMap = new HashMap();
+ protected int textureNum;
+
+ private EGLExt eglExt = null;
+ private long eglSurface = 0;
+ private long eglDisplay = 0;
+ private long eglContext = 0;
+ private int sWidth=0, sHeight=0;
+
+ private GL initGLData(GL gl) {
+ if(null==gl) {
+ throw new RuntimeException("No current GL");
+ }
+ EGLContext eglCtx = (EGLContext) gl.getContext();
+ if(null==eglCtx) {
+ throw new RuntimeException("No current EGL context");
+ }
+ EGLDrawable eglDrawable = (EGLDrawable) eglCtx.getGLDrawable();
+ if(null==eglDrawable) {
+ throw new RuntimeException("No valid drawable");
+ }
+ eglContext = eglCtx.getContext();
+ eglDisplay = eglDrawable.getDisplay();
+ eglSurface = eglDrawable.getSurface();
+ eglExt = eglCtx.getEGLExt();
+ if(null==eglExt) {
+ throw new RuntimeException("No valid EGLExt");
+ }
+
+ int iTmp[] = new int[1];
+ EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_WIDTH, iTmp, 0);
+ sWidth=iTmp[0];
+ EGL.eglQuerySurface(eglDisplay, eglSurface, EGL.EGL_HEIGHT, iTmp, 0);
+ sHeight=iTmp[0];
+ System.out.println("surface size: "+width+"x"+height);
+ System.out.println(eglDrawable);
+ System.out.println(eglCtx);
+ System.out.println("EGL Extensions : "+EGL.eglQueryString(eglDisplay, EGL.EGL_EXTENSIONS));
+ System.out.println("EGL CLIENT APIs: "+EGL.eglQueryString(eglDisplay, EGL.EGL_CLIENT_APIS));
+ return gl;
+ }
+
+ public OMXInstance() {
+ moviePtr = _createInstance();
+ if(0==moviePtr) {
+ throw new GLException("Couldn't create OMXInstance");
+ }
+ }
+ native long _createInstance();
+
+ public synchronized void setStream(int textureNum, URL u) {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ this.textureNum=textureNum;
+ url = u;
+ if (url == null) {
+ System.out.println("setURL (null)");
+ stop();
+ return;
+ }
+ path=null;
+ if (url.getProtocol() == null || "file".equals(url.getProtocol())) {
+ // CV only accepts absolute paths
+ try {
+ File file = new File(url.getPath());
+ if (!file.exists()) {
+ throw new RuntimeException(new FileNotFoundException(file.toString()));
+ }
+ path = file.getCanonicalPath();
+ System.out.println("setURL: path "+path);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+ path = replaceAll(path, "\\", "/").trim();
+ if(null==path) {
+ throw new RuntimeException("Couldn't parse stream URL: "+url);
+ }
+ System.out.println("setURL: clean path "+path);
+
+ System.out.println("setURL: p1 "+this);
+ _setStream(moviePtr, textureNum, path);
+ System.out.println("setURL: p2 "+this);
+ }
+ native void _setStream(long moviePtr, int textureNum, String path);
+
+ public synchronized void setStreamAllEGLImageTexture2D(GL gl) {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ if(null==vcodec) {
+ return;
+ }
+ gl = initGLData(gl);
+
+ if(null!=eglImgTexs) {
+ removeAllEGLImageTexture2D(gl);
+ } else {
+ eglImgTexs = new EGLImageTexture[textureNum];
+ }
+
+ int[] tmp = new int[1];
+ int tex, e;
+
+ errorCheckGL(gl, "i.1");
+ gl.glEnable(gl.GL_TEXTURE_2D);
+ errorCheckGL(gl, "i.2");
+
+ for(int i=0; i<textureNum; i++) {
+ String s0 = String.valueOf(i);
+ gl.glGenTextures(1, tmp, 0);
+ tex=tmp[0];
+ if( (e=gl.glGetError()) != GL.GL_NO_ERROR || 0>tex ) {
+ throw new RuntimeException("TextureName creation failed: "+e);
+ }
+ gl.glBindTexture(gl.GL_TEXTURE_2D, tex);
+
+ // create space for buffer with a texture
+ gl.glTexImage2D(
+ gl.GL_TEXTURE_2D, // target
+ 0, // level
+ gl.GL_RGBA, // internal format
+ width, // width
+ height, // height
+ 0, // border
+ gl.GL_RGBA, // format
+ gl.GL_UNSIGNED_BYTE, // type
+ null); // pixels -- will be provided later
+ gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_NEAREST);
+ gl.glTexParameteri(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_NEAREST);
+
+ long image=0, sync=0;
+
+ // create EGLImage from texture
+ tmp[0] = EGL.EGL_NONE;
+ image = eglExt.eglCreateImageKHR(
+ eglDisplay,
+ eglContext,
+ eglExt.EGL_GL_TEXTURE_2D_KHR,
+ tex,
+ tmp, 0);
+ if (0==image) {
+ throw new RuntimeException("EGLImage creation failed: "+EGL.eglGetError()+", dpy "+eglDisplay+", ctx "+eglContext+", tex "+tex);
+ }
+
+ // Create sync object so that we can be sure that gl has finished
+ // rendering the EGLImage texture before we tell OpenMAX to fill
+ // it with a new frame.
+ tmp[0] = EGL.EGL_NONE;
+ sync = eglExt.eglCreateFenceSyncKHR(
+ eglDisplay,
+ eglExt.EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR, tmp, 0);
+
+ _setStreamEGLImageTexture2D(moviePtr, i, tex, image, sync);
+
+ eglImgTexs[i] = new EGLImageTexture(
+ com.sun.opengl.util.texture.TextureIO.newTexture(tex,
+ javax.media.opengl.GL2.GL_TEXTURE_2D,
+ width,
+ height,
+ width,
+ height,
+ true),
+ image, sync);
+ eglImgTexsMap.put(new Integer(tex), eglImgTexs[i]);
+ }
+ gl.glDisable(gl.GL_TEXTURE_2D);
+ }
+ native void _setStreamEGLImageTexture2D(long moviePtr, int i, int tex, long image, long sync);
+
+ public synchronized void activateStream() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ _activateStream(moviePtr);
+ }
+ native void _activateStream(long moviePtr);
+
+ public synchronized void detachVideoRenderer() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ _detachVideoRenderer(moviePtr);
+ }
+ native void _detachVideoRenderer(long moviePtr); // stop before
+
+ public synchronized void attachVideoRenderer() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ _attachVideoRenderer(moviePtr);
+ }
+ native void _attachVideoRenderer(long moviePtr); // detach before
+
+ public synchronized void setPlaySpeed(float rate) {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ _setPlaySpeed(moviePtr, rate);
+ playSpeed = rate;
+ }
+ public synchronized float getPlaySpeed() {
+ return playSpeed;
+ }
+ native void _setPlaySpeed(long moviePtr, float rate);
+
+ /** @return time position after issuing the command */
+ public synchronized float play() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ return _play(moviePtr);
+ }
+ native float _play(long moviePtr);
+
+ /** @return time position after issuing the command */
+ public synchronized float pause() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ return _pause(moviePtr);
+ }
+ native float _pause(long moviePtr);
+
+ /** @return time position after issuing the command */
+ public synchronized float stop() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ return _stop(moviePtr);
+ }
+ native float _stop(long moviePtr);
+
+ /** @return time position after issuing the command */
+ public synchronized float seek(float pos) {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ return _seek(moviePtr, pos);
+ }
+ native float _seek(long moviePtr, float position);
+
+ public synchronized Texture getLastTextureID() {
+ return texture;
+ }
+ public synchronized Texture getNextTextureID() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ texture=null;
+ EGLImageTexture eglImgTex = (EGLImageTexture) eglImgTexsMap.get(new Integer(_getNextTextureID(moviePtr)));
+ if(null!=eglImgTex) {
+ texture = eglImgTex.texture;
+ }
+ return texture;
+ }
+ native int _getNextTextureID(long moviePtr);
+
+ public synchronized float getCurrentPosition() {
+ if(0==moviePtr) {
+ throw new GLException("OMX native instance null");
+ }
+ return _getCurrentPosition(moviePtr);
+ }
+ native float _getCurrentPosition(long moviePtr);
+
+ public synchronized void destroy(GL gl) {
+ removeAllEGLImageTexture2D(gl);
+ if (moviePtr != 0) {
+ long ptr = moviePtr;
+ moviePtr = 0;
+ _destroyInstance(ptr);
+
+ eglExt=null;
+ eglSurface=0;
+ eglDisplay=0;
+ eglContext=0;
+ }
+ }
+ protected synchronized void finalize() {
+ if (moviePtr != 0) {
+ destroy(null);
+ }
+ }
+ native void _destroyInstance(long moviePtr);
+
+ public synchronized boolean isValid() {
+ return (moviePtr != 0);
+ }
+ public synchronized String getPath() {
+ return path;
+ }
+ public synchronized URL getURL() {
+ return url;
+ }
+ public synchronized String getVideoCodec() {
+ return vcodec;
+ }
+ public synchronized String getAudioCodec() {
+ return acodec;
+ }
+ public synchronized long getTotalFrames() {
+ return totalFrames;
+ }
+ public synchronized long getBitrate() {
+ return bps;
+ }
+ public synchronized int getFramerate() {
+ return fps;
+ }
+ public synchronized int getWidth() {
+ return width;
+ }
+ public synchronized int getHeight() {
+ return height;
+ }
+ public synchronized String toString() {
+ return "OMXInstance [ stream [ video [ "+vcodec+", "+width+"x"+height+", "+fps+"fps, "+bps+"bsp, "+totalFrames+"f ] ] ]";
+ }
+
+ /**
+ * Java callback method issued by the native OMX backend
+ */
+ private void saveAttributes() {
+ o_width = width;
+ o_height = height;
+ o_fps = fps;
+ o_bps = bps;
+ o_totalFrames = totalFrames;
+ }
+
+ private void attributesUpdated() {
+ int event_mask = 0;
+ if( o_width != width || o_height != height ) {
+ event_mask |= OMXEventListener.EVENT_CHANGE_SIZE;
+ }
+ if( o_fps != fps ) {
+ event_mask |= OMXEventListener.EVENT_CHANGE_FPS;
+ }
+ if( o_bps != bps ) {
+ event_mask |= OMXEventListener.EVENT_CHANGE_BPS;
+ }
+ if( o_totalFrames != totalFrames ) {
+ event_mask |= OMXEventListener.EVENT_CHANGE_LENGTH;
+ }
+ if(0==event_mask) {
+ return;
+ }
+
+ ArrayList listeners = null;
+ synchronized(this) {
+ listeners = eventListeners;
+ }
+ for(Iterator i = listeners.iterator(); i.hasNext(); ) {
+ OMXEventListener l = (OMXEventListener) i.next();
+ l.changedAttributes(this, event_mask);
+ }
+ }
+
+ private String replaceAll(String orig, String search, String repl) {
+ String dest=null;
+ // In case replaceAll / java.util.regex.* is not supported (-> CVM)
+ int i=0,j;
+ dest = new String();
+ while((j=orig.indexOf(search, i))>=0) {
+ dest=dest.concat(orig.substring(i, j));
+ dest=dest.concat(repl);
+ i=j+1;
+ }
+ return dest.concat(orig.substring(i, orig.length()));
+ }
+
+ private void removeAllEGLImageTexture2D(GL gl) {
+ if (moviePtr != 0) {
+ if(null==eglExt) {
+ throw new RuntimeException("No valid EGLExt");
+ }
+
+ texture = null;
+ for(int i=0; i<textureNum; i++) {
+ if(null!=eglImgTexs[i]) {
+ if(0!=eglImgTexs[i].image) {
+ eglExt.eglDestroyImageKHR(
+ eglDisplay,
+ eglImgTexs[i].image);
+ }
+ if(0!=eglImgTexs[i].sync) {
+ eglExt.eglDestroySyncKHR(eglImgTexs[i].sync);
+ }
+ if(null!=gl) {
+ eglImgTexs[i].texture.destroy(gl);
+ }
+ eglImgTexs[i]=null;
+ }
+ }
+ eglImgTexsMap.clear();
+ }
+ }
+
+ private void errorCheckGL(GL gl, String s) {
+ int e;
+ if( (e=gl.glGetError()) != GL.GL_NO_ERROR ) {
+ System.out.println("GL Error: ("+s+"): "+e);
+ }
+ }
+
+ private void errorCheckEGL(String s) {
+ int e;
+ if( (e=EGL.eglGetError()) != EGL.EGL_SUCCESS ) {
+ System.out.println("EGL Error: ("+s+"): "+e);
+ }
+ }
+
+
+ //
+ // OMXEventListener Support
+ //
+
+ public synchronized void addEventListener(OMXEventListener l) {
+ if(l == null) {
+ return;
+ }
+ ArrayList newEventListeners = (ArrayList) eventListeners.clone();
+ newEventListeners.add(l);
+ eventListeners = newEventListeners;
+ }
+
+ public synchronized void removeEventListener(OMXEventListener l) {
+ if (l == null) {
+ return;
+ }
+ ArrayList newEventListeners = (ArrayList) eventListeners.clone();
+ newEventListeners.remove(l);
+ eventListeners = newEventListeners;
+ }
+
+ public synchronized OMXEventListener[] getEventListeners() {
+ return (OMXEventListener[]) eventListeners.toArray();
+ }
+
+ private ArrayList eventListeners = new ArrayList();
+
+}
+
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
new file mode 100644
index 000000000..782d041a5
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2003-2009 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 javax.media.opengl;
+
+import javax.media.nativewindow.Capabilities;
+import javax.media.nativewindow.NativeWindowException;
+
+/** <P> The default implementation of the {@link
+ GLCapabilitiesChooser} interface, which provides consistent visual
+ selection behavior across platforms. The precise algorithm is
+ deliberately left loosely specified. Some properties are: </P>
+
+ <UL>
+
+ <LI> As long as there is at least one available non-null
+ GLCapabilities which matches the "stereo" option, will return a
+ valid index.
+
+ <LI> Attempts to match as closely as possible the given
+ GLCapabilities, but will select one with fewer capabilities (i.e.,
+ lower color depth) if necessary.
+
+ <LI> Prefers hardware-accelerated visuals to
+ non-hardware-accelerated.
+
+ <LI> If there is no exact match, prefers a more-capable visual to
+ a less-capable one.
+
+ <LI> If there is more than one exact match, chooses an arbitrary
+ one.
+
+ <LI> May select the opposite of a double- or single-buffered
+ visual (based on the user's request) in dire situations.
+
+ <LI> Color depth (including alpha) mismatches are weighted higher
+ than depth buffer mismatches, which are in turn weighted higher
+ than accumulation buffer (including alpha) and stencil buffer
+ depth mismatches.
+
+ <LI> If a valid windowSystemRecommendedChoice parameter is
+ supplied, chooses that instead of using the cross-platform code.
+
+ </UL>
+*/
+
+public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
+ private static final boolean DEBUG = false; // FIXME: Debug.debug("DefaultGLCapabilitiesChooser");
+
+ public int chooseCapabilities(Capabilities desired,
+ Capabilities[] available,
+ int windowSystemRecommendedChoice) {
+ GLCapabilities _desired = (GLCapabilities) desired;
+ GLCapabilities[] _available = (GLCapabilities[]) available;
+
+ if (DEBUG) {
+ System.err.println("Desired: " + _desired);
+ for (int i = 0; i < _available.length; i++) {
+ System.err.println("Available " + i + ": " + _available[i]);
+ }
+ System.err.println("Window system's recommended choice: " + windowSystemRecommendedChoice);
+ }
+
+ if (windowSystemRecommendedChoice >= 0 &&
+ windowSystemRecommendedChoice < _available.length &&
+ _available[windowSystemRecommendedChoice] != null) {
+ if (DEBUG) {
+ System.err.println("Choosing window system's recommended choice of " + windowSystemRecommendedChoice);
+ System.err.println(_available[windowSystemRecommendedChoice]);
+ }
+ return windowSystemRecommendedChoice;
+ }
+
+ // Create score array
+ int[] scores = new int[_available.length];
+ int NO_SCORE = -9999999;
+ int DOUBLE_BUFFER_MISMATCH_PENALTY = 1000;
+ int STENCIL_MISMATCH_PENALTY = 500;
+ // Pseudo attempt to keep equal rank penalties scale-equivalent
+ // (e.g., stencil mismatch is 3 * accum because there are 3 accum
+ // components)
+ int COLOR_MISMATCH_PENALTY_SCALE = 36;
+ int DEPTH_MISMATCH_PENALTY_SCALE = 6;
+ int ACCUM_MISMATCH_PENALTY_SCALE = 1;
+ int STENCIL_MISMATCH_PENALTY_SCALE = 3;
+ for (int i = 0; i < scores.length; i++) {
+ scores[i] = NO_SCORE;
+ }
+ // Compute score for each
+ for (int i = 0; i < scores.length; i++) {
+ GLCapabilities cur = _available[i];
+ if (cur == null) {
+ continue;
+ }
+ if (_desired.getStereo() != cur.getStereo()) {
+ continue;
+ }
+ int score = 0;
+ // Compute difference in color depth
+ // (Note that this decides the direction of all other penalties)
+ score += (COLOR_MISMATCH_PENALTY_SCALE *
+ ((cur.getRedBits() + cur.getGreenBits() + cur.getBlueBits() + cur.getAlphaBits()) -
+ (_desired.getRedBits() + _desired.getGreenBits() + _desired.getBlueBits() + _desired.getAlphaBits())));
+ // Compute difference in depth buffer depth
+ score += (DEPTH_MISMATCH_PENALTY_SCALE * sign(score) *
+ Math.abs(cur.getDepthBits() - _desired.getDepthBits()));
+ // Compute difference in accumulation buffer depth
+ score += (ACCUM_MISMATCH_PENALTY_SCALE * sign(score) *
+ Math.abs((cur.getAccumRedBits() + cur.getAccumGreenBits() + cur.getAccumBlueBits() + cur.getAccumAlphaBits()) -
+ (_desired.getAccumRedBits() + _desired.getAccumGreenBits() + _desired.getAccumBlueBits() + _desired.getAccumAlphaBits())));
+ // Compute difference in stencil bits
+ score += STENCIL_MISMATCH_PENALTY_SCALE * sign(score) * (cur.getStencilBits() - _desired.getStencilBits());
+ if (cur.getDoubleBuffered() != _desired.getDoubleBuffered()) {
+ score += sign(score) * DOUBLE_BUFFER_MISMATCH_PENALTY;
+ }
+ if ((_desired.getStencilBits() > 0) && (cur.getStencilBits() == 0)) {
+ score += sign(score) * STENCIL_MISMATCH_PENALTY;
+ }
+ scores[i] = score;
+ }
+ // Now prefer hardware-accelerated visuals by pushing scores of
+ // non-hardware-accelerated visuals out
+ boolean gotHW = false;
+ int maxAbsoluteHWScore = 0;
+ for (int i = 0; i < scores.length; i++) {
+ int score = scores[i];
+ if (score == NO_SCORE) {
+ continue;
+ }
+ GLCapabilities cur = _available[i];
+ if (cur.getHardwareAccelerated()) {
+ int absScore = Math.abs(score);
+ if (!gotHW ||
+ (absScore > maxAbsoluteHWScore)) {
+ gotHW = true;
+ maxAbsoluteHWScore = absScore;
+ }
+ }
+ }
+ if (gotHW) {
+ for (int i = 0; i < scores.length; i++) {
+ int score = scores[i];
+ if (score == NO_SCORE) {
+ continue;
+ }
+ GLCapabilities cur = _available[i];
+ if (!cur.getHardwareAccelerated()) {
+ if (score <= 0) {
+ score -= maxAbsoluteHWScore;
+ } else if (score > 0) {
+ score += maxAbsoluteHWScore;
+ }
+ scores[i] = score;
+ }
+ }
+ }
+
+ if (DEBUG) {
+ System.err.print("Scores: [");
+ for (int i = 0; i < _available.length; i++) {
+ if (i > 0) {
+ System.err.print(",");
+ }
+ System.err.print(" " + scores[i]);
+ }
+ System.err.println(" ]");
+ }
+
+ // Ready to select. Choose score closest to 0.
+ int scoreClosestToZero = NO_SCORE;
+ int chosenIndex = -1;
+ for (int i = 0; i < scores.length; i++) {
+ int score = scores[i];
+ if (score == NO_SCORE) {
+ continue;
+ }
+ // Don't substitute a positive score for a smaller negative score
+ if ((scoreClosestToZero == NO_SCORE) ||
+ (Math.abs(score) < Math.abs(scoreClosestToZero) &&
+ ((sign(scoreClosestToZero) < 0) || (sign(score) > 0)))) {
+ scoreClosestToZero = score;
+ chosenIndex = i;
+ }
+ }
+ if (chosenIndex < 0) {
+ throw new NativeWindowException("Unable to select one of the provided GLCapabilities");
+ }
+ if (DEBUG) {
+ System.err.println("Chosen index: " + chosenIndex);
+ System.err.println("Chosen capabilities:");
+ System.err.println(_available[chosenIndex]);
+ }
+
+ return chosenIndex;
+ }
+
+ private static int sign(int score) {
+ if (score < 0) {
+ return -1;
+ }
+ return 1;
+ }
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLArrayData.java b/src/jogl/classes/javax/media/opengl/GLArrayData.java
new file mode 100644
index 000000000..d17ee6a06
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLArrayData.java
@@ -0,0 +1,114 @@
+
+package javax.media.opengl;
+
+import java.nio.*;
+
+/**
+ *
+ * The total number of bytes hold by the referenced buffer is:
+ * getComponentSize()* getComponentNumber() * getElementNumber()
+ *
+ */
+public interface GLArrayData {
+
+ /**
+ * Returns true if this data set is intended for a GLSL vertex shader attribute,
+ * otherwise false, ie intended for fixed function vertex pointer
+ */
+ public boolean isVertexAttribute();
+
+ /**
+ * 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
+ */
+ public int getIndex();
+
+ /**
+ * The name of the reflecting shader array attribute.
+ */
+ public String getName();
+
+ /**
+ * Set a new name for this array.
+ */
+ public void setName(String newName);
+
+
+ /**
+ * Returns the shader attribute location for this name,
+ * -1 if not yet determined
+ */
+ public int getLocation();
+
+ /**
+ * Sets the determined location of the shader attribute
+ * This is usually done within ShaderState.
+ *
+ * @see javax.media.opengl.glsl.ShaderState#glVertexAttribPointer(GL2ES2, GLArrayData)
+ */
+ public void setLocation(int v);
+
+ /**
+ * Determines wheather the data is server side (VBO),
+ * or a client side array (false).
+ */
+ public boolean isVBO();
+
+ /**
+ * The offset, if it's an VBO, otherwise -1
+ */
+ public long getOffset();
+
+ /**
+ * The VBO name, if it's an VBO, otherwise -1
+ */
+ public int getVBOName();
+
+ /**
+ * The Buffer holding the data, may be null in case of VBO
+ */
+ public Buffer getBuffer();
+
+ /**
+ * The number of components per element
+ */
+ public int getComponentNumber();
+
+ /**
+ * The component's GL data type, ie. GL_FLOAT
+ */
+ public int getComponentType();
+
+ /**
+ * The components size in bytes
+ */
+ public int getComponentSize();
+
+ /**
+ * Return the number of elements.
+ */
+ public int getElementNumber();
+
+ /**
+ * True, if GL shall normalize fixed point data while converting
+ * them into float
+ */
+ public boolean getNormalized();
+
+ /**
+ * The distance to the next payload,
+ * allowing interleaved arrays.
+ */
+ public int getStride();
+
+ public String toString();
+
+ public void destroy(GL gl);
+
+}
+
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
new file mode 100644
index 000000000..6b1067701
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+import javax.media.opengl.glu.*;
+
+/** A higher-level abstraction than {@link GLDrawable} which supplies
+ an event based mechanism ({@link GLEventListener}) for performing
+ OpenGL rendering. A GLAutoDrawable automatically creates a primary
+ rendering context which is associated with the GLAutoDrawable for
+ the lifetime of the object. This context has the {@link
+ GLContext#setSynchronized synchronized} property enabled so that
+ calls to {@link GLContext#makeCurrent makeCurrent} will block if
+ the context is current on another thread. This allows the internal
+ GLContext for the GLAutoDrawable to be used both by the event
+ based rendering mechanism as well by end users directly.<P>
+
+ The implementation shall initialize itself as soon as possible,
+ ie if the attached {@link javax.media.nativewindow.NativeWindow NativeWindow} is become visible.
+ The following protocol shall be satisfied:
+ <ul>
+ <li> Create the {@link GLDrawable} with the requested {@link GLCapabilities}</li>
+ <li> Notify {@link GLDrawable} to validate the {@link GLCapabilities} by calling {@link GLDrawable#setRealized setRealized(true)}.</li>
+ <li> Create the new {@link GLContext}.</li>
+ <li> Initialize all OpenGL resources by calling {@link GLEventListener#init init(..)} for all
+ registered {@link GLEventListener}s. This can be done immediatly, or with the followup {@link #display display(..)} call.</li>
+ <li> Send a reshape event by calling {@link GLEventListener#reshape reshape(..)} for all
+ registered {@link GLEventListener}s. This shall be done after the {@link GLEventListener#init init(..)} calls.</li>
+ </ul><P>
+
+ Another implementation detail is the drawable reconfiguration. One use case is where a window is being
+ dragged to another screen with a different pixel configuration, ie {@link GLCapabilities}. The implementation
+ shall be able to detect such cases in conjunction with the associated {@link javax.media.nativewindow.NativeWindow NativeWindow}.<br>
+ For example, AWT's {@link java.awt.Canvas} 's {@link java.awt.Canvas#getGraphicsConfiguration getGraphicsConfiguration()}
+ is capable to determine a display device change. This is demonstrated within {@link javax.media.opengl.awt.GLCanvas}'s
+ and NEWT's <code>AWTCanvas</code> {@link javax.media.opengl.awt.GLCanvas#getGraphicsConfiguration getGraphicsConfiguration()}
+ specialization. Another demonstration is NEWT's {@link javax.media.nativewindow.NativeWindow NativeWindow}
+ implementation on the the Windows platform, which utilizes the native platform's <i>MonitorFromWindow(HWND)</i> function.<br>
+ All OpenGL resources shall be regenerated, while the drawable's {@link GLCapabilities} has
+ to be choosen again. The following protocol shall be satisfied.
+ <ul>
+ <li> Controlled disposal:</li>
+ <ul>
+ <li> Dispose all OpenGL resources by calling {@link GLEventListener#dispose dispose(..)} for all
+ registered {@link GLEventListener}s.</li>
+ <li> Destroy the {@link GLContext}.</li>
+ <li> Notify {@link GLDrawable} of the invalid state by calling {@link GLDrawable#setRealized setRealized(false)}.</li>
+ </ul>
+ <li> Controlled regeneration:</li>
+ <ul>
+ <li> Create the new {@link GLDrawable} with the requested {@link GLCapabilities}
+ <li> Notify {@link GLDrawable} to revalidate the {@link GLCapabilities} by calling {@link GLDrawable#setRealized setRealized(true)}.</li>
+ <li> Create the new {@link GLContext}.</li>
+ <li> Initialize all OpenGL resources by calling {@link GLEventListener#init init(..)} for all
+ registered {@link GLEventListener}s. This can be done immediatly, or with the followup {@link #display display(..)} call.</li>
+ <li> Send a reshape event by calling {@link GLEventListener#reshape reshape(..)} for all
+ registered {@link GLEventListener}s. This shall be done after the {@link GLEventListener#init init(..)} calls.</li>
+ </ul>
+ </ul>
+ Note: Current graphics driver keep the surface configuration for a given window, even if the window is moved to
+ a monitor with a different pixel configuration, ie 32bpp to 16bpp. However, it is best to not assume such behavior
+ and make your application comply with the above protocol.<P>
+
+ However, to not introduce to much breakage with older applications and because of the situation
+ mentioned above, the <code>boolean</code> system property <code>jogl.screenchange.action</code> will control the
+ screen change action as follows:<br>
+
+ <PRE>
+ -Djogl.screenchange.action=false Disable the drawable reconfiguration (the default)
+ -Djogl.screenchange.action=true Enable the drawable reconfiguration
+ </PRE>
+ */
+public interface GLAutoDrawable extends GLDrawable {
+ /** Flag reflecting wheather the drawable reconfiguration will be issued in
+ * case a screen device change occured, e.g. in a multihead environment,
+ * where you drag the window to another monitor. */
+ public static final boolean SCREEN_CHANGE_ACTION_ENABLED = Boolean.getBoolean("jogl.screenchange.action");
+
+ /** FIXME:
+ ** Invalid state, the resources are not yet ready to render. *
+ public static final int STATE_INVALID = 0;
+
+ ** Valid state, all resources are ready to render,
+ and all registered {@link GLEventListener#init init(..)} are called. *
+ public static final int STATE_VALID = 1;
+
+ ** Destroying state, currently executing the {@link #destroy()} method. *
+ public static final int STATE_DESTROYING = 2; */
+
+ /**
+ * Returns the context associated with this drawable. The returned
+ * context will be synchronized.
+ * Don't rely on it's identity, the context may change.
+ */
+ public GLContext getContext();
+
+ /**
+ * Associate a new context to this drawable.
+ */
+ public void setContext(GLContext context);
+
+ /** Adds a {@link GLEventListener} to this drawable. If multiple
+ listeners are added to a given drawable, they are notified of
+ events in an arbitrary order. */
+ public void addGLEventListener(GLEventListener listener);
+
+ /** Removes a {@link GLEventListener} from this drawable. Note that
+ if this is done from within a particular drawable's {@link
+ GLEventListener} handler (reshape, display, etc.) that it is not
+ guaranteed that all other listeners will be evaluated properly
+ during this update cycle. */
+ public void removeGLEventListener(GLEventListener listener);
+
+ /** FIXME: Returns the current state,
+ {@link #STATE_INVALID}, {@link #STATE_VALID} or {@link #STATE_DESTROYING}.
+ Tool to determine, e.g. if a {@link GLEventListener#dispose dispose(..)}
+ event is send in the context of the destruction of this GLAutoDrawable.
+ public int getCurrentState(); */
+
+ /** Destroys all resources associated with this GLAutoDrawable,
+ inclusive the GLContext.
+ If a window is attached to it's implementation, it shall be closed.
+ Causes disposing of all OpenGL resources
+ by calling {@link GLEventListener#dispose dispose(..)} for all
+ registered {@link GLEventListener}s. Called automatically by the
+ window system toolkit upon receiving a destroy notification. This
+ routine may be called manually. */
+ public void destroy();
+
+ /** Causes OpenGL rendering to be performed for this GLAutoDrawable
+ by calling {@link GLEventListener#display display(..)} for all
+ registered {@link GLEventListener}s. Called automatically by the
+ window system toolkit upon receiving a repaint() request. this
+ routine may be called manually for better control over the
+ rendering process. It is legal to call another GLAutoDrawable's
+ display method from within the {@link GLEventListener#display
+ display(..)} callback.<p>
+ In case of a new generated OpenGL context,
+ the implementation shall call {@link GLEventListener#init init(..)} for all
+ registered {@link GLEventListener}s <i>before</i> making the
+ actual {@link GLEventListener#display display(..)} calls,
+ in case this has not been done yet.*/
+ public void display();
+
+ /** Enables or disables automatic buffer swapping for this drawable.
+ By default this property is set to true; when true, after all
+ GLEventListeners have been called for a display() event, the
+ front and back buffers are swapped, displaying the results of
+ the render. When disabled, the user is responsible for calling
+ {@link #swapBuffers(..)} manually. */
+ public void setAutoSwapBufferMode(boolean onOrOff);
+
+ /** Indicates whether automatic buffer swapping is enabled for this
+ drawable. See {@link #setAutoSwapBufferMode}. */
+ public boolean getAutoSwapBufferMode();
+
+ /** Returns the {@link GL} pipeline object this GLAutoDrawable uses.
+ If this method is called outside of the {@link
+ GLEventListener}'s callback methods (init, display, etc.) it may
+ return null. Users should not rely on the identity of the
+ returned GL object; for example, users should not maintain a
+ hash table with the GL object as the key. Additionally, the GL
+ object should not be cached in client code, but should be
+ re-fetched from the GLAutoDrawable at the beginning of each call
+ to init, display, etc. */
+ public GL getGL();
+
+ /** Sets the {@link GL} pipeline object this GLAutoDrawable uses.
+ This should only be called from within the GLEventListener's
+ callback methods, and usually only from within the init()
+ method, in order to install a composable pipeline. See the JOGL
+ demos for examples. */
+ public void setGL(GL gl);
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
new file mode 100644
index 000000000..efd2eedd1
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package javax.media.opengl;
+
+import java.nio.*;
+
+/**
+ * The base interface from which all GL profiles derive, providing
+ * checked conversion down to concrete profiles, and access to the
+ * OpenGL context associated with the GL.
+ */
+public interface GLBase {
+
+ /**
+ * Indicates whether this GL object conforms to any of the common GL profiles.
+ * @return whether this GL object conforms to any of the common GL profiles
+ */
+ public boolean isGL();
+
+ /**
+ * Indicates whether this GL object conforms to the GL3 profile.
+ * The GL3 profile reflects OpenGL versions greater or equal 3.1
+ * @return whether this GL object conforms to the GL3 profile
+ */
+ public boolean isGL3();
+
+ /**
+ * Indicates whether this GL object conforms to the GL2 profile.
+ * The GL2 profile reflects OpenGL versions greater or equal 1.5
+ * @return whether this GL object conforms to the GL2 profile
+ */
+ public boolean isGL2();
+
+ /**
+ * Indicates whether this GL object conforms to the GLES1 profile.
+ * @return whether this GL object conforms to the GLES1 profile
+ */
+ public boolean isGLES1();
+
+ /**
+ * Indicates whether this GL object conforms to the GLES2 profile.
+ * @return whether this GL object conforms to the GLES2 profile
+ */
+ public boolean isGLES2();
+
+ /**
+ * Indicates whether this GL object conforms to one of the OpenGL ES compatible profiles.
+ * @return whether this GL object conforms to one of the OpenGL ES profiles
+ */
+ public boolean isGLES();
+
+ /**
+ * Indicates whether this GL object conforms to the GL2ES1 compatible profile.
+ * @return whether this GL object conforms to the GL2ES1 profile
+ */
+ public boolean isGL2ES1();
+
+ /**
+ * Indicates whether this GL object conforms to the GL2ES2 compatible profile.
+ * @return whether this GL object conforms to the GL2ES2 profile
+ */
+ public boolean isGL2ES2();
+
+ /** Indicates whether this GL object supports GLSL. */
+ public boolean hasGLSL();
+
+ /**
+ * Casts this object to the GL interface.
+ * @return this object cast to the GL interface
+ * @throws GLException if this GLObject is not a GL implementation
+ */
+ public GL getGL() throws GLException;
+
+ /**
+ * Casts this object to the GL3 interface.
+ * @return this object cast to the GL3 interface
+ * @throws GLException if this GLObject is not a GL3 implementation
+ */
+ public GL3 getGL3() throws GLException;
+
+ /**
+ * Casts this object to the GL2 interface.
+ * @return this object cast to the GL2 interface
+ * @throws GLException if this GLObject is not a GL2 implementation
+ */
+ public GL2 getGL2() throws GLException;
+
+ /**
+ * Casts this object to the GLES1 interface.
+ * @return this object cast to the GLES1 interface
+ * @throws GLException if this GLObject is not a GLES1 implementation
+ */
+ public GLES1 getGLES1() throws GLException;
+
+ /**
+ * Casts this object to the GLES2 interface.
+ * @return this object cast to the GLES2 interface
+ * @throws GLException if this GLObject is not a GLES2 implementation
+ */
+ public GLES2 getGLES2() throws GLException;
+
+ /**
+ * Casts this object to the GL2ES1 interface.
+ * @return this object cast to the GL2ES1 interface
+ * @throws GLException if this GLObject is not a GL2ES1 implementation
+ */
+ public GL2ES1 getGL2ES1() throws GLException;
+
+ /**
+ * Casts this object to the GL2ES2 interface.
+ * @return this object cast to the GL2ES2 interface
+ * @throws GLException if this GLObject is not a GL2ES2 implementation
+ */
+ public GL2ES2 getGL2ES2() throws GLException;
+
+ /**
+ * Returns the GLContext with which this GL object is associated.
+ * @return the GLContext with which this GL object is associated
+ */
+ public GLContext getContext();
+
+ /**
+ * Returns the GLProfile with which this GL object is associated.
+ * @return the GLProfile with which this GL object is associated
+ */
+ public GLProfile getGLProfile();
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
new file mode 100644
index 000000000..37e35d4f0
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -0,0 +1,329 @@
+/*
+ * Copyright (c) 2003-2009 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 javax.media.opengl;
+
+import javax.media.nativewindow.Capabilities;
+
+/** Specifies a set of OpenGL capabilities.<br>
+ At creation time of a {@link GLDrawable} using {@link GLDrawableFactory},
+ an instance of this class is passed,
+ describing the desired capabilities that a rendering context
+ must support, such as the OpenGL profile, color depth and whether stereo is enabled.<br>
+
+ The actual capabilites of created {@link GLDrawable}s are then reflected by their own
+ GLCapabilites instance, which can be queried with {@link GLDrawable#getGLCapabilities()}.<br>
+
+ It currently contains the minimal number of routines which allow
+ configuration on all supported window systems. */
+public class GLCapabilities extends Capabilities implements Cloneable {
+ private GLProfile glProfile = null;
+ private boolean doubleBuffered = true;
+ private boolean stereo = false;
+ private boolean hardwareAccelerated = true;
+ private int depthBits = 24;
+ private int stencilBits = 0;
+ private int accumRedBits = 0;
+ private int accumGreenBits = 0;
+ private int accumBlueBits = 0;
+ private int accumAlphaBits = 0;
+ // Shift bits from PIXELFORMATDESCRIPTOR not present because they
+ // are unlikely to be supported on Windows anyway
+
+ // Support for full-scene antialiasing (FSAA)
+ private boolean sampleBuffers = false;
+ private int numSamples = 2;
+
+ // Bits for pbuffer creation
+ private boolean pbufferFloatingPointBuffers;
+ private boolean pbufferRenderToTexture;
+ private boolean pbufferRenderToTextureRectangle;
+
+ /** Creates a GLCapabilities object. All attributes are in a default state.
+ * @param glp GLProfile, or null for the default GLProfile
+ */
+ public GLCapabilities(GLProfile glp) {
+ glProfile = (null!=glp)?glp:GLProfile.getDefault();
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (RuntimeException e) {
+ throw new GLException(e);
+ }
+ }
+
+ public boolean equals(Object obj) {
+ if(!(obj instanceof GLCapabilities)) {
+ return false;
+ }
+ GLCapabilities other = (GLCapabilities)obj;
+ boolean res = super.equals(obj) &&
+ other.getGLProfile()==glProfile &&
+ other.getDoubleBuffered()==doubleBuffered &&
+ other.getStereo()==stereo &&
+ other.getHardwareAccelerated()==hardwareAccelerated &&
+ other.getDepthBits()==depthBits &&
+ other.getStencilBits()==stencilBits &&
+ other.getAccumRedBits()==accumRedBits &&
+ other.getAccumGreenBits()==accumGreenBits &&
+ other.getAccumBlueBits()==accumBlueBits &&
+ other.getAccumAlphaBits()==accumAlphaBits &&
+ other.getSampleBuffers()==sampleBuffers &&
+ other.getPbufferFloatingPointBuffers()==pbufferFloatingPointBuffers &&
+ other.getPbufferRenderToTexture()==pbufferRenderToTexture &&
+ other.getPbufferRenderToTextureRectangle()==pbufferRenderToTextureRectangle;
+ if(sampleBuffers) {
+ res = res && other.getNumSamples()==numSamples;
+ }
+ return res;
+ }
+
+ /** Returns the GL profile you desire or used by the drawable. */
+ public GLProfile getGLProfile() {
+ return glProfile;
+ }
+
+ /** Sets the GL profile you desire */
+ public void setGLProfile(GLProfile profile) {
+ glProfile=profile;
+ }
+
+ /** Indicates whether double-buffering is enabled. */
+ public boolean getDoubleBuffered() {
+ return doubleBuffered;
+ }
+
+ /** Enables or disables double buffering. */
+ public void setDoubleBuffered(boolean onOrOff) {
+ doubleBuffered = onOrOff;
+ }
+
+ /** Indicates whether stereo is enabled. */
+ public boolean getStereo() {
+ return stereo;
+ }
+
+ /** Enables or disables stereo viewing. */
+ public void setStereo(boolean onOrOff) {
+ stereo = onOrOff;
+ }
+
+ /** Indicates whether hardware acceleration is enabled. */
+ public boolean getHardwareAccelerated() {
+ return hardwareAccelerated;
+ }
+
+ /** Enables or disables hardware acceleration. */
+ public void setHardwareAccelerated(boolean onOrOff) {
+ hardwareAccelerated = onOrOff;
+ }
+
+ /** Returns the number of bits requested for the depth buffer. */
+ public int getDepthBits() {
+ return depthBits;
+ }
+
+ /** Sets the number of bits requested for the depth buffer. */
+ public void setDepthBits(int depthBits) {
+ this.depthBits = depthBits;
+ }
+
+ /** Returns the number of bits requested for the stencil buffer. */
+ public int getStencilBits() {
+ return stencilBits;
+ }
+
+ /** Sets the number of bits requested for the stencil buffer. */
+ public void setStencilBits(int stencilBits) {
+ this.stencilBits = stencilBits;
+ }
+
+ /** Returns the number of bits requested for the accumulation
+ buffer's red component. On some systems only the accumulation
+ buffer depth, which is the sum of the red, green, and blue bits,
+ is considered. */
+ public int getAccumRedBits() {
+ return accumRedBits;
+ }
+
+ /** Sets the number of bits requested for the accumulation buffer's
+ red component. On some systems only the accumulation buffer
+ depth, which is the sum of the red, green, and blue bits, is
+ considered. */
+ public void setAccumRedBits(int accumRedBits) {
+ this.accumRedBits = accumRedBits;
+ }
+
+ /** Returns the number of bits requested for the accumulation
+ buffer's green component. On some systems only the accumulation
+ buffer depth, which is the sum of the red, green, and blue bits,
+ is considered. */
+ public int getAccumGreenBits() {
+ return accumGreenBits;
+ }
+
+ /** Sets the number of bits requested for the accumulation buffer's
+ green component. On some systems only the accumulation buffer
+ depth, which is the sum of the red, green, and blue bits, is
+ considered. */
+ public void setAccumGreenBits(int accumGreenBits) {
+ this.accumGreenBits = accumGreenBits;
+ }
+
+ /** Returns the number of bits requested for the accumulation
+ buffer's blue component. On some systems only the accumulation
+ buffer depth, which is the sum of the red, green, and blue bits,
+ is considered. */
+ public int getAccumBlueBits() {
+ return accumBlueBits;
+ }
+
+ /** Sets the number of bits requested for the accumulation buffer's
+ blue component. On some systems only the accumulation buffer
+ depth, which is the sum of the red, green, and blue bits, is
+ considered. */
+ public void setAccumBlueBits(int accumBlueBits) {
+ this.accumBlueBits = accumBlueBits;
+ }
+
+ /** Returns the number of bits requested for the accumulation
+ buffer's alpha component. On some systems only the accumulation
+ buffer depth, which is the sum of the red, green, and blue bits,
+ is considered. */
+ public int getAccumAlphaBits() {
+ return accumAlphaBits;
+ }
+
+ /** Sets number of bits requested for accumulation buffer's alpha
+ component. On some systems only the accumulation buffer depth,
+ which is the sum of the red, green, and blue bits, is
+ considered. */
+ public void setAccumAlphaBits(int accumAlphaBits) {
+ this.accumAlphaBits = accumAlphaBits;
+ }
+
+ /** Indicates whether sample buffers for full-scene antialiasing
+ (FSAA) should be allocated for this drawable. Defaults to
+ false. */
+ public void setSampleBuffers(boolean onOrOff) {
+ sampleBuffers = onOrOff;
+ }
+
+ /** Returns whether sample buffers for full-scene antialiasing
+ (FSAA) should be allocated for this drawable. Defaults to
+ false. */
+ public boolean getSampleBuffers() {
+ return sampleBuffers;
+ }
+
+ /** If sample buffers are enabled, indicates the number of buffers
+ to be allocated. Defaults to 2. */
+ public void setNumSamples(int numSamples) {
+ this.numSamples = numSamples;
+ }
+
+ /** Returns the number of sample buffers to be allocated if sample
+ buffers are enabled. Defaults to 2. */
+ public int getNumSamples() {
+ return numSamples;
+ }
+
+ /** For pbuffers only, indicates whether floating-point buffers
+ should be used if available. Defaults to false. */
+ public void setPbufferFloatingPointBuffers(boolean onOrOff) {
+ pbufferFloatingPointBuffers = onOrOff;
+ }
+
+ /** For pbuffers only, returns whether floating-point buffers should
+ be used if available. Defaults to false. */
+ public boolean getPbufferFloatingPointBuffers() {
+ return pbufferFloatingPointBuffers;
+ }
+
+ /** For pbuffers only, indicates whether the render-to-texture
+ extension should be used if available. Defaults to false. */
+ public void setPbufferRenderToTexture(boolean onOrOff) {
+ pbufferRenderToTexture = onOrOff;
+ }
+
+ /** For pbuffers only, returns whether the render-to-texture
+ extension should be used if available. Defaults to false. */
+ public boolean getPbufferRenderToTexture() {
+ return pbufferRenderToTexture;
+ }
+
+ /** For pbuffers only, indicates whether the
+ render-to-texture-rectangle extension should be used if
+ available. Defaults to false. */
+ public void setPbufferRenderToTextureRectangle(boolean onOrOff) {
+ pbufferRenderToTextureRectangle = onOrOff;
+ }
+
+ /** For pbuffers only, returns whether the render-to-texture
+ extension should be used. Defaults to false. */
+ public boolean getPbufferRenderToTextureRectangle() {
+ return pbufferRenderToTextureRectangle;
+ }
+
+ /** Returns a textual representation of this GLCapabilities
+ object. */
+ public String toString() {
+ StringBuffer msg = new StringBuffer();
+ msg.append("GLCapabilities[");
+ msg.append(super.toString());
+ msg.append(", GL profile: " + glProfile +
+ ", DoubleBuffered: " + doubleBuffered +
+ ", Stereo: " + stereo +
+ ", HardwareAccelerated: " + hardwareAccelerated +
+ ", DepthBits: " + depthBits +
+ ", StencilBits: " + stencilBits +
+ ", Red Accum: " + accumRedBits +
+ ", Green Accum: " + accumGreenBits +
+ ", Blue Accum: " + accumBlueBits +
+ ", Alpha Accum: " + accumAlphaBits +
+ ", Multisample: " + sampleBuffers +
+ ", Num samples: "+(sampleBuffers ? numSamples : 0));
+ msg.append(", PBuffer-FloatingPointBuffers: "+pbufferFloatingPointBuffers+
+ ", PBuffer-RenderToTexture: "+pbufferRenderToTexture+
+ ", PBuffer-RenderToTextureRectangle: "+pbufferRenderToTextureRectangle+ "]");
+ return msg.toString();
+ }
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
new file mode 100644
index 000000000..38cda8cdf
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilitiesChooser.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2003-2009 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 javax.media.opengl;
+
+import javax.media.nativewindow.CapabilitiesChooser;
+
+/** Provides a mechanism by which applications can customize the
+ window type selection for a given {@link GLCapabilities}.
+ Developers can implement this interface and pass an instance into
+ the appropriate method of {@link GLDrawableFactory}; the chooser
+ will be called during the OpenGL context creation process. Note
+ that this is only a marker interface; its signature is the same as
+ {@link CapabilitiesChooser}, but the array of {@link Capabilities}
+ objects passed to {@link #chooseCapabilities chooseCapabilities}
+ will actually be an array of {@link GLCapabilities}. */
+
+public interface GLCapabilitiesChooser extends CapabilitiesChooser {
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
new file mode 100644
index 000000000..ef7fa8189
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+import com.sun.opengl.impl.Debug;
+import java.util.HashMap;
+
+/** Abstraction for an OpenGL rendering context. In order to perform
+ OpenGL rendering, a context must be "made current" on the current
+ thread. OpenGL rendering semantics specify that only one context
+ may be current on the current thread at any given time, and also
+ that a given context may be current on only one thread at any
+ given time. Because components can be added to and removed from
+ the component hierarchy at any time, it is possible that the
+ underlying OpenGL context may need to be destroyed and recreated
+ multiple times over the lifetime of a given component. This
+ process is handled by the implementation, and the GLContext
+ abstraction provides a stable object which clients can use to
+ refer to a given context. */
+
+public abstract class GLContext {
+ protected static final boolean DEBUG = Debug.isPropertyDefined("jogl.debug.GLContext"); // Debug.debug("GLContext");
+
+ /** Indicates that the context was not made current during the last call to {@link #makeCurrent makeCurrent}. */
+ public static final int CONTEXT_NOT_CURRENT = 0;
+ /** Indicates that the context was made current during the last call to {@link #makeCurrent makeCurrent}. */
+ public static final int CONTEXT_CURRENT = 1;
+ /** Indicates that a newly-created context was made current during the last call to {@link #makeCurrent makeCurrent}. */
+ public static final int CONTEXT_CURRENT_NEW = 2;
+
+ private static ThreadLocal currentContext = new ThreadLocal();
+
+ private HashMap/*<int, Object>*/ attachedObjects = new HashMap();
+
+ /**
+ * Returns the GLDrawable to which this context may be used to
+ * draw.
+ */
+ public abstract GLDrawable getGLDrawable();
+
+ /**
+ * Makes this GLContext current on the calling thread.
+ *
+ * There are two return values that indicate success and one that
+ * indicates failure. A return value of CONTEXT_CURRENT_NEW
+ * indicates that that context has been made current, and that
+ * this is the first time this context has been made current, or
+ * that the state of the underlying context or drawable may have
+ * changed since the last time this context was made current. In
+ * this case, the application may wish to initialize the state. A
+ * return value of CONTEXT_CURRENT indicates that the context has
+ * been made currrent, with its previous state restored.
+ *
+ * If the context could not be made current (for example, because
+ * the underlying drawable has not ben realized on the display) ,
+ * a value of CONTEXT_NOT_CURRENT is returned.
+ *
+ * If the context is in use by another thread at the time of the
+ * call, then if isSynchronized() is true the call will
+ * block. If isSynchronized() is false, an exception will be
+ * thrown and the context will remain current on the other thread.
+ *
+ * @return CONTEXT_CURRENT if the context was successfully made current
+ * @return CONTEXT_CURRENT_NEW if the context was successfully made
+ * current, but need to be initialized.
+ *
+ * @return CONTEXT_NOT_CURRENT if the context could not be made current.
+ *
+ * @throws GLException if synchronization is disabled and the
+ * context is current on another thread, or because the context
+ * could not be created or made current due to non-recoverable,
+ * window system-specific errors.
+ */
+ public abstract int makeCurrent() throws GLException;
+
+ /**
+ * Releases control of this GLContext from the current thread.
+ *
+ * @throws GLException if the context had not previously been made
+ * current on the current thread
+ */
+ public abstract void release() throws GLException;
+
+ /**
+ * Copies selected groups of OpenGL state variables from the
+ * supplied source context into this one. The <code>mask</code>
+ * parameter indicates which groups of state variables are to be
+ * 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
+ * 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>
+ *
+ * On most platforms, this context may not be current to any thread,
+ * including the calling thread, when this method is called. Some
+ * platforms have additional requirements such as whether this
+ * context or the source context must occasionally be made current
+ * in order for the results of the copy to be seen; these
+ * requirements are beyond the scope of this specification.
+ *
+ * @param source the source OpenGL context from which to copy state
+ * @param mask a mask of symbolic names indicating which groups of state to copy
+
+ * @throws GLException if an OpenGL-related error occurred
+ */
+ public abstract void copy(GLContext source, int mask) throws GLException;
+
+ /**
+ * Returns the GL object bound to this thread current context.
+ * 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
+ */
+ public static GL getCurrentGL() throws GLException {
+ GLContext glc = getCurrent();
+ if(null==glc) {
+ throw new GLException("No OpenGL context current on this thread");
+ }
+ return glc.getGL();
+ }
+
+ /**
+ * Returns this thread current context.
+ * If no context is current, returns null.
+ *
+ * @return the context current on this thread, or null if no context
+ * is current.
+ */
+ public static GLContext getCurrent() {
+ return (GLContext) currentContext.get();
+ }
+
+ /**
+ * Sets the thread-local variable returned by {@link #getCurrent}
+ * and has no other side-effects. For use by third parties adding
+ * new GLContext implementations; not for use by end users.
+ */
+ protected static void setCurrent(GLContext cur) {
+ if(DEBUG) {
+ Exception e = new Exception("setCurrent: "+Thread.currentThread()+", "+currentContext.get()+" -> "+cur);
+ e.printStackTrace();
+ }
+
+ currentContext.set(cur);
+ }
+
+ /**
+ * Destroys this OpenGL context and frees its associated
+ * resources. The context should have been released before this
+ * method is called.
+ */
+ public abstract void destroy();
+
+ /**
+ * Returns true if 'makeCurrent' will exhibit synchronized behavior.
+ */
+ public abstract boolean isSynchronized();
+
+ /**
+ * Determines whether 'makeCurrent' will exhibit synchronized behavior.
+ */
+ public abstract void setSynchronized(boolean isSynchronized);
+
+ /**
+ * Returns the GL pipeline object for this GLContext.
+ */
+ public abstract GL getGL();
+
+ /**
+ * Sets the GL pipeline object for this GLContext.
+ */
+ public abstract void setGL(GL gl);
+
+ /**
+ * Returns the attached user object for the given name to this GLContext.
+ */
+ public Object getAttachedObject(int name) {
+ return attachedObjects.get(new Integer(name));
+ }
+
+ /**
+ * Returns the attached user object for the given name to this GLContext.
+ */
+ public Object getAttachedObject(String name) {
+ return attachedObjects.get(name);
+ }
+
+ /**
+ * Sets the attached user object for the given name to this GLContext.
+ * Returns the previously set object or null.
+ */
+ public Object putAttachedObject(int name, Object obj) {
+ return attachedObjects.put(new Integer(name), obj);
+ }
+
+ /**
+ * Sets the attached user object for the given name to this GLContext.
+ * Returns the previously set object or null.
+ */
+ public Object putAttachedObject(String name, Object obj) {
+ return attachedObjects.put(name, obj);
+ }
+
+ /**
+ * Classname, GL, GLDrawable
+ */
+ public final String toString() {
+ return getClass().getName()+" ["+getGL()+
+ ",\n\tDrawable: "+ getGLDrawable()+"] ";
+ }
+
+ /** Returns a non-null (but possibly empty) string containing the
+ space-separated list of available platform-dependent (e.g., WGL,
+ GLX) extensions. Can only be called while this context is
+ current. */
+ public abstract String getPlatformExtensionsString();
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawable.java b/src/jogl/classes/javax/media/opengl/GLDrawable.java
new file mode 100644
index 000000000..0cde24ff9
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLDrawable.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+import javax.media.nativewindow.*;
+
+/** An abstraction for an OpenGL rendering target. A GLDrawable's
+ primary functionality is to create OpenGL contexts which can be
+ used to perform rendering. A GLDrawable does not automatically
+ create an OpenGL context, but all implementations of {@link
+ GLAutoDrawable} do so upon creation. */
+
+public interface GLDrawable {
+ /**
+ * Creates a new context for drawing to this drawable that will
+ * optionally share display lists and other server-side OpenGL
+ * objects with the specified GLContext. <P>
+ *
+ * The GLContext <code>share</code> need not be associated with this
+ * GLDrawable and may be null if sharing of display lists and other
+ * objects is not desired. See the note in the overview
+ * documentation on
+ * <a href="../../../overview-summary.html#SHARING">context sharing</a>.
+ */
+ public GLContext createContext(GLContext shareWith);
+
+ /**
+ * Indicates to on-screen GLDrawable implementations whether the
+ * underlying window has been created and can be drawn into. End
+ * users do not need to call this method; it is not necessary to
+ * call <code>setRealized</code> on a GLCanvas, a GLJPanel, or a
+ * GLPbuffer, as these perform the appropriate calls on their
+ * underlying GLDrawables internally.
+ *
+ * <P>
+ *
+ * Developers implementing new OpenGL components for various window
+ * toolkits need to call this method against GLDrawables obtained
+ * from the GLDrawableFactory via the {@link
+ * GLDrawableFactory#getGLDrawable
+ * GLDrawableFactory.getGLDrawable()} method. It must typically be
+ * called with an argument of <code>true</code> when the component
+ * associated with the GLDrawable is realized and with an argument
+ * of <code>false</code> just before the component is unrealized.
+ * For the AWT, this means calling <code>setRealized(true)</code> in
+ * the <code>addNotify</code> method and with an argument of
+ * <code>false</code> in the <code>removeNotify</code> method.
+ *
+ * <P>
+ *
+ * <code>GLDrawable</code> implementations should handle multiple
+ * cycles of <code>setRealized(true)</code> /
+ * <code>setRealized(false)</code> calls. Most, if not all, Java
+ * window toolkits have a persistent object associated with a given
+ * component, regardless of whether that component is currently
+ * realized. The <CODE>GLDrawable</CODE> object associated with a
+ * particular component is intended to be similarly persistent. A
+ * <CODE>GLDrawable</CODE> is intended to be created for a given
+ * component when it is constructed and live as long as that
+ * component. <code>setRealized</code> allows the
+ * <code>GLDrawable</code> to re-initialize and destroy any
+ * associated resources as the component becomes realized and
+ * unrealized, respectively.
+ *
+ * <P>
+ *
+ * With an argument of <code>true</code>,
+ * the minimum implementation shall call
+ * {@link NativeWindow#lockSurface() NativeWindow's lockSurface()} and if successfull:
+ * <ul>
+ * <li> Update the {@link GLCapabilities}, which are associated with
+ * the attached {@link NativeWindow}'s {@link AbstractGraphicsConfiguration}.</li>
+ * <li> Release the lock with {@link NativeWindow#unlockSurface() NativeWindow's unlockSurface()}.</li>
+ * </ul><br>
+ * This is important since {@link NativeWindow#lockSurface() NativeWindow's lockSurface()}
+ * ensures resolving the window/surface handles, and the drawable's {@link GLCapabilities}
+ * might have changed.
+ *
+ * <P>
+ *
+ * Calling this method has no other effects. For example, if
+ * <code>removeNotify</code> is called on a Canvas implementation
+ * for which a GLDrawable has been created, it is also necessary to
+ * destroy all OpenGL contexts associated with that GLDrawable. This
+ * is not done automatically by the implementation.
+ */
+ public void setRealized(boolean realized);
+
+ /** Returns the current width of this GLDrawable. */
+ public int getWidth();
+
+ /** Returns the current height of this GLDrawable. */
+ public int getHeight();
+
+ /** Swaps the front and back buffers of this drawable. For {@link
+ GLAutoDrawable} implementations, when automatic buffer swapping
+ is enabled (as is the default), this method is called
+ automatically and should not be called by the end user. */
+ public void swapBuffers() throws GLException;
+
+ /** Fetches the {@link GLCapabilities} corresponding to the chosen
+ OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.<br>
+ On some platforms, the pixel format is not directly associated
+ with the drawable; a best attempt is made to return a reasonable
+ value in this case. <br>
+ This object shall be directly associated to the attached {@link NativeWindow}'s
+ {@link AbstractGraphicsConfiguration}, and if changes are necessary,
+ they should reflect those as well.
+ @return A copy of the queried object.
+ */
+ public GLCapabilities getChosenGLCapabilities();
+
+ /** Fetches the {@link GLProfile} for this drawable.
+ Returns the GLProfile object, no copy.
+ */
+ public GLProfile getGLProfile();
+
+ public NativeWindow getNativeWindow();
+
+ public GLDrawableFactory getFactory();
+
+ public String toString();
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
new file mode 100644
index 000000000..5da62c30a
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package 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;
+
+/** <P> Provides a virtual machine- and operating system-independent
+ mechanism for creating {@link GLDrawable}s. </P>
+
+ <P> The {@link javax.media.opengl.GLCapabilities} objects passed
+ in to the various factory methods are used as a hint for the
+ properties of the returned drawable. The default capabilities
+ selection algorithm (equivalent to passing in a null {@link
+ GLCapabilitiesChooser}) is described in {@link
+ DefaultGLCapabilitiesChooser}. Sophisticated applications needing
+ to change the selection algorithm may pass in their own {@link
+ GLCapabilitiesChooser} which can select from the available pixel
+ formats. The GLCapabilitiesChooser mechanism may not be supported
+ by all implementations or on all platforms, in which case any
+ passed GLCapabilitiesChooser will be ignored. </P>
+
+ <P> Because of the multithreaded nature of the Java platform's
+ Abstract Window Toolkit, it is typically not possible to immediately
+ reject a given {@link GLCapabilities} as being unsupportable by
+ either returning <code>null</code> from the creation routines or
+ raising a {@link GLException}. The semantics of the rejection
+ process are (unfortunately) left unspecified for now. The current
+ implementation will cause a {@link GLException} to be raised
+ during the first repaint of the {@link GLCanvas} or {@link
+ GLJPanel} if the capabilities can not be met. Pbuffers are always
+ created immediately and their creation will fail with a {@link
+ GLException} if errors occur. </P>
+
+ <P> The concrete GLDrawableFactory subclass instantiated by {@link
+ #getFactory getFactory} can be changed by setting the system
+ property <code>opengl.factory.class.name</code> to the
+ fully-qualified name of the desired class. </P>
+*/
+
+public abstract class GLDrawableFactory {
+ /** Creates a new GLDrawableFactory instance. End users do not need
+ to call this method. */
+ protected GLDrawableFactory() {
+ }
+
+ private static final GLDrawableFactory eglFactory;
+ private static final GLDrawableFactory nativeOSFactory;
+ private static final String nativeOSType;
+
+ /**
+ * Instantiate singleton factories if available, EGLES1, EGLES2 and the OS native ones.
+ */
+ static {
+ GLDrawableFactory tmp = null;
+ try {
+ tmp = (GLDrawableFactory) NWReflection.createInstance("com.sun.opengl.impl.egl.EGLDrawableFactory");
+ } catch (Throwable t) {
+ if (GLProfile.DEBUG) {
+ System.err.println("GLDrawableFactory.static - EGLDrawableFactory - not available");
+ t.printStackTrace();
+ }
+ }
+ eglFactory = tmp;
+
+ nativeOSType = NativeWindowFactory.getNativeWindowType(false);
+
+ String factoryClassName = null;
+ tmp = null;
+ try {
+ factoryClassName =
+ (String) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty("opengl.factory.class.name");
+ }
+ });
+
+ if (null == factoryClassName) {
+ if ( nativeOSType.equals(NativeWindowFactory.TYPE_EGL) ) {
+ // use egl*Factory ..
+ } else 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) ) {
+ // FIXME: remove this residual dependence on the AWT
+ factoryClassName = "com.sun.opengl.impl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory";
+ } else {
+ throw new GLException("Unsupported NativeWindow type: "+nativeOSType);
+ }
+ }
+ if (null != factoryClassName) {
+ tmp = (GLDrawableFactory) NWReflection.createInstance(factoryClassName);
+ }
+ } catch (Throwable t) {
+ if (GLProfile.DEBUG) {
+ System.err.println("GLDrawableFactory.static - Native Platform: "+nativeOSType+" - not available: "+factoryClassName);
+ t.printStackTrace();
+ }
+ }
+ nativeOSFactory = tmp;
+ }
+
+ /**
+ * Returns the sole GLDrawableFactory instance.
+ *
+ * @arg glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
+ * or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
+ */
+ public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException {
+ return getFactoryImpl(glProfile.getImplName());
+ }
+
+ protected static GLDrawableFactory getFactoryImpl(String glProfileImplName) throws GLException {
+ if ( GLProfile.usesNativeGLES(glProfileImplName) ) {
+ if(null==eglFactory) throw new GLException("GLDrawableFactory unavailable for EGL: "+glProfileImplName);
+ return eglFactory;
+ }
+ if(null==nativeOSFactory) throw new GLException("GLDrawableFactory unavailable for Native Platform "+nativeOSType);
+ return nativeOSFactory;
+ }
+
+ /** Shuts down this GLDrawableFactory, releasing resources
+ associated with it. Before calling this method you should first
+ 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() {
+ }
+
+ /**
+ * Returns a GLDrawable that wraps a platform-specific window system
+ * object, such as an AWT or LCDUI Canvas.
+ * On platforms which support pixel format, the NativeWindow's AbstractGraphicsConfiguration
+ * is being used.
+ * support it, selects a pixel format compatible with the supplied
+ * GLCapabilities, or if the passed GLCapabilities object is null,
+ * uses a default set of capabilities. On these platforms, uses
+ * either the supplied GLCapabilitiesChooser object, or if the
+ * passed GLCapabilitiesChooser object is null, uses a
+ * DefaultGLCapabilitiesChooser instance.
+ *
+ * @throws IllegalArgumentException if the passed target is null
+ * @throws GLException if any window system-specific errors caused
+ * the creation of the GLDrawable to fail.
+ *
+ * @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
+ */
+ public abstract GLDrawable createGLDrawable(NativeWindow target)
+ throws IllegalArgumentException, GLException;
+
+ //----------------------------------------------------------------------
+ // Methods to create high-level objects
+
+ /**
+ * Returns true if it is possible to create a GLPbuffer. Some older
+ * graphics cards do not have this capability.
+ */
+ public abstract boolean canCreateGLPbuffer();
+
+ /**
+ * Creates a GLPbuffer with the given capabilites and dimensions. <P>
+ *
+ * See the note in the overview documentation on
+ * <a href="../../../overview-summary.html#SHARING">context sharing</a>.
+ *
+ * @throws GLException if any window system-specific errors caused
+ * the creation of the GLPbuffer to fail.
+ */
+ public abstract GLPbuffer createGLPbuffer(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ int initialWidth,
+ int initialHeight,
+ GLContext shareWith)
+ throws GLException;
+
+ //----------------------------------------------------------------------
+ // Methods for interacting with third-party OpenGL libraries
+
+ /**
+ * <P> Creates a GLContext object representing an existing OpenGL
+ * context in an external (third-party) OpenGL-based library. This
+ * GLContext object may be used to draw into this preexisting
+ * context using its {@link GL} and {@link
+ * javax.media.opengl.glu.GLU} objects. New contexts created through
+ * {@link GLDrawable}s may share textures and display lists with
+ * this external context. </P>
+ *
+ * <P> The underlying OpenGL context must be current on the current
+ * thread at the time this method is called. The user is responsible
+ * for the maintenance of the underlying OpenGL context; calls to
+ * <code>makeCurrent</code> and <code>release</code> on the returned
+ * GLContext object have no effect. If the underlying OpenGL context
+ * is destroyed, the <code>destroy</code> method should be called on
+ * the <code>GLContext</code>. A new <code>GLContext</code> object
+ * should be created for each newly-created underlying OpenGL
+ * context.
+ *
+ * @throws GLException if any window system-specific errors caused
+ * the creation of the external GLContext to fail.
+ */
+ public abstract GLContext createExternalGLContext()
+ throws GLException;
+
+ /**
+ * Returns true if it is possible to create an external GLDrawable
+ * object via {@link #createExternalGLDrawable}.
+ */
+ public abstract boolean canCreateExternalGLDrawable();
+
+ /**
+ * <P> Creates a {@link GLDrawable} object representing an existing
+ * OpenGL drawable in an external (third-party) OpenGL-based
+ * library. This GLDrawable object may be used to create new,
+ * fully-functional {@link GLContext}s on the OpenGL drawable. This
+ * is useful when interoperating with a third-party OpenGL-based
+ * library and it is essential to not perturb the state of the
+ * library's existing context, even to the point of not sharing
+ * textures or display lists with that context. </P>
+ *
+ * <P> An underlying OpenGL context must be current on the desired
+ * drawable and the current thread at the time this method is
+ * called. The user is responsible for the maintenance of the
+ * underlying drawable. If one or more contexts are created on the
+ * drawable using {@link GLDrawable#createContext}, and the drawable
+ * is deleted by the third-party library, the user is responsible
+ * for calling {@link GLContext#destroy} on these contexts. </P>
+ *
+ * <P> Calls to <code>setSize</code>, <code>getWidth</code> and
+ * <code>getHeight</code> are illegal on the returned GLDrawable. If
+ * these operations are required by the user, they must be performed
+ * by the third-party library. </P>
+ *
+ * <P> It is legal to create both an external GLContext and
+ * GLDrawable representing the same third-party OpenGL entities.
+ * This can be used, for example, to query current state information
+ * using the external GLContext and then create and set up new
+ * GLContexts using the external GLDrawable. </P>
+ *
+ * <P> This functionality may not be available on all platforms and
+ * {@link #canCreateExternalGLDrawable} should be called first to
+ * see if it is present. For example, on X11 platforms, this API
+ * requires the presence of GLX 1.3 or later.
+ *
+ * @throws GLException if any window system-specific errors caused
+ * the creation of the external GLDrawable to fail.
+ */
+ public abstract GLDrawable createExternalGLDrawable()
+ throws GLException;
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLEventListener.java b/src/jogl/classes/javax/media/opengl/GLEventListener.java
new file mode 100644
index 000000000..15fae4a39
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLEventListener.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+import java.util.EventListener;
+
+/** Declares events which client code can use to manage OpenGL
+ rendering into a {@link GLAutoDrawable}. At the time any of these
+ methods is called, the drawable has made its associated OpenGL
+ context current, so it is valid to make OpenGL calls. */
+
+public interface GLEventListener extends EventListener {
+ /** Called by the drawable immediately after the OpenGL context is
+ initialized. Can be used to perform one-time OpenGL
+ initialization per GLContext, such as setup of lights and display lists.<p>
+
+ Note that this method may be called more than once if the underlying
+ OpenGL context for the GLAutoDrawable is destroyed and
+ recreated, for example if a GLCanvas is removed from the widget
+ hierarchy and later added again.
+ */
+ public void init(GLAutoDrawable drawable);
+
+ /** Notifies the listener to perform the release of all OpenGL
+ resources per GLContext, such as memory buffers and GLSL programs.<P>
+
+ Called by the drawable before the OpenGL context is
+ destroyed by an external event, like a reconfiguration of the
+ {@link GLAutoDrawable} closing an attached window,
+ but also manually by calling {@link GLAutoDrawable#destroy destroy}.<P>
+
+ Note that this event does not imply the end of life of the application.
+ It could be produced with a followup call to {@link #init(GLAutoDrawable)}
+ in case the GLContext has been recreated,
+ e.g. due to a pixel configuration change in a multihead environment.
+ */
+ public void dispose(GLAutoDrawable drawable);
+
+ /** Called by the drawable to initiate OpenGL rendering by the
+ client. After all GLEventListeners have been notified of a
+ display event, the drawable will swap its buffers if {@link
+ GLAutoDrawable#setAutoSwapBufferMode setAutoSwapBufferMode} is
+ enabled. */
+ public void display(GLAutoDrawable drawable);
+
+ /** Called by the drawable during the first repaint after the
+ component has been resized. The client can update the viewport
+ and view volume of the window appropriately, for example by a
+ call to {@link javax.media.opengl.GL#glViewport}; note that for
+ convenience the component has already called <code>glViewport(x,
+ y, width, height)</code> when this method is called, so the
+ client may not have to do anything in this method.
+ */
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height);
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLException.java b/src/jogl/classes/javax/media/opengl/GLException.java
new file mode 100644
index 000000000..644042e15
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLException.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+/** A generic exception for OpenGL errors used throughout the binding
+ as a substitute for {@link RuntimeException}. */
+
+public class GLException extends RuntimeException {
+ /** Constructs a GLException object. */
+ public GLException() {
+ super();
+ }
+
+ /** Constructs a GLException object with the specified detail
+ message. */
+ public GLException(String message) {
+ super(message);
+ }
+
+ /** Constructs a GLException object with the specified detail
+ message and root cause. */
+ public GLException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /** Constructs a GLException object with the specified root
+ cause. */
+ public GLException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLPbuffer.java b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
new file mode 100644
index 000000000..0250365b0
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+/** Provides offscreen rendering support via pbuffers. The principal
+ addition of this interface is a {@link #destroy} method to
+ deallocate the pbuffer and its associated resources. It also
+ contains experimental methods for accessing the pbuffer's contents
+ as a texture map and enabling rendering to floating-point frame
+ buffers. These methods are not guaranteed to be supported on all
+ platforms and may be deprecated in a future release. */
+
+public interface GLPbuffer extends GLAutoDrawable {
+ /** Indicates the GL_APPLE_float_pixels extension is being used for this pbuffer. */
+ public static final int APPLE_FLOAT = 1;
+
+ /** Indicates the GL_ATI_texture_float extension is being used for this pbuffer. */
+ public static final int ATI_FLOAT = 2;
+
+ /** Indicates the GL_NV_float_buffer extension is being used for this pbuffer. */
+ public static final int NV_FLOAT = 3;
+
+ /** Binds this pbuffer to its internal texture target. Only valid to
+ call if offscreen render-to-texture has been specified in the
+ NWCapabilities for this GLPbuffer. If the
+ render-to-texture-rectangle capability has also been specified,
+ this will use e.g. wglBindTexImageARB as its implementation and
+ cause the texture to be bound to e.g. the
+ GL_TEXTURE_RECTANGLE_NV state; otherwise, during the display()
+ phase the pixels will have been copied into an internal texture
+ target and this will cause that to be bound to the GL_TEXTURE_2D
+ state. */
+ public void bindTexture();
+
+ /** Unbinds the pbuffer from its internal texture target. */
+ public void releaseTexture();
+
+ /** Destroys the native resources associated with this pbuffer. It
+ is not valid to call display() or any other routines on this
+ pbuffer after it has been destroyed. Before destroying the
+ pbuffer, the application must destroy any additional OpenGL
+ contexts which have been created for the pbuffer via {@link
+ #createContext}. */
+ public void destroy();
+
+ /** Indicates which vendor's extension is being used to support
+ floating point channels in this pbuffer if that capability was
+ requested in the NWCapabilities during pbuffer creation. Returns
+ one of NV_FLOAT, ATI_FLOAT or APPLE_FLOAT, or throws GLException
+ if floating-point channels were not requested for this pbuffer.
+ This function may only be called once the init method for this
+ pbuffer's GLEventListener has been called. */
+ public int getFloatingPointMode();
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
new file mode 100644
index 000000000..57f4fb46a
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -0,0 +1,836 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package javax.media.opengl;
+
+import javax.media.opengl.fixedfunc.*;
+import java.lang.reflect.*;
+import java.util.HashMap;
+import java.security.*;
+import com.sun.opengl.impl.*;
+import com.sun.nativewindow.impl.NWReflection;
+
+/**
+ * Specifies the the OpenGL profile.
+ *
+ * This class static singleton initialization queries the availability of all OpenGL Profiles
+ * and instantiates singleton GLProfile objects for each available profile.
+ *
+ * The platform default profile may be used, using {@link GLProfile#GetProfileDefault()},
+ * or more specialized versions using the other static GetProfile methods.
+ */
+public class GLProfile implements Cloneable {
+ public static final boolean DEBUG = Debug.debug("GLProfile");
+
+ //
+ // Public (user-visible) profiles
+ //
+
+ /** The desktop OpenGL profile 3.x, with x >= 1 */
+ public static final String GL3 = "GL3";
+
+ /** The desktop OpenGL profile 1.x up to 3.0 */
+ public static final String GL2 = "GL2";
+
+ /** The embedded OpenGL profile ES 1.x, with x >= 0 */
+ public static final String GLES1 = "GLES1";
+
+ /** The embedded OpenGL profile ES 2.x, with x >= 0 */
+ public static final String GLES2 = "GLES2";
+
+ /** The intersection of the desktop GL2 and embedded ES1 profile */
+ public static final String GL2ES1 = "GL2ES1";
+
+ /** The intersection of the desktop GL3, GL2 and embedded ES2 profile */
+ public static final String GL2ES2 = "GL2ES2";
+
+ /**
+ * All GL Profiles in the order of default detection: GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL3
+ */
+ public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL3 };
+
+ /**
+ * All GL2ES2 Profiles in the order of default detection: GL2ES2, GL2, GLES2, GL3
+ */
+ public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL2, GLES2, GL3 };
+
+ /**
+ * All GL2ES1 Profiles in the order of default detection: GL2ES1, GL2, GLES1
+ */
+ public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL2, 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}
+ */
+ public static final GLProfile getDefault() {
+ if(null==defaultGLProfile) {
+ throw new GLException("No default profile available"); // should never be reached
+ }
+ return defaultGLProfile;
+ }
+
+ /** Returns a GLProfile object.
+ * Verfifies the given profile and chooses an apropriate implementation.
+ *
+ * @throws GLException if no implementation for the given profile is found.
+ */
+ public static final GLProfile get(String profile)
+ throws GLException
+ {
+ if(null==profile) return getDefault();
+ GLProfile glProfile = (GLProfile) mappedProfiles.get(profile);
+ if(null==glProfile) {
+ throw new GLException("No implementation for profile "+profile+" available");
+ }
+ return glProfile;
+ }
+
+ /**
+ * Returns a profile, implementing the interface GL2ES1.
+ * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES1}
+ *
+ * @throws GLException if no implementation for the given profile is found.
+ */
+ public static final GLProfile getGL2ES1()
+ throws GLException
+ {
+ return get(GL_PROFILE_LIST_GL2ES1);
+ }
+
+ /**
+ * Returns a profile, implementing the interface GL2ES2.
+ * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES2}
+ *
+ * @throws GLException if no implementation for the given profile is found.
+ */
+ public static final GLProfile getGL2ES2()
+ throws GLException
+ {
+ return get(GL_PROFILE_LIST_GL2ES2);
+ }
+
+ /**
+ * Returns the first profile from the given list,
+ * where an implementation is available.
+ *
+ * @throws GLException if no implementation for the given profile is found.
+ */
+ public static final GLProfile get(String[] profiles)
+ throws GLException
+ {
+ for(int i=0; i<profiles.length; i++) {
+ String profile = profiles[i];
+ GLProfile glProfile = (GLProfile) mappedProfiles.get(profile);
+ if(null!=glProfile) {
+ return glProfile;
+ }
+ }
+ throw new GLException("Profiles "+list2String(profiles)+" not available");
+ }
+
+ /** Indicates whether the native OpenGL ES1 profile is in use.
+ * This requires an EGL interface.
+ */
+ public static final boolean usesNativeGLES1(String profileImpl) {
+ return GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl) ;
+ }
+
+ /** Indicates whether the native OpenGL ES2 profile is in use.
+ * This requires an EGL interface.
+ */
+ public static final boolean usesNativeGLES2(String profileImpl) {
+ return GLES2.equals(profileImpl) || GL2ES2.equals(profileImpl) ;
+ }
+
+ /** Indicates whether either of the native OpenGL ES profiles are in use. */
+ public static final boolean usesNativeGLES(String profileImpl) {
+ return usesNativeGLES2(profileImpl) || usesNativeGLES1(profileImpl);
+ }
+
+ private static final String getGLImplBaseClassName(String profileImpl) {
+ if(GL3.equals(profileImpl)) {
+ return "com.sun.opengl.impl.gl3.GL3";
+ } else if(GL2.equals(profileImpl)) {
+ return "com.sun.opengl.impl.gl2.GL2";
+ } else if(GL2ES12.equals(profileImpl)) {
+ return "com.sun.opengl.impl.gl2es12.GL2ES12";
+ } else if(GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl)) {
+ return "com.sun.opengl.impl.es1.GLES1";
+ } else if(GLES2.equals(profileImpl) || GL2ES2.equals(profileImpl)) {
+ return "com.sun.opengl.impl.es2.GLES2";
+ } else {
+ throw new GLException("unsupported profile \"" + profileImpl + "\"");
+ }
+ }
+
+ public final String getGLImplBaseClassName() {
+ return getGLImplBaseClassName(profileImpl);
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (Exception e) {
+ throw new GLException(e);
+ }
+ }
+
+ /**
+ * @param o GLProfile object to compare with
+ * @return true if given Object is a GLProfile and
+ * if both, profile and profileImpl is equal with this.
+ */
+ public final boolean equals(Object o) {
+ if(o instanceof GLProfile) {
+ GLProfile glp = (GLProfile)o;
+ return profile.equals(glp.getName()) &&
+ profileImpl.equals(glp.getImplName()) ;
+ }
+ return false;
+ }
+
+ /**
+ * @param glp GLProfile to compare with
+ * @throws GLException if given GLProfile and this aren't equal
+ */
+ public final void verifyEquality(GLProfile glp)
+ throws GLException
+ {
+ if(!this.equals(glp)) throw new GLException("GLProfiles are not equal: "+this+" != "+glp);
+ }
+
+ public final String getName() {
+ return profile;
+ }
+
+ public final String getImplName() {
+ return profileImpl;
+ }
+
+ /** Indicates whether this profile is capable of GL3. */
+ public final boolean isGL3() {
+ return GL3.equals(profile);
+ }
+
+ /** Indicates whether this profile is capable of GL2. */
+ public final boolean isGL2() {
+ return GL2.equals(profile);
+ }
+
+ /** Indicates whether this profile is capable of GLES1. */
+ public final boolean isGLES1() {
+ return GLES1.equals(profile);
+ }
+
+ /** Indicates whether this profile is capable of GLES2. */
+ public final boolean isGLES2() {
+ return GLES2.equals(profile);
+ }
+
+ /** Indicates whether this profile is capable of GL2ES1. */
+ public final boolean isGL2ES1() {
+ return GL2ES1.equals(profile) || isGL2() || isGLES1() ;
+ }
+
+ /** Indicates whether this profile is capable os GL2ES2. */
+ public final boolean isGL2ES2() {
+ return GL2ES2.equals(profile) || isGL2() || isGL3() || isGLES2() ;
+ }
+
+ /** Indicates whether this profile uses the native OpenGL ES1 implementations. */
+ public final boolean usesNativeGLES1() {
+ return GLES1.equals(profileImpl) || GL2ES1.equals(profileImpl) ;
+ }
+
+ /** Indicates whether this profile uses the native OpenGL ES2 implementations. */
+ public final boolean usesNativeGLES2() {
+ return GLES2.equals(profileImpl) || GL2ES2.equals(profileImpl) ;
+ }
+
+ /** Indicates whether this profile uses either of the native OpenGL ES implementations. */
+ public final boolean usesNativeGLES() {
+ return usesNativeGLES2() || usesNativeGLES1();
+ }
+
+ /** 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
+ */
+ public boolean isValidDataType(int type, boolean throwException) {
+ switch(type) {
+ case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_BYTE:
+ case GL.GL_UNSIGNED_SHORT:
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case GL.GL_FIXED:
+ return true;
+ case javax.media.opengl.GL2ES2.GL_INT:
+ case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+ if( isGL2ES2() ) {
+ return true;
+ }
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ if( isGL3() ) {
+ return true;
+ }
+ case javax.media.opengl.GL2.GL_2_BYTES:
+ case javax.media.opengl.GL2.GL_3_BYTES:
+ case javax.media.opengl.GL2.GL_4_BYTES:
+ if( isGL2() ) {
+ return true;
+ }
+ }
+ if(throwException) {
+ throw new GLException("Illegal data type on profile "+this+": "+type);
+ }
+ return false;
+ }
+
+ public boolean isValidArrayDataType(int index, int comps, int type,
+ boolean isVertexAttribPointer, boolean throwException) {
+ String arrayName = getGLArrayName(index);
+ if(isGLES1()) {
+ if(isVertexAttribPointer) {
+ if(throwException) {
+ throw new GLException("Illegal array type for "+arrayName+" on profile GLES1: VertexAttribPointer");
+ }
+ return false;
+ }
+ switch(index) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ switch(type) {
+ case GL.GL_BYTE:
+ case GL.GL_SHORT:
+ case GL.GL_FIXED:
+ case GL.GL_FLOAT:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
+ }
+ return false;
+ }
+ break;
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ switch(type) {
+ case GL.GL_BYTE:
+ case GL.GL_SHORT:
+ case GL.GL_FIXED:
+ case GL.GL_FLOAT:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 3:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
+ }
+ return false;
+ }
+ break;
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ switch(type) {
+ case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_FIXED:
+ case GL.GL_FLOAT:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GLES1: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
+ }
+ return false;
+ }
+ break;
+ }
+ } else if(isGLES2()) {
+ // simply ignore !isVertexAttribPointer case, since it is simulated anyway ..
+ switch(type) {
+ case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_BYTE:
+ case GL.GL_UNSIGNED_SHORT:
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case GL.GL_FIXED:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GLES2: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
+ }
+ return false;
+ }
+ } else if( isGL2ES2() ) {
+ if(isVertexAttribPointer) {
+ switch(type) {
+ case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_BYTE:
+ case GL.GL_UNSIGNED_SHORT:
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case javax.media.opengl.GL2ES2.GL_INT:
+ case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
+ }
+ return false;
+ }
+ } else {
+ switch(index) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ switch(type) {
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case javax.media.opengl.GL2ES2.GL_INT:
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
+ }
+ return false;
+ }
+ break;
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ switch(type) {
+ case GL.GL_BYTE:
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case javax.media.opengl.GL2ES2.GL_INT:
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 3:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GLES1: "+comps);
+ }
+ return false;
+ }
+ break;
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ switch(type) {
+ case GL.GL_UNSIGNED_BYTE:
+ case GL.GL_BYTE:
+ case GL.GL_UNSIGNED_SHORT:
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case javax.media.opengl.GL2ES2.GL_INT:
+ case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 3:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
+ }
+ return false;
+ }
+ break;
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ switch(type) {
+ case GL.GL_SHORT:
+ case GL.GL_FLOAT:
+ case javax.media.opengl.GL2ES2.GL_INT:
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal data type for "+arrayName+" on profile GL2: "+type);
+ }
+ return false;
+ }
+ switch(comps) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ default:
+ if(throwException) {
+ throw new GLException("Illegal component number for "+arrayName+" on profile GL2: "+comps);
+ }
+ return false;
+ }
+ break;
+ }
+ }
+ }
+ return true;
+ }
+
+ public String toString() {
+ return "GLProfile[" + profile + "/" + profileImpl + "]";
+ }
+
+ // The intersection between desktop OpenGL and the union of the OpenGL ES profiles
+ // This is here only to avoid having separate GL2ES1Impl and GL2ES2Impl classes
+ private static final String GL2ES12 = "GL2ES12";
+
+ 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;
+
+ /** All GLProfiles */
+ private static final HashMap/*<String, GLProfile>*/ mappedProfiles;
+
+ /**
+ * Tries the profiles implementation and native libraries.
+ * Throws an GLException if no profile could be found at all.
+ */
+ static {
+ boolean hasDesktopGL = false;
+ boolean hasDesktopGLES12 = false;
+ boolean hasNativeOSFactory = false;
+
+ try {
+ // See DRIHack.java for an explanation of why this is necessary
+ DRIHack.begin();
+ NativeLibLoader.loadGLDesktop();
+ DRIHack.end();
+ hasDesktopGL = true;
+ } catch (Throwable t) {
+ if (DEBUG) {
+ System.err.println("GLProfile.static Desktop GL Library not available");
+ t.printStackTrace();
+ }
+ }
+
+ try {
+ // See DRIHack.java for an explanation of why this is necessary
+ DRIHack.begin();
+ NativeLibLoader.loadGLDesktopES12();
+ DRIHack.end();
+ hasDesktopGLES12 = true;
+ } catch (Throwable t) {
+ if (DEBUG) {
+ System.err.println("GLProfile.static Desktop GL ES12 Library not available");
+ t.printStackTrace();
+ }
+ }
+
+ if(hasDesktopGL||hasDesktopGLES12) {
+ try {
+ hasNativeOSFactory = null!=GLDrawableFactory.getFactoryImpl(GL2);
+ } catch (Throwable t) {
+ if (DEBUG) {
+ System.err.println("GLProfile.static - Native platform GLDrawable factory not available");
+ t.printStackTrace();
+ }
+ }
+ }
+
+ if(!hasNativeOSFactory) {
+ hasDesktopGLES12=false;
+ hasDesktopGL=false;
+ }
+
+ // FIXME: check for real GL3 availability .. ?
+ 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");
+
+ boolean btest = false;
+
+ boolean hasEGLDynLookup = NWReflection.isClassAvailable("com.sun.opengl.impl.egl.EGLDynamicLookupHelper");
+ boolean hasEGLDrawableFactory = false;
+ 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);
+ }
+ } catch (Throwable t) {
+ if (DEBUG) {
+ System.err.println("GLProfile.static - GL ES2 Factory/Library not available");
+ t.printStackTrace();
+ }
+ }
+ hasGLES2Impl = btest;
+
+ btest = false;
+ try {
+ if(hasEGLDynLookup) {
+ 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();
+ }
+ }
+ hasGLES1Impl = btest;
+
+ if (DEBUG) {
+ 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 hasGL3Impl "+hasGL3Impl);
+ System.err.println("GLProfile.static hasGL2Impl "+hasGL2Impl);
+ System.err.println("GLProfile.static hasGL2ES12Impl "+hasGL2ES12Impl);
+ System.err.println("GLProfile.static hasGLES2Impl "+hasGLES2Impl);
+ System.err.println("GLProfile.static hasGLES1Impl "+hasGLES1Impl);
+ }
+
+ 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];
+ String profileImpl = computeProfileImpl(profile);
+ if(null!=profileImpl) {
+ GLProfile glProfile = new GLProfile(profile, profileImpl);
+ _mappedProfiles.put(profile, glProfile);
+ if (DEBUG) {
+ System.err.println("GLProfile.static map "+glProfile);
+ }
+ if(null==defaultGLProfile) {
+ defaultGLProfile=glProfile;
+ if (DEBUG) {
+ System.err.println("GLProfile.static default "+glProfile);
+ }
+ }
+ } else {
+ if (DEBUG) {
+ System.err.println("GLProfile.static map *** no mapping for "+profile);
+ }
+ }
+ }
+ 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();
+ }
+
+ /**
+ * Returns the profile implementation
+ */
+ private static String computeProfileImpl(String profile) {
+ if (GL2ES1.equals(profile)) {
+ if(hasGL2Impl) {
+ return GL2;
+ } else if(hasGL2ES12Impl) {
+ return GL2ES12;
+ } else if(hasGLES1Impl) {
+ return GLES1;
+ }
+ } else if (GL2ES2.equals(profile)) {
+ if(hasGL2ES12Impl) {
+ return GL2ES12;
+ } else if(hasGL2Impl) {
+ return GL2;
+ } else if(hasGL3Impl) {
+ return GL3;
+ } else if(hasGLES2Impl) {
+ return GLES2;
+ }
+ } else if(GL3.equals(profile) && hasGL3Impl) {
+ return GL3;
+ } else if(GL2.equals(profile) && hasGL2Impl) {
+ return GL2;
+ } else if(GLES2.equals(profile) && hasGLES2Impl) {
+ return GLES2;
+ } else if(GLES1.equals(profile) && hasGLES1Impl) {
+ return GLES1;
+ }
+ return null;
+ }
+
+ public static String getGLTypeName(int type) {
+ switch (type) {
+ case GL.GL_UNSIGNED_BYTE:
+ return "GL_UNSIGNED_BYTE";
+ case GL.GL_BYTE:
+ return "GL_BYTE";
+ case GL.GL_UNSIGNED_SHORT:
+ return "GL_UNSIGNED_SHORT";
+ case GL.GL_SHORT:
+ return "GL_SHORT";
+ case GL.GL_FLOAT:
+ return "GL_FLOAT";
+ case GL.GL_FIXED:
+ return "GL_FIXED";
+ case javax.media.opengl.GL2ES2.GL_INT:
+ return "GL_INT";
+ case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+ return "GL_UNSIGNED_INT";
+ case javax.media.opengl.GL2.GL_DOUBLE:
+ return "GL_DOUBLE";
+ case javax.media.opengl.GL2.GL_2_BYTES:
+ return "GL_2_BYTES";
+ case javax.media.opengl.GL2.GL_3_BYTES:
+ return "GL_3_BYTES";
+ case javax.media.opengl.GL2.GL_4_BYTES:
+ return "GL_4_BYTES";
+ }
+ return null;
+ }
+
+ public static String getGLArrayName(int array) {
+ switch(array) {
+ case GLPointerFunc.GL_VERTEX_ARRAY:
+ return "GL_VERTEX_ARRAY";
+ case GLPointerFunc.GL_NORMAL_ARRAY:
+ return "GL_NORMAL_ARRAY";
+ case GLPointerFunc.GL_COLOR_ARRAY:
+ return "GL_COLOR_ARRAY";
+ case GLPointerFunc.GL_TEXTURE_COORD_ARRAY:
+ return "GL_TEXTURE_COORD_ARRAY";
+ }
+ return null;
+ }
+
+ private GLProfile(String profile, String profileImpl) {
+ this.profile = profile;
+ this.profileImpl = profileImpl;
+ }
+
+ private String profileImpl = null;
+ private String profile = null;
+}
diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java
new file mode 100644
index 000000000..8b5fb1a03
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java
@@ -0,0 +1,156 @@
+
+package javax.media.opengl;
+
+import java.nio.*;
+
+public class GLUniformData {
+
+ /**
+ * int atom
+ *
+ * Number of objects is 1
+ *
+ * @arg 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));
+ }
+
+ /**
+ * float atom
+ *
+ * Number of objects is 1
+ *
+ * @arg 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));
+ }
+
+ /**
+ * Multiple IntBuffer Vector
+ *
+ * Number of objects is calculated by data.limit()/components
+ *
+ * @arg components number of elements of one object, ie 4 for GL_FLOAT_VEC4,
+ */
+ public GLUniformData(String name, int components, IntBuffer data) {
+ init(name, components, data);
+ }
+
+ /**
+ * Multiple FloatBuffer Vector
+ *
+ * Number of objects is calculated by data.limit()/components
+ *
+ * @arg components number of elements of one object, ie 4 for GL_FLOAT_VEC4,
+ */
+ public GLUniformData(String name, int components, FloatBuffer data) {
+ init(name, components, data);
+ }
+
+ /**
+ * Multiple FloatBuffer Matrix
+ *
+ * Number of objects is calculated by data.limit()/(rows*columns)
+ *
+ * @arg rows the matrix rows
+ * @arg column the matrix column
+ */
+ public GLUniformData(String name, int rows, int columns, FloatBuffer data) {
+ init(name, rows, columns, data);
+ }
+
+ public void setData(int data) { init(new Integer(data)); }
+ public void setData(float data) { init(new Float(data)); }
+ public void setData(IntBuffer data) { init(data); }
+ public void setData(FloatBuffer data) { init(data); }
+
+ public int intValue() { return ((Integer)data).intValue(); };
+ public float floatValue() { return ((Float)data).floatValue(); };
+ public IntBuffer intBufferValue() { return (IntBuffer)data; };
+ public FloatBuffer floatBufferValue() { return (FloatBuffer)data; };
+
+ public String toString() {
+ return "GLUniformData[name "+name+
+ ", location "+location+
+ ", size "+rows+"*"+columns+
+ ", count "+count+
+ ", matrix "+isMatrix+
+ ", data "+data+
+ "]";
+ }
+
+ private void init(String name, int rows, int columns, Object data) {
+ if( 2>rows || rows>4 || 2>columns || columns>4 ) {
+ throw new GLException("rowsXcolumns must be within [2..4]X[2..4], is: "+rows+"X"+columns);
+ }
+ this.name=name;
+ this.rows=rows;
+ this.columns=columns;
+ this.isMatrix=true;
+ this.location=-1;
+ init(data);
+ }
+
+ private void init(String name, int components, Object data) {
+ if( 1>components || components>4 ) {
+ throw new GLException("components must be within [1..4], is: "+components);
+ }
+ this.name=name;
+ this.columns=components;
+ this.rows=1;
+ this.isMatrix=false;
+ this.location=-1;
+ init(data);
+ }
+
+ private void init(Object data) {
+ if(data instanceof Buffer) {
+ int sz = rows*columns;
+ Buffer buffer = (Buffer)data;
+ if(buffer.limit()<sz || 0!=buffer.limit()%sz) {
+ throw new GLException("data buffer size invalid: new buffer limit: "+buffer.limit()+"\n\t"+this);
+ }
+ this.count=buffer.limit()/(rows*columns);
+ } else {
+ if(isMatrix) {
+ throw new GLException("Atom type not allowed for matrix : "+this);
+ }
+ this.count=1;
+ }
+ this.data=data;
+ }
+
+ public String getName() { return name; }
+
+ public int getLocation() { return location; }
+
+ /**
+ * Sets the determined location of the shader uniform.
+ */
+ public void setLocation(int location) { this.location=location; }
+
+ public Object getObject() {
+ return data;
+ }
+ public Buffer getBuffer() {
+ return (data instanceof Buffer)?(Buffer)data:null;
+ }
+ public boolean isBuffer() {
+ return (data instanceof Buffer);
+ }
+ public boolean isMatrix() { return isMatrix; }
+
+ public int count() { return count; }
+ public int components() { return rows*columns; }
+ public int rows() { return rows; }
+ public int columns() { return columns; }
+
+ private String name;
+ private int location;
+ private int rows, columns;
+ private int count;
+ private Object data;
+ private boolean isMatrix;
+}
diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java
new file mode 100755
index 000000000..fecf6c78b
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/Threading.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+import com.sun.opengl.impl.*;
+
+/** This API provides access to the threading model for the implementation of
+ the classes in this package.
+
+ <P>
+
+ OpenGL is specified as a thread-safe API, but in practice there
+ are multithreading-related issues on most, if not all, of the
+ platforms which support it. For example, some OpenGL
+ implementations do not behave well when one context is made
+ current first on one thread, released, and then made current on a
+ second thread, although this is legal according to the OpenGL
+ specification. On other platforms there are other problems.
+
+ <P>
+
+ Due to these limitations, and due to the inherent multithreading
+ in the Java platform (in particular, in the Abstract Window
+ Toolkit), it is often necessary to limit the multithreading
+ occurring in the typical application using the OpenGL API.
+
+ <P>
+
+ In the current reference implementation, for instance, multithreading
+ has been limited by
+ forcing all OpenGL-related work for GLAutoDrawables on to a single
+ thread. In other words, if an application uses only the
+ GLAutoDrawable and GLEventListener callback mechanism, it is
+ guaranteed to have the most correct single-threaded behavior on
+ all platforms.
+
+ <P>
+
+ Applications using the GLContext makeCurrent/release API directly
+ will inherently break this single-threaded model, as these methods
+ require that the OpenGL context be made current on the current
+ thread immediately. For applications wishing to integrate better
+ with an implementation that uses the single-threaded model, this
+ class provides public access to the mechanism used by the implementation.
+
+ <P>
+
+ Users can execute Runnables on the
+ internal thread used for performing OpenGL work, and query whether
+ the current thread is already this thread. Using these mechanisms
+ the user can move work from the current thread on to the internal
+ OpenGL thread if desired.
+
+ <P>
+
+ This class also provides mechanisms for querying whether this
+ internal serialization of OpenGL work is in effect, and a
+ programmatic way of disabling it. In the current reference
+ implementation it is enabled by default, although it could be
+ disabled in the future if OpenGL drivers become more robust on
+ all platforms.
+
+ <P>
+
+ In addition to specifying programmatically whether the single
+ thread for OpenGL work is enabled, users may switch it on and off
+ using the system property <code>opengl.1thread</code>. Valid values
+ for this system property are:
+
+ <PRE>
+ -Dopengl.1thread=false Disable single-threading of OpenGL work
+ -Dopengl.1thread=true Enable single-threading of OpenGL work (default -- on a newly-created worker thread)
+ -Dopengl.1thread=auto Select default single-threading behavior (currently on)
+ -Dopengl.1thread=awt Enable single-threading of OpenGL work on AWT event dispatch thread (current default on all
+ platforms, and also the default behavior older releases)
+ -Dopengl.1thread=worker Enable single-threading of OpenGL work on newly-created worker thread (not suitable for Mac
+ OS X or X11 platforms, and risky on Windows in applet environments)
+ </PRE>
+*/
+
+public class Threading {
+
+ /** No reason to ever instantiate this class */
+ private Threading() {}
+
+ /** If an implementation of the javax.media.opengl APIs offers a
+ multithreading option but the default behavior is single-threading,
+ this API provides a mechanism for end users to disable single-threading
+ in this implementation. Users are strongly discouraged from
+ calling this method unless they are aware of all of the
+ consequences and are prepared to enforce some amount of
+ threading restrictions in their applications. Disabling
+ single-threading, for example, may have unintended consequences
+ on GLAutoDrawable implementations such as GLCanvas, GLJPanel and
+ GLPbuffer. Currently there is no supported way to re-enable it
+ once disabled, partly to discourage careless use of this
+ method. This method should be called as early as possible in an
+ application. */
+ public static void disableSingleThreading() {
+ ThreadingImpl.disableSingleThreading();
+ }
+
+ /** Indicates whether OpenGL work is being automatically forced to a
+ single thread in this implementation. */
+ public static boolean isSingleThreaded() {
+ return ThreadingImpl.isSingleThreaded();
+ }
+
+ /** Indicates whether the current thread is the single thread on
+ which this implementation of the javax.media.opengl APIs
+ performs all of its OpenGL-related work. This method should only
+ be called if the single-thread model is in effect. */
+ public static boolean isOpenGLThread() throws GLException {
+ return ThreadingImpl.isOpenGLThread();
+ }
+
+ /** Executes the passed Runnable on the single thread used for all
+ OpenGL work in this javax.media.opengl API implementation. It is
+ not specified exactly which thread is used for this
+ purpose. This method should only be called if the single-thread
+ model is in use and if the current thread is not the OpenGL
+ thread (i.e., if <code>isOpenGLThread()</code> returns
+ false). It is up to the end user to check to see whether the
+ current thread is the OpenGL thread and either execute the
+ Runnable directly or perform the work inside it. */
+ public static void invokeOnOpenGLThread(Runnable r) throws GLException {
+ ThreadingImpl.invokeOnOpenGLThread(r);
+ }
+}
diff --git a/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java
new file mode 100644
index 000000000..d92cec389
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/awt/AWTGLAutoDrawable.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl.awt;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+public interface AWTGLAutoDrawable extends GLAutoDrawable, ComponentEvents {
+ /** Requests a new width and height for this AWTGLAutoDrawable. */
+ public void setSize(int width, int height);
+
+ /** Schedules a repaint of the component at some point in the
+ future. */
+ public void repaint();
+}
diff --git a/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java b/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
new file mode 100644
index 000000000..0c4f63c2d
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/awt/ComponentEvents.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl.awt;
+
+import javax.media.opengl.*;
+import java.awt.event.*;
+import java.beans.PropertyChangeListener;
+
+/** Factors out the listener manipulation for the events supported by
+ all of the {@link GLDrawable} implementations. Provided to reduce
+ clutter in the documentation for GLDrawable. */
+
+public interface ComponentEvents {
+ public void addComponentListener(ComponentListener l);
+ public void removeComponentListener(ComponentListener l);
+ public void addFocusListener(FocusListener l);
+ public void removeFocusListener(FocusListener l);
+ public void addHierarchyBoundsListener(HierarchyBoundsListener l);
+ public void removeHierarchyBoundsListener(HierarchyBoundsListener l);
+ public void addHierarchyListener(HierarchyListener l);
+ public void removeHierarchyListener(HierarchyListener l);
+ public void addInputMethodListener(InputMethodListener l);
+ public void removeInputMethodListener(InputMethodListener l);
+ public void addKeyListener(KeyListener l);
+ public void removeKeyListener(KeyListener l);
+ public void addMouseListener(MouseListener l);
+ public void removeMouseListener(MouseListener l);
+ public void addMouseMotionListener(MouseMotionListener l);
+ public void removeMouseMotionListener(MouseMotionListener l);
+ public void addMouseWheelListener(MouseWheelListener l);
+ public void removeMouseWheelListener(MouseWheelListener l);
+ public void addPropertyChangeListener(PropertyChangeListener listener);
+ public void removePropertyChangeListener(PropertyChangeListener listener);
+ public void addPropertyChangeListener(String propertyName,
+ PropertyChangeListener listener);
+ public void removePropertyChangeListener(String propertyName,
+ PropertyChangeListener listener);
+}
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
new file mode 100644
index 000000000..4282e9985
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -0,0 +1,710 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl.awt;
+
+import javax.media.opengl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+
+import com.sun.opengl.impl.*;
+
+import java.awt.Canvas;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.Container;
+import java.awt.Window;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.geom.*;
+import java.beans.*;
+import java.lang.reflect.*;
+import java.security.*;
+
+// FIXME: Subclasses need to call resetGLFunctionAvailability() on their
+// context whenever the displayChanged() function is called on our
+// GLEventListeners
+
+/** A heavyweight AWT component which provides OpenGL rendering
+ support. This is the primary implementation of {@link GLDrawable};
+ {@link GLJPanel} is provided for compatibility with Swing user
+ interfaces when adding a heavyweight doesn't work either because
+ of Z-ordering or LayoutManager problems. */
+
+public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
+
+ private static final boolean DEBUG = Debug.debug("GLCanvas");
+
+ static private GLProfile defaultGLProfile = GLProfile.getDefault();
+ private GLProfile glProfile;
+ private GLDrawableHelper drawableHelper = new GLDrawableHelper();
+ private GraphicsConfiguration chosen;
+ private AWTGraphicsConfiguration awtConfig;
+ private GLDrawable drawable;
+ private GLContextImpl context;
+ private boolean autoSwapBufferMode = true;
+ private boolean sendReshape = false;
+
+ // copy of the cstr args ..
+ private GLCapabilities capabilities;
+ private GLCapabilitiesChooser chooser;
+ private GLContext shareWith;
+ private GraphicsDevice device;
+
+ /** Creates a new GLCanvas component with a default set of OpenGL
+ capabilities, using the default OpenGL capabilities selection
+ mechanism, on the default screen device. */
+ public GLCanvas() {
+ this(null);
+ }
+
+ /** Creates a new GLCanvas component with the requested set of
+ OpenGL capabilities, using the default OpenGL capabilities
+ selection mechanism, on the default screen device. */
+ public GLCanvas(GLCapabilities capabilities) {
+ this(capabilities, null, null, null);
+ }
+
+ /** Creates a new GLCanvas component. The passed GLCapabilities
+ specifies the OpenGL capabilities for the component; if null, a
+ default set of capabilities is used. The GLCapabilitiesChooser
+ specifies the algorithm for selecting one of the available
+ GLCapabilities for the component; a DefaultGLCapabilitesChooser
+ is used if null is passed for this argument. The passed
+ GLContext specifies an OpenGL context with which to share
+ textures, display lists and other OpenGL state, and may be null
+ if sharing is not desired. See the note in the overview
+ documentation on <a
+ href="../../../overview-summary.html#SHARING">context
+ sharing</a>. The passed GraphicsDevice indicates the screen on
+ which to create the GLCanvas; the GLDrawableFactory uses the
+ default screen device of the local GraphicsEnvironment if null
+ is passed for this argument. */
+ public GLCanvas(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ GLContext shareWith,
+ GraphicsDevice device) {
+ /*
+ * Workaround for Xinerama, always pass null so we can detect whether
+ * super.getGraphicsConfiguration() is returning the Canvas' GC (null),
+ * or an ancestor component's GC (non-null) in the overridden version
+ * below.
+ */
+ super();
+
+ if(null==capabilities) {
+ capabilities = new GLCapabilities(defaultGLProfile);
+ }
+ glProfile = capabilities.getGLProfile();
+
+ this.capabilities = capabilities;
+ this.chooser = chooser;
+ this.shareWith=shareWith;
+ this.device = device;
+ }
+
+ protected interface DestroyMethod {
+ public void destroyMethod();
+ }
+
+ protected final static Object addClosingListener(Component c, final DestroyMethod d) {
+ WindowAdapter cl = null;
+ Window w = getWindow(c);
+ if(null!=w) {
+ cl = new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ // we have to issue this call rigth away,
+ // otherwise the window gets destroyed
+ d.destroyMethod();
+ }
+ };
+ w.addWindowListener(cl);
+ }
+ return cl;
+ }
+
+ protected final static Window getWindow(Component c) {
+ while ( c!=null && ! ( c instanceof Window ) ) {
+ c = c.getParent();
+ }
+ return (Window)c;
+ }
+
+ /**
+ * Overridden to choose a GraphicsConfiguration on a parent container's
+ * GraphicsDevice because both devices
+ */
+ public GraphicsConfiguration getGraphicsConfiguration() {
+ /*
+ * Workaround for problems with Xinerama and java.awt.Component.checkGD
+ * when adding to a container on a different graphics device than the
+ * one that this Canvas is associated with.
+ *
+ * GC will be null unless:
+ * - A native peer has assigned it. This means we have a native
+ * peer, and are already comitted to a graphics configuration.
+ * - This canvas has been added to a component hierarchy and has
+ * an ancestor with a non-null GC, but the native peer has not
+ * yet been created. This means we can still choose the GC on
+ * all platforms since the peer hasn't been created.
+ */
+ final GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ /*
+ * chosen is only non-null on platforms where the GLDrawableFactory
+ * returns a non-null GraphicsConfiguration (in the GLCanvas
+ * constructor).
+ *
+ * if gc is from this Canvas' native peer then it should equal chosen,
+ * otherwise it is from an ancestor component that this Canvas is being
+ * added to, and we go into this block.
+ */
+ if (gc != null && chosen != null && !chosen.equals(gc)) {
+ /*
+ * Check for compatibility with gc. If they differ by only the
+ * device then return a new GCconfig with the super-class' GDevice
+ * (and presumably the same visual ID in Xinerama).
+ *
+ */
+ if (!chosen.getDevice().getIDstring().equals(gc.getDevice().getIDstring())) {
+ /*
+ * Here we select a GraphicsConfiguration on the alternate
+ * device that is presumably identical to the chosen
+ * configuration, but on the other device.
+ *
+ * Should really check to ensure that we select a configuration
+ * with the same X visual ID for Xinerama screens, otherwise the
+ * GLDrawable may have the wrong visual ID (I don't think this
+ * ever gets updated). May need to add a method to
+ * X11GLDrawableFactory to do this in a platform specific
+ * manner.
+ *
+ * However, on platforms where we can actually get into this
+ * block, both devices should have the same visual list, and the
+ * same configuration should be selected here.
+ */
+ AWTGraphicsConfiguration config = chooseGraphicsConfiguration((GLCapabilities)awtConfig.getRequestedCapabilities(), chooser, gc.getDevice());
+ final GraphicsConfiguration compatible = (null!=config)?config.getGraphicsConfiguration():null;
+ boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
+ if(DEBUG) {
+ Exception e = new Exception("Call Stack: "+Thread.currentThread().getName());
+ e.printStackTrace();
+ System.err.println("!!! Created Config (n): HAVE GC "+chosen);
+ System.err.println("!!! Created Config (n): THIS GC "+gc);
+ System.err.println("!!! Created Config (n): Choosen GC "+compatible);
+ System.err.println("!!! Created Config (n): HAVE CF "+awtConfig);
+ System.err.println("!!! Created Config (n): Choosen CF "+config);
+ System.err.println("!!! Created Config (n): EQUALS CAPS "+equalCaps);
+ }
+
+ if (compatible != null) {
+ /*
+ * Save the new GC for equals test above, and to return to
+ * any outside callers of this method.
+ */
+ chosen = compatible;
+
+ awtConfig = config;
+
+ if( !equalCaps && GLAutoDrawable.SCREEN_CHANGE_ACTION_ENABLED ) {
+ dispose(true);
+ }
+ }
+ }
+
+ /*
+ * If a compatible GC was not found in the block above, this will
+ * return the GC that was selected in the constructor (and might
+ * cause an exception in Component.checkGD when adding to a
+ * container, but in this case that would be the desired behavior).
+ *
+ */
+ return chosen;
+ } else if (gc == null) {
+ /*
+ * The GC is null, which means we have no native peer, and are not
+ * part of a (realized) component hierarchy. So we return the
+ * desired visual that was selected in the constructor (possibly
+ * null).
+ */
+ return chosen;
+ }
+
+ /*
+ * Otherwise we have not explicitly selected a GC in the constructor, so
+ * just return what Canvas would have.
+ */
+ return gc;
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return drawable.createContext(shareWith);
+ }
+
+ public void setRealized(boolean realized) {
+ }
+
+ private Object closingListener = null;
+ private Object closingListenerLock = new Object();
+
+ public void display() {
+ maybeDoSingleThreadedWorkaround(displayOnEventDispatchThreadAction,
+ displayAction);
+ if(null==closingListener) {
+ synchronized(closingListenerLock) {
+ if(null==closingListener) {
+ closingListener=addClosingListener(this, new DestroyMethod() {
+ public void destroyMethod() { destroy(); } });
+ }
+ }
+ }
+ }
+
+ protected void dispose(boolean regenerate) {
+ if(DEBUG) {
+ Exception ex1 = new Exception("dispose("+regenerate+") - start");
+ ex1.printStackTrace();
+ }
+ disposeRegenerate=regenerate;
+
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ // Workaround for termination issues with applets --
+ // sun.applet.AppletPanel should probably be performing the
+ // remove() call on the EDT rather than on its own thread
+ if (ThreadingImpl.isAWTMode() &&
+ Thread.holdsLock(getTreeLock())) {
+ // The user really should not be invoking remove() from this
+ // thread -- but since he/she is, we can not go over to the
+ // EDT at this point. Try to destroy the context from here.
+ drawableHelper.invokeGL(drawable, context, disposeAction, null);
+ } else {
+ Threading.invokeOnOpenGLThread(disposeOnEventDispatchThreadAction);
+ }
+ } else {
+ drawableHelper.invokeGL(drawable, context, disposeAction, null);
+ }
+
+ if(DEBUG) {
+ System.err.println("dispose("+regenerate+") - stop");
+ }
+ }
+
+ /**
+ * Just an alias for removeNotify
+ */
+ public void destroy() {
+ removeNotify();
+ }
+
+ /** Overridden to cause OpenGL rendering to be performed during
+ repaint cycles. Subclasses which override this method must call
+ super.paint() in their paint() method in order to function
+ properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>paint</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void paint(Graphics g) {
+ if (Beans.isDesignTime()) {
+ // Make GLCanvas behave better in NetBeans GUI builder
+ g.setColor(Color.BLACK);
+ g.fillRect(0, 0, getWidth(), getHeight());
+ FontMetrics fm = g.getFontMetrics();
+ String name = getName();
+ if (name == null) {
+ name = getClass().getName();
+ int idx = name.lastIndexOf('.');
+ if (idx >= 0) {
+ name = name.substring(idx + 1);
+ }
+ }
+ Rectangle2D bounds = fm.getStringBounds(name, g);
+ g.setColor(Color.WHITE);
+ g.drawString(name,
+ (int) ((getWidth() - bounds.getWidth()) / 2),
+ (int) ((getHeight() + bounds.getHeight()) / 2));
+ return;
+ }
+
+ display();
+ }
+
+ /** Overridden to track when this component is added to a container.
+ Subclasses which override this method must call
+ super.addNotify() in their addNotify() method in order to
+ function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>addNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void addNotify() {
+ super.addNotify();
+ if (!Beans.isDesignTime()) {
+ disableBackgroundErase();
+
+ if(null==device) {
+ GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ if(null!=gc) {
+ device = gc.getDevice();
+ }
+ }
+
+ /*
+ * Save the chosen capabilities for use in getGraphicsConfiguration().
+ */
+ awtConfig = chooseGraphicsConfiguration(capabilities, chooser, device);
+ if(DEBUG) {
+ Exception e = new Exception("Created Config: "+awtConfig);
+ e.printStackTrace();
+ }
+ if(null!=awtConfig) {
+ // update ..
+ chosen = awtConfig.getGraphicsConfiguration();
+
+ }
+ if(null==awtConfig) {
+ throw new GLException("Error: AWTGraphicsConfiguration is null");
+ }
+ drawable = GLDrawableFactory.getFactory(glProfile).createGLDrawable(NativeWindowFactory.getNativeWindow(this, awtConfig));
+ context = (GLContextImpl) drawable.createContext(shareWith);
+ context.setSynchronized(true);
+
+ if(DEBUG) {
+ System.err.println("Created Drawable: "+drawable);
+ }
+ drawable.setRealized(true);
+ }
+ }
+
+ /** Overridden to track when this component is removed from a
+ container. Subclasses which override this method must call
+ super.removeNotify() in their removeNotify() method in order to
+ function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void removeNotify() {
+ if(DEBUG) {
+ Exception ex1 = new Exception("removeNotify - start");
+ ex1.printStackTrace();
+ }
+
+ if (Beans.isDesignTime()) {
+ super.removeNotify();
+ } else {
+ try {
+ dispose(false);
+ } finally {
+ drawable=null;
+ super.removeNotify();
+ }
+ }
+ if(DEBUG) {
+ System.out.println("removeNotify - end");
+ }
+ }
+
+ /** Overridden to cause {@link GLDrawableHelper#reshape} to be
+ called on all registered {@link GLEventListener}s. Subclasses
+ which override this method must call super.reshape() in
+ their reshape() method in order to function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>reshape</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void reshape(int x, int y, int width, int height) {
+ super.reshape(x, y, width, height);
+ sendReshape = true;
+ }
+
+ /** <B>Overrides:</B>
+ <DL><DD><CODE>update</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ // Overridden from Canvas to prevent the AWT's clearing of the
+ // canvas from interfering with the OpenGL rendering.
+ public void update(Graphics g) {
+ paint(g);
+ }
+
+ public void addGLEventListener(GLEventListener listener) {
+ drawableHelper.addGLEventListener(listener);
+ }
+
+ public void removeGLEventListener(GLEventListener listener) {
+ drawableHelper.removeGLEventListener(listener);
+ }
+
+ public void setContext(GLContext ctx) {
+ context=(GLContextImpl)ctx;
+ }
+
+ public GLContext getContext() {
+ return context;
+ }
+
+ public GL getGL() {
+ if (Beans.isDesignTime()) {
+ return null;
+ }
+ GLContext context = getContext();
+ return (context == null) ? null : context.getGL();
+ }
+
+ public void setGL(GL gl) {
+ GLContext context = getContext();
+ if (context != null) {
+ context.setGL(gl);
+ }
+ }
+
+
+ public void setAutoSwapBufferMode(boolean onOrOff) {
+ drawableHelper.setAutoSwapBufferMode(onOrOff);
+ }
+
+ public boolean getAutoSwapBufferMode() {
+ return drawableHelper.getAutoSwapBufferMode();
+ }
+
+ public void swapBuffers() {
+ maybeDoSingleThreadedWorkaround(swapBuffersOnEventDispatchThreadAction, swapBuffersAction);
+ }
+
+ public GLProfile getGLProfile() {
+ return glProfile;
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ if (awtConfig == null) {
+ throw new GLException("No AWTGraphicsConfiguration: "+this);
+ }
+
+ return (GLCapabilities)awtConfig.getChosenCapabilities();
+ }
+
+ public GLCapabilities getRequestedGLCapabilities() {
+ if (awtConfig == null) {
+ throw new GLException("No AWTGraphicsConfiguration: "+this);
+ }
+
+ return (GLCapabilities)awtConfig.getRequestedCapabilities();
+ }
+
+ public NativeWindow getNativeWindow() {
+ return drawable.getNativeWindow();
+ }
+
+ public GLDrawableFactory getFactory() {
+ return drawable.getFactory();
+ }
+
+ public String toString() {
+ return "AWT-GLCanvas[ "+awtConfig+", "+((null!=drawable)?drawable.getClass().getName():"null-drawable")+", "+drawableHelper+"]";
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void maybeDoSingleThreadedWorkaround(Runnable eventDispatchThreadAction,
+ Runnable invokeGLAction) {
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ Threading.invokeOnOpenGLThread(eventDispatchThreadAction);
+ } else {
+ drawableHelper.invokeGL(drawable, context, invokeGLAction, initAction);
+ }
+ }
+
+ private boolean disposeRegenerate;
+ private DisposeAction disposeAction = new DisposeAction(this);
+
+ class DisposeAction implements Runnable {
+ private GLCanvas canvas;
+ public DisposeAction(GLCanvas canvas) {
+ this.canvas = canvas;
+ }
+ public void run() {
+ drawableHelper.dispose(GLCanvas.this);
+
+ if(null!=context) {
+ context.makeCurrent(); // implicit wait for lock ..
+ context.destroy();
+ context=null;
+ }
+
+ if(null!=drawable) {
+ drawable.setRealized(false);
+ }
+
+ if(disposeRegenerate) {
+ // recreate GLDrawable to reflect it's new graphics configuration
+ drawable = GLDrawableFactory.getFactory(glProfile).createGLDrawable(NativeWindowFactory.getNativeWindow(canvas, awtConfig));
+ if(DEBUG) {
+ System.err.println("GLCanvas.dispose(true): new drawable: "+drawable);
+ }
+ drawable.setRealized(true);
+ context = (GLContextImpl) drawable.createContext(shareWith);
+ context.setSynchronized(true);
+ sendReshape=true; // ensure a reshape is being send ..
+ }
+ }
+ }
+
+ private DisposeOnEventDispatchThreadAction disposeOnEventDispatchThreadAction =
+ new DisposeOnEventDispatchThreadAction();
+
+ class DisposeOnEventDispatchThreadAction implements Runnable {
+ public void run() {
+ drawableHelper.invokeGL(drawable, context, disposeAction, null);
+ }
+ }
+
+ class InitAction implements Runnable {
+ public void run() {
+ drawableHelper.init(GLCanvas.this);
+ }
+ }
+ private InitAction initAction = new InitAction();
+
+ class DisplayAction implements Runnable {
+ public void run() {
+ if (sendReshape) {
+ // Note: we ignore the given x and y within the parent component
+ // since we are drawing directly into this heavyweight component.
+ int width = getWidth();
+ int height = getHeight();
+ getGL().glViewport(0, 0, width, height);
+ drawableHelper.reshape(GLCanvas.this, 0, 0, width, height);
+ sendReshape = false;
+ }
+
+ drawableHelper.display(GLCanvas.this);
+ }
+ }
+ private DisplayAction displayAction = new DisplayAction();
+
+ class SwapBuffersAction implements Runnable {
+ public void run() {
+ drawable.swapBuffers();
+ }
+ }
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
+
+ // Workaround for ATI driver bugs related to multithreading issues
+ // like simultaneous rendering via Animators to canvases that are
+ // being resized on the AWT event dispatch thread
+ class DisplayOnEventDispatchThreadAction implements Runnable {
+ public void run() {
+ drawableHelper.invokeGL(drawable, context, displayAction, initAction);
+ }
+ }
+ private DisplayOnEventDispatchThreadAction displayOnEventDispatchThreadAction =
+ new DisplayOnEventDispatchThreadAction();
+ class SwapBuffersOnEventDispatchThreadAction implements Runnable {
+ public void run() {
+ drawableHelper.invokeGL(drawable, context, swapBuffersAction, initAction);
+ }
+ }
+ private SwapBuffersOnEventDispatchThreadAction swapBuffersOnEventDispatchThreadAction =
+ new SwapBuffersOnEventDispatchThreadAction();
+
+ // Disables the AWT's erasing of this Canvas's background on Windows
+ // in Java SE 6. This internal API is not available in previous
+ // releases, but the system property
+ // -Dsun.awt.noerasebackground=true can be specified to get similar
+ // results globally in previous releases.
+ private static boolean disableBackgroundEraseInitialized;
+ private static Method disableBackgroundEraseMethod;
+ private void disableBackgroundErase() {
+ if (!disableBackgroundEraseInitialized) {
+ try {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+ Class clazz = getToolkit().getClass();
+ while (clazz != null && disableBackgroundEraseMethod == null) {
+ try {
+ disableBackgroundEraseMethod =
+ clazz.getDeclaredMethod("disableBackgroundErase",
+ new Class[] { Canvas.class });
+ disableBackgroundEraseMethod.setAccessible(true);
+ } catch (Exception e) {
+ clazz = clazz.getSuperclass();
+ }
+ }
+ } catch (Exception e) {
+ }
+ return null;
+ }
+ });
+ } catch (Exception e) {
+ }
+ disableBackgroundEraseInitialized = true;
+ }
+ if (disableBackgroundEraseMethod != null) {
+ try {
+ disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
+ } catch (Exception e) {
+ // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
+ // throw new GLException(e);
+ }
+ }
+ }
+
+ private static AWTGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
+ GLCapabilitiesChooser chooser,
+ GraphicsDevice device) {
+ // Make GLCanvas behave better in NetBeans GUI builder
+ if (Beans.isDesignTime()) {
+ return null;
+ }
+
+ AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device);
+ AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capabilities,
+ chooser,
+ aScreen);
+ if (config == null) {
+ throw new GLException("Error: Couldn't fetch AWTGraphicsConfiguration");
+ }
+
+ return config;
+ }
+}
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
new file mode 100644
index 000000000..5da6a892f
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -0,0 +1,1582 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package 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.impl.*;
+import com.sun.opengl.impl.awt.*;
+
+// FIXME: Subclasses need to call resetGLFunctionAvailability() on their
+// context whenever the displayChanged() function is called on their
+// GLEventListeners
+
+/** A lightweight Swing component which provides OpenGL rendering
+ support. Provided for compatibility with Swing user interfaces
+ when adding a heavyweight doesn't work either because of
+ Z-ordering or LayoutManager problems. <P>
+
+ The GLJPanel can be made transparent by creating it with a
+ GLCapabilities object with alpha bits specified and calling {@link
+ #setOpaque}(false). Pixels with resulting OpenGL alpha values less
+ than 1.0 will be overlaid on any underlying Swing rendering. <P>
+
+ Notes specific to the Reference Implementation: This component
+ attempts to use hardware-accelerated rendering via pbuffers and
+ falls back on to software rendering if problems occur.
+ Note that because this component attempts to use pbuffers for
+ rendering, and because pbuffers can not be resized, somewhat
+ surprising behavior may occur during resize operations; the {@link
+ GLEventListener#init} method may be called multiple times as the
+ pbuffer is resized to be able to cover the size of the GLJPanel.
+ This behavior is correct, as the textures and display lists for
+ the GLJPanel will have been lost during the resize operation. The
+ application should attempt to make its GLEventListener.init()
+ methods as side-effect-free as possible. <P>
+
+*/
+
+public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
+ private static final boolean DEBUG = Debug.debug("GLJPanel");
+ private static final boolean VERBOSE = Debug.verbose();
+
+ private GLDrawableHelper drawableHelper = new GLDrawableHelper();
+ private volatile boolean isInitialized;
+
+ // Data used for either pbuffers or pixmap-based offscreen surfaces
+ private GLCapabilities offscreenCaps;
+ private GLProfile glProfile;
+ private GLDrawableFactoryImpl factory;
+ private GLCapabilitiesChooser chooser;
+ private GLContext shareWith;
+ // Width of the actual GLJPanel
+ private int panelWidth = 0;
+ private int panelHeight = 0;
+ // Lazy reshape notification
+ private boolean handleReshape = false;
+ private boolean sendReshape = true;
+
+ // The backend in use
+ private Backend backend;
+
+ // Used by all backends either directly or indirectly to hook up callbacks
+ private Updater updater = new Updater();
+
+ // Turns off the pbuffer-based backend (used by default, unless the
+ // Java 2D / OpenGL pipeline is in use)
+ private static boolean hardwareAccelerationDisabled =
+ Debug.isPropertyDefined("jogl.gljpanel.nohw");
+
+ // Turns off the fallback to software-based rendering from
+ // pbuffer-based rendering
+ private static boolean softwareRenderingDisabled =
+ Debug.isPropertyDefined("jogl.gljpanel.nosw");
+
+ // Indicates whether the Java 2D OpenGL pipeline is enabled
+ private boolean oglPipelineEnabled =
+ Java2D.isOGLPipelineActive() &&
+ !Debug.isPropertyDefined("jogl.gljpanel.noogl");
+
+ // For handling reshape events lazily
+ private int reshapeX;
+ private int reshapeY;
+ private int reshapeWidth;
+ private int reshapeHeight;
+
+ // These are always set to (0, 0) except when the Java2D / OpenGL
+ // pipeline is active
+ private int viewportX;
+ private int viewportY;
+
+ static {
+ // Force eager initialization of part of the Java2D class since
+ // otherwise it's likely it will try to be initialized while on
+ // the Queue Flusher Thread, which is not allowed
+ if (Java2D.isOGLPipelineActive() && Java2D.isFBOEnabled()) {
+ Java2D.getShareContext(GraphicsEnvironment.
+ getLocalGraphicsEnvironment().
+ getDefaultScreenDevice());
+ }
+ }
+
+ /** Creates a new GLJPanel component with a default set of OpenGL
+ capabilities and using the default OpenGL capabilities selection
+ mechanism. */
+ public GLJPanel() {
+ this(null);
+ }
+
+ /** Creates a new GLJPanel component with the requested set of
+ OpenGL capabilities, using the default OpenGL capabilities
+ selection mechanism. */
+ public GLJPanel(GLCapabilities capabilities) {
+ this(capabilities, null, null);
+ }
+
+ /** Creates a new GLJPanel component. The passed GLCapabilities
+ specifies the OpenGL capabilities for the component; if null, a
+ default set of capabilities is used. The GLCapabilitiesChooser
+ specifies the algorithm for selecting one of the available
+ GLCapabilities for the component; a DefaultGLCapabilitesChooser
+ is used if null is passed for this argument. The passed
+ GLContext specifies an OpenGL context with which to share
+ textures, display lists and other OpenGL state, and may be null
+ if sharing is not desired. See the note in the overview documentation on
+ <a href="../../../overview-summary.html#SHARING">context sharing</a>.
+ */
+ public GLJPanel(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith) {
+ super();
+
+ // Works around problems on many vendors' cards; we don't need a
+ // back buffer for the offscreen surface anyway
+ if (capabilities != null) {
+ offscreenCaps = (GLCapabilities) capabilities.clone();
+ } else {
+ offscreenCaps = new GLCapabilities(null);
+ }
+ offscreenCaps.setDoubleBuffered(false);
+ this.glProfile = offscreenCaps.getGLProfile();
+ this.factory = GLDrawableFactoryImpl.getFactoryImpl(glProfile);
+ this.chooser = ((chooser != null) ? chooser : new DefaultGLCapabilitiesChooser());
+ this.shareWith = shareWith;
+ }
+
+ public void display() {
+ if (EventQueue.isDispatchThread()) {
+ // Want display() to be synchronous, so call paintImmediately()
+ paintImmediately(0, 0, getWidth(), getHeight());
+ } else {
+ // Multithreaded redrawing of Swing components is not allowed,
+ // so do everything on the event dispatch thread
+ try {
+ EventQueue.invokeAndWait(paintImmediatelyAction);
+ } catch (Exception e) {
+ throw new GLException(e);
+ }
+ }
+ }
+
+ protected void dispose(boolean regenerate) {
+ if(DEBUG) {
+ Exception ex1 = new Exception("dispose("+regenerate+") - start");
+ ex1.printStackTrace();
+ }
+ if (backend != null) {
+ disposeRegenerate=regenerate;
+ disposeContext=backend.getContext();
+ disposeDrawable=backend.getDrawable();
+
+ if (Threading.isSingleThreaded() &&
+ !Threading.isOpenGLThread()) {
+ // Workaround for termination issues with applets --
+ // sun.applet.AppletPanel should probably be performing the
+ // remove() call on the EDT rather than on its own thread
+ if (ThreadingImpl.isAWTMode() &&
+ Thread.holdsLock(getTreeLock())) {
+ // The user really should not be invoking remove() from this
+ // thread -- but since he/she is, we can not go over to the
+ // EDT at this point. Try to destroy the context from here.
+ drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
+ } else {
+ Threading.invokeOnOpenGLThread(disposeOnEventDispatchThreadAction);
+ }
+ } else {
+ drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
+ }
+
+ backend.setContext(disposeContext);
+ if(null==disposeContext) {
+ isInitialized = false;
+ }
+ }
+
+ if(DEBUG) {
+ System.err.println("dispose("+regenerate+") - stop");
+ }
+ }
+
+ /**
+ * Just an alias for removeNotify
+ */
+ public void destroy() {
+ removeNotify();
+ }
+
+ /** Overridden to cause OpenGL rendering to be performed during
+ repaint cycles. Subclasses which override this method must call
+ super.paintComponent() in their paintComponent() method in order
+ to function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>paintComponent</CODE> in class <CODE>javax.swing.JComponent</CODE></DD></DL> */
+ protected void paintComponent(final Graphics g) {
+ if (Beans.isDesignTime()) {
+ // Make GLJPanel behave better in NetBeans GUI builder
+ g.setColor(Color.BLACK);
+ g.fillRect(0, 0, getWidth(), getHeight());
+ FontMetrics fm = g.getFontMetrics();
+ String name = getName();
+ if (name == null) {
+ name = getClass().getName();
+ int idx = name.lastIndexOf('.');
+ if (idx >= 0) {
+ name = name.substring(idx + 1);
+ }
+ }
+ Rectangle2D bounds = fm.getStringBounds(name, g);
+ g.setColor(Color.WHITE);
+ g.drawString(name,
+ (int) ((getWidth() - bounds.getWidth()) / 2),
+ (int) ((getHeight() + bounds.getHeight()) / 2));
+ return;
+ }
+
+ if (backend == null || !isInitialized) {
+ createAndInitializeBackend();
+ }
+
+ if (!isInitialized) {
+ return;
+ }
+
+ // NOTE: must do this when the context is not current as it may
+ // involve destroying the pbuffer (current context) and
+ // re-creating it -- tricky to do properly while the context is
+ // current
+ if (handleReshape) {
+ handleReshape();
+ }
+
+ updater.setGraphics(g);
+ backend.doPaintComponent(g);
+ }
+
+ /** Overridden to track when this component is added to a container.
+ Subclasses which override this method must call
+ super.addNotify() in their addNotify() method in order to
+ function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>addNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void addNotify() {
+ super.addNotify();
+ if (DEBUG) {
+ System.err.println("GLJPanel.addNotify()");
+ }
+ }
+
+ /** Overridden to track when this component is removed from a
+ container. Subclasses which override this method must call
+ super.removeNotify() in their removeNotify() method in order to
+ function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>removeNotify</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void removeNotify() {
+ if(DEBUG) {
+ Exception ex1 = new Exception("removeNotify - start");
+ ex1.printStackTrace();
+ }
+ dispose(false);
+ if (backend != null) {
+ backend.destroy();
+ backend = null;
+ }
+ isInitialized = false;
+ super.removeNotify();
+ if(DEBUG) {
+ System.out.println("removeNotify - end");
+ }
+ }
+
+ /** Overridden to cause {@link GLDrawableHelper#reshape} to be
+ called on all registered {@link GLEventListener}s. Subclasses
+ which override this method must call super.reshape() in
+ their reshape() method in order to function properly. <P>
+
+ <B>Overrides:</B>
+ <DL><DD><CODE>reshape</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
+ public void reshape(int x, int y, int width, int height) {
+ super.reshape(x, y, width, height);
+
+ reshapeX = x;
+ reshapeY = y;
+ reshapeWidth = width;
+ reshapeHeight = height;
+ handleReshape = true;
+ }
+
+ public void setOpaque(boolean opaque) {
+ if (backend != null) {
+ backend.setOpaque(opaque);
+ }
+ super.setOpaque(opaque);
+ }
+
+ public void addGLEventListener(GLEventListener listener) {
+ drawableHelper.addGLEventListener(listener);
+ }
+
+ public void removeGLEventListener(GLEventListener listener) {
+ drawableHelper.removeGLEventListener(listener);
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return backend.createContext(shareWith);
+ }
+
+ public void setRealized(boolean realized) {
+ }
+
+ public void setContext(GLContext ctx) {
+ if (backend == null) {
+ return;
+ }
+ backend.setContext(ctx);
+ }
+
+ public GLContext getContext() {
+ if (backend == null) {
+ return null;
+ }
+ return backend.getContext();
+ }
+
+ public GL getGL() {
+ if (Beans.isDesignTime()) {
+ return null;
+ }
+ GLContext context = getContext();
+ return (context == null) ? null : context.getGL();
+ }
+
+ public void setGL(GL gl) {
+ GLContext context = getContext();
+ if (context != null) {
+ context.setGL(gl);
+ }
+ }
+
+ public void setAutoSwapBufferMode(boolean onOrOff) {
+ // In the current implementation this is a no-op. Both the pbuffer
+ // and pixmap based rendering paths use a single-buffered surface
+ // so swapping the buffers doesn't do anything. We also don't
+ // currently have the provision to skip copying the data to the
+ // Swing portion of the GLJPanel in any of the rendering paths.
+ }
+
+ public boolean getAutoSwapBufferMode() {
+ // In the current implementation this is a no-op. Both the pbuffer
+ // and pixmap based rendering paths use a single-buffered surface
+ // so swapping the buffers doesn't do anything. We also don't
+ // currently have the provision to skip copying the data to the
+ // Swing portion of the GLJPanel in any of the rendering paths.
+ return true;
+ }
+
+ public void swapBuffers() {
+ // In the current implementation this is a no-op. Both the pbuffer
+ // and pixmap based rendering paths use a single-buffered surface
+ // so swapping the buffers doesn't do anything. We also don't
+ // currently have the provision to skip copying the data to the
+ // Swing portion of the GLJPanel in any of the rendering paths.
+ }
+
+ /** For a translucent GLJPanel (one for which {@link #setOpaque
+ setOpaque}(false) has been called), indicates whether the
+ application should preserve the OpenGL color buffer
+ (GL_COLOR_BUFFER_BIT) for correct rendering of the GLJPanel and
+ underlying widgets which may show through portions of the
+ GLJPanel with alpha values less than 1. Most Swing
+ implementations currently expect the GLJPanel to be completely
+ cleared (e.g., by <code>glClear(GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT)</code>), but for certain optimized Swing
+ implementations which use OpenGL internally, it may be possible
+ to perform OpenGL rendering using the GLJPanel into the same
+ OpenGL drawable as the Swing implementation uses. */
+ public boolean shouldPreserveColorBufferIfTranslucent() {
+ return oglPipelineEnabled;
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ return backend.getChosenGLCapabilities();
+ }
+
+ public final GLProfile getGLProfile() {
+ return glProfile;
+ }
+
+ public NativeWindow getNativeWindow() {
+ throw new GLException("FIXME");
+ }
+
+ public final GLDrawableFactory getFactory() {
+ return factory;
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void createAndInitializeBackend() {
+ if (panelWidth == 0 ||
+ panelHeight == 0) {
+ // See whether we have a non-zero size yet and can go ahead with
+ // initialization
+ if (reshapeWidth == 0 ||
+ reshapeHeight == 0) {
+ return;
+ }
+
+ // Pull down reshapeWidth and reshapeHeight into panelWidth and
+ // panelHeight eagerly in order to complete initialization, and
+ // force a reshape later
+ panelWidth = reshapeWidth;
+ panelHeight = reshapeHeight;
+ }
+
+ do {
+ if (backend == null) {
+ if (oglPipelineEnabled) {
+ backend = new J2DOGLBackend();
+ } else {
+ if (!hardwareAccelerationDisabled &&
+ factory.canCreateGLPbuffer()) {
+ backend = new PbufferBackend();
+ } else {
+ if (softwareRenderingDisabled) {
+ throw new GLException("Fallback to software rendering disabled by user");
+ }
+ backend = new SoftwareBackend();
+ }
+ }
+ }
+
+ if (!isInitialized) {
+ backend.initialize();
+ }
+ // The backend might set itself to null, indicating it punted to
+ // a different implementation -- try again
+ } while (backend == null);
+
+ if(null==closingListener) {
+ synchronized(closingListenerLock) {
+ if(null==closingListener) {
+ closingListener=GLCanvas.addClosingListener(this, new GLCanvas.DestroyMethod() {
+ public void destroyMethod() { destroy(); } });
+ }
+ }
+ }
+ }
+ private Object closingListener = null;
+ private Object closingListenerLock = new Object();
+
+ private void handleReshape() {
+ panelWidth = reshapeWidth;
+ panelHeight = reshapeHeight;
+
+ if (DEBUG) {
+ System.err.println("GLJPanel.handleReshape: (w,h) = (" +
+ panelWidth + "," + panelHeight + ")");
+ }
+
+ sendReshape = true;
+ backend.handleReshape();
+ handleReshape = false;
+ }
+
+ // This is used as the GLEventListener for the pbuffer-based backend
+ // as well as the callback mechanism for the other backends
+ class Updater implements GLEventListener {
+ private Graphics g;
+
+ public void setGraphics(Graphics g) {
+ this.g = g;
+ }
+
+ public void init(GLAutoDrawable drawable) {
+ if (!backend.preGL(g)) {
+ return;
+ }
+ drawableHelper.init(GLJPanel.this);
+ backend.postGL(g, false);
+ }
+
+ public void dispose(GLAutoDrawable drawable) {
+ drawableHelper.dispose(GLJPanel.this);
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ if (!backend.preGL(g)) {
+ return;
+ }
+ if (sendReshape) {
+ if (DEBUG) {
+ System.err.println("glViewport(" + viewportX + ", " + viewportY + ", " + panelWidth + ", " + panelHeight + ")");
+ }
+ getGL().getGL2().glViewport(viewportX, viewportY, panelWidth, panelHeight);
+ drawableHelper.reshape(GLJPanel.this, viewportX, viewportY, panelWidth, panelHeight);
+ sendReshape = false;
+ }
+
+ drawableHelper.display(GLJPanel.this);
+ backend.postGL(g, true);
+ }
+
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+ // This is handled above and dispatched directly to the appropriate context
+ }
+
+ public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+ }
+ }
+
+ public String toString() {
+ return "AWT-GLJPanel[ "+((null!=backend)?backend.getDrawable().getClass().getName():"null-drawable")+", "+drawableHelper+"]";
+ }
+
+ private boolean disposeRegenerate;
+ private GLContext disposeContext;
+ private GLDrawable disposeDrawable;
+ private DisposeAction disposeAction = new DisposeAction();
+
+ class DisposeAction implements Runnable {
+ public void run() {
+ updater.dispose(GLJPanel.this);
+
+ if(null!=disposeContext) {
+ disposeContext.destroy();
+ disposeContext=null;
+ }
+ if(null!=disposeDrawable) {
+ disposeDrawable.setRealized(false);
+ }
+ if(disposeRegenerate && null!=disposeDrawable) {
+ disposeDrawable.setRealized(true);
+ disposeContext = (GLContextImpl) disposeDrawable.createContext(shareWith);
+ disposeContext.setSynchronized(true);
+ }
+ }
+ }
+
+ private DisposeOnEventDispatchThreadAction disposeOnEventDispatchThreadAction =
+ new DisposeOnEventDispatchThreadAction();
+
+ class DisposeOnEventDispatchThreadAction implements Runnable {
+ public void run() {
+ drawableHelper.invokeGL(disposeDrawable, disposeContext, disposeAction, null);
+ }
+ }
+
+
+ class InitAction implements Runnable {
+ public void run() {
+ updater.init(GLJPanel.this);
+ }
+ }
+ private InitAction initAction = new InitAction();
+
+ class DisplayAction implements Runnable {
+ public void run() {
+ updater.display(GLJPanel.this);
+ }
+ }
+ private DisplayAction displayAction = new DisplayAction();
+
+ class PaintImmediatelyAction implements Runnable {
+ public void run() {
+ paintImmediately(0, 0, getWidth(), getHeight());
+ }
+ }
+ private PaintImmediatelyAction paintImmediatelyAction = new PaintImmediatelyAction();
+
+ private int getNextPowerOf2(int number) {
+ // Workaround for problems where 0 width or height are transiently
+ // seen during layout
+ if (number == 0) {
+ return 2;
+ }
+
+ if (((number-1) & number) == 0) {
+ //ex: 8 -> 0b1000; 8-1=7 -> 0b0111; 0b1000&0b0111 == 0
+ return number;
+ }
+ int power = 0;
+ while (number > 0) {
+ number = number>>1;
+ power++;
+ }
+ return (1<<power);
+ }
+
+ private int getGLInteger(GL gl, int which) {
+ int[] tmp = new int[1];
+ gl.glGetIntegerv(which, tmp, 0);
+ return tmp[0];
+ }
+
+ //----------------------------------------------------------------------
+ // Implementations of the various backends
+ //
+
+ // Abstraction of the different rendering backends: i.e., pure
+ // software / pixmap rendering, pbuffer-based acceleration, Java 2D
+ // / JOGL bridge
+ static interface Backend {
+ // Called each time the backend needs to initialize itself
+ public void initialize();
+
+ // Called when the backend should clean up its resources
+ public void destroy();
+
+ // Called when the opacity of the GLJPanel is changed
+ public void setOpaque(boolean opaque);
+
+ // Called to manually create an additional OpenGL context against
+ // this GLJPanel
+ public GLContext createContext(GLContext shareWith);
+
+ // Called to set the current backend's GLContext
+ public void setContext(GLContext ctx);
+
+ // Called to get the current backend's GLContext
+ public GLContext getContext();
+
+ // Called to get the current backend's GLDrawable
+ public GLDrawable getDrawable();
+
+ // Called to fetch the "real" GLCapabilities for the backend
+ public GLCapabilities getChosenGLCapabilities();
+
+ // Called to fetch the "real" GLProfile for the backend
+ public GLProfile getGLProfile();
+
+ // Called to handle a reshape event. When this is called, the
+ // OpenGL context associated with the backend is not current, to
+ // make it easier to destroy and re-create pbuffers if necessary.
+ public void handleReshape();
+
+ // Called before the OpenGL work is done in init() and display().
+ // If false is returned, this render is aborted.
+ public boolean preGL(Graphics g);
+
+ // Called after the OpenGL work is done in init() and display().
+ // The isDisplay argument indicates whether this was called on
+ // behalf of a call to display() rather than init().
+ public void postGL(Graphics g, boolean isDisplay);
+
+ // Called from within paintComponent() to initiate the render
+ public void doPaintComponent(Graphics g);
+ }
+
+ // Base class used by both the software (pixmap) and pbuffer
+ // backends, both of which rely on reading back the OpenGL frame
+ // buffer and drawing it with a BufferedImage
+ abstract class AbstractReadbackBackend implements Backend {
+ // This image is exactly the correct size to render into the panel
+ protected BufferedImage offscreenImage;
+ // One of these is used to store the read back pixels before storing
+ // in the BufferedImage
+ protected ByteBuffer readBackBytes;
+ protected IntBuffer readBackInts;
+ protected int readBackWidthInPixels;
+ protected int readBackHeightInPixels;
+
+ private int awtFormat;
+ private int glFormat;
+ private int glType;
+
+ // For saving/restoring of OpenGL state during ReadPixels
+ private int[] swapbytes = new int[1];
+ private int[] rowlength = new int[1];
+ private int[] skiprows = new int[1];
+ private int[] skippixels = new int[1];
+ private int[] alignment = new int[1];
+
+ public void setOpaque(boolean opaque) {
+ if (opaque != isOpaque()) {
+ if (offscreenImage != null) {
+ offscreenImage.flush();
+ offscreenImage = null;
+ }
+ }
+ }
+
+ public boolean preGL(Graphics g) {
+ // Empty in this implementation
+ return true;
+ }
+
+ public void postGL(Graphics g, boolean isDisplay) {
+ if (isDisplay) {
+ // Must now copy pixels from offscreen context into surface
+ if (offscreenImage == null) {
+ if (panelWidth > 0 && panelHeight > 0) {
+ // It looks like NVidia's drivers (at least the ones on my
+ // notebook) are buggy and don't allow a sub-rectangle to be
+ // read from a pbuffer...this doesn't really matter because
+ // it's the Graphics.drawImage() calls that are the
+ // bottleneck
+
+ int awtFormat = 0;
+
+ // Should be more flexible in these BufferedImage formats;
+ // perhaps see what the preferred image types are on the
+ // given platform
+ if (isOpaque()) {
+ awtFormat = BufferedImage.TYPE_INT_RGB;
+ } else {
+ awtFormat = BufferedImage.TYPE_INT_ARGB;
+ }
+
+ offscreenImage = new BufferedImage(panelWidth,
+ panelHeight,
+ awtFormat);
+ switch (awtFormat) {
+ case BufferedImage.TYPE_3BYTE_BGR:
+ glFormat = GL2.GL_BGR;
+ glType = GL2.GL_UNSIGNED_BYTE;
+ readBackBytes = ByteBuffer.allocate(readBackWidthInPixels * readBackHeightInPixels * 3);
+ break;
+
+ case BufferedImage.TYPE_INT_RGB:
+ case BufferedImage.TYPE_INT_ARGB:
+ glFormat = GL2.GL_BGRA;
+ glType = getGLPixelType();
+ readBackInts = IntBuffer.allocate(readBackWidthInPixels * readBackHeightInPixels);
+ break;
+
+ default:
+ // FIXME: Support more off-screen image types (current
+ // offscreen context implementations don't use others, and
+ // some of the OpenGL formats aren't supported in the 1.1
+ // headers, which we're currently using)
+ throw new GLException("Unsupported offscreen image type " + awtFormat);
+ }
+ }
+ }
+
+ if (offscreenImage != null) {
+ GL2 gl = getGL().getGL2();
+ // Save current modes
+ gl.glGetIntegerv(GL2.GL_PACK_SWAP_BYTES, swapbytes, 0);
+ gl.glGetIntegerv(GL2.GL_PACK_ROW_LENGTH, rowlength, 0);
+ gl.glGetIntegerv(GL2.GL_PACK_SKIP_ROWS, skiprows, 0);
+ gl.glGetIntegerv(GL2.GL_PACK_SKIP_PIXELS, skippixels, 0);
+ gl.glGetIntegerv(GL2.GL_PACK_ALIGNMENT, alignment, 0);
+
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, GL.GL_FALSE);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, readBackWidthInPixels);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
+ gl.glPixelStorei(GL2.GL_PACK_ALIGNMENT, 1);
+
+ // Actually read the pixels.
+ gl.glReadBuffer(GL2.GL_FRONT);
+ if (readBackBytes != null) {
+ gl.glReadPixels(0, 0, readBackWidthInPixels, readBackHeightInPixels, glFormat, glType, readBackBytes);
+ } else if (readBackInts != null) {
+ gl.glReadPixels(0, 0, readBackWidthInPixels, readBackHeightInPixels, glFormat, glType, readBackInts);
+ }
+
+ // Restore saved modes.
+ gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, swapbytes[0]);
+ gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, rowlength[0]);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, skiprows[0]);
+ gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, skippixels[0]);
+ gl.glPixelStorei(GL2.GL_PACK_ALIGNMENT, alignment[0]);
+
+ if (readBackBytes != null || readBackInts != null) {
+ // Copy temporary data into raster of BufferedImage for faster
+ // blitting Note that we could avoid this copy in the cases
+ // where !offscreenContext.offscreenImageNeedsVerticalFlip(),
+ // but that's the software rendering path which is very slow
+ // anyway
+ Object src = null;
+ Object dest = null;
+ int srcIncr = 0;
+ int destIncr = 0;
+
+ if (readBackBytes != null) {
+ src = readBackBytes.array();
+ dest = ((DataBufferByte) offscreenImage.getRaster().getDataBuffer()).getData();
+ srcIncr = readBackWidthInPixels * 3;
+ destIncr = offscreenImage.getWidth() * 3;
+ } else {
+ src = readBackInts.array();
+ dest = ((DataBufferInt) offscreenImage.getRaster().getDataBuffer()).getData();
+ srcIncr = readBackWidthInPixels;
+ destIncr = offscreenImage.getWidth();
+ }
+
+ if (flipVertically()) {
+ int srcPos = 0;
+ int destPos = (offscreenImage.getHeight() - 1) * destIncr;
+ for (; destPos >= 0; srcPos += srcIncr, destPos -= destIncr) {
+ System.arraycopy(src, srcPos, dest, destPos, destIncr);
+ }
+ } else {
+ int srcPos = 0;
+ int destEnd = destIncr * offscreenImage.getHeight();
+ for (int destPos = 0; destPos < destEnd; srcPos += srcIncr, destPos += destIncr) {
+ System.arraycopy(src, srcPos, dest, destPos, destIncr);
+ }
+ }
+
+ // Note: image will be drawn back in paintComponent() for
+ // correctness on all platforms
+ }
+ }
+ }
+ }
+
+ public void doPaintComponent(Graphics g) {
+ doPaintComponentImpl();
+ if (offscreenImage != null) {
+ // Draw resulting image in one shot
+ g.drawImage(offscreenImage, 0, 0,
+ offscreenImage.getWidth(),
+ offscreenImage.getHeight(),
+ GLJPanel.this);
+ }
+ }
+
+ protected abstract void doPaintComponentImpl();
+ protected abstract int getGLPixelType();
+ protected abstract boolean flipVertically();
+ }
+
+ class SoftwareBackend extends AbstractReadbackBackend {
+ // Implementation using software rendering
+ private GLDrawableImpl offscreenDrawable;
+ private GLContextImpl offscreenContext;
+
+ public void initialize() {
+ // Fall-through path: create an offscreen context instead
+ offscreenDrawable = factory.createOffscreenDrawable(offscreenCaps,
+ chooser,
+ Math.max(1, panelWidth),
+ Math.max(1, panelHeight));
+ offscreenContext = (GLContextImpl) offscreenDrawable.createContext(shareWith);
+ offscreenContext.setSynchronized(true);
+ isInitialized = true;
+ }
+
+ public void destroy() {
+ if (offscreenContext != null) {
+ offscreenContext.destroy();
+ offscreenContext = null;
+ }
+ if (offscreenDrawable != null) {
+ offscreenDrawable.destroy();
+ offscreenDrawable = null;
+ }
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return offscreenDrawable.createContext(shareWith);
+ }
+
+ public void setContext(GLContext ctx) {
+ offscreenContext=(GLContextImpl)ctx;
+ }
+
+ public GLContext getContext() {
+ return offscreenContext;
+ }
+
+ public GLDrawable getDrawable() {
+ return offscreenDrawable;
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ if (offscreenDrawable == null) {
+ return null;
+ }
+ return offscreenDrawable.getChosenGLCapabilities();
+ }
+
+ public GLProfile getGLProfile() {
+ if (offscreenDrawable == null) {
+ return null;
+ }
+ return offscreenDrawable.getGLProfile();
+ }
+
+ public void handleReshape() {
+ destroy();
+ initialize();
+ readBackWidthInPixels = Math.max(1, panelWidth);
+ readBackHeightInPixels = Math.max(1, panelHeight);
+
+ if (offscreenImage != null) {
+ offscreenImage.flush();
+ offscreenImage = null;
+ }
+ }
+
+ protected void doPaintComponentImpl() {
+ drawableHelper.invokeGL(offscreenDrawable, offscreenContext, displayAction, initAction);
+ }
+
+ protected int getGLPixelType() {
+ return offscreenContext.getOffscreenContextPixelDataType();
+ }
+
+ protected boolean flipVertically() {
+ return offscreenContext.offscreenImageNeedsVerticalFlip();
+ }
+ }
+
+ class PbufferBackend extends AbstractReadbackBackend {
+ private GLPbuffer pbuffer;
+ private int pbufferWidth = 256;
+ private int pbufferHeight = 256;
+
+ public void initialize() {
+ if (pbuffer != null) {
+ throw new InternalError("Creating pbuffer twice without destroying it (memory leak / correctness bug)");
+ }
+ try {
+ pbuffer = factory.createGLPbuffer(offscreenCaps,
+ null,
+ pbufferWidth,
+ pbufferHeight,
+ shareWith);
+ pbuffer.addGLEventListener(updater);
+ isInitialized = true;
+ } catch (GLException e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ System.err.println("GLJPanel: Falling back on software rendering because of problems creating pbuffer");
+ }
+ hardwareAccelerationDisabled = true;
+ backend = null;
+ isInitialized = false;
+ createAndInitializeBackend();
+ }
+ }
+
+ public void destroy() {
+ if (pbuffer != null) {
+ pbuffer.destroy();
+ pbuffer = null;
+ }
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ return pbuffer.createContext(shareWith);
+ }
+
+ public void setContext(GLContext ctx) {
+ if (pbuffer == null && Beans.isDesignTime()) {
+ return;
+ }
+ pbuffer.setContext(ctx);
+ }
+
+ public GLContext getContext() {
+ // Workaround for crashes in NetBeans GUI builder
+ if (pbuffer == null && Beans.isDesignTime()) {
+ return null;
+ }
+ return pbuffer.getContext();
+ }
+
+ public GLDrawable getDrawable() {
+ return pbuffer;
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ if (pbuffer == null) {
+ return null;
+ }
+ return pbuffer.getChosenGLCapabilities();
+ }
+
+ public GLProfile getGLProfile() {
+ if (pbuffer == null) {
+ return null;
+ }
+ return pbuffer.getGLProfile();
+ }
+
+ public void handleReshape() {
+ // Use factor larger than 2 during shrinks for some hysteresis
+ float shrinkFactor = 2.5f;
+ if ((panelWidth > pbufferWidth) || (panelHeight > pbufferHeight) ||
+ (panelWidth < (pbufferWidth / shrinkFactor)) || (panelHeight < (pbufferHeight / shrinkFactor))) {
+ if (DEBUG) {
+ System.err.println("Resizing pbuffer from (" + pbufferWidth + ", " + pbufferHeight + ") " +
+ " to fit (" + panelWidth + ", " + panelHeight + ")");
+ }
+ // Must destroy and recreate pbuffer to fit
+ if (pbuffer != null) {
+ // Watch for errors during pbuffer destruction (due to
+ // buggy / bad OpenGL drivers, in particular SiS) and fall
+ // back to software rendering
+ try {
+ pbuffer.destroy();
+ } catch (GLException e) {
+ hardwareAccelerationDisabled = true;
+ backend = null;
+ isInitialized = false;
+ // Just disabled hardware acceleration during this resize operation; do a fixup
+ readBackWidthInPixels = Math.max(1, panelWidth);
+ readBackHeightInPixels = Math.max(1, panelHeight);
+ if (DEBUG) {
+ System.err.println("WARNING: falling back to software rendering due to bugs in OpenGL drivers");
+ e.printStackTrace();
+ }
+ createAndInitializeBackend();
+ return;
+ }
+ }
+ pbuffer = null;
+ isInitialized = false;
+ pbufferWidth = getNextPowerOf2(panelWidth);
+ pbufferHeight = getNextPowerOf2(panelHeight);
+ if (DEBUG && !hardwareAccelerationDisabled) {
+ System.err.println("New pbuffer size is (" + pbufferWidth + ", " + pbufferHeight + ")");
+ }
+ initialize();
+ }
+
+ // It looks like NVidia's drivers (at least the ones on my
+ // notebook) are buggy and don't allow a rectangle of less than
+ // the pbuffer's width to be read...this doesn't really matter
+ // because it's the Graphics.drawImage() calls that are the
+ // bottleneck. Should probably make the size of the offscreen
+ // image be the exact size of the pbuffer to save some work on
+ // resize operations...
+ readBackWidthInPixels = pbufferWidth;
+ readBackHeightInPixels = panelHeight;
+
+ if (offscreenImage != null) {
+ offscreenImage.flush();
+ offscreenImage = null;
+ }
+ }
+
+ protected void doPaintComponentImpl() {
+ pbuffer.display();
+ }
+
+ protected int getGLPixelType() {
+ // This seems to be a good choice on all platforms
+ return GL2.GL_UNSIGNED_INT_8_8_8_8_REV;
+ }
+
+ protected boolean flipVertically() {
+ return true;
+ }
+ }
+
+ class J2DOGLBackend implements Backend {
+ // Opaque Object identifier representing the Java2D surface we are
+ // drawing to; used to determine when to destroy and recreate JOGL
+ // context
+ private Object j2dSurface;
+ // Graphics object being used during Java2D update action
+ // (absolutely essential to cache this)
+ private Graphics cached2DGraphics;
+ // No-op context representing the Java2D OpenGL context
+ private GLContext j2dContext;
+ // Context associated with no-op drawable representing the JOGL
+ // OpenGL context
+ private GLDrawable joglDrawable;
+ // The real OpenGL context JOGL uses to render
+ private GLContext joglContext;
+ // State captured from Java2D OpenGL context necessary in order to
+ // properly render into Java2D back buffer
+ private int[] drawBuffer = new int[1];
+ private int[] readBuffer = new int[1];
+ // This is required when the FBO option of the Java2D / OpenGL
+ // pipeline is active
+ private int[] frameBuffer = new int[1];
+ // Current (as of this writing) NVidia drivers have a couple of bugs
+ // relating to the sharing of framebuffer and renderbuffer objects
+ // between contexts. It appears we have to (a) reattach the color
+ // attachment and (b) actually create new depth buffer storage and
+ // attach it in order for the FBO to behave properly in our context.
+ private boolean checkedForFBObjectWorkarounds;
+ private boolean fbObjectWorkarounds;
+ private int[] frameBufferDepthBuffer;
+ private int[] frameBufferTexture;
+ private boolean createNewDepthBuffer;
+ // Current (as of this writing) ATI drivers have problems when the
+ // same FBO is bound in two different contexts. Here we check for
+ // this case and explicitly release the FBO from Java2D's context
+ // before switching to ours. Java2D will re-bind the FBO when it
+ // makes its context current the next time. Interestingly, if we run
+ // this code path on NVidia hardware, it breaks the rendering
+ // results -- no output is generated. This doesn't appear to be an
+ // interaction with the abovementioned NVidia-specific workarounds,
+ // as even if we disable that code the FBO is still reported as
+ // incomplete in our context.
+ private boolean checkedGLVendor;
+ private boolean vendorIsATI;
+
+ // Holding on to this GraphicsConfiguration is a workaround for a
+ // problem in the Java 2D / JOGL bridge when FBOs are enabled; see
+ // comment related to Issue 274 below
+ private GraphicsConfiguration workaroundConfig;
+
+ public void initialize() {
+ // No-op in this implementation; everything is done lazily
+ isInitialized = true;
+ }
+
+ public void destroy() {
+ Java2D.invokeWithOGLContextCurrent(null, new Runnable() {
+ public void run() {
+ if (joglContext != null) {
+ joglContext.destroy();
+ joglContext = null;
+ }
+ joglDrawable = null;
+ if (j2dContext != null) {
+ j2dContext.destroy();
+ j2dContext = null;
+ }
+ }
+ });
+ }
+
+ public void setOpaque(boolean opaque) {
+ // Empty in this implementation
+ }
+
+ public GLContext createContext(GLContext shareWith) {
+ // FIXME: should implement this, but it was not properly
+ // implemented before the refactoring anyway
+ throw new GLException("Not yet implemented");
+ }
+
+ public void setContext(GLContext ctx) {
+ joglContext=ctx;
+ }
+
+ public GLContext getContext() {
+ return joglContext;
+ }
+
+ public GLDrawable getDrawable() {
+ return joglDrawable;
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ // FIXME: should do better than this; is it possible to using only platform-independent code?
+ return new GLCapabilities(null);
+ }
+
+ public GLProfile getGLProfile() {
+ // FIXME: should do better than this; is it possible to using only platform-independent code?
+ return GLProfile.getDefault();
+ }
+
+ public void handleReshape() {
+ // Empty in this implementation
+ }
+
+ public boolean preGL(Graphics g) {
+ GL2 gl = joglContext.getGL().getGL2();
+ // Set up needed state in JOGL context from Java2D context
+ gl.glEnable(GL2.GL_SCISSOR_TEST);
+ Rectangle r = Java2D.getOGLScissorBox(g);
+
+ if (r == null) {
+ if (DEBUG && VERBOSE) {
+ System.err.println("Java2D.getOGLScissorBox() returned null");
+ }
+ return false;
+ }
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLJPanel: gl.glScissor(" + r.x + ", " + r.y + ", " + r.width + ", " + r.height + ")");
+ }
+
+ gl.glScissor(r.x, r.y, r.width, r.height);
+ Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
+ // If the viewport X or Y changes, in addition to the panel's
+ // width or height, we need to send a reshape operation to the
+ // client
+ if ((viewportX != oglViewport.x) ||
+ (viewportY != oglViewport.y)) {
+ sendReshape = true;
+ if (DEBUG) {
+ System.err.println("Sending reshape because viewport changed");
+ System.err.println(" viewportX (" + viewportX + ") ?= oglViewport.x (" + oglViewport.x + ")");
+ System.err.println(" viewportY (" + viewportY + ") ?= oglViewport.y (" + oglViewport.y + ")");
+ }
+ }
+ viewportX = oglViewport.x;
+ viewportY = oglViewport.y;
+
+ // If the FBO option is active, bind to the FBO from the Java2D
+ // context.
+ // Note that all of the plumbing in the context sharing stuff will
+ // allow us to bind to this object since it's in our namespace.
+ if (Java2D.isFBOEnabled() &&
+ Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) {
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLJPanel: Binding to framebuffer object " + frameBuffer[0]);
+ }
+
+ // The texture target for Java2D's OpenGL pipeline when using FBOs
+ // -- either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB
+ int fboTextureTarget = Java2D.getOGLTextureType(g);
+
+ if (!checkedForFBObjectWorkarounds) {
+ checkedForFBObjectWorkarounds = true;
+ gl.glBindTexture(fboTextureTarget, 0);
+ gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]);
+ if (gl.glCheckFramebufferStatus(GL2.GL_FRAMEBUFFER) !=
+ GL2.GL_FRAMEBUFFER_COMPLETE) {
+ // Need to do workarounds
+ fbObjectWorkarounds = true;
+ createNewDepthBuffer = true;
+ if (DEBUG) {
+ System.err.println("-- GLJPanel: discovered frame_buffer_object workarounds to be necessary");
+ }
+ } else {
+ // Don't need the frameBufferTexture temporary any more
+ frameBufferTexture = null;
+ }
+ }
+
+ if (fbObjectWorkarounds && createNewDepthBuffer) {
+ if (frameBufferDepthBuffer == null)
+ frameBufferDepthBuffer = new int[1];
+
+ // Create our own depth renderbuffer and associated storage
+ // If we have an old one, delete it
+ if (frameBufferDepthBuffer[0] != 0) {
+ gl.glDeleteRenderbuffers(1, frameBufferDepthBuffer, 0);
+ frameBufferDepthBuffer[0] = 0;
+ }
+
+ gl.glBindTexture(fboTextureTarget, frameBufferTexture[0]);
+ int[] width = new int[1];
+ int[] height = new int[1];
+ gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_WIDTH, width, 0);
+ gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_HEIGHT, height, 0);
+
+ gl.glGenRenderbuffers(1, frameBufferDepthBuffer, 0);
+ if (DEBUG) {
+ System.err.println("GLJPanel: Generated frameBufferDepthBuffer " + frameBufferDepthBuffer[0] +
+ " with width " + width[0] + ", height " + height[0]);
+ }
+
+ gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, frameBufferDepthBuffer[0]);
+ // FIXME: may need a loop here like in Java2D
+ gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER, GL2.GL_DEPTH_COMPONENT24, width[0], height[0]);
+
+ gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0);
+ createNewDepthBuffer = false;
+ }
+
+ gl.glBindTexture(fboTextureTarget, 0);
+ gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]);
+
+ if (fbObjectWorkarounds) {
+ // Hook up the color and depth buffer attachment points for this framebuffer
+ gl.glFramebufferTexture2D(GL2.GL_FRAMEBUFFER,
+ GL2.GL_COLOR_ATTACHMENT0,
+ fboTextureTarget,
+ frameBufferTexture[0],
+ 0);
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLJPanel: frameBufferDepthBuffer: " + frameBufferDepthBuffer[0]);
+ }
+ gl.glFramebufferRenderbuffer(GL2.GL_FRAMEBUFFER,
+ GL2.GL_DEPTH_ATTACHMENT,
+ GL2.GL_RENDERBUFFER,
+ frameBufferDepthBuffer[0]);
+ }
+
+ if (DEBUG) {
+ int status = gl.glCheckFramebufferStatus(GL2.GL_FRAMEBUFFER);
+ if (status != GL2.GL_FRAMEBUFFER_COMPLETE) {
+ throw new GLException("Error: framebuffer was incomplete: status = 0x" +
+ Integer.toHexString(status));
+ }
+ }
+ } else {
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLJPanel: Setting up drawBuffer " + drawBuffer[0] +
+ " and readBuffer " + readBuffer[0]);
+ }
+
+ gl.glDrawBuffer(drawBuffer[0]);
+ gl.glReadBuffer(readBuffer[0]);
+ }
+
+ return true;
+ }
+
+ public void postGL(Graphics g, boolean isDisplay) {
+ // Cause OpenGL pipeline to flush its results because
+ // otherwise it's possible we will buffer up multiple frames'
+ // rendering results, resulting in apparent mouse lag
+ GL gl = getGL();
+ gl.glFinish();
+
+ if (Java2D.isFBOEnabled() &&
+ Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) {
+ // Unbind the framebuffer from our context to work around
+ // apparent driver bugs or at least unspecified behavior causing
+ // OpenGL to run out of memory with certain cards and drivers
+ gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
+ }
+ }
+
+ public void doPaintComponent(final Graphics g) {
+ // This is a workaround for an issue in the Java 2D / JOGL
+ // bridge (reported by an end user as JOGL Issue 274) where Java
+ // 2D can occasionally leave its internal OpenGL context current
+ // to the on-screen window rather than its internal "scratch"
+ // pbuffer surface to which the FBO is attached. JOGL expects to
+ // find a stable OpenGL drawable (on Windows, an HDC) upon which
+ // it can create another OpenGL context. It turns out that, on
+ // Windows, when Java 2D makes its internal OpenGL context
+ // current against the window in order to put pixels on the
+ // screen, it gets the device context for the window, makes its
+ // context current, and releases the device context. This means
+ // that when JOGL's Runnable gets to run below, the HDC is
+ // already invalid. The workaround for this is to force Java 2D
+ // to make its context current to the scratch surface, which we
+ // can do by executing an empty Runnable with the "shared"
+ // context current. This will be fixed in a Java SE 6 update
+ // release, hopefully 6u2.
+ if (Java2D.isFBOEnabled()) {
+ if (workaroundConfig == null) {
+ workaroundConfig = GraphicsEnvironment.
+ getLocalGraphicsEnvironment().
+ getDefaultScreenDevice().
+ getDefaultConfiguration();
+ }
+ Java2D.invokeWithOGLSharedContextCurrent(workaroundConfig, new Runnable() { public void run() {}});
+ }
+
+ Java2D.invokeWithOGLContextCurrent(g, new Runnable() {
+ public void run() {
+ if (DEBUG && VERBOSE) {
+ System.err.println("-- In invokeWithOGLContextCurrent");
+ }
+
+ // Create no-op context representing Java2D context
+ if (j2dContext == null) {
+ j2dContext = factory.createExternalGLContext();
+ if (DEBUG) {
+ j2dContext.setGL(new DebugGL2(j2dContext.getGL().getGL2()));
+ }
+
+ // Check to see whether we can support the requested
+ // capabilities or need to fall back to a pbuffer
+ // FIXME: add more checks?
+
+ j2dContext.makeCurrent();
+ GL gl = j2dContext.getGL();
+ if ((getGLInteger(gl, GL2.GL_RED_BITS) < offscreenCaps.getRedBits()) ||
+ (getGLInteger(gl, GL2.GL_GREEN_BITS) < offscreenCaps.getGreenBits()) ||
+ (getGLInteger(gl, GL2.GL_BLUE_BITS) < offscreenCaps.getBlueBits()) ||
+ // (getGLInteger(gl, GL2.GL_ALPHA_BITS) < offscreenCaps.getAlphaBits()) ||
+ (getGLInteger(gl, GL2.GL_ACCUM_RED_BITS) < offscreenCaps.getAccumRedBits()) ||
+ (getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) < offscreenCaps.getAccumGreenBits()) ||
+ (getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS) < offscreenCaps.getAccumBlueBits()) ||
+ (getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) < offscreenCaps.getAccumAlphaBits()) ||
+ // (getGLInteger(gl, GL2.GL_DEPTH_BITS) < offscreenCaps.getDepthBits()) ||
+ (getGLInteger(gl, GL2.GL_STENCIL_BITS) < offscreenCaps.getStencilBits())) {
+ if (DEBUG) {
+ System.err.println("GLJPanel: Falling back to pbuffer-based support because Java2D context insufficient");
+ System.err.println(" Available Required");
+ System.err.println("GL_RED_BITS " + getGLInteger(gl, GL2.GL_RED_BITS) + " " + offscreenCaps.getRedBits());
+ System.err.println("GL_GREEN_BITS " + getGLInteger(gl, GL2.GL_GREEN_BITS) + " " + offscreenCaps.getGreenBits());
+ System.err.println("GL_BLUE_BITS " + getGLInteger(gl, GL2.GL_BLUE_BITS) + " " + offscreenCaps.getBlueBits());
+ System.err.println("GL_ALPHA_BITS " + getGLInteger(gl, GL2.GL_ALPHA_BITS) + " " + offscreenCaps.getAlphaBits());
+ System.err.println("GL_ACCUM_RED_BITS " + getGLInteger(gl, GL2.GL_ACCUM_RED_BITS) + " " + offscreenCaps.getAccumRedBits());
+ System.err.println("GL_ACCUM_GREEN_BITS " + getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) + " " + offscreenCaps.getAccumGreenBits());
+ System.err.println("GL_ACCUM_BLUE_BITS " + getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS) + " " + offscreenCaps.getAccumBlueBits());
+ System.err.println("GL_ACCUM_ALPHA_BITS " + getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) + " " + offscreenCaps.getAccumAlphaBits());
+ System.err.println("GL_DEPTH_BITS " + getGLInteger(gl, GL2.GL_DEPTH_BITS) + " " + offscreenCaps.getDepthBits());
+ System.err.println("GL_STENCIL_BITS " + getGLInteger(gl, GL2.GL_STENCIL_BITS) + " " + offscreenCaps.getStencilBits());
+ }
+ isInitialized = false;
+ backend = null;
+ oglPipelineEnabled = false;
+ handleReshape = true;
+ j2dContext.release();
+ j2dContext.destroy();
+ j2dContext = null;
+ return;
+ }
+ j2dContext.release();
+ }
+
+ j2dContext.makeCurrent();
+ try {
+ captureJ2DState(j2dContext.getGL(), g);
+ Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
+ if (curSurface != null) {
+ if (j2dSurface != curSurface) {
+ if (joglContext != null) {
+ joglContext.destroy();
+ joglContext = null;
+ joglDrawable = null;
+ sendReshape = true;
+ if (DEBUG) {
+ System.err.println("Sending reshape because surface changed");
+ System.err.println("New surface = " + curSurface);
+ }
+ }
+ j2dSurface = curSurface;
+ }
+ if (joglContext == null) {
+ if (factory.canCreateExternalGLDrawable()) {
+ joglDrawable = factory.createExternalGLDrawable();
+ joglContext = joglDrawable.createContext(shareWith);
+ } else if (factory.canCreateContextOnJava2DSurface()) {
+ // Mac OS X code path
+ joglContext = factory.createContextOnJava2DSurface(g, shareWith);
+ }
+ if (DEBUG) {
+ joglContext.setGL(new DebugGL2(joglContext.getGL().getGL2()));
+ }
+
+ if (Java2D.isFBOEnabled() &&
+ Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT &&
+ fbObjectWorkarounds) {
+ createNewDepthBuffer = true;
+ }
+ }
+ if (joglContext instanceof Java2DGLContext) {
+ // Mac OS X code path
+ ((Java2DGLContext) joglContext).setGraphics(g);
+ }
+
+ if (DEBUG && VERBOSE && Java2D.isFBOEnabled()) {
+ System.err.print("-- Surface type: ");
+ int surfaceType = Java2D.getOGLSurfaceType(g);
+ if (surfaceType == Java2D.UNDEFINED) {
+ System.err.println("UNDEFINED");
+ } else if (surfaceType == Java2D.WINDOW) {
+ System.err.println("WINDOW");
+ } else if (surfaceType == Java2D.PBUFFER) {
+ System.err.println("PBUFFER");
+ } else if (surfaceType == Java2D.TEXTURE) {
+ System.err.println("TEXTURE");
+ } else if (surfaceType == Java2D.FLIP_BACKBUFFER) {
+ System.err.println("FLIP_BACKBUFFER");
+ } else if (surfaceType == Java2D.FBOBJECT) {
+ System.err.println("FBOBJECT");
+ } else {
+ System.err.println("(Unknown surface type " + surfaceType + ")");
+ }
+ }
+
+ drawableHelper.invokeGL(joglDrawable, joglContext, displayAction, initAction);
+ }
+ } finally {
+ j2dContext.release();
+ }
+ }
+ });
+ }
+
+ private void captureJ2DState(GL gl, Graphics g) {
+ gl.glGetIntegerv(GL2.GL_DRAW_BUFFER, drawBuffer, 0);
+ gl.glGetIntegerv(GL2.GL_READ_BUFFER, readBuffer, 0);
+ if (Java2D.isFBOEnabled() &&
+ Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) {
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLJPanel: Fetching GL_FRAMEBUFFER_BINDING_EXT");
+ }
+ gl.glGetIntegerv(GL2.GL_FRAMEBUFFER_BINDING, frameBuffer, 0);
+
+ if (fbObjectWorkarounds ||
+ !checkedForFBObjectWorkarounds) {
+ // See above for description of what we are doing here
+ if (frameBufferTexture == null)
+ frameBufferTexture = new int[1];
+
+ // Query the framebuffer for its color buffer so we can hook
+ // it back up in our context (should not be necessary)
+ gl.glGetFramebufferAttachmentParameteriv(GL2.GL_FRAMEBUFFER,
+ GL2.GL_COLOR_ATTACHMENT0,
+ GL2.GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,
+ frameBufferTexture, 0);
+ if (DEBUG && VERBOSE) {
+ System.err.println("GLJPanel: FBO COLOR_ATTACHMENT0: " + frameBufferTexture[0]);
+ }
+ }
+
+ if (!checkedGLVendor) {
+ checkedGLVendor = true;
+ String vendor = gl.glGetString(GL2.GL_VENDOR);
+
+ if ((vendor != null) &&
+ vendor.startsWith("ATI")) {
+ vendorIsATI = true;
+ }
+ }
+
+ if (vendorIsATI) {
+ // Unbind the FBO from Java2D's context as it appears that
+ // driver bugs on ATI's side are causing problems if the FBO is
+ // simultaneously bound to more than one context. Java2D will
+ // re-bind the FBO during the next validation of its context.
+ // Note: this breaks rendering at least on NVidia hardware
+ gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, 0);
+ }
+ }
+ }
+ }
+}
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
new file mode 100644
index 000000000..5563ea9c8
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLLightingFunc.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package javax.media.opengl.fixedfunc;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+
+public interface GLLightingFunc {
+ public static final int GL_LIGHT0 = 0x4000;
+ public static final int GL_LIGHT1 = 0x4001;
+ public static final int GL_LIGHT2 = 0x4002;
+ public static final int GL_LIGHT3 = 0x4003;
+ public static final int GL_LIGHT4 = 0x4004;
+ public static final int GL_LIGHT5 = 0x4005;
+ public static final int GL_LIGHT6 = 0x4006;
+ public static final int GL_LIGHT7 = 0x4007;
+ public static final int GL_LIGHTING = 0xB50;
+ public static final int GL_AMBIENT = 0x1200;
+ public static final int GL_DIFFUSE = 0x1201;
+ public static final int GL_SPECULAR = 0x1202;
+ public static final int GL_POSITION = 0x1203;
+ public static final int GL_SPOT_DIRECTION = 0x1204;
+ public static final int GL_SPOT_EXPONENT = 0x1205;
+ public static final int GL_SPOT_CUTOFF = 0x1206;
+ public static final int GL_CONSTANT_ATTENUATION = 0x1207;
+ public static final int GL_LINEAR_ATTENUATION = 0x1208;
+ public static final int GL_QUADRATIC_ATTENUATION = 0x1209;
+ public static final int GL_EMISSION = 0x1600;
+ public static final int GL_SHININESS = 0x1601;
+ public static final int GL_AMBIENT_AND_DIFFUSE = 0x1602;
+ public static final int GL_COLOR_MATERIAL = 0xB57;
+ public static final int GL_NORMALIZE = 0xBA1;
+
+ public static final int GL_FLAT = 0x1D00;
+ public static final int GL_SMOOTH = 0x1D01;
+
+ public void glLightfv(int light, int pname, java.nio.FloatBuffer params);
+ public void glLightfv(int light, int pname, float[] params, int params_offset);
+ public void glMaterialf(int face, int pname, float param);
+ public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params);
+ public void glMaterialfv(int face, int pname, float[] params, int params_offset);
+ public void glColor4f(float red, float green, float blue, float alpha);
+ public void glShadeModel(int mode);
+
+}
+
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
new file mode 100644
index 000000000..61757abde
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package javax.media.opengl.fixedfunc;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+
+public interface GLMatrixFunc {
+
+ public static final int GL_MATRIX_MODE = 0x0BA0;
+ public static final int GL_MODELVIEW = 0x1700;
+ public static final int GL_PROJECTION = 0x1701;
+ // public static final int GL_TEXTURE = 0x1702; // Use GL.GL_TEXTURE due to ambiguous GL usage
+ public static final int GL_MODELVIEW_MATRIX = 0x0BA6;
+ public static final int GL_PROJECTION_MATRIX = 0x0BA7;
+ public static final int GL_TEXTURE_MATRIX = 0x0BA8;
+
+ /**
+ * glGetFloatv
+ * @param pname GL_MODELVIEW_MATRIX, GL_PROJECTION_MATRIX or GL_TEXTURE_MATRIX
+ * @param params the FloatBuffer's position remains unchanged,
+ * which is the same behavior than the native JOGL GL impl
+ */
+ public void glGetFloatv(int pname, java.nio.FloatBuffer params);
+ public void glGetFloatv(int pname, float[] params, int params_offset);
+ /**
+ * glGetIntegerv
+ * @param pname GL_MATRIX_MODE
+ * @param params the FloatBuffer's position remains unchanged
+ * which is the same behavior than the native JOGL GL impl
+ */
+ public void glGetIntegerv(int pname, IntBuffer params);
+ public void glGetIntegerv(int pname, int[] params, int params_offset);
+
+ /**
+ * sets the current matrix
+ * @param pname GL_MODELVIEW, GL_PROJECTION or GL.GL_TEXTURE
+ */
+ public void glMatrixMode(int mode) ;
+
+ public void glPushMatrix();
+ public void glPopMatrix();
+
+ public void glLoadIdentity() ;
+
+ /**
+ * glLoadMatrixf
+ * @param params the FloatBuffer's position remains unchanged,
+ * which is the same behavior than the native JOGL GL impl
+ */
+ public void glLoadMatrixf(java.nio.FloatBuffer m) ;
+ public void glLoadMatrixf(float[] m, int m_offset);
+
+ /**
+ * glMultMatrixf
+ * @param params the FloatBuffer's position remains unchanged,
+ * which is the same behavior than the native JOGL GL impl
+ */
+ public void glMultMatrixf(java.nio.FloatBuffer m) ;
+ public void glMultMatrixf(float[] m, int m_offset);
+
+ public void glTranslatef(float x, float y, float z) ;
+
+ public void glRotatef(float angle, float x, float y, float z);
+
+ public void glScalef(float x, float y, float z) ;
+
+ public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) ;
+
+ public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar);
+
+}
+
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
new file mode 100644
index 000000000..ed7bef5d4
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFunc.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
+ */
+
+package javax.media.opengl.fixedfunc;
+
+import java.nio.*;
+
+import javax.media.opengl.*;
+
+public interface GLPointerFunc {
+ public static final int GL_VERTEX_ARRAY = 0x8074;
+ public static final int GL_NORMAL_ARRAY = 0x8075;
+ public static final int GL_COLOR_ARRAY = 0x8076;
+ public static final int GL_TEXTURE_COORD_ARRAY = 0x8078;
+
+ public void glEnableClientState(int arrayName);
+ public void glDisableClientState(int arrayName);
+
+ public void glVertexPointer(GLArrayData array);
+ public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer);
+ public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset);
+
+ public void glColorPointer(GLArrayData array);
+ public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer);
+ public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset);
+ public void glColor4f(float red, float green, float blue, float alpha);
+
+ public void glNormalPointer(GLArrayData array);
+ public void glNormalPointer(int type, int stride, java.nio.Buffer pointer);
+ public void glNormalPointer(int type, int stride, long pointer_buffer_offset);
+
+ public void glTexCoordPointer(GLArrayData array);
+ public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer);
+ public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset);
+
+}
+
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUnurbs.java b/src/jogl/classes/javax/media/opengl/glu/GLUnurbs.java
new file mode 100755
index 000000000..2641115d0
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUnurbs.java
@@ -0,0 +1,8 @@
+package javax.media.opengl.glu;
+
+/**
+ * Wrapper for a GLU NURBS object.
+ */
+
+public interface GLUnurbs {
+}
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java b/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java
new file mode 100755
index 000000000..d5a7a11f3
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUquadric.java
@@ -0,0 +1,33 @@
+package javax.media.opengl.glu;
+
+import javax.media.opengl.GL;
+import com.sun.opengl.util.ImmModeSink;
+
+/**
+ * Wrapper for a GLU quadric object.
+ */
+
+public interface GLUquadric {
+ // enable/disables the Immediate Mode Sink module.
+ // This defaults to false for GLUgl2,
+ // and is always true for GLUes1.
+ public void enableImmModeSink(boolean val);
+
+ public boolean isImmModeSinkEnabled();
+
+ // set Immediate Mode usage.
+ // This defaults to false at GLU creation time.
+ // If enabled rendering will happen immediately,
+ // otherwise rendering will be hold in the ImmModeSink
+ // object, to be rendered deferred.
+ public void setImmMode(boolean val);
+
+ public boolean getImmMode();
+
+ // creates a new ImmModeSink (VBO Buffers) and
+ // returns the old vbo buffer with it's rendering result
+ public ImmModeSink replaceImmModeSink();
+
+ // gl may be null, then the GL client states are not disabled
+ public void resetImmModeSink(GL gl);
+}
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java
new file mode 100755
index 000000000..cb7bd9d76
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellator.java
@@ -0,0 +1,66 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package javax.media.opengl.glu;
+
+/**
+ * The <b>GLUtessellator</b> object is used to hold the data, such as the
+ * vertices, edges and callback objects, to describe and tessellate complex
+ * polygons. A <b>GLUtessellator</b> object is used with the
+ * {@link GLU GLU} tessellator methods and
+ * {@link GLUtessellatorCallback GLU callbacks}.
+ *
+ * @author Eric Veach, July 1994
+ * @author Java Port: Pepijn Van Eechhoudt, July 2003
+ * @author Java Port: Nathan Parker Burg, August 2003
+ */
+public interface GLUtessellator {}
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java
new file mode 100755
index 000000000..4b5ec63b7
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallback.java
@@ -0,0 +1,356 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package javax.media.opengl.glu;
+
+/**
+ * <b>GLUtessellatorCallback</b> interface provides methods that the user will
+ * override to define the callbacks for a tessellation object.
+ *
+ * @author Eric Veach, July 1994
+ * @author Java Port: Pepijn Van Eeckhoudt, July 2003
+ * @author Java Port: Nathan Parker Burg, August 2003
+ */
+public interface GLUtessellatorCallback {
+ /**
+ * The <b>begin</b> callback method is invoked like
+ * {@link javax.media.opengl.GL#glBegin glBegin} to indicate the start of a
+ * (triangle) primitive. The method takes a single argument of type int. If
+ * the <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_FALSE</b>, then
+ * the argument is set to either <b>GL_TRIANGLE_FAN</b>,
+ * <b>GL_TRIANGLE_STRIP</b>, or <b>GL_TRIANGLES</b>. If the
+ * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_TRUE</b>, then the
+ * argument will be set to <b>GL_LINE_LOOP</b>.
+ *
+ * @param type
+ * Specifics the type of begin/end pair being defined. The following
+ * values are valid: <b>GL_TRIANGLE_FAN</b>, <b>GL_TRIANGLE_STRIP</b>,
+ * <b>GL_TRIANGLES</b> or <b>GL_LINE_LOOP</b>.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #end end
+ * @see #begin begin
+ */
+ public void begin(int type);
+
+ /**
+ * The same as the {@link #begin begin} callback method except that
+ * it takes an additional reference argument. This reference is
+ * identical to the opaque reference provided when {@link
+ * GLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
+ *
+ * @param type
+ * Specifics the type of begin/end pair being defined. The following
+ * values are valid: <b>GL_TRIANGLE_FAN</b>, <b>GL_TRIANGLE_STRIP</b>,
+ * <b>GL_TRIANGLES</b> or <b>GL_LINE_LOOP</b>.
+ * @param polygonData
+ * Specifics a reference to user-defined data.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #endData endData
+ * @see #begin begin
+ */
+ public void beginData(int type, Object polygonData);
+
+
+ /**
+ * The <b>edgeFlag</b> callback method is similar to
+ * {@link javax.media.opengl.GL#glEdgeFlag glEdgeFlag}. The method takes
+ * a single boolean boundaryEdge that indicates which edges lie on the
+ * polygon boundary. If the boundaryEdge is <b>GL_TRUE</b>, then each vertex
+ * that follows begins an edge that lies on the polygon boundary, that is,
+ * an edge that separates an interior region from an exterior one. If the
+ * boundaryEdge is <b>GL_FALSE</b>, then each vertex that follows begins an
+ * edge that lies in the polygon interior. The edge flag callback (if
+ * defined) is invoked before the first vertex callback.<P>
+ *
+ * Since triangle fans and triangle strips do not support edge flags, the
+ * begin callback is not called with <b>GL_TRIANGLE_FAN</b> or
+ * <b>GL_TRIANGLE_STRIP</b> if a non-null edge flag callback is provided.
+ * (If the callback is initialized to null, there is no impact on
+ * performance). Instead, the fans and strips are converted to independent
+ * triangles.
+ *
+ * @param boundaryEdge
+ * Specifics which edges lie on the polygon boundary.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #edgeFlagData edgeFlagData
+ */
+ public void edgeFlag(boolean boundaryEdge);
+
+
+ /**
+ * The same as the {@link #edgeFlag edgeFlage} callback method
+ * except that it takes an additional reference argument. This
+ * reference is identical to the opaque reference provided when
+ * {@link GLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
+ *
+ * @param boundaryEdge
+ * Specifics which edges lie on the polygon boundary.
+ * @param polygonData
+ * Specifics a reference to user-defined data.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #edgeFlag edgeFlag
+ */
+ public void edgeFlagData(boolean boundaryEdge, Object polygonData);
+
+
+ /**
+ * The <b>vertex</b> callback method is invoked between the {@link
+ * #begin begin} and {@link #end end} callback methods. It is
+ * similar to {@link javax.media.opengl.GL#glVertex3f glVertex3f},
+ * and it defines the vertices of the triangles created by the
+ * tessellation process. The method takes a reference as its only
+ * argument. This reference is identical to the opaque reference
+ * provided by the user when the vertex was described (see {@link
+ * GLU#gluTessVertex gluTessVertex}).
+ *
+ * @param vertexData
+ * Specifics a reference to the vertices of the triangles created
+ * by the tessellation process.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #vertexData vertexData
+ */
+ public void vertex(Object vertexData);
+
+
+ /**
+ * The same as the {@link #vertex vertex} callback method except
+ * that it takes an additional reference argument. This reference is
+ * identical to the opaque reference provided when {@link
+ * GLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
+ *
+ * @param vertexData
+ * Specifics a reference to the vertices of the triangles created
+ * by the tessellation process.
+ * @param polygonData
+ * Specifics a reference to user-defined data.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #vertex vertex
+ */
+ public void vertexData(Object vertexData, Object polygonData);
+
+
+ /**
+ * The end callback serves the same purpose as
+ * {@link javax.media.opengl.GL#glEnd glEnd}. It indicates the end of a
+ * primitive and it takes no arguments.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #begin begin
+ * @see #endData endData
+ */
+ public void end();
+
+
+ /**
+ * The same as the {@link #end end} callback method except that it
+ * takes an additional reference argument. This reference is
+ * identical to the opaque reference provided when {@link
+ * GLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
+ *
+ * @param polygonData
+ * Specifics a reference to user-defined data.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #beginData beginData
+ * @see #end end
+ */
+ public void endData(Object polygonData);
+
+
+ /**
+ * The <b>combine</b> callback method is called to create a new vertex when
+ * the tessellation detects an intersection, or wishes to merge features. The
+ * method takes four arguments: an array of three elements each of type
+ * double, an array of four references, an array of four elements each of
+ * type float, and a reference to a reference.<P>
+ *
+ * The vertex is defined as a linear combination of up to four existing
+ * vertices, stored in <i>data</i>. The coefficients of the linear combination
+ * are given by <i>weight</i>; these weights always add up to 1. All vertex
+ * pointers are valid even when some of the weights are 0. <i>coords</i> gives
+ * the location of the new vertex.<P>
+ *
+ * The user must allocate another vertex, interpolate parameters using
+ * <i>data</i> and <i>weight</i>, and return the new vertex pointer in
+ * <i>outData</i>. This handle is supplied during rendering callbacks. The
+ * user is responsible for freeing the memory some time after
+ * {@link GLU#gluTessEndPolygon gluTessEndPolygon} is
+ * called.<P>
+ *
+ * For example, if the polygon lies in an arbitrary plane in 3-space, and a
+ * color is associated with each vertex, the <b>GLU_TESS_COMBINE</b>
+ * callback might look like this:
+ * </UL>
+ * <PRE>
+ * void myCombine(double[] coords, Object[] data,
+ * float[] weight, Object[] outData)
+ * {
+ * MyVertex newVertex = new MyVertex();
+ *
+ * newVertex.x = coords[0];
+ * newVertex.y = coords[1];
+ * newVertex.z = coords[2];
+ * newVertex.r = weight[0]*data[0].r +
+ * weight[1]*data[1].r +
+ * weight[2]*data[2].r +
+ * weight[3]*data[3].r;
+ * newVertex.g = weight[0]*data[0].g +
+ * weight[1]*data[1].g +
+ * weight[2]*data[2].g +
+ * weight[3]*data[3].g;
+ * newVertex.b = weight[0]*data[0].b +
+ * weight[1]*data[1].b +
+ * weight[2]*data[2].b +
+ * weight[3]*data[3].b;
+ * newVertex.a = weight[0]*data[0].a +
+ * weight[1]*data[1].a +
+ * weight[2]*data[2].a +
+ * weight[3]*data[3].a;
+ * outData = newVertex;
+ * }</PRE>
+ *
+ * @param coords
+ * Specifics the location of the new vertex.
+ * @param data
+ * Specifics the vertices used to create the new vertex.
+ * @param weight
+ * Specifics the weights used to create the new vertex.
+ * @param outData
+ * Reference user the put the coodinates of the new vertex.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #combineData combineData
+ */
+ public void combine(double[] coords, Object[] data,
+ float[] weight, Object[] outData);
+
+
+ /**
+ * The same as the {@link #combine combine} callback method except
+ * that it takes an additional reference argument. This reference is
+ * identical to the opaque reference provided when {@link
+ * GLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
+ *
+ * @param coords
+ * Specifics the location of the new vertex.
+ * @param data
+ * Specifics the vertices used to create the new vertex.
+ * @param weight
+ * Specifics the weights used to create the new vertex.
+ * @param outData
+ * Reference user the put the coodinates of the new vertex.
+ * @param polygonData
+ * Specifics a reference to user-defined data.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #combine combine
+ */
+ public void combineData(double[] coords, Object[] data,
+ float[] weight, Object[] outData,
+ Object polygonData);
+
+
+ /**
+ * The <b>error</b> callback method is called when an error is encountered.
+ * The one argument is of type int; it indicates the specific error that
+ * occurred and will be set to one of <b>GLU_TESS_MISSING_BEGIN_POLYGON</b>,
+ * <b>GLU_TESS_MISSING_END_POLYGON</b>, <b>GLU_TESS_MISSING_BEGIN_CONTOUR</b>,
+ * <b>GLU_TESS_MISSING_END_CONTOUR</b>, <b>GLU_TESS_COORD_TOO_LARGE</b>,
+ * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> or <b>GLU_OUT_OF_MEMORY</b>.
+ * Character strings describing these errors can be retrieved with the
+ * {@link GLU#gluErrorString gluErrorString} call.<P>
+ *
+ * The GLU library will recover from the first four errors by inserting the
+ * missing call(s). <b>GLU_TESS_COORD_TOO_LARGE</b> indicates that some
+ * vertex coordinate exceeded the predefined constant
+ * <b>GLU_TESS_MAX_COORD</b> in absolute value, and that the value has been
+ * clamped. (Coordinate values must be small enough so that two can be
+ * multiplied together without overflow.)
+ * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> indicates that the tessellation
+ * detected an intersection between two edges in the input data, and the
+ * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback was not
+ * provided. No output is generated. <b>GLU_OUT_OF_MEMORY</b> indicates that
+ * there is not enough memory so no output is generated.
+ *
+ * @param errnum
+ * Specifics the error number code.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #errorData errorData
+ */
+ public void error(int errnum);
+
+
+ /**
+ * The same as the {@link #error error} callback method except that
+ * it takes an additional reference argument. This reference is
+ * identical to the opaque reference provided when {@link
+ * GLU#gluTessBeginPolygon gluTessBeginPolygon} was called.
+ *
+ * @param errnum
+ * Specifics the error number code.
+ * @param polygonData
+ * Specifics a reference to user-defined data.
+ *
+ * @see GLU#gluTessCallback gluTessCallback
+ * @see #error error
+ */
+ public void errorData(int errnum, Object polygonData);
+
+ //void mesh(com.sun.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
new file mode 100755
index 000000000..bf6f2d29a
--- /dev/null
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
@@ -0,0 +1,84 @@
+/*
+* Portions Copyright (C) 2003-2006 Sun Microsystems, Inc.
+* All rights reserved.
+*/
+
+/*
+** License Applicability. Except to the extent portions of this file are
+** made subject to an alternative license as permitted in the SGI Free
+** Software License B, Version 1.1 (the "License"), the contents of this
+** file are subject only to the provisions of the License. You may not use
+** this file except in compliance with the License. You may obtain a copy
+** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
+** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
+**
+** http://oss.sgi.com/projects/FreeB
+**
+** Note that, as provided in the License, the Software is distributed on an
+** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
+** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
+** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
+** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
+**
+** NOTE: The Original Code (as defined below) has been licensed to Sun
+** Microsystems, Inc. ("Sun") under the SGI Free Software License B
+** (Version 1.1), shown above ("SGI License"). Pursuant to Section
+** 3.2(3) of the SGI License, Sun is distributing the Covered Code to
+** you under an alternative license ("Alternative License"). This
+** Alternative License includes all of the provisions of the SGI License
+** except that Section 2.2 and 11 are omitted. Any differences between
+** the Alternative License and the SGI License are offered solely by Sun
+** and not by SGI.
+**
+** Original Code. The Original Code is: OpenGL Sample Implementation,
+** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
+** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
+** Copyright in any portions created by third parties is as indicated
+** elsewhere herein. All Rights Reserved.
+**
+** Additional Notice Provisions: The application programming interfaces
+** established by SGI in conjunction with the Original Code are The
+** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
+** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
+** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
+** Window System(R) (Version 1.3), released October 19, 1998. This software
+** was created using the OpenGL(R) version 1.2.1 Sample Implementation
+** published by SGI, but has not been independently verified as being
+** compliant with the OpenGL(R) version 1.2.1 Specification.
+**
+** Author: Eric Veach, July 1994
+** Java Port: Pepijn Van Eeckhoudt, July 2003
+** Java Port: Nathan Parker Burg, August 2003
+*/
+package javax.media.opengl.glu;
+
+/**
+ * The <b>GLUtessellatorCallbackAdapter</b> provides a default implementation of
+ * {@link GLUtessellatorCallback GLUtessellatorCallback}
+ * with empty callback methods. This class can be extended to provide user
+ * defined callback methods.
+ *
+ * @author Eric Veach, July 1994
+ * @author Java Port: Pepijn Van Eechhoudt, July 2003
+ * @author Java Port: Nathan Parker Burg, August 2003
+ */
+
+public class GLUtessellatorCallbackAdapter implements GLUtessellatorCallback {
+ public void begin(int type) {}
+ 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 error(int errnum) {}
+ public void combine(double[] coords, Object[] data,
+ float[] weight, Object[] outData) {}
+ public void beginData(int type, Object polygonData) {}
+ public void edgeFlagData(boolean boundaryEdge,
+ Object polygonData) {}
+ public void vertexData(Object vertexData, Object polygonData) {}
+ public void endData(Object polygonData) {}
+ public void errorData(int errnum, Object polygonData) {}
+ public void combineData(double[] coords, Object[] data,
+ float[] weight, Object[] outData,
+ Object polygonData) {}
+}
diff --git a/src/jogl/native/GLXGetProcAddressARB.c b/src/jogl/native/GLXGetProcAddressARB.c
new file mode 100644
index 000000000..6e9f6c3c2
--- /dev/null
+++ b/src/jogl/native/GLXGetProcAddressARB.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+#if defined(__sun) || defined(_HPUX)
+#include <dlfcn.h>
+
+/* HP-UX doesn't define RTLD_DEFAULT. */
+#if defined(_HPUX) && !defined(RTLD_DEFAULT)
+#define RTLD_DEFAULT NULL
+#endif
+
+/* Sun's GLX implementation doesn't have glXGetProcAddressARB (or
+ glXGetProcAddress) so we implement it here */
+void (*glXGetProcAddressARB(const char *procname))() {
+ return (void (*)()) dlsym(RTLD_DEFAULT, procname);
+}
+#endif /* __ sun || _HPUX */
diff --git a/src/jogl/native/audio/Mixer.cpp b/src/jogl/native/audio/Mixer.cpp
new file mode 100755
index 000000000..8843c00ec
--- /dev/null
+++ b/src/jogl/native/audio/Mixer.cpp
@@ -0,0 +1,199 @@
+#include <windows.h>
+#include <stdlib.h>
+#include <mmsystem.h>
+#include <mmreg.h>
+#include "com_sun_javafx_audio_windows_waveout_Mixer.h"
+
+static HANDLE event = NULL;
+static HWAVEOUT output = NULL;
+// We use only two buffers to keep latency down
+#define NUM_BUFFERS 2
+//#define NUM_BUFFERS 4
+// This is about 20 ms of data for WAVE_FORMAT_PCM:
+// (44100 samples / sec) * (20 ms / 1000 ms) * (2 bytes / sample) * (2 channels)
+//#define BUFFER_SIZE 3528
+
+// This is about 50 ms of data for WAVE_FORMAT_PCM:
+// (44100 samples / sec) * (50 ms / 1000 ms) * (2 bytes / sample) * (1 channel)
+//#define BUFFER_SIZE 4410
+
+// This is about 200 ms of data for WAVE_FORMAT_PCM:
+// (44100 samples / sec) * (200 ms / 1000 ms) * (2 bytes / sample) * (1 channel)
+//#define BUFFER_SIZE 17640
+
+// This is about 200 ms of data for WAVE_FORMAT_PCM:
+// (44100 samples / sec) * (200 ms / 1000 ms) * (2 bytes / sample) * (2 channel)
+//#define BUFFER_SIZE 35280
+
+// This is about 1000 ms of data for WAVE_FORMAT_PCM:
+// (44100 samples / sec) * (1000 ms / 1000 ms) * (2 bytes / sample) * (1 channel)
+//#define BUFFER_SIZE 88200
+
+// This is about 50 ms of data for WAVE_FORMAT_PCM:
+// (44100 samples / sec) * (50 ms / 1000 ms) * (2 bytes / sample) * (2 channels)
+//#define BUFFER_SIZE 8820
+
+// This is about 50 ms of data for WAVE_FORMAT_IEEE_FLOAT:
+// (44100 samples / sec) * (50 ms / 1000 ms) * (4 bytes / sample) * (2 channels)
+//#define BUFFER_SIZE 17640
+
+// This is about 200 ms of data for WAVE_FORMAT_PCM:
+// (11025 samples / sec) * (200 ms / 1000 ms) * (2 bytes / sample) * (2 channel)
+#define BUFFER_SIZE 8820
+
+//#define BUFFER_SIZE 8192
+static WAVEHDR** buffers = NULL;
+
+void CALLBACK playbackCallback(HWAVEOUT output,
+ UINT msg,
+ DWORD_PTR userData,
+ DWORD_PTR param1,
+ DWORD_PTR param2)
+{
+ if (msg == WOM_DONE) {
+ WAVEHDR* hdr = (WAVEHDR*) param1;
+ hdr->dwFlags |= WHDR_DONE;
+ SetEvent(event);
+ }
+}
+
+JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_initializeWaveOut
+ (JNIEnv *env, jclass unused, jlong eventObject)
+{
+ event = (HANDLE) eventObject;
+
+ // Note the hard requirements on the RawSoundConverter's output format
+ WAVEFORMATEX format;
+ format.wFormatTag = WAVE_FORMAT_PCM;
+ // format.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
+ format.nChannels = 2;
+ // format.nChannels = 1;
+ // format.nSamplesPerSec = 44100;
+ format.nSamplesPerSec = 11025;
+ format.wBitsPerSample = 16;
+ // format.wBitsPerSample = 32;
+ format.nBlockAlign = format.nChannels * format.wBitsPerSample / 8;
+ format.nAvgBytesPerSec = format.nBlockAlign * format.nSamplesPerSec;
+ format.cbSize = 0;
+ MMRESULT res = waveOutOpen(&output,
+ WAVE_MAPPER,
+ &format,
+ /* NULL, */ (DWORD_PTR) &playbackCallback,
+ NULL, // No user data right now
+ /* CALLBACK_NULL */ CALLBACK_FUNCTION);
+ if (res != MMSYSERR_NOERROR) {
+ return JNI_FALSE;
+ }
+
+ buffers = (WAVEHDR**) calloc(NUM_BUFFERS, sizeof(WAVEHDR));
+ for (int i = 0; i < NUM_BUFFERS; i++) {
+ char* data = (char*) calloc(BUFFER_SIZE, 1);
+ WAVEHDR* hdr = (WAVEHDR*) calloc(1, sizeof(WAVEHDR));
+ hdr->lpData = data;
+ hdr->dwBufferLength = BUFFER_SIZE;
+ hdr->dwFlags |= WHDR_DONE;
+ buffers[i] = hdr;
+ }
+
+ return JNI_TRUE;
+}
+
+JNIEXPORT void JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_shutdownWaveOut
+ (JNIEnv *env, jclass unused)
+{
+ // writeString("Pausing\n");
+ waveOutPause(output);
+ // writeString("Resetting\n");
+ waveOutReset(output);
+ // writeString("Closing output\n");
+ waveOutClose(output);
+}
+
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_getNextMixerBuffer
+ (JNIEnv *env, jclass unused)
+{
+ WAVEHDR* hdr = NULL;
+ for (int i = 0; i < NUM_BUFFERS; i++) {
+ if (buffers[i] != NULL && ((buffers[i]->dwFlags & WHDR_DONE) != 0)) {
+ hdr = buffers[i];
+ hdr->dwFlags &= ~WHDR_DONE;
+ break;
+ }
+ }
+ return (jlong) hdr;
+}
+
+JNIEXPORT jobject JNICALL Java_com_sun_javafx_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
+ (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
+ (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
+ (JNIEnv *env, jclass unused, jlong mixerBuffer)
+{
+ MMRESULT res = waveOutPrepareHeader(output,
+ (WAVEHDR*) mixerBuffer,
+ sizeof(WAVEHDR));
+ if (res == MMSYSERR_NOERROR) {
+ return JNI_TRUE;
+ }
+ return JNI_FALSE;
+}
+
+JNIEXPORT jboolean JNICALL Java_com_sun_javafx_audio_windows_waveout_Mixer_writeMixerBuffer
+ (JNIEnv *env, jclass unused, jlong mixerBuffer)
+{
+ MMRESULT res = waveOutWrite(output,
+ (WAVEHDR*) mixerBuffer,
+ sizeof(WAVEHDR));
+ if (res == MMSYSERR_NOERROR) {
+ waveOutRestart(output);
+
+ return JNI_TRUE;
+ }
+ return JNI_FALSE;
+}
+
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_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
+ (JNIEnv *env, jclass unused, jlong eventObject)
+{
+ DWORD res = WaitForSingleObject((HANDLE) eventObject, INFINITE);
+ if (res == WAIT_OBJECT_0) {
+ return JNI_TRUE;
+ }
+ return JNI_FALSE;
+}
+
+JNIEXPORT void JNICALL Java_com_sun_javafx_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
+ (JNIEnv *env, jclass unused, jlong eventObject)
+{
+ CloseHandle((HANDLE) eventObject);
+}
diff --git a/src/jogl/native/macosx/ContextUpdater.h b/src/jogl/native/macosx/ContextUpdater.h
new file mode 100644
index 000000000..e8b757fac
--- /dev/null
+++ b/src/jogl/native/macosx/ContextUpdater.h
@@ -0,0 +1,40 @@
+/*
+
+Listens to NSViewGlobalFrameDidChangeNotification
+
+This notification is sent whenever an NSView that has an attached NSSurface changes size or changes screens (thus potentially changing graphics hardware drivers.)
+
+*/
+
+#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
+#import <AppKit/NSView.h>
+#import <OpenGL/OpenGL.h>
+#import <OpenGL/gl.h>
+
+//#define DEBUG_GL_LOCKS
+
+#ifdef DEBUG_GL_LOCKS
+ #define LOCK_GL(func, line) [ContextUpdater lockInFunction:func atLine:line];
+ #define UNLOCK_GL(func, line) [ContextUpdater unlockInFunction:func atLine:line];
+#else
+ #define LOCK_GL(func, line) [ContextUpdater lock];
+ #define UNLOCK_GL(func, line) [ContextUpdater unlock];
+#endif
+
+// gznote: OpenGL NOT thread safe - need to sync on update and paints
+
+@interface ContextUpdater : NSObject
+{
+}
+
++ (void) lock;
++ (void) lockInFunction:(char *)func atLine:(int)line;
++ (void) unlock;
++ (void) unlockInFunction:(char *)func atLine:(int)line;
+
+- (void) registerFor:(NSOpenGLContext *)context with: (NSView *)window;
+
+- (void) update:(NSNotification *)notification;
+
+@end
diff --git a/src/jogl/native/macosx/ContextUpdater.m b/src/jogl/native/macosx/ContextUpdater.m
new file mode 100644
index 000000000..587782c98
--- /dev/null
+++ b/src/jogl/native/macosx/ContextUpdater.m
@@ -0,0 +1,83 @@
+#import "ContextUpdater.h"
+#import <pthread.h>
+
+@implementation ContextUpdater
+{
+}
+
+static NSOpenGLContext *theContext;
+static pthread_mutex_t resourceLock = PTHREAD_MUTEX_INITIALIZER;
+
+static void printLockDebugInfo(char *message, char *func, int line)
+{
+ fprintf(stderr, "%s in function: \"%s\" at line: %d\n", message, func, line);
+ fflush(stderr);
+}
+
++ (void) lock
+{
+ if (theContext != NULL)
+ {
+ pthread_mutex_lock(&resourceLock);
+ }
+}
+
++ (void) lockInFunction:(char *)func atLine:(int)line
+{
+ if (theContext != NULL)
+ {
+ printLockDebugInfo("locked ", func, line);
+ [self lock];
+ }
+}
+
++ (void) unlock
+{
+ if (theContext != NULL)
+ {
+ pthread_mutex_unlock(&resourceLock);
+ }
+}
+
++ (void) unlockInFunction:(char *)func atLine:(int)line
+{
+ if (theContext != NULL)
+ {
+ printLockDebugInfo("unlocked", func, line);
+ [self unlock];
+ }
+}
+
+- (void) registerFor:(NSOpenGLContext *)context with: (NSView *)view
+{
+ if (view != NULL)
+ {
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update:) name:NSViewGlobalFrameDidChangeNotification object: view];
+ theContext = context;
+ }
+}
+
+- (void) update:(NSNotification *)notification
+{
+ [ContextUpdater lock];
+
+ [theContext update];
+
+ [ContextUpdater unlock];
+}
+
+- (id) init
+{
+ theContext = NULL;
+
+ return [super init];
+}
+
+- (void) dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [super dealloc];
+}
+
+@end \ No newline at end of file
diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
new file mode 100644
index 000000000..350f6152f
--- /dev/null
+++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m
@@ -0,0 +1,702 @@
+/* Note: usage of AvailabilityMacros.h to detect whether we're
+ building on OS X 10.3 does not work because the header #defines
+ MAC_OS_X_VERSION_10_4 even though the machine is a 10.3 machine
+
+#include <AvailabilityMacros.h>
+
+#ifndef MAC_OS_X_VERSION_10_3
+ #error building JOGL requires Mac OS X 10.3 or greater
+#endif
+
+#ifndef MAC_OS_X_VERSION_10_4
+ #define NSOpenGLPFAColorFloat kCGLPFAColorFloat
+ #define kCGLNoError 0
+#endif
+*/
+
+#import <Cocoa/Cocoa.h>
+#import <OpenGL/gl.h>
+#import <OpenGL/CGLTypes.h>
+#import <jni.h>
+#import "ContextUpdater.h"
+
+#import "macosx-window-system.h"
+
+// see MacOSXPbufferGLContext.java createPbuffer
+#define USE_GL_TEXTURE_RECTANGLE_EXT
+
+#ifdef USE_GL_TEXTURE_RECTANGLE_EXT
+ #ifndef GL_TEXTURE_RECTANGLE_EXT
+ #define GL_TEXTURE_RECTANGLE_EXT 0x84F5
+ #endif
+#endif
+
+// Workarounds for compiling on 10.3
+#ifndef kCGLRGBA16161616Bit
+#define kCGLRGBA16161616Bit 0x00800000 /* 64 argb bit/pixel, R=63:48, G=47:32, B=31:16, A=15:0 */
+#define kCGLRGBFloat64Bit 0x01000000 /* 64 rgb bit/pixel, half float */
+#define kCGLRGBAFloat64Bit 0x02000000 /* 64 argb bit/pixel, half float */
+#define kCGLRGBFloat128Bit 0x04000000 /* 128 rgb bit/pixel, ieee float */
+#define kCGLRGBAFloat128Bit 0x08000000 /* 128 argb bit/pixel, ieee float */
+#define kCGLRGBFloat256Bit 0x10000000 /* 256 rgb bit/pixel, ieee double */
+#define kCGLRGBAFloat256Bit 0x20000000 /* 256 argb bit/pixel, ieee double */
+#endif
+
+struct _RendererInfo
+{
+ long id; // kCGLRPRendererID
+ long displayMask; // kCGLRPDisplayMask
+
+ long accelerated; // kCGLRPAccelerated
+
+ long window; // kCGLRPWindow
+ long fullscreen; // kCGLRPFullScreen
+ long multiscreen; // kCGLRPMultiScreen
+ long offscreen; // kCGLRPOffScreen
+ long floatPixels; // see kCGLRPColorModes
+ long stereo; // kCGLRPBufferModes
+
+ long auxBuffers; // kCGLRPMaxAuxBuffers
+ long sampleBuffers; // kCGLRPMaxSampleBuffers
+ long samples; // kCGLRPMaxSamples
+ long samplesModes; // kCGLRPSampleModes
+ long multiSample; // see kCGLRPSampleModes
+ long superSample; // see kCGLRPSampleModes
+ long alphaSample; // kCGLRPSampleAlpha
+
+ long colorModes; // kCGLRPColorModes
+ long colorRGBSizeMAX;
+ long colorASizeMAX;
+ long colorFloatRGBSizeMAX;
+ long colorFloatASizeMAX;
+ long colorFloatRGBSizeMIN;
+ long colorFloatASizeMIN;
+ long colorModesCount;
+ long colorFloatModesCount;
+ long depthModes; // kCGLRPDepthModes
+ long depthSizeMAX;
+ long depthModesCount;
+ long stencilModes; // kCGLRPStencilModes
+ long stencilSizeMAX;
+ long stencilModesCount;
+ long accumModes; // kCGLRPAccumModes
+ long accumRGBSizeMAX;
+ long accumASizeMAX;
+ long accumModesCount;
+}
+typedef RendererInfo;
+
+RendererInfo *gRenderers = NULL;
+long gRenderersCount = 0;
+
+long depthModes[] = {
+ kCGL0Bit,
+ kCGL1Bit,
+ kCGL2Bit,
+ kCGL3Bit,
+ kCGL4Bit,
+ kCGL5Bit,
+ kCGL6Bit,
+ kCGL8Bit,
+ kCGL10Bit,
+ kCGL12Bit,
+ kCGL16Bit,
+ kCGL24Bit,
+ kCGL32Bit,
+ kCGL48Bit,
+ kCGL64Bit,
+ kCGL96Bit,
+ kCGL128Bit,
+ 0
+ };
+long depthModesBits[] = {0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 24, 32, 48, 64, 96, 128};
+long colorModes[] = {
+ kCGLRGB444Bit,
+ kCGLARGB4444Bit,
+ kCGLRGB444A8Bit,
+ kCGLRGB555Bit,
+ kCGLARGB1555Bit,
+ kCGLRGB555A8Bit,
+ kCGLRGB565Bit,
+ kCGLRGB565A8Bit,
+ kCGLRGB888Bit,
+ kCGLARGB8888Bit,
+ kCGLRGB888A8Bit,
+ kCGLRGB101010Bit,
+ kCGLARGB2101010Bit,
+ kCGLRGB101010_A8Bit,
+ kCGLRGB121212Bit,
+ kCGLARGB12121212Bit,
+ kCGLRGB161616Bit,
+ kCGLRGBA16161616Bit,
+ kCGLRGBFloat64Bit,
+ kCGLRGBAFloat64Bit,
+ kCGLRGBFloat128Bit,
+ kCGLRGBAFloat128Bit,
+ kCGLRGBFloat256Bit,
+ kCGLRGBAFloat256Bit,
+ 0
+ };
+long colorModesBitsRGB[] = {4, 4, 4, 5, 5, 5, 5, 5, 8, 8, 8, 10, 10, 10, 12, 12, 16, 16, 16, 16, 32, 32, 64, 64};
+long colorModesBitsA[] = {0, 4, 8, 0, 1, 8, 0, 8, 0, 8, 8, 0, 2, 8, 0, 12, 0, 16, 0, 16, 0, 32, 0, 64};
+
+void getRendererInfo()
+{
+ if (gRenderersCount == 0)
+ {
+ CGLRendererInfoObj info;
+ CGLError err = CGLQueryRendererInfo(CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &gRenderersCount);
+ if (err == 0 /* kCGLNoError */)
+ {
+ // how many renderers are available?
+ CGLDescribeRenderer(info, 0, kCGLRPRendererCount, &gRenderersCount);
+
+ // allocate our global renderers info
+ gRenderers = (RendererInfo*)malloc(gRenderersCount*sizeof(RendererInfo));
+ memset(gRenderers, 0x00, gRenderersCount*sizeof(RendererInfo));
+
+ // iterate through the renderers checking for their features
+ long j;
+ for (j=0; j<gRenderersCount; j++)
+ {
+ RendererInfo *renderer = &gRenderers[j];
+ int i;
+
+ CGLDescribeRenderer(info, j, kCGLRPRendererID, &(renderer->id));
+ CGLDescribeRenderer(info, j, kCGLRPDisplayMask, &(renderer->displayMask));
+
+ CGLDescribeRenderer(info, j, kCGLRPAccelerated, &(renderer->accelerated));
+
+ CGLDescribeRenderer(info, j, kCGLRPWindow, &(renderer->window));
+ CGLDescribeRenderer(info, j, kCGLRPFullScreen, &(renderer->fullscreen));
+ CGLDescribeRenderer(info, j, kCGLRPMultiScreen, &(renderer->multiscreen));
+ CGLDescribeRenderer(info, j, kCGLRPOffScreen, &(renderer->offscreen));
+ CGLDescribeRenderer(info, j, kCGLRPColorModes, &(renderer->floatPixels));
+ if ((renderer->floatPixels >= kCGLRGBFloat64Bit) != 0)
+ {
+ renderer->floatPixels = 1;
+ }
+ else
+ {
+ renderer->floatPixels = 0;
+ }
+ CGLDescribeRenderer(info, j, kCGLRPBufferModes, &(renderer->stereo));
+ if ((renderer->stereo & kCGLStereoscopicBit) != 0)
+ {
+ renderer->stereo = 1;
+ }
+ else
+ {
+ renderer->stereo = 0;
+ }
+
+ CGLDescribeRenderer(info, j, kCGLRPMaxAuxBuffers, &(renderer->auxBuffers));
+ CGLDescribeRenderer(info, j, kCGLRPMaxSampleBuffers, &(renderer->sampleBuffers));
+ CGLDescribeRenderer(info, j, kCGLRPMaxSamples, &(renderer->samples));
+ // The following queries are only legal on 10.4
+ // FIXME: should figure out a way to enable them dynamically
+#ifdef kCGLRPSampleModes
+ CGLDescribeRenderer(info, j, kCGLRPSampleModes, &(renderer->samplesModes));
+ if ((renderer->samplesModes & kCGLSupersampleBit) != 0)
+ {
+ renderer->multiSample = 1;
+ }
+ if ((renderer->samplesModes & kCGLMultisampleBit) != 0)
+ {
+ renderer->superSample = 1;
+ }
+ CGLDescribeRenderer(info, j, kCGLRPSampleAlpha, &(renderer->alphaSample));
+#endif
+ CGLDescribeRenderer(info, j, kCGLRPColorModes, &(renderer->colorModes));
+ i=0;
+ int floatPixelFormatInitialized = 0;
+ while (colorModes[i] != 0)
+ {
+ if ((renderer->colorModes & colorModes[i]) != 0)
+ {
+ // non-float color model
+ if (colorModes[i] < kCGLRGBFloat64Bit)
+ {
+ // look for max color and alpha values - prefer color models that have alpha
+ if ((colorModesBitsRGB[i] >= renderer->colorRGBSizeMAX) && (colorModesBitsA[i] >= renderer->colorASizeMAX))
+ {
+ renderer->colorRGBSizeMAX = colorModesBitsRGB[i];
+ renderer->colorASizeMAX = colorModesBitsA[i];
+ }
+ renderer->colorModesCount++;
+ }
+ // float-color model
+ if (colorModes[i] >= kCGLRGBFloat64Bit)
+ {
+ if (floatPixelFormatInitialized == 0)
+ {
+ floatPixelFormatInitialized = 1;
+
+ renderer->colorFloatASizeMAX = colorModesBitsA[i];
+ renderer->colorFloatRGBSizeMAX = colorModesBitsRGB[i];
+ renderer->colorFloatASizeMIN = colorModesBitsA[i];
+ renderer->colorFloatRGBSizeMIN = colorModesBitsRGB[i];
+ }
+ // look for max color and alpha values - prefer color models that have alpha
+ if ((colorModesBitsRGB[i] >= renderer->colorFloatRGBSizeMAX) && (colorModesBitsA[i] >= renderer->colorFloatASizeMAX))
+ {
+ renderer->colorFloatRGBSizeMAX = colorModesBitsRGB[i];
+ renderer->colorFloatASizeMAX = colorModesBitsA[i];
+ }
+ // find min color
+ if (colorModesBitsA[i] < renderer->colorFloatASizeMIN)
+ {
+ renderer->colorFloatASizeMIN = colorModesBitsA[i];
+ }
+ // find min alpha color
+ if (colorModesBitsA[i] < renderer->colorFloatRGBSizeMIN)
+ {
+ renderer->colorFloatRGBSizeMIN = colorModesBitsRGB[i];
+ }
+ renderer->colorFloatModesCount++;
+ }
+ }
+ i++;
+ }
+ CGLDescribeRenderer(info, j, kCGLRPDepthModes, &(renderer->depthModes));
+ i=0;
+ while (depthModes[i] != 0)
+ {
+ if ((renderer->depthModes & depthModes[i]) != 0)
+ {
+ renderer->depthSizeMAX = depthModesBits[i];
+ renderer->depthModesCount++;
+ }
+ i++;
+ }
+ CGLDescribeRenderer(info, j, kCGLRPStencilModes, &(renderer->stencilModes));
+ i=0;
+ while (depthModes[i] != 0)
+ {
+ if ((renderer->stencilModes & depthModes[i]) != 0)
+ {
+ renderer->stencilSizeMAX = depthModesBits[i];
+ renderer->stencilModesCount++;
+ }
+ i++;
+ }
+ CGLDescribeRenderer(info, j, kCGLRPAccumModes, &(renderer->accumModes));
+ i=0;
+ while (colorModes[i] != 0)
+ {
+ if ((renderer->accumModes & colorModes[i]) != 0)
+ {
+ if ((colorModesBitsRGB[i] >= renderer->accumRGBSizeMAX) && (colorModesBitsA[i] >= renderer->accumASizeMAX))
+ {
+ renderer->accumRGBSizeMAX = colorModesBitsRGB[i];
+ renderer->accumASizeMAX = colorModesBitsA[i];
+ }
+ renderer->accumModesCount++;
+ }
+ i++;
+ }
+ }
+ }
+ CGLDestroyRendererInfo (info);
+ }
+
+#if 0
+ fprintf(stderr, "gRenderersCount=%ld\n", gRenderersCount);
+ int j;
+ for (j=0; j<gRenderersCount; j++)
+ {
+ RendererInfo *renderer = &gRenderers[j];
+ fprintf(stderr, " id=%ld\n", renderer->id);
+ fprintf(stderr, " displayMask=%ld\n", renderer->displayMask);
+
+ fprintf(stderr, " accelerated=%ld\n", renderer->accelerated);
+
+ fprintf(stderr, " window=%ld\n", renderer->window);
+ fprintf(stderr, " fullscreen=%ld\n", renderer->fullscreen);
+ fprintf(stderr, " multiscreen=%ld\n", renderer->multiscreen);
+ fprintf(stderr, " offscreen=%ld\n", renderer->offscreen);
+ fprintf(stderr, " floatPixels=%ld\n", renderer->floatPixels);
+ fprintf(stderr, " stereo=%ld\n", renderer->stereo);
+
+ fprintf(stderr, " auxBuffers=%ld\n", renderer->auxBuffers);
+ fprintf(stderr, " sampleBuffers=%ld\n", renderer->sampleBuffers);
+ fprintf(stderr, " samples=%ld\n", renderer->samples);
+ fprintf(stderr, " samplesModes=%ld\n", renderer->samplesModes);
+ fprintf(stderr, " multiSample=%ld\n", renderer->superSample);
+ fprintf(stderr, " superSample=%ld\n", renderer->superSample);
+ fprintf(stderr, " alphaSample=%ld\n", renderer->alphaSample);
+
+ fprintf(stderr, " colorModes=%ld\n", renderer->colorModes);
+ fprintf(stderr, " colorRGBSizeMAX=%ld\n", renderer->colorRGBSizeMAX);
+ fprintf(stderr, " colorASizeMAX=%ld\n", renderer->colorASizeMAX);
+ fprintf(stderr, " colorFloatRGBSizeMAX=%ld\n", renderer->colorFloatRGBSizeMAX);
+ fprintf(stderr, " colorFloatASizeMAX=%ld\n", renderer->colorFloatASizeMAX);
+ fprintf(stderr, " colorFloatRGBSizeMIN=%ld\n", renderer->colorFloatRGBSizeMIN);
+ fprintf(stderr, " colorFloatASizeMIN=%ld\n", renderer->colorFloatASizeMIN);
+ fprintf(stderr, " colorModesCount=%ld\n", renderer->colorModesCount);
+ fprintf(stderr, " colorFloatModesCount=%ld\n", renderer->colorFloatModesCount);
+ fprintf(stderr, " depthModes=%ld\n", renderer->depthModes);
+ fprintf(stderr, " depthSizeMAX=%ld\n", renderer->depthSizeMAX);
+ fprintf(stderr, " depthModesCount=%ld\n", renderer->depthModesCount);
+ fprintf(stderr, " stencilModes=%ld\n", renderer->stencilModes);
+ fprintf(stderr, " stencilSizeMAX=%ld\n", renderer->stencilSizeMAX);
+ fprintf(stderr, " stencilModesCount=%ld\n", renderer->stencilModesCount);
+ fprintf(stderr, " accumModes=%ld\n", renderer->accumModes);
+ fprintf(stderr, " accumRGBSizeMAX=%ld\n", renderer->accumRGBSizeMAX);
+ fprintf(stderr, " accumASizeMAX=%ld\n", renderer->accumASizeMAX);
+ fprintf(stderr, " accumModesCount=%ld\n", renderer->accumModesCount);
+ fprintf(stderr, "\n");
+ }
+#endif
+}
+
+long validateParameter(NSOpenGLPixelFormatAttribute attribute, long value)
+{
+ int i;
+ for (i=0; i<gRenderersCount; i++) {
+ RendererInfo* renderer = &gRenderers[i];
+ if (renderer->accelerated != 0) {
+ switch (attribute) {
+ case NSOpenGLPFAStereo:
+ return renderer->stereo;
+
+ case NSOpenGLPFAStencilSize:
+ return MIN(value, renderer->stencilSizeMAX);
+
+ default:
+ break;
+ }
+ }
+ }
+
+ return value;
+}
+
+void* createPixelFormat(int* iattrs, int niattrs, int* ivalues) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ getRendererInfo();
+
+ // http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSOpenGLPixelFormat.html
+ NSOpenGLPixelFormatAttribute attribs[256];
+
+ int idx = 0;
+ int i;
+ for (i = 0; i < niattrs; i++) {
+ int attr = iattrs[i];
+ switch (attr) {
+ case NSOpenGLPFAPixelBuffer:
+ if (ivalues[i] != 0) {
+ attribs[idx++] = NSOpenGLPFAPixelBuffer;
+ }
+ break;
+
+ case kCGLPFAColorFloat:
+ if (ivalues[i] != 0) {
+ attribs[idx++] = kCGLPFAColorFloat;
+ }
+ break;
+
+ case NSOpenGLPFADoubleBuffer:
+ if (ivalues[i] != 0) {
+ attribs[idx++] = NSOpenGLPFADoubleBuffer;
+ }
+ break;
+
+ case NSOpenGLPFAStereo:
+ if (ivalues[i] != 0 && (validateParameter(NSOpenGLPFAStereo, 0 /* dummy */) != 0)) {
+ attribs[idx++] = NSOpenGLPFAStereo;
+ }
+ break;
+
+ case NSOpenGLPFAColorSize:
+ case NSOpenGLPFAAlphaSize:
+ case NSOpenGLPFADepthSize:
+ case NSOpenGLPFAAccumSize:
+ case NSOpenGLPFASampleBuffers:
+ case NSOpenGLPFASamples:
+ attribs[idx++] = attr;
+ attribs[idx++] = ivalues[i];
+ break;
+
+ case NSOpenGLPFAStencilSize:
+ attribs[idx++] = attr;
+ attribs[idx++] = validateParameter(NSOpenGLPFAStencilSize, ivalues[i]);
+ break;
+
+ default:
+ // Need better way to signal to caller
+ return nil;
+ }
+ }
+
+ // Zero-terminate
+ attribs[idx++] = 0;
+
+ NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
+ if (fmt == nil) {
+ // should we fallback to defaults or not?
+ fmt = [NSOpenGLView defaultPixelFormat];
+ }
+
+ [pool release];
+ return fmt;
+}
+
+void queryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int* ivalues) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSOpenGLPixelFormat* fmt = (NSOpenGLPixelFormat*) pixelFormat;
+ long tmp;
+ // FIXME: think about how specifying this might affect the API
+ int virtualScreen = 0;
+
+ int i;
+ for (i = 0; i < niattrs; i++) {
+ [fmt getValues: &tmp
+ forAttribute: (NSOpenGLPixelFormatAttribute) iattrs[i]
+ forVirtualScreen: virtualScreen];
+ ivalues[i] = (int) tmp;
+ }
+ [pool release];
+}
+
+void deletePixelFormat(void* pixelFormat) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSOpenGLPixelFormat* fmt = (NSOpenGLPixelFormat*) pixelFormat;
+ [fmt release];
+ [pool release];
+}
+
+void* createContext(void* shareContext,
+ void* view,
+ void* pixelFormat,
+ int* viewNotReady)
+{
+ getRendererInfo();
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ NSView *nsView = (NSView*)view;
+
+ if (nsView != NULL)
+ {
+ Bool viewReady = true;
+
+ if ([nsView lockFocusIfCanDraw] == NO)
+ {
+ viewReady = false;
+ }
+ else
+ {
+ NSRect frame = [nsView frame];
+ if ((frame.size.width == 0) || (frame.size.height == 0))
+ {
+ [nsView unlockFocus];
+ viewReady = false;
+ }
+ }
+
+ if (!viewReady)
+ {
+ if (viewNotReady != NULL)
+ {
+ *viewNotReady = 1;
+ }
+
+ // the view is not ready yet
+ [pool release];
+ return NULL;
+ }
+ }
+
+ NSOpenGLContext* nsContext = [[NSOpenGLContext alloc]
+ initWithFormat: (NSOpenGLPixelFormat*) pixelFormat
+ shareContext: (NSOpenGLContext*) shareContext];
+
+ if (nsContext != nil) {
+ if (nsView != nil) {
+ [nsContext setView:nsView];
+ [nsView unlockFocus];
+ }
+ }
+
+ [pool release];
+ return nsContext;
+}
+
+Bool makeCurrentContext(void* context) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [nsContext makeCurrentContext];
+ [pool release];
+ return true;
+}
+
+Bool clearCurrentContext(void* context) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [NSOpenGLContext clearCurrentContext];
+ [pool release];
+ return true;
+}
+
+Bool deleteContext(void* context) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [nsContext clearDrawable];
+ [nsContext release];
+ [pool release];
+ return true;
+}
+
+Bool flushBuffer(void* context) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [nsContext flushBuffer];
+ [pool release];
+ return true;
+}
+
+void setContextOpacity(void* context, int opacity) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+
+ [nsContext setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
+}
+
+void updateContext(void* context) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [nsContext update];
+ [pool release];
+}
+
+void copyContext(void* destContext, void* srcContext, int mask) {
+ NSOpenGLContext *src = (NSOpenGLContext*) srcContext;
+ NSOpenGLContext *dst = (NSOpenGLContext*) destContext;
+ [dst copyAttributesFromContext: src withMask: mask];
+}
+
+void* updateContextRegister(void* context, void* view) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+ NSView *nsView = (NSView*)view;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ ContextUpdater *contextUpdater = [[ContextUpdater alloc] init];
+ [contextUpdater registerFor:nsContext with:nsView];
+ [pool release];
+ return NULL;
+}
+
+void updateContextUnregister(void* context, void* view, void* updater) {
+ ContextUpdater *contextUpdater = (ContextUpdater *)updater;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [contextUpdater release];
+ [pool release];
+}
+
+void* createPBuffer(int renderTarget, int internalFormat, int width, int height) {
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSOpenGLPixelBuffer* pBuffer = [[NSOpenGLPixelBuffer alloc]
+ initWithTextureTarget:renderTarget
+ textureInternalFormat:internalFormat
+ textureMaxMipMapLevel:0
+ pixelsWide:width
+ pixelsHigh:height];
+ [pool release];
+ return pBuffer;
+}
+
+Bool destroyPBuffer(void* context, void* buffer) {
+ /* FIXME: not clear whether we need to perform the clearDrawable below */
+ /* FIXME: remove the context argument -- don't need it any more */
+ /* NSOpenGLContext *nsContext = (NSOpenGLContext*)context; */
+ NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ /*
+ if (nsContext != NULL) {
+ [nsContext clearDrawable];
+ }
+ */
+ [pBuffer release];
+ [pool release];
+
+ return true;
+}
+
+void setContextPBuffer(void* context, void* buffer) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+ NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [nsContext setPixelBuffer: pBuffer
+ cubeMapFace: 0
+ mipMapLevel: 0
+ currentVirtualScreen: [nsContext currentVirtualScreen]];
+ [pool release];
+}
+
+void setContextTextureImageToPBuffer(void* context, void* buffer, int colorBuffer) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+ NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer;
+
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [nsContext setTextureImageToPixelBuffer: pBuffer
+ colorBuffer: (unsigned long) colorBuffer];
+ [pool release];
+}
+
+#include <mach-o/dyld.h>
+Bool imagesInitialized = false;
+static char libGLStr[] = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib";
+static char libGLUStr[] = "/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib";
+static const struct mach_header *libGLImage;
+static const struct mach_header *libGLUImage;
+void* getProcAddress(const char *procname) {
+ if (imagesInitialized == false) {
+ imagesInitialized = true;
+ unsigned long options = NSADDIMAGE_OPTION_RETURN_ON_ERROR;
+ libGLImage = NSAddImage(libGLStr, options);
+ libGLUImage = NSAddImage(libGLUStr, options);
+ }
+
+ unsigned long options = NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR;
+ char underscoreName[512] = "_";
+ strcat(underscoreName, procname);
+
+ if (NSIsSymbolNameDefinedInImage(libGLImage, underscoreName) == YES) {
+ NSSymbol sym = NSLookupSymbolInImage(libGLImage, underscoreName, options);
+ return NSAddressOfSymbol(sym);
+ }
+
+ if (NSIsSymbolNameDefinedInImage(libGLUImage, underscoreName) == YES) {
+ NSSymbol sym = NSLookupSymbolInImage(libGLUImage, underscoreName, options);
+ return NSAddressOfSymbol(sym);
+ }
+
+ if (NSIsSymbolNameDefinedWithHint(underscoreName, "GL")) {
+ NSSymbol sym = NSLookupAndBindSymbol(underscoreName);
+ return NSAddressOfSymbol(sym);
+ }
+
+ return NULL;
+}
+
+void setSwapInterval(void* context, int interval) {
+ NSOpenGLContext *nsContext = (NSOpenGLContext*)context;
+ long swapInterval = interval;
+ [nsContext setValues: &swapInterval forParameter: NSOpenGLCPSwapInterval];
+}
+
+Bool setGammaRamp(int tableSize, float* redRamp, float* greenRamp, float* blueRamp) {
+ CGDisplayErr err = CGSetDisplayTransferByTable(kCGDirectMainDisplay, tableSize, redRamp, greenRamp, blueRamp);
+ return (err == CGDisplayNoErr);
+}
+
+void resetGammaRamp() {
+ CGDisplayRestoreColorSyncSettings();
+}
diff --git a/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c b/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c
new file mode 100644
index 000000000..c763b0dd6
--- /dev/null
+++ b/src/jogl/native/openmax/com_sun_openmax_OMXInstance.c
@@ -0,0 +1,255 @@
+/*
+ * javafx_media_video_Movie.c
+ * JFXFramework
+ *
+ * Created by sun on 17/02/08.
+ * Copyright 2007 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+// http://developer.apple.com/technotes/tn2005/tn2140.html
+// http://developer.apple.com/qa/qa2005/qa1443.html
+// http://developer.apple.com/documentation/QuickTime/Conceptual/QT7UpdateGuide/Chapter03/chapter_3_section_1.html#//apple_ref/doc/c_ref/NewMovieFromProperties
+// http://developer.apple.com/qa/qa2001/qa1149.html
+// http://developer.apple.com/qa/qa2001/qa1262.html
+
+#include "com_sun_openmax_OMXInstance.h"
+#include "omx_tool.h"
+#include <stdarg.h>
+
+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"
+#endif
+
+static void _initStatics(JNIEnv *env)
+{
+ jclass c;
+#ifdef _WIN32_WCE
+ _wfreopen(TEXT(STDOUT_FILE),L"w",stdout);
+ _wfreopen(TEXT(STDERR_FILE),L"w",stderr);
+#endif
+ fprintf(stdout, "_initstatics ..\n"); fflush(stdout); // JAU
+ if (runtimeExceptionClz != NULL) {
+ return;
+ }
+
+ c = (*env)->FindClass(env, ClazzNameRuntimeException);
+ if(NULL==c) {
+ fprintf(stdout, "FatalError: can't find %s\n", ClazzNameRuntimeException);
+ (*env)->FatalError(env, ClazzNameRuntimeException);
+ }
+ runtimeExceptionClz = (jclass)(*env)->NewGlobalRef(env, c);
+ if(NULL==runtimeExceptionClz) {
+ fprintf(stdout, "FatalError: can't use %s\n", ClazzNameRuntimeException);
+ (*env)->FatalError(env, ClazzNameRuntimeException);
+ }
+}
+
+void java_throwNewRuntimeException(intptr_t jni_env, const char* format, ...)
+{
+ va_list ap;
+ char buffer[255];
+ va_start(ap, format);
+ #ifdef _WIN32
+ _vsnprintf(buffer, sizeof(buffer)-1, format, ap);
+ #else
+ vsnprintf(buffer, sizeof(buffer)-1, format, ap);
+ #endif
+ va_end(ap);
+ buffer[sizeof(buffer)-1]=0;
+ fprintf(stderr, "RuntimeException: %s\n", buffer); fflush(stderr);
+ if(jni_env!=0) {
+ (*((JNIEnv *)jni_env))->ThrowNew((JNIEnv *)jni_env, runtimeExceptionClz, buffer);
+ }
+}
+
+void OMXInstance_SaveJavaAttributes(OMXToolBasicAV_t *pOMXAV, KDboolean issueJavaCallback)
+{
+ if(NULL==pOMXAV || 0==pOMXAV->jni_env || 0==pOMXAV->jni_instance) {
+ fprintf(stderr, "OMXInstance_SaveJavaAttributes failed");
+ return;
+ } else if(issueJavaCallback==KD_TRUE) {
+ JNIEnv * env = (JNIEnv *)pOMXAV->jni_env;
+ jobject instance = (jobject)pOMXAV->jni_instance;
+ (*env)->CallVoidMethod(env, instance, (jmethodID)pOMXAV->jni_mid_saveAttributes);
+ }
+}
+
+void OMXInstance_UpdateJavaAttributes(OMXToolBasicAV_t *pOMXAV, KDboolean issueJavaCallback)
+{
+ if(NULL==pOMXAV || 0==pOMXAV->jni_env || 0==pOMXAV->jni_instance) {
+ fprintf(stderr, "OMXInstance_UpdateJavaAttributes failed");
+ return;
+ } else {
+ JNIEnv * env = (JNIEnv *)pOMXAV->jni_env;
+ jobject instance = (jobject)pOMXAV->jni_instance;
+ (*env)->SetIntField(env, instance, (jfieldID)pOMXAV->jni_fid_width, (jint)pOMXAV->width);
+ (*env)->SetIntField(env, instance, (jfieldID)pOMXAV->jni_fid_height, (jint)pOMXAV->height);
+ (*env)->SetIntField(env, instance, (jfieldID)pOMXAV->jni_fid_fps, (jint)pOMXAV->framerate);
+ (*env)->SetLongField(env, instance, (jfieldID)pOMXAV->jni_fid_bps, (jlong)pOMXAV->bitrate);
+ (*env)->SetLongField(env, instance, (jfieldID)pOMXAV->jni_fid_totalFrames, (jlong)(pOMXAV->length*pOMXAV->framerate));
+ if(issueJavaCallback==KD_TRUE) {
+ (*env)->CallVoidMethod(env, instance, (jmethodID)pOMXAV->jni_mid_attributesUpdated);
+ } else {
+ if(strlen(pOMXAV->videoCodec)>0) {
+ (*env)->SetObjectField(env, instance, (jfieldID)pOMXAV->jni_fid_vcodec, (*env)->NewStringUTF(env, pOMXAV->videoCodec));
+ }
+ if(strlen(pOMXAV->audioCodec)>0) {
+ (*env)->SetObjectField(env, instance, (jfieldID)pOMXAV->jni_fid_acodec, (*env)->NewStringUTF(env, pOMXAV->audioCodec));
+ }
+ }
+ }
+}
+
+JNIEXPORT jlong JNICALL Java_com_sun_openmax_OMXInstance__1createInstance
+ (JNIEnv *env, jobject instance)
+{
+ OMXToolBasicAV_t * pOMXAV;
+
+ _initStatics(env);
+
+ pOMXAV->jni_env=(intptr_t)env;
+ pOMXAV->jni_instance=(intptr_t)instance;
+
+ pOMXAV = OMXToolBasicAV_CreateInstance((intptr_t)env, (intptr_t)instance);
+ if(NULL!=pOMXAV) {
+ jclass cls = (*env)->GetObjectClass(env, instance);
+ pOMXAV->jni_mid_saveAttributes = (intptr_t) (*env)->GetMethodID(env, cls, "saveAttributes", "()V");
+ pOMXAV->jni_mid_attributesUpdated = (intptr_t) (*env)->GetMethodID(env, cls, "attributesUpdated", "()V");
+ pOMXAV->jni_fid_width = (intptr_t) (*env)->GetFieldID(env, cls, "width", "I");
+ pOMXAV->jni_fid_height = (intptr_t) (*env)->GetFieldID(env, cls, "height", "I");
+ pOMXAV->jni_fid_fps = (intptr_t) (*env)->GetFieldID(env, cls, "fps", "I");
+ pOMXAV->jni_fid_bps = (intptr_t) (*env)->GetFieldID(env, cls, "bps", "J");
+ pOMXAV->jni_fid_totalFrames = (intptr_t) (*env)->GetFieldID(env, cls, "totalFrames", "J");
+ pOMXAV->jni_fid_acodec = (intptr_t) (*env)->GetFieldID(env, cls, "acodec", "Ljava/lang/String;");
+ pOMXAV->jni_fid_vcodec = (intptr_t) (*env)->GetFieldID(env, cls, "vcodec", "Ljava/lang/String;");
+ }
+
+ return (jlong) (intptr_t) (void *)pOMXAV;
+}
+
+JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1setStream
+ (JNIEnv *env, jobject instance, jlong ptr, jint vBufferNum, jstring jpath)
+{
+ jboolean iscopy;
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+
+ fprintf(stdout, "setStream 1 ..\n"); fflush(stdout); // JAU
+ if (pOMXAV != NULL) {
+ const char *filePath = (*env)->GetStringUTFChars(env, jpath, &iscopy);
+ fprintf(stdout, "setStream 2 %s..\n", filePath); fflush(stdout); // JAU
+ pOMXAV->jni_env=(intptr_t)env;
+ pOMXAV->jni_instance=(intptr_t)instance;
+ OMXToolBasicAV_SetStream(pOMXAV, vBufferNum, filePath);
+ (*env)->ReleaseStringChars(env, jpath, (const jchar *)filePath);
+ }
+ fprintf(stdout, "setStream 3 ..\n"); fflush(stdout); // JAU
+}
+
+JNIEXPORT void JNICALL Java_com_sun_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));
+ if (pOMXAV != NULL) {
+ OMXToolBasicAV_SetStreamEGLImageTexture2D( pOMXAV, i, (GLuint) tex,
+ (EGLImageKHR)(intptr_t)image,
+ (EGLSyncKHR)(intptr_t)sync);
+ }
+}
+
+JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1activateStream
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+
+ if (pOMXAV != NULL) {
+ OMXToolBasicAV_ActivateStream(pOMXAV);
+ }
+}
+
+JNIEXPORT void JNICALL Java_com_sun_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
+ (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
+ (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
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ OMXToolBasicAV_PlayStart(pOMXAV);
+ return OMXToolBasicAV_GetCurrentPosition(pOMXAV);
+}
+
+JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1pause
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ OMXToolBasicAV_PlayPause(pOMXAV);
+ return OMXToolBasicAV_GetCurrentPosition(pOMXAV);
+}
+
+JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1stop
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ OMXToolBasicAV_PlayStop(pOMXAV);
+ return OMXToolBasicAV_GetCurrentPosition(pOMXAV);
+}
+
+JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1seek
+ (JNIEnv *env, jobject instance, jlong ptr, jfloat pos)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ OMXToolBasicAV_PlaySeek(pOMXAV, pos);
+ return OMXToolBasicAV_GetCurrentPosition(pOMXAV);
+}
+
+JNIEXPORT jint JNICALL Java_com_sun_openmax_OMXInstance__1getNextTextureID
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ jint textureID = 0xffffffff;
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ if (pOMXAV != NULL) {
+ textureID = OMXToolBasicAV_GetNextTextureID(pOMXAV);
+ }
+ return textureID;
+}
+
+JNIEXPORT jfloat JNICALL Java_com_sun_openmax_OMXInstance__1getCurrentPosition
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ return OMXToolBasicAV_GetCurrentPosition(pOMXAV);
+}
+
+
+JNIEXPORT void JNICALL Java_com_sun_openmax_OMXInstance__1destroyInstance
+ (JNIEnv *env, jobject instance, jlong ptr)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *)((void *)((intptr_t)ptr));
+ if (pOMXAV != NULL) {
+ OMXToolBasicAV_DestroyInstance(pOMXAV);
+ }
+}
+
+
diff --git a/src/jogl/native/openmax/omx_tool.c b/src/jogl/native/openmax/omx_tool.c
new file mode 100644
index 000000000..e9633af1b
--- /dev/null
+++ b/src/jogl/native/openmax/omx_tool.c
@@ -0,0 +1,1713 @@
+
+#include "omx_tool.h"
+
+#define VERBOSE_ON 1
+#define VERBOSE2_ON 1
+
+#ifdef VERBOSE_ON
+ #define DBG_PRINT(...) fprintf(stdout, __VA_ARGS__)
+#else
+ #define DBG_PRINT(...)
+#endif
+
+#if defined(VERBOSE_ON) && defined(VERBOSE2_ON)
+ #define DBG_PRINT2(...) fprintf(stdout, __VA_ARGS__)
+#else
+ #define DBG_PRINT2(...)
+#endif
+
+#ifdef VERBOSE_ON
+ #ifdef _WIN32_WCE
+ #define STDOUT_FILE "\\Storage Card\\stdout.txt"
+ #define STDERR_FILE "\\Storage Card\\stderr.txt"
+ #endif
+#endif
+
+#include <NVOMX_IndexExtensions.h>
+
+#define NOTSET_U8 ((OMX_U8)0xDE)
+#define NOTSET_U16 ((OMX_U16)0xDEDE)
+#define NOTSET_U32 ((OMX_U32)0xDEDEDEDE)
+#define INIT_PARAM(_X_) (memset(&(_X_), NOTSET_U8, sizeof(_X_)), ((_X_).nSize = sizeof (_X_)), (_X_).nVersion = vOMX)
+
+void OMXInstance_SaveJavaAttributes(OMXToolBasicAV_t *pOMXAV, KDboolean issueJavaCallback);
+void OMXInstance_UpdateJavaAttributes(OMXToolBasicAV_t *pOMXAV, KDboolean issueJavaCallback);
+
+#if !defined(SELF_TEST)
+void java_throwNewRuntimeException(intptr_t jni_env, const char* format, ...);
+#else
+#include <stdarg.h>
+void java_throwNewRuntimeException(intptr_t jni_env, const char* format, ...) {
+ va_list ap;
+ char buffer[255];
+ va_start(ap, format);
+ #ifdef _WIN32
+ _vsnprintf(buffer, sizeof(buffer)-1, format, ap);
+ #else
+ vsnprintf(buffer, sizeof(buffer)-1, format, ap);
+ #endif
+ va_end(ap);
+ buffer[sizeof(buffer)-1]=0;
+ DBG_PRINT( "RuntimeException: %s\n", buffer);
+ exit(1);
+}
+#endif
+static void DestroyInstanceUnlock(OMXToolBasicAV_t * pOMXAV);
+
+#define OMXSAFEVOID(x) \
+do { \
+ OMX_ERRORTYPE err = (x); \
+ if (err != OMX_ErrorNone) { \
+ java_throwNewRuntimeException((NULL!=pOMXAV)?pOMXAV->jni_env:0, "FAILED at %s:%d, Error: 0x%x\n", __FILE__, __LINE__, err); \
+ if(NULL!=pOMXAV) { \
+ DestroyInstanceUnlock(pOMXAV); \
+ } \
+ return; \
+ } \
+} while (0);
+
+#define OMXSAFE(x) \
+do { \
+ OMX_ERRORTYPE err = (x); \
+ if (err != OMX_ErrorNone) { \
+ java_throwNewRuntimeException((NULL!=pOMXAV)?pOMXAV->jni_env:0, "FAILED at %s:%d, Error: 0x%x\n", __FILE__, __LINE__, err); \
+ if(NULL!=pOMXAV) { \
+ DestroyInstanceUnlock(pOMXAV); \
+ } \
+ return -1; \
+ } \
+} while (0);
+
+#define OMXSAFEERR(x) \
+do { \
+ OMX_ERRORTYPE err = (x); \
+ if (err != OMX_ErrorNone) { \
+ java_throwNewRuntimeException((NULL!=pOMXAV)?pOMXAV->jni_env:0, "FAILED at %s:%d, Error: 0x%x\n", __FILE__, __LINE__, err); \
+ if(NULL!=pOMXAV) { \
+ DestroyInstanceUnlock(pOMXAV); \
+ } \
+ return err; \
+ } \
+} while (0);
+
+static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR;
+static PFNEGLCREATEFENCESYNCKHRPROC eglCreateFenceSyncKHR;
+static PFNEGLFENCEKHRPROC eglFenceKHR;
+static PFNEGLGETSYNCATTRIBKHRPROC eglGetSyncAttribKHR;
+static PFNEGLSIGNALSYNCKHRPROC eglSignalSyncKHR;
+static int _hasEGLSync = 0;
+
+#define GETEXTENSION(type, ext) \
+do \
+{ \
+ ext = (type) eglGetProcAddress(#ext); \
+ if (!ext) \
+ { \
+ fprintf(stderr, "ERROR getting proc addr of " #ext "\n"); \
+ } \
+} while (0);
+
+int USE_OPENGL = 1;
+int USE_HWAUDIOOUT = 1;
+int USE_AUDIOBUFFERING = 0;
+const int PORT_VRENDERER = 6;
+
+static OMX_VERSIONTYPE vOMX;
+
+static int _initialized = 0;
+static void InitStatic()
+{
+ if(_initialized) return;
+
+#ifdef VERBOSE_ON
+ #ifdef _WIN32_WCE
+ _wfreopen(TEXT(STDOUT_FILE),L"w",stdout);
+ _wfreopen(TEXT(STDERR_FILE),L"w",stderr);
+ #endif
+#endif
+
+ _initialized = 1;
+
+ vOMX.s.nVersionMajor = 1;
+ vOMX.s.nVersionMinor = 1;
+ vOMX.s.nRevision = 0;
+ vOMX.s.nStep = 0;
+
+ GETEXTENSION(PFNEGLCREATEIMAGEKHRPROC, eglCreateImageKHR);
+ GETEXTENSION(PFNEGLCREATEFENCESYNCKHRPROC, eglCreateFenceSyncKHR);
+ GETEXTENSION(PFNEGLFENCEKHRPROC, eglFenceKHR);
+ GETEXTENSION(PFNEGLGETSYNCATTRIBKHRPROC, eglGetSyncAttribKHR);
+ GETEXTENSION(PFNEGLSIGNALSYNCKHRPROC, eglSignalSyncKHR);
+ if(NULL==eglFenceKHR||NULL==eglGetSyncAttribKHR||NULL==eglSignalSyncKHR) {
+ _hasEGLSync = 0;
+ } else {
+ _hasEGLSync = 1;
+ }
+
+ OMX_Init();
+}
+
+static void Invalidate(OMXToolBasicAV_t * pOMXAV)
+{
+ DBG_PRINT("INVALIDATE\n");
+ pOMXAV->status=OMXAV_INVALID;
+}
+
+static void GetComponentName(OMX_HANDLETYPE hComponent, KDchar *pName, int nameMaxLen)
+{
+ OMX_VERSIONTYPE v1, v2;
+ OMX_UUIDTYPE uuid;
+
+ OMX_GetComponentVersion(hComponent, pName, &v1, &v2, &uuid);
+}
+
+static OMX_ERRORTYPE UpdateStreamInfo(OMXToolBasicAV_t * pOMXAV, KDboolean issueCallback);
+
+static OMX_ERRORTYPE EventHandler(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1,
+ OMX_IN OMX_U32 nData2,
+ OMX_IN OMX_PTR pEventData)
+{
+ OMXToolBasicAV_t * pOMXAV = (OMXToolBasicAV_t *) pAppData;
+ KDchar name[128];
+
+ GetComponentName(hComponent, name, 128);
+
+ switch (eEvent)
+ {
+ case OMX_EventCmdComplete:
+ {
+ DBG_PRINT("event complete: cmd 0x%X, s:0x%X, component: %p - %s\n", (unsigned)nData1, (unsigned)nData2, hComponent, name);
+ if (nData1 == OMX_CommandStateSet && pOMXAV->status == OMXAV_INVALID)
+ {
+ if (nData2 > OMX_StateLoaded) {
+ DBG_PRINT("\t state -> StateLoaded\n");
+ // Transition the component down to StateLoaded
+ OMX_SendCommand(hComponent, OMX_CommandStateSet, OMX_StateLoaded, 0);
+ }
+ }
+ else if (nData1 == OMX_CommandFlush && nData2 == OMX_ALL)
+ {
+ DBG_PRINT("\t flush\n");
+ kdThreadSemPost(pOMXAV->flushSem);
+ }
+ break;
+ }
+ case OMX_EventBufferFlag:
+ if (nData2 & OMX_BUFFERFLAG_EOS)
+ {
+ DBG_PRINT("event buffer EOS: component: %p - %s\n", hComponent, name);
+ if (pOMXAV->endComponent == hComponent)
+ {
+ DBG_PRINT("\t end component - FIN\n");
+ pOMXAV->status = OMXAV_FIN;
+ }
+ }
+ break;
+ case OMX_EventError:
+ {
+ if (nData1 == OMX_ErrorIncorrectStateTransition)
+ {
+ DBG_PRINT("event error: 0x%X IncorrectTransition, component: %p - %s\n", (unsigned int) nData1, hComponent, name);
+ // We are shutting down, just continue with that process
+ OMX_SendCommand(hComponent, OMX_CommandStateSet, OMX_StateIdle, 0);
+ }
+ else if(nData1 == OMX_ErrorSameState)
+ {
+ DBG_PRINT("event error: Same State 0x%X, component: %p - %s\n", (unsigned int) nData2, hComponent, name);
+ }
+ else
+ {
+ DBG_PRINT("event error: 0x%X, component: %p - %s\n", (unsigned int) nData1, hComponent, name);
+ Invalidate(pOMXAV);
+ }
+ }
+ break;
+ case OMX_EventPortSettingsChanged:
+ {
+ (void) UpdateStreamInfo(pOMXAV, (pOMXAV->status>OMXAV_INIT)?KD_TRUE:KD_FALSE);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return OMX_ErrorNone;
+}
+
+
+static OMX_ERRORTYPE EmptyBufferDone(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer)
+{
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE FillBufferDone(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer)
+{
+ OMXToolBasicAV_t *pOMXAV = (OMXToolBasicAV_t *) pAppData;
+
+ if (pBuffer->nFlags & OMX_BUFFERFLAG_EOS)
+ {
+ pOMXAV->status = OMXAV_FIN;
+ }
+ pOMXAV->available++;
+ DBG_PRINT("FillBufferDone avail %d\n", pOMXAV->available);
+
+ return OMX_ErrorNone;
+}
+
+#define STATE_SLEEP 10 // ms
+#define STATE_TIMEOUT 1000 // ms
+#define STATE_TIMEOUT_LOOP (STATE_TIMEOUT/STATE_SLEEP)
+
+static OMX_ERRORTYPE WaitForState(OMX_HANDLETYPE hComponent,
+ OMX_STATETYPE eTestState,
+ OMX_STATETYPE eTestState2,
+ OMX_STATETYPE *currentState)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_STATETYPE eState;
+ int loop=STATE_TIMEOUT_LOOP;
+
+ DBG_PRINT( "WaitForState p1 c:%p s1:0x%X s2:0x%X\n", hComponent, eTestState, eTestState2);
+ eError = OMX_GetState(hComponent, &eState);
+ DBG_PRINT( "WaitForState p2 s:0x%X e:0x%X\n", eState, eError);
+
+ while (loop>0 &&
+ OMX_ErrorNone == eError &&
+ eState != eTestState &&
+ eState != eTestState2)
+ {
+ usleep(STATE_SLEEP*1000);
+ loop--;
+
+ eError = OMX_GetState(hComponent, &eState);
+ DBG_PRINT( "WaitForState p3 s:0x%X e:0x%X\n", eState, eError);
+ }
+
+ if(NULL!=currentState) *currentState=eState;
+
+ return eError;
+}
+
+static KDint SyncOnState(OMX_HANDLETYPE hComponent, OMX_STATETYPE state)
+{
+ OMX_STATETYPE currentState;
+ OMX_ERRORTYPE eError = WaitForState(hComponent, state, OMX_StateInvalid, &currentState);
+ return ( OMX_ErrorNone != eError ) ? -1 : ( currentState!=state ) ? -2 : 0 ;
+}
+
+static KDint CheckState(OMX_HANDLETYPE hComponent, OMX_STATETYPE state)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_STATETYPE eState;
+
+ eError = OMX_GetState(hComponent, &eState);
+
+ return ( OMX_ErrorNone != eError ) ? -1 : ( eState!=state ) ? -2 : 0 ;
+}
+
+KDint OMXToolBasicAV_IsFileValid(const KDchar * file)
+{
+ #ifdef _WIN32
+ KDchar cvtdPath[_MAX_PATH];
+
+ if(NULL==file) return -1;
+
+ kdStrcpy_s(cvtdPath, _MAX_PATH, file);
+ while(kdStrchr(cvtdPath,'/'))
+ *kdStrchr(cvtdPath,'/')='\\';
+
+ {
+ #ifdef UNICODE
+ wchar_t properfilename[_MAX_PATH];
+ mbstowcs( properfilename, cvtdPath, _MAX_PATH );
+ #else
+ char *properfilename = cvtdPath;
+ #endif
+
+ if (INVALID_FILE_ATTRIBUTES==GetFileAttributes(properfilename))
+ {
+ fprintf(stderr, "!>Input file (%s) does not exist! EXITING.", file);
+ return -2;
+ }
+ }
+ #else
+ if(NULL==file) return -1;
+ #endif
+
+ return 0;
+}
+
+KDint OMXToolBasicAV_CheckState(OMXToolBasicAV_t * pOMXAV, OMX_STATETYPE state)
+{
+ KDint i, res;
+ if(NULL==pOMXAV) return -1;
+
+ for(i=0; i<OMXAV_H_NUMBER; i++) {
+ if(0!=pOMXAV->comp[i]) {
+ if( 0!=(res=CheckState(pOMXAV->comp[i], state)) ) {
+ return res-(i*10);
+ }
+ }
+ }
+ return 0;
+}
+
+KDint OMXToolBasicAV_WaitForState(OMXToolBasicAV_t * pOMXAV, OMX_STATETYPE state)
+{
+ KDint res, i;
+ DBG_PRINT( "OMXToolBasicAV_WaitForState %p s:%d\n", pOMXAV, state);
+ if(NULL==pOMXAV) {
+ DBG_PRINT( "OMXToolBasicAV_WaitForState p1\n");
+ return -1;
+ }
+
+ for(i=0; i<OMXAV_H_NUMBER; i++) {
+ if(0!=pOMXAV->comp[i]) {
+ DBG_PRINT( "OMXToolBasicAV_WaitForState p4 %d c:%p\n", i, pOMXAV->comp[i]);
+ if( 0!=(res=SyncOnState(pOMXAV->comp[i], state)) ) {
+ KDchar name[128];
+ GetComponentName(pOMXAV->comp[i], name, 128);
+ DBG_PRINT( "OMXToolBasicAV_WaitForState Failed (Wait) %d c:%p - %s, s:0x%X\n",
+ i, pOMXAV->comp[i], name, state);
+ return res-(i*10);
+ }
+ }
+ }
+
+ return 0;
+}
+
+static OMX_ERRORTYPE RequestState(OMX_HANDLETYPE hComponent, OMX_STATETYPE state, KDboolean wait)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_STATETYPE eState;
+ eError = OMX_GetState(hComponent, &eState);
+ DBG_PRINT( "RequestState p2 c:%p, e:0x%X, s:0x%X\n",
+ hComponent, eError, eState);
+ // Skip StateSet in case the state is already reached ..
+ if(OMX_ErrorNone != eError || eState!=state) {
+ eError = OMX_SendCommand(hComponent, OMX_CommandStateSet, state, 0);
+ DBG_PRINT( "RequestState p3 c:%p e:0x%X s: 0x%X -> 0x%X\n",
+ hComponent, eError, eState, state);
+ if(wait) {
+ OMX_STATETYPE currentState;
+ eError = WaitForState(hComponent, state, OMX_StateInvalid, &currentState);
+ if ( OMX_ErrorNone==eError && currentState!=state ) eError=OMX_StateInvalid;
+ }
+ }
+ return eError;
+}
+
+KDint OMXToolBasicAV_RequestState(OMXToolBasicAV_t * pOMXAV, OMX_STATETYPE state, KDboolean wait)
+{
+ KDint i;
+ DBG_PRINT( "OMXToolBasicAV_RequestState %p s:%d, w:%d\n", pOMXAV, state, wait);
+ if(NULL==pOMXAV) {
+ DBG_PRINT( "OMXToolBasicAV_RequestState p1\n");
+ return -1;
+ }
+
+ for(i=0; i<OMXAV_H_NUMBER; i++) {
+ if(0!=pOMXAV->comp[i]) {
+ OMXSAFE(RequestState(pOMXAV->comp[i], state, KD_FALSE));
+ }
+ }
+
+ if (wait)
+ {
+ return OMXToolBasicAV_WaitForState(pOMXAV, state);
+ }
+
+ return 0;
+}
+
+static KDint SendCommand(OMXToolBasicAV_t * pOMXAV, OMX_COMMANDTYPE cmd, OMX_U32 nParam1, OMX_PTR pCmdData)
+{
+ KDint i;
+ if(NULL==pOMXAV) return -1;
+
+ for(i=0; i<OMXAV_H_NUMBER; i++) {
+ if(0!=pOMXAV->comp[i]) {
+ if(OMX_ErrorNone!=OMX_SendCommand(pOMXAV->comp[i], cmd, nParam1, pCmdData)) {
+ return -1;
+ }
+ if(OMX_CommandFlush==cmd) {
+ kdThreadSemWait(pOMXAV->flushSem);
+ }
+ }
+ }
+ return 0;
+}
+
+static KDint PlayStop(OMXToolBasicAV_t * pOMXAV);
+static int DetachVideoRenderer(OMXToolBasicAV_t * pOMXAV);
+
+static void DestroyInstanceUnlock(OMXToolBasicAV_t * pOMXAV)
+{
+ // 0: Stop
+ // 1: X -> idle
+ // 2: Disable all ports
+ // 3: DetachVideoRenderer
+ // 3: X -> loaded
+ // 4: Free Handle
+ // 5: Free mutex/semaphores/struct
+ int i, res1=0, res2=0;
+ if(NULL==pOMXAV) return;
+
+ DBG_PRINT( "Destroy p1\n");
+ PlayStop(pOMXAV);
+
+ DBG_PRINT( "Destroy p2\n");
+ if(0!=(res1=OMXToolBasicAV_RequestState(pOMXAV, OMX_StateIdle, KD_TRUE)))
+ {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Destroy - Wait for Idle Failed (%d)", res1);
+ }
+
+ DBG_PRINT( "Destroy p3\n");
+ SendCommand(pOMXAV, OMX_CommandPortDisable, OMX_ALL, 0); // Ignore error ..
+
+ DBG_PRINT( "Destroy p3\n");
+ DetachVideoRenderer(pOMXAV);
+
+ DBG_PRINT( "Destroy p4\n");
+ if(0!=(res2=OMXToolBasicAV_RequestState(pOMXAV, OMX_StateLoaded, KD_TRUE)))
+ {
+ if(!res1) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Destroy - Wait for Loaded Failed (%d)", res2);
+ }
+ }
+
+ DBG_PRINT( "Destroy p5\n");
+ for(i=0; i<OMXAV_H_NUMBER; i++) {
+ if(0!=pOMXAV->comp[i]) {
+ OMX_FreeHandle(pOMXAV->comp[i]);
+ pOMXAV->comp[i]=0;
+ }
+ }
+
+ if(0!=pOMXAV->flushSem) {
+ DBG_PRINT( "Destroy p6\n");
+ kdThreadSemFree(pOMXAV->flushSem);
+ pOMXAV->flushSem=0;
+ }
+ if(0!=pOMXAV->mutex) {
+ DBG_PRINT( "Destroy p7\n");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ DBG_PRINT( "Destroy p8\n");
+ kdThreadMutexFree(pOMXAV->mutex);
+ pOMXAV->mutex=0;
+ }
+
+ DBG_PRINT( "Destroy DONE\n");
+
+ free(pOMXAV);
+}
+
+static OMX_ERRORTYPE AddFile(OMXToolBasicAV_t * pOMXAV, const KDchar* filename)
+{
+ // FIXME: Non NV case ..
+ OMX_ERRORTYPE eError;
+ NVX_PARAM_FILENAME oFilenameParam;
+ OMX_INDEXTYPE eIndexParamFilename;
+
+ eError = OMX_GetExtensionIndex(pOMXAV->comp[OMXAV_H_READER], NVX_INDEX_PARAM_FILENAME,
+ &eIndexParamFilename);
+ if (eError != OMX_ErrorNone)
+ return eError;
+
+ INIT_PARAM(oFilenameParam);
+ oFilenameParam.pFilename = (char*) filename;
+
+ eError = OMX_SetParameter(pOMXAV->comp[OMXAV_H_READER], eIndexParamFilename, &oFilenameParam);
+ if (eError != OMX_ErrorNone)
+ return eError;
+
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE ProbePort(OMXToolBasicAV_t * pOMXAV, int port, KDchar *codec, KDchar* component)
+{
+ // FIXME: Non NV case ..
+ OMX_U32 roles = 1;
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ OMX_INDEXTYPE eParam;
+ NVX_PARAM_STREAMTYPE oStreamType;
+ OMX_PARAM_PORTDEFINITIONTYPE oPortDef;
+
+ INIT_PARAM(oStreamType);
+ INIT_PARAM(oPortDef);
+ OMXSAFEERR(OMX_GetExtensionIndex(pOMXAV->comp[OMXAV_H_READER], NVX_INDEX_PARAM_STREAMTYPE, &eParam));
+
+ oPortDef.nPortIndex = port;
+ OMXSAFEERR(OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], OMX_IndexParamPortDefinition, &oPortDef));
+
+ oStreamType.nPort = port;
+ OMXSAFEERR(OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], eParam, &oStreamType));
+
+ if (oPortDef.eDomain != OMX_PortDomainVideo &&
+ oPortDef.eDomain != OMX_PortDomainAudio) {
+ return OMX_ErrorNotImplemented;
+ }
+
+ switch (oStreamType.eStreamType)
+ {
+#define CODEC(a, b) case a: kdStrncat_s(codec, 128, b, kdStrlen(b)); break
+ CODEC(NvxStreamType_MPEG4, "mpeg4");
+ CODEC(NvxStreamType_H264, "avc");
+ CODEC(NvxStreamType_H263, "mpeg4");
+ CODEC(NvxStreamType_WMV, "vc1");
+ CODEC(NvxStreamType_MP3, "mp3");
+ CODEC(NvxStreamType_AAC, "aac");
+ CODEC(NvxStreamType_AACSBR, "eaacplus");
+ CODEC(NvxStreamType_BSAC, "bsac");
+ CODEC(NvxStreamType_WMA, "wma");
+ CODEC(NvxStreamType_WMAPro, "wmapro");
+ CODEC(NvxStreamType_WMALossless, "wmalossless");
+ CODEC(NvxStreamType_AMRWB, "amrwb");
+ CODEC(NvxStreamType_AMRNB, "amrnb");
+ CODEC(NvxStreamType_VORBIS, "vorbis");
+#undef CODEC
+ default:
+ return OMX_ErrorNotImplemented;
+ }
+
+ {
+ KDchar ocodec[256];
+ OMX_U8 *tmp = (OMX_U8*) kdMalloc(OMX_MAX_STRINGNAME_SIZE + 1);
+ kdMemset(tmp, 0, sizeof(OMX_U8) * (OMX_MAX_STRINGNAME_SIZE + 1));
+
+ if (oPortDef.eDomain == OMX_PortDomainVideo)
+ kdStrcpy_s(ocodec, 128, "video_decoder.");
+ else if (oPortDef.eDomain == OMX_PortDomainAudio)
+ kdStrcpy_s(ocodec, 128, "audio_decoder.");
+ kdStrncat_s(ocodec, 128, codec, kdStrlen(codec));
+
+ err = OMX_GetComponentsOfRole(codec, &roles, &tmp);
+ kdStrcpy_s(component, 256, (KDchar*) tmp);
+ kdFree(tmp);
+ printf("%s(%s) -> %s\n", ocodec, codec, component);
+ }
+
+ return err != OMX_ErrorNone ? err : roles ? OMX_ErrorNone : OMX_ErrorComponentNotFound;
+}
+
+static int StartClock(OMXToolBasicAV_t * pOMXAV, KDboolean start, KDfloat32 time) {
+ OMX_TIME_CONFIG_CLOCKSTATETYPE oClockState;
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ int loop=STATE_TIMEOUT_LOOP;
+ INIT_PARAM(oClockState);
+ oClockState.nOffset = 0;
+ oClockState.nStartTime = (KD_TRUE==start)? (OMX_TICKS) (time * 1000.0 * 1000.0) : 0;
+ oClockState.nWaitMask = 0;
+ oClockState.eState = (KD_TRUE==start)?OMX_TIME_ClockStateRunning:OMX_TIME_ClockStateStopped;
+
+ eError = OMX_SetConfig(pOMXAV->comp[OMXAV_H_CLOCK], OMX_IndexConfigTimeClockState, &oClockState);
+ while (loop>0 && OMX_ErrorNotReady == eError)
+ {
+ DBG_PRINT( "Play 3.2\n");
+ usleep(STATE_SLEEP*1000);
+ loop--;
+ eError = OMX_SetConfig(pOMXAV->comp[OMXAV_H_CLOCK], OMX_IndexConfigTimeClockState,
+ &oClockState);
+ }
+ return (OMX_ErrorNotReady == eError)?-1:0;
+}
+
+static KDfloat32 GetClockPosition(OMXToolBasicAV_t * pOMXAV)
+{
+ OMX_TIME_CONFIG_TIMESTAMPTYPE stamp;
+ INIT_PARAM(stamp);
+ stamp.nPortIndex = 0;
+
+ OMX_GetConfig(pOMXAV->comp[OMXAV_H_CLOCK], OMX_IndexConfigTimeCurrentMediaTime, &stamp);
+ return (KDfloat32) (stamp.nTimestamp * (1.0f/(1000.0f*1000.0f)));
+}
+
+static KDfloat32 GetClockScale(OMXToolBasicAV_t * pOMXAV)
+{
+ OMX_TIME_CONFIG_SCALETYPE pScale;
+ INIT_PARAM(pScale);
+
+ OMX_GetConfig(pOMXAV->comp[OMXAV_H_CLOCK], OMX_IndexConfigTimeScale, &pScale);
+ return (pScale.xScale / 65536.0f);
+}
+
+static KDint SetClockScale(OMXToolBasicAV_t * pOMXAV, KDfloat32 scale)
+{
+ OMX_TIME_CONFIG_SCALETYPE pScale;
+ INIT_PARAM(pScale);
+ pScale.xScale = (int) (scale * (1<<16));
+
+ OMX_SetConfig(pOMXAV->comp[OMXAV_H_CLOCK], OMX_IndexConfigTimeScale, &pScale);
+ return 0;
+}
+
+static int SetMediaPosition(OMXToolBasicAV_t * pOMXAV, KDfloat32 time) {
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_TIME_CONFIG_TIMESTAMPTYPE timestamp;
+ int loop=STATE_TIMEOUT_LOOP;
+ INIT_PARAM(timestamp);
+ timestamp.nPortIndex = 0;
+ timestamp.nTimestamp = (OMX_TICKS) (time * 1000.0 * 1000.0);
+
+ eError = OMX_SetConfig(pOMXAV->comp[OMXAV_H_READER], OMX_IndexConfigTimePosition, &timestamp);
+ while (loop>0 && OMX_ErrorNotReady == eError)
+ {
+ usleep(STATE_SLEEP*1000);
+ loop--;
+ eError = OMX_SetConfig(pOMXAV->comp[OMXAV_H_READER], OMX_IndexConfigTimePosition, &timestamp);
+ }
+ return (OMX_ErrorNotReady == eError)?-1:0;
+}
+
+static KDfloat32 GetMediaLength(OMXToolBasicAV_t * pOMXAV)
+{
+ NVX_PARAM_DURATION oDuration;
+ OMX_INDEXTYPE eParam;
+
+ if (OMX_ErrorNone != OMX_GetExtensionIndex(pOMXAV->comp[OMXAV_H_READER], NVX_INDEX_PARAM_DURATION, &eParam))
+ return -1.0f;
+
+ if (OMX_ErrorNone != OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], eParam, &oDuration))
+ return -1.0f;
+
+ return (KDfloat32) (oDuration.nDuration * (1.0f/(1000.0f*1000.0f)));
+}
+
+static OMX_ERRORTYPE UpdateStreamInfo(OMXToolBasicAV_t * pOMXAV, KDboolean issueCallback)
+{
+ OMX_ERRORTYPE err = OMX_ErrorNone;
+ OMX_PARAM_PORTDEFINITIONTYPE oPortDef;
+
+ DBG_PRINT( "Update StreamInfo p0\n" );
+
+ kdMemset(&oPortDef, 0, sizeof(oPortDef));
+ oPortDef.nSize = sizeof(oPortDef);
+ oPortDef.nVersion.s.nVersionMajor = 1;
+ oPortDef.nVersion.s.nVersionMinor = 1;
+ oPortDef.nPortIndex = 0;
+ err = OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], OMX_IndexParamPortDefinition, &oPortDef);
+ if(OMX_ErrorNone!=err) {
+ fprintf(stderr, "UpdateStreamInfo failed - p1 0x%X", err);
+ return err;
+ }
+
+ if (oPortDef.eDomain != OMX_PortDomainVideo)
+ {
+ kdMemset(&oPortDef, 0, sizeof(oPortDef));
+ oPortDef.nSize = sizeof(oPortDef);
+ oPortDef.nVersion.s.nVersionMajor = 1;
+ oPortDef.nVersion.s.nVersionMinor = 1;
+ oPortDef.nPortIndex = 1;
+ err = OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], OMX_IndexParamPortDefinition, &oPortDef);
+ if(OMX_ErrorNone!=err) {
+ fprintf(stderr, "UpdateStreamInfo failed - p2 0x%X", err);
+ return err;
+ }
+ }
+
+ DBG_PRINT( "Update StreamInfo p1\n" );
+ OMXInstance_SaveJavaAttributes(pOMXAV, issueCallback);
+
+ pOMXAV->width = oPortDef.format.video.nFrameWidth;
+ pOMXAV->height = oPortDef.format.video.nFrameHeight;
+ /* pOMXAV->stride = oPortDef.format.video.nStride;
+ pOMXAV->sliceHeight = oPortDef.format.video.nSliceHeight; */
+ pOMXAV->framerate = oPortDef.format.video.xFramerate;
+ pOMXAV->bitrate = oPortDef.format.video.nBitrate;
+ DBG_PRINT( "Update StreamInfo p2 %dx%d, fps %d, bps %d\n", pOMXAV->width, pOMXAV->height, pOMXAV->framerate, pOMXAV->bitrate );
+ pOMXAV->length = GetMediaLength(pOMXAV);
+ pOMXAV->speed = GetClockScale(pOMXAV);
+
+ OMXInstance_UpdateJavaAttributes(pOMXAV, issueCallback);
+
+ return err;
+}
+
+static int AttachAudioRenderer(OMXToolBasicAV_t * pOMXAV)
+{
+ int res=0;
+ // Configure audio port
+
+ if (USE_AUDIOBUFFERING)
+ {
+ // FIXME: proper audio buffering ..
+ OMXSAFE(OMX_GetHandle(&pOMXAV->comp[OMXAV_H_ABUFFERING], "OMX.Nvidia.audio.visualization", pOMXAV, &pOMXAV->callbacks));
+ if(0!=(res=SyncOnState(pOMXAV->comp[OMXAV_H_ABUFFERING], OMX_StateLoaded))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Loading AudioBuffering Failed (%d)", res);
+ return res;
+ }
+ /**
+ if (m_settings.m_avsync)
+ {
+ // Tweak the avsync parameter
+ NVX_CONFIG_VISU conf;
+ INIT_PARAM(conf);
+ conf.nAVSyncOffset = m_settings.m_avsync;
+
+ OMX_INDEXTYPE idx;
+ OMX_GetExtensionIndex(pOMXAV->comp[OMXAV_H_ABUFFERING], NVX_INDEX_PARAM_VISUDATA, &idx);
+ OMX_SetConfig(pOMXAV->comp[OMXAV_H_ABUFFERING], idx, &conf);
+ }*/
+ }
+
+ OMXSAFE(OMX_GetHandle(&pOMXAV->comp[OMXAV_H_ARENDERER], "OMX.Nvidia.audio.render",pOMXAV, &pOMXAV->callbacks));
+ pOMXAV->endComponent = pOMXAV->comp[OMXAV_H_ARENDERER];
+
+ // mandatory before SetupTunnel
+ if(0!=(res=SyncOnState(pOMXAV->comp[OMXAV_H_ARENDERER], OMX_StateLoaded))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Loading AudioRenderer Failed (%d)", res);
+ return res;
+ }
+
+ {
+ OMX_INDEXTYPE eIndexConfigOutputType;
+ NVX_CONFIG_AUDIOOUTPUT ao;
+ OMX_ERRORTYPE eError;
+
+ INIT_PARAM(ao);
+
+ eError = OMX_GetExtensionIndex(pOMXAV->comp[OMXAV_H_ARENDERER], NVX_INDEX_CONFIG_AUDIO_OUTPUT,
+ &eIndexConfigOutputType);
+ if (eError != OMX_ErrorNoMore)
+ {
+ /** FIXME: HDMI configuration ..
+ // for now, only put audio out hdmi if the settings say to, regardless of the hdmi-video flag.
+ // if (// m_settings.m_hdmiVideo || // m_settings.m_hdmiAudio)
+ // ao.eOutputType = NVX_AUDIO_OutputHdmi;
+ else */
+ ao.eOutputType = NVX_AUDIO_OutputI2S;
+
+ OMX_SetConfig(pOMXAV->comp[OMXAV_H_ARENDERER], eIndexConfigOutputType, &ao);
+ }
+ }
+
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_CLOCK], OMX_CommandPortEnable, pOMXAV->audioPort, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_ARENDERER], OMX_CommandPortEnable, 1, 0));
+
+ if (USE_AUDIOBUFFERING)
+ {
+ OMXSAFE(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_ADECODER], 1, pOMXAV->comp[OMXAV_H_ABUFFERING], 0));
+ OMXSAFE(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_ABUFFERING], 1, pOMXAV->comp[OMXAV_H_ARENDERER], 0));
+ }
+ else
+ {
+ OMXSAFE(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_ADECODER], 1, pOMXAV->comp[OMXAV_H_ARENDERER], 0));
+ }
+
+ OMXSAFE(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_CLOCK], pOMXAV->audioPort, pOMXAV->comp[OMXAV_H_ARENDERER], 1));
+
+ return OMX_ErrorNone;
+}
+
+static int AttachVideoRenderer(OMXToolBasicAV_t * pOMXAV)
+{
+ int i, res=0;
+ if(KD_NULL!=pOMXAV->comp[OMXAV_H_VSCHEDULER]) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Detach Video first");
+ return -1;
+ }
+ OMXSAFE(OMX_GetHandle(&pOMXAV->comp[OMXAV_H_VSCHEDULER], "OMX.Nvidia.video.scheduler", pOMXAV, &pOMXAV->callbacks));
+ pOMXAV->endComponent = pOMXAV->comp[OMXAV_H_VSCHEDULER];
+
+ // mandatory before SetupTunnel
+ if(0!=(res=SyncOnState(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_StateLoaded))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Loading VideoScheduler Failed (%d)", res);
+ return res;
+ }
+ // mandatory before EGLUseImage
+ OMXSAFE(RequestState(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_StateIdle, KD_FALSE));
+
+ DBG_PRINT( "Attach VR %p c:%p\n", pOMXAV, pOMXAV->comp[OMXAV_H_VSCHEDULER]);
+ OMXSAFE(UpdateStreamInfo(pOMXAV, KD_FALSE));
+
+ DBG_PRINT( "UseEGLImg port enable/tunneling %p\n", pOMXAV);
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_CLOCK], OMX_CommandPortEnable, PORT_VRENDERER, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_VDECODER], OMX_CommandPortEnable, 1, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_CommandPortEnable, 0, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_CommandPortEnable, 2, 0));
+ OMXSAFE(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_VDECODER], 1, pOMXAV->comp[OMXAV_H_VSCHEDULER], 0));
+ OMXSAFE(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_CLOCK], PORT_VRENDERER, pOMXAV->comp[OMXAV_H_VSCHEDULER], 2));
+
+ for (i = 0; i < pOMXAV->vBufferNum; i++) {
+ OMXToolImageBuffer_t *pBuf = &pOMXAV->buffers[i];
+ // The Texture, EGLImage and EGLSync was created by the Java client,
+ // and registered using the OMXToolBasicAV_SetStreamEGLImageTexture2D command.
+
+ DBG_PRINT( "UseEGLImg %p #%d t:%d i:%p s:%p p1\n", pOMXAV, i, pBuf->tex, pBuf->image, pBuf->sync);
+
+ if(NULL==pBuf->image) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "AttachVideoRenderer: User didn't set buffer %d/%d\n", i, pOMXAV->vBufferNum);
+ return -1;
+ } else {
+ // tell decoder output port that it will be using EGLImage
+ OMXSAFE(OMX_UseEGLImage(
+ pOMXAV->comp[OMXAV_H_VSCHEDULER],
+ &pBuf->omxBufferHeader,
+ 1, // The port to use the EGLImage for
+ pOMXAV, // app private data
+ pBuf->image));
+ }
+ DBG_PRINT( "UseEGLImg %p #%d t:%d i:%p s:%p b:%p - p2\n",
+ pOMXAV, i, pBuf->tex, pBuf->image, pBuf->sync, pBuf->omxBufferHeader);
+ }
+
+ DBG_PRINT( "UseEGLImg %p #%d DONE\n", pOMXAV, i);
+ return 0;
+}
+
+static int DetachVideoRenderer(OMXToolBasicAV_t * pOMXAV)
+{
+ int i;
+ if(NULL==pOMXAV) return -1;
+
+ if(KD_NULL==pOMXAV->comp[OMXAV_H_VSCHEDULER]) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Attach Video first");
+ return -1;
+ }
+ DBG_PRINT( "DetachVideoRenderer p0\n");
+ if(0==CheckState(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_StateLoaded)) {
+ DBG_PRINT( "DetachVideoRenderer DONE (already state loaded)\n");
+ return 0;
+ }
+ OMXSAFE(RequestState(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_StateIdle, KD_TRUE));
+
+ DBG_PRINT( "DetachVideoRenderer p1\n");
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_CLOCK], OMX_CommandPortDisable, PORT_VRENDERER, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_VDECODER], OMX_CommandPortDisable, 1, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_CommandPortDisable, 0, 0));
+ OMXSAFE(OMX_SendCommand(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_CommandPortDisable, 2, 0));
+ DBG_PRINT( "DetachVideoRenderer p2\n");
+
+ for (i = 0; i < pOMXAV->vBufferNum; i++) {
+ OMXToolImageBuffer_t *pBuf = &pOMXAV->buffers[i];
+
+ // tell decoder output port to stop using EGLImage
+ if (NULL!=pBuf->omxBufferHeader) {
+ OMX_FreeBuffer(
+ pOMXAV->comp[OMXAV_H_VSCHEDULER],
+ 1,
+ pBuf->omxBufferHeader);
+ pBuf->omxBufferHeader=NULL;
+ }
+ }
+
+ OMXSAFE(RequestState(pOMXAV->comp[OMXAV_H_VSCHEDULER], OMX_StateLoaded, KD_TRUE));
+ DBG_PRINT( "DetachVideoRenderer p3\n");
+
+ OMX_FreeHandle(pOMXAV->comp[OMXAV_H_VSCHEDULER]);
+ pOMXAV->comp[OMXAV_H_VSCHEDULER]=NULL;
+ DBG_PRINT( "DetachVideoRenderer DONE\n");
+ return 0;
+}
+
+OMXToolBasicAV_t * OMXToolBasicAV_CreateInstance()
+{
+ int i;
+ OMXToolBasicAV_t * pOMXAV = NULL;
+ InitStatic();
+
+ pOMXAV = malloc(sizeof(OMXToolBasicAV_t));
+ if(NULL==pOMXAV) {
+ DBG_PRINT( "Init struct failed!\n");
+ return NULL;
+ }
+ memset(pOMXAV, 0, sizeof(OMXToolBasicAV_t));
+
+ pOMXAV->audioPort=-1;
+ pOMXAV->videoPort=-1;
+
+ for(i=0; i<OMXAV_H_NUMBER; i++) {
+ pOMXAV->comp[i] = KD_NULL;
+ }
+
+ pOMXAV->callbacks.EventHandler = EventHandler;
+ pOMXAV->callbacks.EmptyBufferDone = EmptyBufferDone;
+ pOMXAV->callbacks.FillBufferDone = FillBufferDone;
+
+ pOMXAV->mutex = kdThreadMutexCreate(KD_NULL);
+ pOMXAV->flushSem = kdThreadSemCreate(0);
+
+ pOMXAV->play_speed = 1.0f;
+ pOMXAV->status=OMXAV_INIT;
+
+ return pOMXAV;
+}
+
+void OMXToolBasicAV_SetStream(OMXToolBasicAV_t * pOMXAV, int vBufferNum, const KDchar * stream)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+
+ DBG_PRINT( "SetStream 1 %s ..\n", stream);
+
+ // FIXME: verify player state .. ie stop !
+ if(pOMXAV->status!=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Player instance in use\n");
+ return;
+ }
+ if(vBufferNum>EGLIMAGE_MAX_BUFFERS) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "buffer number %d > MAX(%d)\n", vBufferNum, EGLIMAGE_MAX_BUFFERS);
+ return;
+ }
+
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ DBG_PRINT( "SetStream 3\n");
+
+ pOMXAV->vBufferNum = vBufferNum;
+
+ // Use the "super parser" :) FIXME: Non NV case ..
+ eError = OMX_GetHandle(&pOMXAV->comp[OMXAV_H_READER], "OMX.Nvidia.reader", pOMXAV, &pOMXAV->callbacks);
+
+ eError = AddFile(pOMXAV, stream);
+ if(eError!=OMX_ErrorNone) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Couldn't open or handle stream: %s\n", stream);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ DBG_PRINT( "SetStream 4\n");
+
+ // Auto detect codecs
+ {
+ OMX_PARAM_PORTDEFINITIONTYPE oPortDef;
+ INIT_PARAM(oPortDef);
+ oPortDef.nPortIndex = 0;
+ pOMXAV->videoPort = -1;
+ pOMXAV->audioPort = -1;
+ OMXSAFEVOID(OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], OMX_IndexParamPortDefinition, &oPortDef));
+
+ if (oPortDef.eDomain == OMX_PortDomainAudio)
+ pOMXAV->audioPort = oPortDef.nPortIndex;
+ else if (oPortDef.eDomain == OMX_PortDomainVideo)
+ pOMXAV->videoPort = oPortDef.nPortIndex;
+ else
+ OMXSAFEVOID(OMX_ErrorNotImplemented);
+
+ INIT_PARAM(oPortDef);
+ oPortDef.nPortIndex = 1;
+ if (OMX_GetParameter(pOMXAV->comp[OMXAV_H_READER], OMX_IndexParamPortDefinition, &oPortDef) == OMX_ErrorNone)
+ {
+ if (oPortDef.eDomain == OMX_PortDomainAudio)
+ pOMXAV->audioPort = oPortDef.nPortIndex;
+ else if (oPortDef.eDomain == OMX_PortDomainVideo)
+ pOMXAV->videoPort = oPortDef.nPortIndex;
+ else
+ OMXSAFEVOID(OMX_ErrorNotImplemented);
+ }
+ if (pOMXAV->audioPort != -1)
+ {
+ if (ProbePort(pOMXAV, pOMXAV->audioPort, pOMXAV->audioCodec, pOMXAV->audioCodecComponent) != OMX_ErrorNone)
+ {
+ printf("disabling audio port\n");
+ OMXSAFEVOID(OMX_SendCommand(pOMXAV->comp[OMXAV_H_READER], OMX_CommandPortDisable, pOMXAV->audioPort, 0));
+ pOMXAV->audioPort = -1;
+ }
+ }
+ if (pOMXAV->videoPort != -1)
+ if (ProbePort(pOMXAV, pOMXAV->videoPort, pOMXAV->videoCodec, pOMXAV->videoCodecComponent) != OMX_ErrorNone)
+ {
+ printf("disabling video port\n");
+ OMXSAFEVOID(OMX_SendCommand(pOMXAV->comp[OMXAV_H_READER], OMX_CommandPortDisable, pOMXAV->videoPort, 0));
+ pOMXAV->videoPort = -1;
+ }
+
+ if (pOMXAV->audioPort == -1 && pOMXAV->videoPort == -1)
+ {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Neither audioport or videoport could be played back!\n");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ }
+ DBG_PRINT( "SetStream 5 ; audioPort %d, videoPort %d\n", pOMXAV->audioPort, pOMXAV->videoPort);
+
+ OMXSAFEVOID(OMX_GetHandle(&pOMXAV->comp[OMXAV_H_CLOCK], "OMX.Nvidia.clock.component", pOMXAV, &pOMXAV->callbacks));
+
+ DBG_PRINT( "Configuring comp[OMXAV_H_CLOCK]\n");
+ {
+
+ OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE oActiveClockType;
+ INIT_PARAM(oActiveClockType);
+ oActiveClockType.eClock = (pOMXAV->audioPort != -1) ?
+ OMX_TIME_RefClockAudio : OMX_TIME_RefClockVideo;
+ OMXSAFEVOID(OMX_SetConfig(pOMXAV->comp[OMXAV_H_CLOCK], OMX_IndexConfigTimeActiveRefClock,
+ &oActiveClockType));
+ }
+ OMXSAFEVOID(OMX_SendCommand(pOMXAV->comp[OMXAV_H_CLOCK], OMX_CommandPortDisable, (OMX_U32) -1, 0));
+
+ OMXSAFEVOID(UpdateStreamInfo(pOMXAV, KD_FALSE));
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+
+ DBG_PRINT( "SetStream X\n");
+}
+
+void OMXToolBasicAV_SetStreamEGLImageTexture2D(OMXToolBasicAV_t * pOMXAV, KDint i, GLuint tex, EGLImageKHR image, EGLSyncKHR sync)
+{
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ DBG_PRINT( "SetStreamEGLImg %p #%d/%d t:%d i:%p s:%p..\n", pOMXAV, i, pOMXAV->vBufferNum, tex, image, sync);
+ if(i<0||i>=pOMXAV->vBufferNum) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Buffer index out of range: %d\n", i);
+ return;
+ }
+
+ kdThreadMutexLock(pOMXAV->mutex);
+ {
+ OMXToolImageBuffer_t *pBuf = &pOMXAV->buffers[i];
+ pBuf->tex=tex;
+ pBuf->image=image;
+ pBuf->sync=sync;
+
+ }
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+void OMXToolBasicAV_ActivateStream(OMXToolBasicAV_t * pOMXAV) {
+ int res;
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ DBG_PRINT( "ActivateStream 1\n");
+
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ if (pOMXAV->audioPort != -1)
+ {
+ OMXSAFEVOID(OMX_GetHandle(&pOMXAV->comp[OMXAV_H_ADECODER], pOMXAV->audioCodecComponent, pOMXAV, &pOMXAV->callbacks));
+ }
+
+ if (pOMXAV->videoPort != -1)
+ {
+ OMXSAFEVOID(OMX_GetHandle(&pOMXAV->comp[OMXAV_H_VDECODER], pOMXAV->videoCodecComponent, pOMXAV, &pOMXAV->callbacks));
+ }
+
+ //
+ // mandatory: before SetupTunnel (->Activate), wait until all devices are ready ..
+ // arender/vrender must wait as well ..
+ if(0!=(res=OMXToolBasicAV_WaitForState(pOMXAV, OMX_StateLoaded))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Loaded Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ if (pOMXAV->audioPort != -1)
+ {
+ if(0!=(res=AttachAudioRenderer(pOMXAV))) {
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return; // exception thrown
+ }
+ }
+
+ if (pOMXAV->videoPort != -1)
+ {
+ if(0!=(res=AttachVideoRenderer(pOMXAV))) {
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return; // exception thrown
+ }
+ }
+
+ DBG_PRINT( "Setup tunneling\n");
+ {
+ // do tunneling
+ if (pOMXAV->audioPort != -1)
+ {
+ DBG_PRINT( "Setup tunneling audio\n");
+ OMXSAFEVOID(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_READER], pOMXAV->audioPort, pOMXAV->comp[OMXAV_H_ADECODER], 0));
+ // The rest of the audio port is configured in AttachAudioRenderer
+ }
+
+ if (pOMXAV->videoPort != -1)
+ {
+ DBG_PRINT( "Setup tunneling video\n");
+ OMXSAFEVOID(OMX_SetupTunnel(pOMXAV->comp[OMXAV_H_READER], pOMXAV->videoPort, pOMXAV->comp[OMXAV_H_VDECODER], 0));
+ // The rest of the video port is configured in AttachVideoRenderer
+ }
+ }
+ DBG_PRINT( "ActivateStream .. %p\n", pOMXAV);
+
+ //
+ // mandatory: wait until all devices are idle
+ // failure means not all necessary ports/buffer are set.
+ //
+ if(0!=(res=OMXToolBasicAV_RequestState(pOMXAV, OMX_StateIdle, KD_TRUE)))
+ {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Wait for Idle Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ pOMXAV->status=OMXAV_STOPPED;
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ DBG_PRINT( "ActivateStream done %p\n", pOMXAV);
+}
+
+void OMXToolBasicAV_DetachVideoRenderer(OMXToolBasicAV_t * pOMXAV) {
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ (void) DetachVideoRenderer(pOMXAV);
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+void OMXToolBasicAV_AttachVideoRenderer(OMXToolBasicAV_t * pOMXAV) {
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ (void) AttachVideoRenderer(pOMXAV);
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+void OMXToolBasicAV_SetPlaySpeed(OMXToolBasicAV_t * pOMXAV, KDfloat32 scale)
+{
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ if(!SetClockScale(pOMXAV, scale)) {
+ pOMXAV->play_speed=scale;
+ }
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+
+void OMXToolBasicAV_PlayStart(OMXToolBasicAV_t * pOMXAV)
+{
+ int res;
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ if(pOMXAV->status==OMXAV_PLAYING) {
+ return;
+ }
+
+ kdThreadMutexLock(pOMXAV->mutex);
+ DBG_PRINT( "Play 2\n");
+
+ SetClockScale(pOMXAV, pOMXAV->play_speed);
+
+ DBG_PRINT( "Play 3.1\n");
+ if(0!=(res=OMXToolBasicAV_RequestState(pOMXAV, OMX_StateExecuting, KD_TRUE))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Play Execute Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ if(pOMXAV->status==OMXAV_STOPPED || pOMXAV->status==OMXAV_FIN) {
+ DBG_PRINT( "Play 3.2\n");
+ if(StartClock(pOMXAV, KD_TRUE, 0.0)) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Play StartClock Failed");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ }
+ DBG_PRINT( "Play 4.0\n");
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ pOMXAV->status=OMXAV_PLAYING;
+ DBG_PRINT( "Play DONE\n");
+}
+
+static int PlayStop(OMXToolBasicAV_t * pOMXAV)
+{
+ int res;
+ if(NULL==pOMXAV || pOMXAV->status<=OMXAV_INIT) {
+ return -1;
+ }
+ if( pOMXAV->status!=OMXAV_PLAYING && pOMXAV->status!=OMXAV_PAUSED ) {
+ return -1;
+ }
+
+ if(OMXToolBasicAV_CheckState(pOMXAV, OMX_StateLoaded)) {
+ if(StartClock(pOMXAV, KD_FALSE, 0.0)) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Stop StopClock Failed");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return -1;
+ }
+ if(OMXToolBasicAV_CheckState(pOMXAV, OMX_StateIdle)) {
+ if(0!=(res=OMXToolBasicAV_RequestState(pOMXAV, OMX_StateIdle, KD_TRUE))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Stop Idle Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return res;
+ }
+ }
+ }
+ pOMXAV->status=OMXAV_STOPPED;
+ return 0;
+}
+
+void OMXToolBasicAV_PlayStop(OMXToolBasicAV_t * pOMXAV)
+{
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ (void) PlayStop(pOMXAV);
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+void OMXToolBasicAV_PlayPause(OMXToolBasicAV_t * pOMXAV)
+{
+ int res;
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ if(pOMXAV->status==OMXAV_PAUSED || pOMXAV->status!=OMXAV_PLAYING) {
+ return;
+ }
+
+ kdThreadMutexLock(pOMXAV->mutex);
+ SetClockScale(pOMXAV, 0);
+ if(0!=(res=OMXToolBasicAV_RequestState(pOMXAV, OMX_StatePause, KD_TRUE))) {
+ fprintf(stderr, "Err: Pause Pause Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ pOMXAV->status=OMXAV_PAUSED;
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+void OMXToolBasicAV_PlaySeek(OMXToolBasicAV_t * pOMXAV, KDfloat32 time)
+{
+ int res;
+
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return;
+ }
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ pOMXAV->length = GetMediaLength(pOMXAV);
+ if(pOMXAV->length<=time) {
+ (void) PlayStop(pOMXAV);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ // 1. Pause the component through the use of OMX_SendCommand requesting a
+ // state transition to OMX_StatePause.
+ if(pOMXAV->status!=OMXAV_PAUSED) {
+ if(0!=(res=OMXToolBasicAV_RequestState(pOMXAV, OMX_StatePause, KD_TRUE))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Seek Pause Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ }
+
+ // 2. Stop the comp[OMXAV_H_CLOCK] component’s media comp[OMXAV_H_CLOCK] through the use of OMX_SetConfig
+ // on OMX_TIME_CONFIG_CLOCKSTATETYPE requesting a transition to
+ // OMX_TIME_ClockStateStopped.
+ if(StartClock(pOMXAV, KD_FALSE, 0.0)) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Seek StopClock Failed");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ // 3. Seek to the desired location through the use of OMX_SetConfig on
+ // OMX_IndexConfigTimePosition requesting the desired timestamp.
+ if(SetMediaPosition(pOMXAV, time)) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Seek position Failed");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ // 4. Flush all components.
+ if(SendCommand(pOMXAV, OMX_CommandFlush, OMX_ALL, 0)) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Seek Flush Failed");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ // 5. Start the comp[OMXAV_H_CLOCK] component’s media comp[OMXAV_H_CLOCK] through the use of OMX_SetConfig
+ // on OMX_TIME_CONFIG_CLOCKSTATETYPE requesting a transition to either
+ // OMX_TIME_ClockStateRunning or
+ // OMX_TIME_ClockStateWaitingForStartTime.
+ if(StartClock(pOMXAV, KD_TRUE, time)) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Seek StartClock Failed");
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+
+ // 6. Un-pause the component through the use of OMX_SendCommand requesting a
+ // state transition to OMX_StateExecuting.
+ if(pOMXAV->status==OMXAV_PLAYING) {
+ if(0!=(res=OMXToolBasicAV_RequestState(pOMXAV, OMX_StateExecuting, KD_TRUE))) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "Seek Execute Failed (%d)", res);
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return;
+ }
+ }
+ kdThreadMutexUnlock(pOMXAV->mutex);
+}
+
+GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV) {
+ GLuint texID = 0;
+ int ret = pOMXAV->glPos;
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ if(pOMXAV->status==OMXAV_PLAYING) {
+ int next = (pOMXAV->omxPos + 1) % pOMXAV->vBufferNum;
+
+ DBG_PRINT2("GetNextTexture A avail %d, filled %d, pos o:%d g:%d\n",
+ pOMXAV->available, pOMXAV->filled, pOMXAV->omxPos, pOMXAV->glPos);
+
+ while (pOMXAV->filled < pOMXAV->vBufferNum)
+ {
+ int attr;
+ if ( !_hasEGLSync || (
+ eglGetSyncAttribKHR(pOMXAV->buffers[pOMXAV->omxPos].sync, EGL_SYNC_STATUS_KHR, &attr) &&
+ attr == EGL_SIGNALED_KHR )
+ )
+ {
+ DBG_PRINT2( "GetNextTexture p2.1 attr 0x%X\n", attr);
+ // OpenGL has finished rendering with this texture, so we are free
+ // to make OpenMAX IL fill it with new data.
+ OMX_FillThisBuffer(pOMXAV->comp[OMXAV_H_VSCHEDULER], pOMXAV->buffers[pOMXAV->omxPos].omxBufferHeader);
+ DBG_PRINT2( "GetNextTexture p2.2\n");
+ pOMXAV->omxPos = next;
+ next = (pOMXAV->omxPos + 1) % pOMXAV->vBufferNum;
+ pOMXAV->filled++;
+ }
+ else
+ {
+ DBG_PRINT2( "GetNextTexture p2.3\n");
+ break;
+ }
+ }
+ }
+ if (pOMXAV->available > 1)
+ {
+ DBG_PRINT2("GetNextTexture p3.1\n");
+ // We want to make sure that the previous eglImage
+ // has finished, so insert a fence command into the
+ // command stream to make sure that any rendering using
+ // the previous eglImage has finished.
+ //
+ // Only move on to rendering the next image if the insertion
+ // was successfull.
+ if (!_hasEGLSync || eglFenceKHR(pOMXAV->buffers[pOMXAV->glPos].sync))
+ {
+ DBG_PRINT2( "GetNextTexture p3.2\n");
+ pOMXAV->available--;
+ pOMXAV->filled--;
+ pOMXAV->glPos = (pOMXAV->glPos + 1) % pOMXAV->vBufferNum;
+ ret = pOMXAV->glPos;
+ }
+ }
+
+ texID = pOMXAV->available ? pOMXAV->buffers[ret].tex : 0;
+ DBG_PRINT2( "GetNextTexture B avail %d, filled %d, pos o:%d g:%d t:%d\n",
+ pOMXAV->available, pOMXAV->filled, pOMXAV->omxPos, pOMXAV->glPos, texID);
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+ return texID;
+}
+
+KDfloat32 OMXToolBasicAV_GetCurrentPosition(OMXToolBasicAV_t * pOMXAV) {
+ KDfloat32 res = -1.0f;
+ if(NULL==pOMXAV) {
+ java_throwNewRuntimeException(0, "OMX instance null\n");
+ return res;
+ }
+ if(pOMXAV->status<=OMXAV_INIT) {
+ java_throwNewRuntimeException(pOMXAV->jni_env, "OMX invalid status: %d <= INIT\n", pOMXAV->status);
+ return res;
+ }
+ kdThreadMutexLock(pOMXAV->mutex);
+
+ res = GetClockPosition(pOMXAV);
+
+ kdThreadMutexUnlock(pOMXAV->mutex);
+
+ return res;
+}
+
+void OMXToolBasicAV_DestroyInstance(OMXToolBasicAV_t * pOMXAV)
+{
+ if(NULL==pOMXAV) return;
+
+ kdThreadMutexLock(pOMXAV->mutex);
+ DestroyInstanceUnlock(pOMXAV);
+}
+
+#if defined(SELF_TEST)
+
+#include <KD/NV_extwindowprops.h>
+
+static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR;
+
+int ModuleTest()
+{
+ int i;
+ OMXToolBasicAV_t * pOMXAV = NULL;
+ GLuint tex; EGLImageKHR image; EGLSyncKHR sync;
+ KDchar file[512];
+ EGLint attrib = EGL_NONE;
+
+#if 0
+ const EGLint s_configAttribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_ALPHA_SIZE, EGL_DONT_CARE,
+ EGL_DEPTH_SIZE, 1,
+ EGL_STENCIL_SIZE, EGL_DONT_CARE,
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL_NONE
+ };
+#else
+ const EGLint s_configAttribs[] = {
+ EGL_RED_SIZE, 5,
+ EGL_GREEN_SIZE, 6,
+ EGL_BLUE_SIZE, 5,
+ EGL_ALPHA_SIZE, EGL_DONT_CARE,
+ EGL_DEPTH_SIZE, 16,
+ EGL_STENCIL_SIZE, EGL_DONT_CARE,
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+ EGL_NONE
+ };
+#endif
+
+ const EGLint contextAttrs[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+ EGL_NONE
+ };
+
+ EGLint numConfigs;
+ EGLint majorVersion;
+ EGLint minorVersion;
+
+ EGLint sWidth, sHeight;
+
+ EGLDisplay eglDisplay;
+ EGLConfig eglConfig;
+ EGLContext eglContext;
+ EGLSurface eglWindowSurface;
+ KDWindow *kdWindow;
+ NativeWindowType ntWindow;
+
+// KDint wSize[2];
+
+ /*
+ * EGL initialisation.
+ */
+
+ eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ eglInitialize(eglDisplay, &majorVersion, &minorVersion);
+ eglChooseConfig(eglDisplay, s_configAttribs, &eglConfig, 1, &numConfigs);
+ kdWindow = kdCreateWindow(eglDisplay, eglConfig, KD_NULL);
+
+ {
+ /* Set fullscreen mode */
+ KDboolean fullscreen = KD_TRUE;
+ kdSetWindowPropertybv(kdWindow,
+ KD_WINDOWPROPERTY_FULLSCREEN_NV, &fullscreen);
+ }
+
+ kdRealizeWindow(kdWindow, &ntWindow);
+
+ eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, contextAttrs);
+
+ eglWindowSurface = eglCreateWindowSurface(eglDisplay, eglConfig, ntWindow, KD_NULL);
+ eglMakeCurrent(eglDisplay, eglWindowSurface, eglWindowSurface, eglContext);
+
+ printf("EGL Extensions : %s\n",eglQueryString(eglDisplay, EGL_EXTENSIONS));
+ printf("EGL CLIENT APIs: %s\n",eglQueryString(eglDisplay, EGL_CLIENT_APIS));
+
+ eglQuerySurface(eglDisplay, eglWindowSurface, EGL_WIDTH , &sWidth);
+ eglQuerySurface(eglDisplay, eglWindowSurface, EGL_HEIGHT , &sHeight);
+
+ /* Set up the viewport and perspective. */
+ printf("screen dim %dx%d\n", sWidth, sHeight);
+ glViewport(0, 0, sWidth, sHeight);
+
+ /*
+ if (argc == 2)
+ kdStrcpy_s(file, 512, argv[1]);
+ else */
+ kdStrcpy_s(file, 512, "/Storage Card/resources/videoplayer/Luna_800x480_1_5M_H264.mp4");
+
+ if( OMXToolBasicAV_IsFileValid(file) ) {
+ fprintf(stderr, "File is invalid");
+ return -1;
+ }
+
+ GETEXTENSION(PFNEGLDESTROYIMAGEKHRPROC, eglDestroyImageKHR);
+
+ pOMXAV = OMXToolBasicAV_CreateInstance(3);
+ if(OMXToolBasicAV_SetStream(pOMXAV, file)) {
+ return -1;
+ }
+ printf("movie dim %dx%d\n", pOMXAV->width, pOMXAV->height);
+
+ glActiveTexture(GL_TEXTURE0);
+ printf("i1: 0x%X\n", glGetError());
+ glEnable(GL_TEXTURE_2D);
+ printf("i2: 0x%X\n", glGetError());
+
+ for (i = 0; i < 3; i++)
+ {
+ printf("0: 0x%X\n", glGetError());
+ glGenTextures(1, &tex);
+ printf("1: tex: %d, e 0x%X\n", tex, glGetError());
+ glBindTexture(GL_TEXTURE_2D, tex);
+ printf("2: 0x%X\n", glGetError());
+
+ // create space for buffer with a texture
+ glTexImage2D(
+ GL_TEXTURE_2D, // target
+ 0, // level
+ GL_RGBA, // internal format
+ pOMXAV->width, // width
+ pOMXAV->height, // height
+ 0, // border
+ GL_RGBA, // format
+ GL_UNSIGNED_BYTE, // type
+ NULL); // pixels -- will be provided later
+ printf("3: 0x%X\n", glGetError());
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ printf("4: 0x%X\n", glGetError());
+
+ // create EGLImage from texture
+ image = eglCreateImageKHR(
+ eglDisplay,
+ eglContext,
+ EGL_GL_TEXTURE_2D_KHR,
+ (EGLClientBuffer)(tex),
+ &attrib);
+ if (!image)
+ {
+ printf("eglGetError: 0x%x\n", eglGetError());
+ printf("ERROR creating EglImage\n");
+ return -1;
+ }
+ printf("5 eglGetError: 0x%x\n", eglGetError());
+
+ sync = eglCreateFenceSyncKHR(
+ eglDisplay, EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR, &attrib);
+
+ printf("6 eglGetError: 0x%x\n", eglGetError());
+
+ if(OMXToolBasicAV_SetStreamEGLImageTexture2D(pOMXAV, i, tex, image, sync)) {
+ return -1;
+ }
+ }
+
+ printf("7\n");
+ if( OMXToolBasicAV_ActivateStream(pOMXAV) ) {
+ return -1;
+ }
+
+ printf("8\n");
+ if( OMXToolBasicAV_PlayStart(pOMXAV) ) {
+ return -1;
+ }
+
+ printf("8.2\n");
+
+ i = 0;
+ while (i++ < 10) {
+ glClear(GL_COLOR_BUFFER_BIT);
+ // set uniforms
+ // set attributes
+ // draw arrays ..
+ eglSwapBuffers(eglDisplay, eglWindowSurface);
+ printf("Sleep %d\n", i);
+ usleep(1000);
+ }
+
+ printf("9\n");
+ if( OMXToolBasicAV_PlayStop(pOMXAV) ) {
+ fprintf(stderr, "Err: Stop");
+ return -1;
+ }
+ printf("A1\n");
+ OMXToolBasicAV_DetachVideoRenderer(pOMXAV); // Stop before ..
+
+ printf("A2\n");
+ OMXToolBasicAV_AttachVideoRenderer(pOMXAV); // DetachVideoRenderer before ..
+
+ printf("B\n");
+ OMXToolBasicAV_DestroyInstance(pOMXAV);
+
+ printf("C\n");
+ eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglDestroySurface(eglDisplay, eglWindowSurface);
+ eglDestroyContext(eglDisplay, eglContext);
+
+ printf("D\n");
+ kdDestroyWindow(kdWindow);
+
+ printf("E\n");
+ eglTerminate(eglDisplay);
+ printf("F\n");
+ eglReleaseThread();
+
+ return 0;
+}
+
+KDint kdMain(KDint argc, const KDchar *const *argv)
+// int main(int argc, const char *const *argv)
+{
+ return ModuleTest();
+}
+#endif
+
diff --git a/src/jogl/native/openmax/omx_tool.h b/src/jogl/native/openmax/omx_tool.h
new file mode 100644
index 000000000..9c0df93b3
--- /dev/null
+++ b/src/jogl/native/openmax/omx_tool.h
@@ -0,0 +1,165 @@
+
+#ifndef _OMX_TOOL_H
+#define _OMX_TOOL_H
+
+#ifdef _WIN32
+ #include <windows.h>
+ // __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
+
+ #define usleep(t) Sleep((t) / 1000)
+
+ #ifdef _MSC_VER
+ /* This typedef is apparently needed for Microsoft compilers before VC8,
+ and on Windows CE */
+ #if (_MSC_VER < 1400) || defined(UNDER_CE)
+ #ifdef _WIN64
+ typedef long long intptr_t;
+ #else
+ typedef int intptr_t;
+ #endif
+ #endif
+ #else
+ #include <inttypes.h>
+ #endif
+#else
+ #include <unistd.h>
+ #include <inttypes.h>
+#endif
+
+#include <OMX_Core.h>
+#include <OMX_Index.h>
+#include <OMX_Video.h>
+#include <OMX_Audio.h>
+#include <OMX_Other.h>
+#include <OMX_Image.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <EGL/eglext.h>
+#include <KD/kd.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define EGLIMAGE_MAX_BUFFERS 4
+
+extern int USE_OPENGL;
+extern int USE_HWAUDIOOUT;
+extern int USE_AUDIOBUFFERING;
+extern const int PORT_VRENDERER;
+
+typedef struct {
+ EGLSyncKHR sync;
+ EGLImageKHR image;
+ GLuint tex;
+ OMX_BUFFERHEADERTYPE *omxBufferHeader;
+} OMXToolImageBuffer_t;
+
+typedef enum
+{
+ OMXAV_INVALID=0,
+ OMXAV_INIT,
+ OMXAV_STOPPED,
+ OMXAV_PLAYING,
+ OMXAV_PAUSED,
+ OMXAV_FIN,
+} OMXToolStatus;
+
+typedef enum
+{
+ OMXAV_H_READER=0,
+ OMXAV_H_CLOCK,
+ OMXAV_H_ADECODER,
+ OMXAV_H_ABUFFERING,
+ OMXAV_H_ARENDERER,
+ OMXAV_H_VDECODER,
+ OMXAV_H_VRENDERER,
+ OMXAV_H_VSCHEDULER,
+ OMXAV_H_NUMBER,
+} OMXToolHandleIdx;
+
+
+typedef struct {
+ OMX_VERSIONTYPE version;
+ OMX_HANDLETYPE comp[OMXAV_H_NUMBER];
+ OMX_HANDLETYPE endComponent;
+ OMX_CALLBACKTYPE callbacks;
+
+ KDchar audioCodec[256];
+ KDchar audioCodecComponent[256];
+ KDchar videoCodec[256];
+ KDchar videoCodecComponent[256];
+ int audioPort;
+ int videoPort;
+ KDuint32 width;
+ KDuint32 height;
+ KDuint32 bitrate; // per seconds
+ KDuint32 framerate; // per seconds
+ KDfloat32 length; // seconds
+ KDfloat32 speed; // current clock scale
+ KDfloat32 play_speed; // current play clock scale
+
+ KDThreadMutex * mutex;
+ KDThreadSem * flushSem;
+
+ OMXToolImageBuffer_t buffers[EGLIMAGE_MAX_BUFFERS];
+ int vBufferNum;
+ int glPos;
+ int omxPos;
+ int filled;
+ int available;
+
+ int status;
+
+ intptr_t jni_env;
+ intptr_t jni_instance;
+ intptr_t jni_mid_saveAttributes;
+ intptr_t jni_mid_attributesUpdated;
+ intptr_t jni_fid_width;
+ intptr_t jni_fid_height;
+ intptr_t jni_fid_fps;
+ intptr_t jni_fid_bps;
+ intptr_t jni_fid_totalFrames;
+ intptr_t jni_fid_acodec;
+ intptr_t jni_fid_vcodec;
+} OMXToolBasicAV_t ;
+
+//
+// more internal stuff ..
+//
+KDint OMXToolBasicAV_IsFileValid(const KDchar * file);
+
+//
+// OMX state control ..
+//
+KDint OMXToolBasicAV_CheckState(OMXToolBasicAV_t * pOMXAV, OMX_STATETYPE state);
+KDint OMXToolBasicAV_SetState(OMXToolBasicAV_t * pOMXAV, OMX_STATETYPE state, KDboolean wait);
+
+//
+// User related functionality, mutex managed
+//
+OMXToolBasicAV_t * OMXToolBasicAV_CreateInstance(); // #1
+void OMXToolBasicAV_SetStream(OMXToolBasicAV_t * pOMXAV, int vBufferNum, const KDchar * stream); // #2
+void OMXToolBasicAV_SetStreamEGLImageTexture2D(OMXToolBasicAV_t * pOMXAV, KDint i, GLuint tex, EGLImageKHR image, EGLSyncKHR sync); // #3
+void OMXToolBasicAV_ActivateStream(OMXToolBasicAV_t * pOMXAV); // #4
+
+void OMXToolBasicAV_AttachVideoRenderer(OMXToolBasicAV_t * pOMXAV); // Stop, DetachVideoRenderer, SetEGLImageTexture2D .. before ..
+void OMXToolBasicAV_DetachVideoRenderer(OMXToolBasicAV_t * pOMXAV); // Stop before ..
+
+void OMXToolBasicAV_SetPlaySpeed(OMXToolBasicAV_t * pOMXAV, KDfloat32 scale);
+void OMXToolBasicAV_PlayStart(OMXToolBasicAV_t * pOMXAV); // #5
+void OMXToolBasicAV_PlayPause(OMXToolBasicAV_t * pOMXAV);
+void OMXToolBasicAV_PlayStop(OMXToolBasicAV_t * pOMXAV);
+void OMXToolBasicAV_PlaySeek(OMXToolBasicAV_t * pOMXAV, KDfloat32 time);
+GLuint OMXToolBasicAV_GetNextTextureID(OMXToolBasicAV_t * pOMXAV);
+
+KDfloat32 OMXToolBasicAV_GetCurrentPosition(OMXToolBasicAV_t * pOMXAV);
+
+void OMXToolBasicAV_DestroyInstance(OMXToolBasicAV_t * pOMXAV);
+
+#if defined(SELF_TEST)
+ int ModuleTest();
+#endif
+
+#endif /* _OMX_TOOL_H */
+
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java b/src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java
new file mode 100644
index 000000000..5d53f88fd
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/Debug.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl;
+
+import java.security.*;
+
+/** Helper routines for logging and debugging. */
+
+public class Debug {
+ // Some common properties
+ private static boolean verbose;
+ private static boolean debugAll;
+
+ static {
+ verbose = isPropertyDefined("nativewindow.verbose");
+ debugAll = isPropertyDefined("nativewindow.debug");
+ if (verbose) {
+ Package p = Package.getPackage("javax.media.nativewindow");
+ System.err.println("NativeWindow specification version " + p.getSpecificationVersion());
+ System.err.println("NativeWindow implementation version " + p.getImplementationVersion());
+ System.err.println("NativeWindow implementation vendor " + p.getImplementationVendor());
+ }
+ }
+
+ public static boolean getBooleanProperty(final String property) {
+ Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ boolean val = Boolean.getBoolean(property);
+ return (val ? Boolean.TRUE : Boolean.FALSE);
+ }
+ });
+ return b.booleanValue();
+ }
+
+ public static boolean isPropertyDefined(final String property) {
+ Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String val = System.getProperty(property);
+ return (val != null ? Boolean.TRUE : Boolean.FALSE);
+ }
+ });
+ return b.booleanValue();
+ }
+
+ public static boolean verbose() {
+ return verbose;
+ }
+
+ public static boolean debugAll() {
+ return debugAll;
+ }
+
+ public static boolean debug(String subcomponent) {
+ return debugAll() || isPropertyDefined("nativewindow.debug." + subcomponent);
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java
new file mode 100644
index 000000000..4e8e281a8
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/GraphicsConfigurationFactoryImpl.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.nativewindow.impl;
+
+import javax.media.nativewindow.*;
+
+public class GraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen screen) {
+ return new DefaultGraphicsConfiguration(screen, capabilities, capabilities);
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java b/src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java
new file mode 100644
index 000000000..0425014df
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/InternalBufferUtil.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.nativewindow.impl;
+
+import java.lang.reflect.*;
+import java.nio.*;
+
+/** Internal copy of selected routines from BufferUtil to avoid
+ outward dependencies on com.sun.opengl.util package. */
+public class InternalBufferUtil {
+ 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;
+
+ //----------------------------------------------------------------------
+ // Allocation routines
+ //
+
+ /** 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;
+ }
+
+ /** 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();
+ }
+
+ //----------------------------------------------------------------------
+ // 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;
+ }
+
+ //----------------------------------------------------------------------
+ // Conversion routines
+ //
+
+ 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;
+ }
+
+ //----------------------------------------------------------------------
+ // 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/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java
new file mode 100644
index 000000000..b13cf4317
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.nativewindow.impl;
+
+import java.lang.reflect.*;
+import javax.media.nativewindow.*;
+
+public final class NWReflection {
+ public static final boolean DEBUG = Debug.debug("NWReflection");
+
+ public static final boolean isClassAvailable(String clazzName) {
+ try {
+ Class clazz = Class.forName(clazzName, false, NWReflection.class.getClassLoader());
+ return null!=clazz;
+ } catch (Throwable e) { }
+ return false;
+ }
+
+ public static final Class getClass(String clazzName, boolean initialize) {
+ try {
+ return Class.forName(clazzName, initialize, NWReflection.class.getClassLoader());
+ } catch (Throwable e) { }
+ return null;
+ }
+
+ public static final Constructor getConstructor(String clazzName, Class[] cstrArgTypes) {
+ Class factoryClass = null;
+ Constructor factory = null;
+
+ try {
+ factoryClass = getClass(clazzName, true);
+ if (factoryClass == null) {
+ throw new NativeWindowException(clazzName + " not available");
+ }
+ try {
+ factory = factoryClass.getDeclaredConstructor( cstrArgTypes );
+ } catch(NoSuchMethodException nsme) {
+ throw new NativeWindowException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found");
+ }
+ return factory;
+ } catch (Throwable e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
+ throw new NativeWindowException(e);
+ }
+ }
+
+ public static final Constructor getConstructor(String clazzName) {
+ return getConstructor(clazzName, new Class[0]);
+ }
+
+ public static final Object createInstance(String clazzName, Class[] cstrArgTypes, Object[] cstrArgs) {
+ Constructor factory = null;
+
+ try {
+ factory = getConstructor(clazzName, cstrArgTypes);
+ return factory.newInstance( cstrArgs ) ;
+ } catch (Exception e) {
+ throw new NativeWindowException(e);
+ }
+ }
+
+ public static final Object createInstance(String clazzName, Object[] cstrArgs) {
+ Class[] cstrArgTypes = new Class[cstrArgs.length];
+ for(int i=0; i<cstrArgs.length; i++) {
+ cstrArgTypes[i] = cstrArgs[i].getClass();
+ }
+ return createInstance(clazzName, cstrArgTypes, cstrArgs);
+ }
+
+ public static final Object createInstance(String clazzName) {
+ return createInstance(clazzName, new Class[0], null);
+ }
+
+ public static final boolean instanceOf(Object obj, String clazzName) {
+ return instanceOf(obj.getClass(), clazzName);
+ }
+ public static final boolean instanceOf(Class clazz, String clazzName) {
+ do {
+ if(clazz.getName().equals(clazzName)) {
+ return true;
+ }
+ clazz = clazz.getSuperclass();
+ } while (clazz!=null);
+ return false;
+ }
+
+ public static final boolean implementationOf(Object obj, String faceName) {
+ return implementationOf(obj.getClass(), faceName);
+ }
+ public static final boolean implementationOf(Class clazz, String faceName) {
+ do {
+ Class[] clazzes = clazz.getInterfaces();
+ for(int i=clazzes.length-1; i>=0; i--) {
+ Class face = clazzes[i];
+ if(face.getName().equals(faceName)) {
+ return true;
+ }
+ }
+ clazz = clazz.getSuperclass();
+ } while (clazz!=null);
+ return false;
+ }
+
+ public static boolean isAWTComponent(Object target) {
+ return instanceOf(target, "java.awt.Component");
+ }
+
+ public static boolean isAWTComponent(Class clazz) {
+ return instanceOf(clazz, "java.awt.Component");
+ }
+
+}
+
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java
new file mode 100644
index 000000000..e1427d7be
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeLibLoaderBase.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl;
+
+// FIXME: refactor Java SE dependencies
+//import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+
+public class NativeLibLoaderBase {
+ public static final boolean DEBUG = Debug.debug("NativeLibLoader");
+
+ public interface LoaderAction {
+ /**
+ * Loads the library specified by libname. Optionally preloads the libraries specified by
+ * preload. The implementation should ignore, if the preload-libraries have already been
+ * loaded.
+ * @param libname the library to load
+ * @param preload the libraries to load before loading the main library if not null
+ * @param preloadIgnoreError true, if errors during loading the preload-libraries should be ignored
+ */
+ void loadLibrary(String libname, String[] preload,
+ boolean preloadIgnoreError);
+ }
+
+ private static class DefaultAction implements LoaderAction {
+ public void loadLibrary(String libname, String[] preload,
+ boolean preloadIgnoreError) {
+ if (null!=preload) {
+ for (int i=0; i<preload.length; i++) {
+ if(!isLoaded(preload[i])) {
+ try {
+ System.loadLibrary(preload[i]);
+ addLoaded(preload[i]);
+ if(DEBUG) {
+ System.err.println("NativeLibLoaderBase preloaded "+preload[i]);
+ }
+ }
+ catch (UnsatisfiedLinkError e) {
+ if(DEBUG) e.printStackTrace();
+ if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) {
+ throw e;
+ }
+ }
+ }
+ }
+ }
+ System.loadLibrary(libname);
+ addLoaded(libname);
+ if(DEBUG) {
+ System.err.println("NativeLibLoaderBase loaded "+libname);
+ }
+ }
+ }
+
+ private static final HashSet loaded = new HashSet();
+ private static LoaderAction loaderAction = new DefaultAction();
+
+ public static boolean isLoaded(String libName) {
+ return loaded.contains(libName);
+ }
+
+ public static void addLoaded(String libName) {
+ loaded.add(libName);
+ if(DEBUG) {
+ System.err.println("NativeLibLoaderBase Loaded Native Library: "+libName);
+ }
+ }
+
+ public static void disableLoading() {
+ setLoadingAction(null);
+ }
+
+ public static void enableLoading() {
+ setLoadingAction(new DefaultAction());
+ }
+
+ public static synchronized void setLoadingAction(LoaderAction action) {
+ loaderAction = action;
+ }
+
+ protected static synchronized void loadLibrary(String libname, String[] preload,
+ boolean preloadIgnoreError) {
+ if (loaderAction != null && !isLoaded(libname))
+ {
+ loaderAction.loadLibrary(libname, preload, preloadIgnoreError);
+ }
+ }
+
+ public static void loadNativeWindow(final String ossuffix) {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ loadLibrary("nativewindow_"+ossuffix, null, false);
+ return null;
+ }
+ });
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java
new file mode 100644
index 000000000..424b44c8c
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NativeWindowFactoryImpl.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.nativewindow.impl;
+
+import java.lang.reflect.*;
+import java.security.*;
+
+import javax.media.nativewindow.*;
+
+public class NativeWindowFactoryImpl extends NativeWindowFactory {
+ protected static final boolean DEBUG = Debug.debug("NativeWindowFactoryImpl");
+
+ // This subclass of NativeWindowFactory handles the case of
+ // NativeWindows being passed in
+ protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
+ if (null == winObj) {
+ throw new IllegalArgumentException("winObj is null");
+ }
+ if (winObj instanceof NativeWindow) {
+ // Use the NativeWindow directly
+ return (NativeWindow) winObj;
+ }
+
+ if (null == config) {
+ throw new IllegalArgumentException("AbstractGraphicsConfiguration is null with a non NativeWindow object");
+ }
+
+ if (NWReflection.isAWTComponent(winObj)) {
+ return getAWTNativeWindow(winObj, config);
+ }
+
+ throw new IllegalArgumentException("Target window object type " +
+ winObj.getClass().getName() + " is unsupported; expected " +
+ "javax.media.nativewindow.NativeWindow or java.awt.Component");
+ }
+
+ private Constructor nativeWindowConstructor = null;
+
+ private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
+ if (nativeWindowConstructor == null) {
+ try {
+ String osType = getNativeWindowType(false);
+ String windowClassName = null;
+
+ // We break compile-time dependencies on the AWT here to
+ // make it easier to run this code on mobile devices
+
+ if (osType.equals(TYPE_WINDOWS)) {
+ windowClassName = "com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow";
+ } else if (osType.equals(TYPE_MACOSX)) {
+ windowClassName = "com.sun.nativewindow.impl.jawt.macosx.MacOSXJAWTWindow";
+ } else if (osType.equals(TYPE_X11)) {
+ // Assume Linux, Solaris, etc. Should probably test for these explicitly.
+ windowClassName = "com.sun.nativewindow.impl.jawt.x11.X11JAWTWindow";
+ } else {
+ throw new IllegalArgumentException("OS " + getNativeOSName(false) + " not yet supported");
+ }
+
+ nativeWindowConstructor = NWReflection.getConstructor(windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class });
+ } catch (Exception e) {
+ throw (IllegalArgumentException) new IllegalArgumentException().initCause(e);
+ }
+ }
+
+ try {
+ return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
+ } catch (Exception ie) {
+ throw (IllegalArgumentException) new IllegalArgumentException().initCause(ie);
+ }
+ }
+
+ // On most platforms the toolkit lock is a no-op
+ private ToolkitLock toolkitLock = new ToolkitLock() {
+ public void lock() {
+ }
+
+ public void unlock() {
+ }
+ };
+
+ public ToolkitLock getToolkitLock() {
+ return toolkitLock;
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java
new file mode 100644
index 000000000..46128b227
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NullWindow.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.nativewindow.impl;
+
+import javax.media.nativewindow.*;
+
+public class NullWindow implements NativeWindow {
+ private Exception lockedStack = null;
+ protected int width, height, scrnIndex;
+ protected long surfaceHandle, displayHandle;
+ protected AbstractGraphicsConfiguration config;
+
+
+ public NullWindow(AbstractGraphicsConfiguration cfg) {
+ invalidate();
+ config = cfg;
+ displayHandle=cfg.getScreen().getDevice().getHandle();
+ scrnIndex=cfg.getScreen().getIndex();
+ }
+
+ protected void init(Object windowObject) throws NativeWindowException {
+ }
+
+ protected void initNative() throws NativeWindowException {
+ }
+
+ public synchronized void invalidate() {
+ displayHandle=0;
+ scrnIndex=-1;
+ surfaceHandle=0;
+ }
+
+ public synchronized int lockSurface() throws NativeWindowException {
+ if (null!=lockedStack) {
+ lockedStack.printStackTrace();
+ throw new NativeWindowException("Surface already locked - "+this);
+ }
+ lockedStack = new Exception("NullWindow previously locked by "+Thread.currentThread().getName());
+ return LOCK_SUCCESS;
+ }
+
+ public synchronized void unlockSurface() {
+ if (null!=lockedStack) {
+ lockedStack = null;
+ } else {
+ throw new NativeWindowException("NullWindow not locked");
+ }
+ }
+
+ public synchronized boolean isSurfaceLocked() {
+ return null!=lockedStack;
+ }
+
+ public Exception getLockedStack() {
+ return lockedStack;
+ }
+
+ public long getDisplayHandle() {
+ return displayHandle;
+ }
+ public int getScreenIndex() {
+ return scrnIndex;
+ }
+ public long getWindowHandle() {
+ return 0;
+ }
+ public long getSurfaceHandle() {
+ return surfaceHandle;
+ }
+ public void setSurfaceHandle(long handle) {
+ surfaceHandle=handle;
+ }
+ public AbstractGraphicsConfiguration getGraphicsConfiguration() {
+ return config;
+ }
+
+ public Object getWrappedWindow() {
+ return null;
+ }
+
+ public final boolean isTerminalObject() {
+ return true;
+ }
+
+ public void setSize(int width, int height) {
+ this.width=width;
+ this.height=height;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java
new file mode 100644
index 000000000..f0f2ac8c3
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTNativeLibLoader.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl.jawt;
+
+import javax.media.nativewindow.NativeWindowFactory;
+import com.sun.nativewindow.impl.NativeLibLoaderBase;
+
+import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+public class JAWTNativeLibLoader extends NativeLibLoaderBase {
+ public static void loadAWTImpl() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ // Make sure that awt.dll is loaded before loading jawt.dll. Otherwise
+ // a Dialog with "awt.dll not found" might pop up.
+ // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4481947.
+ Toolkit.getDefaultToolkit();
+
+ // Must pre-load JAWT on all non-Mac platforms to
+ // ensure references from jogl_awt shared object
+ // will succeed since JAWT shared object isn't in
+ // default library path
+ if ( ! NativeWindowFactory.TYPE_MACOSX.equals( NativeWindowFactory.getNativeWindowType(false) ) ) {
+ loadLibrary("jawt", null, true);
+ }
+ return null;
+ }
+ });
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java
new file mode 100644
index 000000000..ae606a790
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTUtil.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.nativewindow.impl.jawt;
+
+import com.sun.nativewindow.impl.*;
+
+import javax.media.nativewindow.*;
+
+import java.awt.GraphicsEnvironment;
+
+public class JAWTUtil {
+ static {
+ JAWTNativeLibLoader.loadAWTImpl();
+ NativeLibLoaderBase.loadNativeWindow("awt");
+ }
+
+ // See whether we're running in headless mode
+ private static boolean headlessMode;
+
+ static {
+ lockedStack = null;
+ headlessMode = GraphicsEnvironment.isHeadless();
+ }
+
+ private static Exception lockedStack;
+
+ public static synchronized void lockToolkit() throws NativeWindowException {
+ if (null!=lockedStack) {
+ lockedStack.printStackTrace();
+ throw new NativeWindowException("JAWT Toolkit already locked - "+Thread.currentThread().getName());
+ }
+ lockedStack = new Exception("JAWT Toolkit already locked by: "+Thread.currentThread().getName());
+
+ if (headlessMode) {
+ // Workaround for running (to some degree) in headless
+ // environments but still supporting rendering via pbuffers
+ // For full correctness, would need to implement a Lock class
+ return;
+ }
+
+ JAWT.getJAWT().Lock();
+ }
+
+ public static synchronized void unlockToolkit() {
+ if (null!=lockedStack) {
+ lockedStack = null;
+ if (headlessMode) {
+ // Workaround for running (to some degree) in headless
+ // environments but still supporting rendering via pbuffers
+ // For full correctness, would need to implement a Lock class
+ return;
+ }
+
+ JAWT.getJAWT().Unlock();
+ }
+ }
+
+ public static boolean isToolkitLocked() {
+ return null!=lockedStack;
+ }
+
+ public static Exception getLockedStack() {
+ return lockedStack;
+ }
+}
+
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java
new file mode 100644
index 000000000..a4a529c54
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWTWindow.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.nativewindow.impl.jawt;
+
+import com.sun.nativewindow.impl.*;
+
+import java.awt.Component;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.*;
+import com.sun.nativewindow.impl.*;
+
+public abstract class JAWTWindow implements NativeWindow {
+ protected static final boolean DEBUG = Debug.debug("JAWT");
+
+ // See whether we're running in headless mode
+ private static boolean headlessMode;
+
+ static {
+ headlessMode = GraphicsEnvironment.isHeadless();
+ }
+
+ // lifetime: forever
+ protected Component component;
+ protected AbstractGraphicsConfiguration config;
+
+ // lifetime: valid after lock, forever until invalidate
+ protected long drawable;
+
+ public JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ if (config == null) {
+ throw new NativeWindowException("Error: AbstractGraphicsConfiguration is null");
+ }
+ this.config = config;
+ init((Component)comp);
+ }
+
+ protected void init(Component windowObject) throws NativeWindowException {
+ invalidate();
+ this.component = windowObject;
+ initNative();
+ }
+
+ protected abstract void initNative() throws NativeWindowException;
+
+ public synchronized void invalidate() {
+ component = null;
+ drawable= 0;
+ }
+
+ private volatile Exception lockedStack = null;
+
+ public synchronized int lockSurface() throws NativeWindowException {
+ // We have to be the owner of the JAWT ToolkitLock 'lock' to benefit from the
+ // recursive lock capabitlites. Otherwise a followup ToolkitLock would
+ // deadlock, since we already have locked JAWT with the surface lock.
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+
+ if (null!=lockedStack) {
+ lockedStack.printStackTrace();
+ throw new NativeWindowException("JAWT Surface already locked - "+Thread.currentThread().getName()+" "+this);
+ }
+ lockedStack = new Exception("JAWT Surface previously locked by "+Thread.currentThread().getName());
+
+ return LOCK_SUCCESS;
+ }
+
+ public synchronized void unlockSurface() {
+ if (null!=lockedStack) {
+ lockedStack = null;
+ } else {
+ throw new NativeWindowException("JAWT Surface not locked");
+ }
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+
+ public synchronized boolean isSurfaceLocked() {
+ return null!=lockedStack;
+ }
+
+ public Exception getLockedStack() {
+ return lockedStack;
+ }
+
+ public long getDisplayHandle() {
+ return config.getScreen().getDevice().getHandle();
+ }
+ public int getScreenIndex() {
+ return config.getScreen().getIndex();
+ }
+ public long getWindowHandle() {
+ return drawable;
+ }
+ public long getSurfaceHandle() {
+ return drawable;
+ }
+ public AbstractGraphicsConfiguration getGraphicsConfiguration() {
+ return config;
+ }
+
+ public Object getWrappedWindow() {
+ return component;
+ }
+
+ public void setSize(int width, int height) {
+ component.setSize(width, height);
+ }
+
+ public int getWidth() {
+ return component.getWidth();
+ }
+
+ public int getHeight() {
+ return component.getHeight();
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+
+ sb.append("JAWT-Window["+
+ "windowHandle 0x"+Long.toHexString(getWindowHandle())+
+ ", surfaceHandle 0x"+Long.toHexString(getSurfaceHandle()));
+ if(null!=component) {
+ sb.append(", pos "+component.getX()+"/"+component.getY()+", size "+getWidth()+"x"+getHeight()+
+ ", visible "+component.isVisible());
+ } else {
+ sb.append(", component NULL");
+ }
+ sb.append(", locked "+isSurfaceLocked()+
+ ",\n\tconfig "+config+
+ ",\n\twrappedWindow "+getWrappedWindow()+"]");
+
+ return sb.toString();
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java
new file mode 100644
index 000000000..cc6af7ea4
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/JAWT_PlatformInfo.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl.jawt;
+
+import com.sun.nativewindow.impl.*;
+
+/** Marker class for all window system-specific JAWT data structures. */
+
+public interface JAWT_PlatformInfo {
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java
new file mode 100644
index 000000000..2d85f1d4d
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/macosx/MacOSXJAWTWindow.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl.jawt.macosx;
+
+import com.sun.nativewindow.impl.jawt.*;
+import com.sun.nativewindow.impl.*;
+
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+
+import javax.media.nativewindow.*;
+import java.security.*;
+
+public class MacOSXJAWTWindow extends JAWTWindow {
+
+ public MacOSXJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ super(comp, config);
+ }
+
+ protected void initNative() throws NativeWindowException {
+ }
+
+ public int lockSurface() throws NativeWindowException {
+ int ret = super.lockSurface();
+ if(NativeWindow.LOCK_SUCCESS != ret) {
+ return ret;
+ }
+ ds = JAWT.getJAWT().GetDrawingSurface(component);
+ if (ds == null) {
+ // Widget not yet realized
+ super.unlockSurface();
+ return NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+ int res = ds.Lock();
+ if ((res & JAWTFactory.JAWT_LOCK_ERROR) != 0) {
+ super.unlockSurface();
+ throw new NativeWindowException("Unable to lock surface");
+ }
+ // See whether the surface changed and if so destroy the old
+ // OpenGL context so it will be recreated (NOTE: removeNotify
+ // should handle this case, but it may be possible that race
+ // conditions can cause this code to be triggered -- should test
+ // more)
+ if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
+ ret = NativeWindow.LOCK_SURFACE_CHANGED;
+ }
+ if (firstLock) {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ dsi = ds.GetDrawingSurfaceInfo();
+ return null;
+ }
+ });
+ } else {
+ dsi = ds.GetDrawingSurfaceInfo();
+ }
+ if (dsi == null) {
+ // Widget not yet realized
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ super.unlockSurface();
+ return NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+ firstLock = false;
+ macosxdsi = (JAWT_MacOSXDrawingSurfaceInfo) dsi.platformInfo();
+ if (macosxdsi == null) {
+ // Widget not yet realized
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ super.unlockSurface();
+ return NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+ drawable = macosxdsi.cocoaViewRef();
+
+ if (drawable == 0) {
+ // Widget not yet realized
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ macosxdsi = null;
+ super.unlockSurface();
+ return NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+ return ret;
+ }
+
+ public void unlockSurface() throws NativeWindowException {
+ if(!isSurfaceLocked()) {
+ throw new RuntimeException("JAWTWindow not locked");
+ }
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ macosxdsi = null;
+ super.unlockSurface();
+ }
+
+ // Variables for lockSurface/unlockSurface
+ private JAWT_DrawingSurface ds;
+ private JAWT_DrawingSurfaceInfo dsi;
+ private JAWT_MacOSXDrawingSurfaceInfo macosxdsi;
+
+ // Workaround for instance of 4796548
+ private boolean firstLock = true;
+
+}
+
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java
new file mode 100644
index 000000000..591213038
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/windows/WindowsJAWTWindow.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl.jawt.windows;
+
+import com.sun.nativewindow.impl.*;
+import com.sun.nativewindow.impl.jawt.*;
+
+import javax.media.nativewindow.*;
+
+public class WindowsJAWTWindow extends JAWTWindow {
+
+ public static final boolean PROFILING = false; // FIXME
+ public static final int PROFILING_TICKS = 600; // FIXME
+
+ public WindowsJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ super(comp, config);
+ }
+
+ protected void initNative() throws NativeWindowException {
+ }
+
+ public int lockSurface() throws NativeWindowException {
+ int ret = super.lockSurface();
+ if(LOCK_SUCCESS != ret) {
+ return ret;
+ }
+
+ long startTime;
+ if (PROFILING) {
+ startTime = System.currentTimeMillis();
+ }
+ ds = JAWT.getJAWT().GetDrawingSurface(component);
+ if (ds == null) {
+ // Widget not yet realized
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ int res = ds.Lock();
+ if ((res & JAWTFactory.JAWT_LOCK_ERROR) != 0) {
+ super.unlockSurface();
+ throw new NativeWindowException("Unable to lock surface");
+ }
+ // See whether the surface changed and if so destroy the old
+ // OpenGL context so it will be recreated (NOTE: removeNotify
+ // should handle this case, but it may be possible that race
+ // conditions can cause this code to be triggered -- should test
+ // more)
+ if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
+ ret = LOCK_SURFACE_CHANGED;
+ }
+ dsi = ds.GetDrawingSurfaceInfo();
+ if (dsi == null) {
+ // Widget not yet realized
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ win32dsi = (JAWT_Win32DrawingSurfaceInfo) dsi.platformInfo();
+ if (win32dsi == null) {
+ // Widget not yet realized
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ drawable = win32dsi.hdc();
+ if (drawable == 0) {
+ // Widget not yet realized
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ win32dsi = null;
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ if (PROFILING) {
+ long endTime = System.currentTimeMillis();
+ profilingLockSurfaceTime += (endTime - startTime);
+ if (++profilingLockSurfaceTicks == PROFILING_TICKS) {
+ System.err.println("LockSurface calls: " + profilingLockSurfaceTime + " ms / " + PROFILING_TICKS + " calls (" +
+ ((float) profilingLockSurfaceTime / (float) PROFILING_TICKS) + " ms/call)");
+ profilingLockSurfaceTime = 0;
+ profilingLockSurfaceTicks = 0;
+ }
+ }
+ return ret;
+ }
+
+ public void unlockSurface() {
+ if(!isSurfaceLocked()) {
+ throw new RuntimeException("JAWTWindow not locked");
+ }
+ long startTime = 0;
+ if (PROFILING) {
+ startTime = System.currentTimeMillis();
+ }
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ win32dsi = null;
+ super.unlockSurface();
+ if (PROFILING) {
+ long endTime = System.currentTimeMillis();
+ profilingUnlockSurfaceTime += (endTime - startTime);
+ if (++profilingUnlockSurfaceTicks == PROFILING_TICKS) {
+ System.err.println("UnlockSurface calls: " + profilingUnlockSurfaceTime + " ms / " + PROFILING_TICKS + " calls (" +
+ ((float) profilingUnlockSurfaceTime / (float) PROFILING_TICKS) + " ms/call)");
+ profilingUnlockSurfaceTime = 0;
+ profilingUnlockSurfaceTicks = 0;
+ }
+ }
+ }
+
+ // Variables for lockSurface/unlockSurface
+ private JAWT_DrawingSurface ds;
+ private JAWT_DrawingSurfaceInfo dsi;
+ private JAWT_Win32DrawingSurfaceInfo win32dsi;
+ private long profilingLockSurfaceTime = 0;
+ private int profilingLockSurfaceTicks = 0;
+ private long profilingUnlockSurfaceTime = 0;
+ private int profilingUnlockSurfaceTicks = 0;
+
+}
+
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java
new file mode 100644
index 000000000..75133488f
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11JAWTWindow.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.nativewindow.impl.jawt.x11;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+
+import com.sun.nativewindow.impl.x11.*;
+import com.sun.nativewindow.impl.jawt.*;
+import com.sun.nativewindow.impl.*;
+
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+
+public class X11JAWTWindow extends JAWTWindow {
+
+ public X11JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+ super(comp, config);
+ }
+
+ protected void initNative() throws NativeWindowException {
+ }
+
+ public synchronized int lockSurface() throws NativeWindowException {
+ int ret = super.lockSurface();
+ if(LOCK_SUCCESS != ret) {
+ return ret;
+ }
+ ds = JAWT.getJAWT().GetDrawingSurface(component);
+ if (ds == null) {
+ // Widget not yet realized
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ int res = ds.Lock();
+ if ((res & JAWTFactory.JAWT_LOCK_ERROR) != 0) {
+ super.unlockSurface();
+ throw new NativeWindowException("Unable to lock surface");
+ }
+ // See whether the surface changed and if so destroy the old
+ // OpenGL context so it will be recreated (NOTE: removeNotify
+ // should handle this case, but it may be possible that race
+ // conditions can cause this code to be triggered -- should test
+ // more)
+ if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
+ ret = LOCK_SURFACE_CHANGED;
+ }
+ dsi = ds.GetDrawingSurfaceInfo();
+ if (dsi == null) {
+ // Widget not yet realized
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ x11dsi = (JAWT_X11DrawingSurfaceInfo) dsi.platformInfo();
+ if (x11dsi == null) {
+ // Widget not yet realized
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ drawable = x11dsi.drawable();
+ if (drawable == 0) {
+ // Widget not yet realized
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ x11dsi = null;
+ drawable = 0;
+ super.unlockSurface();
+ return LOCK_SURFACE_NOT_READY;
+ }
+ return ret;
+ }
+
+ public synchronized void unlockSurface() {
+ if(!isSurfaceLocked()) {
+ throw new RuntimeException("JAWTWindow not locked");
+ }
+ ds.FreeDrawingSurfaceInfo(dsi);
+ ds.Unlock();
+ JAWT.getJAWT().FreeDrawingSurface(ds);
+ ds = null;
+ dsi = null;
+ x11dsi = null;
+ super.unlockSurface();
+ }
+
+ // Variables for lockSurface/unlockSurface
+ private JAWT_DrawingSurface ds;
+ private JAWT_DrawingSurfaceInfo dsi;
+ private JAWT_X11DrawingSurfaceInfo x11dsi;
+
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java
new file mode 100644
index 000000000..ef1f82cee
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/jawt/x11/X11SunJDKReflection.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.nativewindow.impl.jawt.x11;
+
+import com.sun.nativewindow.impl.x11.*;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.lang.reflect.*;
+import java.security.*;
+
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.awt.AWTGraphicsConfiguration;
+
+/** This class encapsulates the reflection routines necessary to peek
+ inside a few data structures in the AWT implementation on X11 for
+ the purposes of correctly enumerating the available visuals. */
+
+public class X11SunJDKReflection {
+ private static Class x11GraphicsDeviceClass;
+ private static Method x11GraphicsDeviceGetScreenMethod;
+ private static Method x11GraphicsDeviceGetDisplayMethod;
+ private static Class x11GraphicsConfigClass;
+ private static Method x11GraphicsConfigGetVisualMethod;
+ private static boolean initted;
+
+ static {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+ x11GraphicsDeviceClass = Class.forName("sun.awt.X11GraphicsDevice");
+ x11GraphicsDeviceGetScreenMethod = x11GraphicsDeviceClass.getDeclaredMethod("getScreen", new Class[] {});
+ x11GraphicsDeviceGetScreenMethod.setAccessible(true);
+ x11GraphicsDeviceGetDisplayMethod = x11GraphicsDeviceClass.getDeclaredMethod("getDisplay", new Class[] {});
+ x11GraphicsDeviceGetDisplayMethod.setAccessible(true);
+
+ x11GraphicsConfigClass = Class.forName("sun.awt.X11GraphicsConfig");
+ x11GraphicsConfigGetVisualMethod = x11GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
+ x11GraphicsConfigGetVisualMethod.setAccessible(true);
+ initted = true;
+ } catch (Exception e) {
+ // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
+ }
+ return null;
+ }
+ });
+ }
+
+ public static int graphicsDeviceGetScreen(GraphicsDevice device) {
+ if (!initted) {
+ return 0;
+ }
+
+ try {
+ return ((Integer) x11GraphicsDeviceGetScreenMethod.invoke(device, new Object[] {})).intValue();
+ } catch (Exception e) {
+ return 0;
+ }
+ }
+
+ public static long graphicsDeviceGetDisplay(GraphicsDevice device) {
+ if (!initted) {
+ return 0;
+ }
+
+ try {
+ return ((Long) x11GraphicsDeviceGetDisplayMethod.invoke(device, new Object[] {})).longValue();
+ } catch (Exception e) {
+ return 0;
+ }
+ }
+
+ public static int graphicsConfigurationGetVisualID(AbstractGraphicsConfiguration config) {
+ try {
+ if (config instanceof AWTGraphicsConfiguration) {
+ return graphicsConfigurationGetVisualID(((AWTGraphicsConfiguration) config).getGraphicsConfiguration());
+ }
+ return 0;
+ } catch (Exception e) {
+ return 0;
+ }
+ }
+
+ public static int graphicsConfigurationGetVisualID(GraphicsConfiguration config) {
+ if (!initted) {
+ return 0;
+ }
+
+ try {
+ return ((Integer) x11GraphicsConfigGetVisualMethod.invoke(config, new Object[] {})).intValue();
+ } catch (Exception e) {
+ return 0;
+ }
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java
new file mode 100644
index 000000000..890f017ab
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.nativewindow.impl.x11;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+import com.sun.nativewindow.impl.x11.XVisualInfo;
+import com.sun.nativewindow.impl.x11.X11Lib;
+
+public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactory {
+ public AbstractGraphicsConfiguration
+ chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen screen)
+ throws IllegalArgumentException, NativeWindowException {
+
+ if(null==screen || !(screen instanceof X11GraphicsScreen)) {
+ throw new NativeWindowException("Only valid X11GraphicsScreen are allowed");
+ }
+ return new X11GraphicsConfiguration((X11GraphicsScreen)screen, capabilities, capabilities, getXVisualInfo(screen, capabilities));
+ }
+
+ public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, long visualID)
+ {
+ XVisualInfo xvi_temp = XVisualInfo.create();
+ xvi_temp.visualid(visualID);
+ xvi_temp.screen(screen.getIndex());
+ int num[] = { -1 };
+
+ XVisualInfo[] xvis = X11Lib.XGetVisualInfoCopied(screen.getDevice().getHandle(), X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
+
+ if(xvis==null || num[0]<1) {
+ return null;
+ }
+
+ return XVisualInfo.create(xvis[0]);
+ }
+
+ public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, Capabilities capabilities)
+ {
+ XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
+ if(null!=xv) return xv;
+ return getXVisualInfoImpl(screen, capabilities, 5 /* DirectColor */);
+ }
+
+ private static XVisualInfo getXVisualInfoImpl(AbstractGraphicsScreen screen, Capabilities capabilities, int c_class)
+ {
+ XVisualInfo ret = null;
+ int[] num = { -1 };
+
+ XVisualInfo vinfo_template = XVisualInfo.create();
+ vinfo_template.screen(screen.getIndex());
+ vinfo_template.c_class(c_class);
+
+ XVisualInfo[] vinfos = X11Lib.XGetVisualInfoCopied(screen.getDevice().getHandle(), X11Lib.VisualScreenMask, vinfo_template, num, 0);
+ XVisualInfo best=null;
+ int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
+ for (int i = 0; vinfos!=null && i < num[0]; i++) {
+ if ( best == null ||
+ best.depth() < vinfos[i].depth() )
+ {
+ best = vinfos[i];
+ if(rdepth <= best.depth())
+ break;
+ }
+ }
+ if ( null!=best && ( rdepth <= best.depth() || 24 == best.depth()) ) {
+ ret = XVisualInfo.create(best);
+ }
+ best = null;
+
+ return ret;
+ }
+}
+
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11NativeWindowFactory.java b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11NativeWindowFactory.java
new file mode 100644
index 000000000..1c67d6184
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11NativeWindowFactory.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.nativewindow.impl.x11;
+
+import javax.media.nativewindow.*;
+import com.sun.nativewindow.impl.*;
+
+public class X11NativeWindowFactory extends NativeWindowFactoryImpl {
+ // On X11 platforms we need to do some locking; this basic
+ // implementation should suffice for some simple window toolkits
+ private ToolkitLock toolkitLock = new ToolkitLock() {
+ private Thread owner;
+ private int recursionCount;
+
+ public synchronized void lock() {
+ Thread cur = Thread.currentThread();
+ if (owner == cur) {
+ ++recursionCount;
+ return;
+ }
+ while (owner != null) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ owner = cur;
+ }
+
+ public synchronized void unlock() {
+ if (owner != Thread.currentThread()) {
+ throw new RuntimeException("Not owner");
+ }
+ if (recursionCount > 0) {
+ --recursionCount;
+ return;
+ }
+ owner = null;
+ notifyAll();
+ }
+ };
+
+ public ToolkitLock getToolkitLock() {
+ return toolkitLock;
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java
new file mode 100644
index 000000000..731bd3caf
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/X11Util.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.nativewindow.impl.x11;
+
+import java.util.HashMap;
+
+import javax.media.nativewindow.*;
+
+import com.sun.nativewindow.impl.*;
+
+/**
+ * Contains a thread safe X11 utility to retrieve tread local display connection,<br>
+ * as well as the static global discplay connection.<br>
+ *
+ * The TLS variant is thread safe per se, but has the memory leak risk on applications
+ * heavily utilizing runnables on a new thread.<br>
+ *
+ * The static variant is more nice to resources, but involves the default toolkit
+ * locking mechanism, which invocation you have to provide as shown below.<br>
+ * <PRE>
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ long displayHandle = X11Util.getStaticDefaultDisplay();
+ ...
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+ * </PRE><br>
+ *
+ * We will use the TLS variant, where a long term display connection is being used,
+ * ie in JOGL's <code>X11AWTGLXGraphicsConfigurationFactory</code>,
+ * on all other situations where we just query some X11 attributes,
+ * the locked static variant shall be used instead.<br>
+ */
+public class X11Util {
+ private static final boolean DEBUG = Debug.debug("X11Util");
+
+ static {
+ NativeLibLoaderBase.loadNativeWindow("x11");
+ }
+
+ private X11Util() {}
+
+ private static ThreadLocal currentDisplayAssociation = new ThreadLocal();
+
+ private static long staticDefaultDisplay=0;
+ private static boolean staticDefaultDisplayXineramaEnable=false;
+
+ private static long fetchStaticDefaultDisplay() {
+ if(0==staticDefaultDisplay) {
+ synchronized (X11Util.class) {
+ if(0==staticDefaultDisplay) {
+ staticDefaultDisplay = X11Lib.XOpenDisplay(null);
+ if(0==staticDefaultDisplay) {
+ throw new NativeWindowException("Unable to create a static default display connection");
+ }
+ staticDefaultDisplayXineramaEnable = X11Lib.XineramaEnabled(staticDefaultDisplay);
+ }
+ }
+ }
+ return staticDefaultDisplay;
+ }
+
+ /** Returns the global static default display connection, read the toolkit lock/unlock
+ * requirements {@link X11Util above} for synchronization. */
+ public static long getStaticDefaultDisplay() {
+ return fetchStaticDefaultDisplay();
+ }
+
+ /** Returns the global static default display connection, read the toolkit lock/unlock
+ * requirements {@link X11Util above} for synchronization. */
+ public static boolean isXineramaEnabledOnStaticDefaultDisplay() {
+ fetchStaticDefaultDisplay();
+ return staticDefaultDisplayXineramaEnable;
+ }
+
+
+ /** Returns this thread current default display. */
+ public static long getThreadLocalDefaultDisplay() {
+ Long dpyL = (Long) currentDisplayAssociation.get();
+ if(null==dpyL) {
+ long dpy = X11Lib.XOpenDisplay(null);
+ if(0==dpy) {
+ throw new NativeWindowException("Unable to create a default display connection on Thread "+Thread.currentThread().getName());
+ }
+ dpyL = new Long(dpy);
+ currentDisplayAssociation.set( dpyL );
+ if(DEBUG) {
+ Exception e = new Exception("Created new TLS display connection 0x"+Long.toHexString(dpy)+" for thread "+Thread.currentThread().getName());
+ e.printStackTrace();
+ }
+ }
+ return dpyL.longValue();
+ }
+}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java
new file mode 100644
index 000000000..53b82ce08
--- /dev/null
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/x11/awt/X11AWTNativeWindowFactory.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package com.sun.nativewindow.impl.x11.awt;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.*;
+
+import com.sun.nativewindow.impl.*;
+import com.sun.nativewindow.impl.jawt.*;
+import com.sun.nativewindow.impl.jawt.x11.*;
+import com.sun.nativewindow.impl.x11.*;
+
+public class X11AWTNativeWindowFactory extends X11NativeWindowFactory {
+
+ // When running the AWT on X11 platforms, we use the AWT native
+ // interface (JAWT) to lock and unlock the toolkit
+ private ToolkitLock toolkitLock = new ToolkitLock() {
+ private Thread owner;
+ private int recursionCount;
+
+ public synchronized void lock() {
+ Thread cur = Thread.currentThread();
+ if (owner == cur) {
+ ++recursionCount;
+ return;
+ }
+ while (owner != null) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ owner = cur;
+ JAWTUtil.lockToolkit();
+ }
+
+ public synchronized void unlock() {
+ if (owner != Thread.currentThread()) {
+ throw new RuntimeException("Not owner");
+ }
+ if (recursionCount > 0) {
+ --recursionCount;
+ return;
+ }
+ owner = null;
+ JAWTUtil.unlockToolkit();
+ notifyAll();
+ }
+ };
+
+ public ToolkitLock getToolkitLock() {
+ return toolkitLock;
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java
new file mode 100644
index 000000000..e53f75251
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsConfiguration.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** A marker interface describing a graphics configuration, visual, or
+ pixel format in a toolkit-independent manner. */
+
+public interface AbstractGraphicsConfiguration extends Cloneable {
+ /**
+ * Return the screen this graphics configuration is valid for
+ */
+ public AbstractGraphicsScreen getScreen();
+
+ /**
+ * Return the capabilities reflecting this graphics configuration,
+ * which may differ from the capabilites used to choose this configuration.
+ *
+ * @return A copy of the Capabilities to avoid mutation by the user.
+ */
+ public Capabilities getChosenCapabilities();
+
+ /**
+ * Return the capabilities used to choose this graphics configuration.
+ *
+ * These may be used to reconfigure the NativeWindow in case
+ * the device changes in a multi screen environment.
+ *
+ * @return A copy of the Capabilities to avoid mutation by the user.
+ */
+ public Capabilities getRequestedCapabilities();
+
+ /**
+ * In case this instance already reflects a native configuration,
+ * return this one.
+ * Otherwise return the encapsuled native configuration,
+ * as it shall be included e.g. in the AWT case.
+ */
+ public AbstractGraphicsConfiguration getNativeGraphicsConfiguration();
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
new file mode 100644
index 000000000..4240ec81e
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** A interface describing a graphics device in a
+ toolkit-independent manner.
+ */
+
+public interface AbstractGraphicsDevice extends Cloneable {
+ /**
+ * Returns the type of the underlying subsystem, ie
+ * NativeWindowFactory.TYPE_KD, NativeWindowFactory.TYPE_X11, ..
+ */
+ public String getType();
+
+ /**
+ * Returns the native handle of the underlying native device,
+ * if such thing exist.
+ */
+ public long getHandle();
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java
new file mode 100644
index 000000000..eb2cc9120
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsScreen.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** A interface describing a graphics screen in a
+ toolkit-independent manner.
+ */
+
+public interface AbstractGraphicsScreen extends Cloneable {
+ /**
+ * Return the device this graphics configuration is valid for
+ */
+ public AbstractGraphicsDevice getDevice();
+
+ /** Returns the screen index this graphics screen is valid for
+ */
+ public int getIndex();
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
new file mode 100644
index 000000000..6c4c93003
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** Specifies a set of capabilities that a window's rendering context
+ must support, such as color depth per channel. It currently
+ contains the minimal number of routines which allow configuration
+ on all supported window systems. */
+
+public class Capabilities implements Cloneable {
+ private int redBits = 8;
+ private int greenBits = 8;
+ private int blueBits = 8;
+ private int alphaBits = 0;
+
+ // Support for transparent windows containing OpenGL content
+ private boolean backgroundOpaque = true;
+ private int transparentValueRed = -1;
+ private int transparentValueGreen = -1;
+ private int transparentValueBlue = -1;
+ private int transparentValueAlpha = -1;
+
+ /** Creates a Capabilities object. All attributes are in a default
+ state.
+ */
+ public Capabilities() {}
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new NativeWindowException(e);
+ }
+ }
+
+ public boolean equals(Object obj) {
+ if(!(obj instanceof Capabilities)) {
+ return false;
+ }
+ Capabilities other = (Capabilities)obj;
+ boolean res = other.getRedBits()==redBits &&
+ other.getGreenBits()==greenBits &&
+ other.getBlueBits()==blueBits &&
+ other.getAlphaBits()==alphaBits &&
+ other.isBackgroundOpaque()==backgroundOpaque;
+ if(!backgroundOpaque) {
+ res = res && other.getTransparentRedValue()==transparentValueRed &&
+ other.getTransparentGreenValue()==transparentValueGreen &&
+ other.getTransparentBlueValue()==transparentValueBlue &&
+ other.getTransparentAlphaValue()==transparentValueAlpha;
+ }
+
+ return res;
+ }
+
+ /** Returns the number of bits requested for the color buffer's red
+ component. On some systems only the color depth, which is the
+ sum of the red, green, and blue bits, is considered. */
+ public int getRedBits() {
+ return redBits;
+ }
+
+ /** Sets the number of bits requested for the color buffer's red
+ component. On some systems only the color depth, which is the
+ sum of the red, green, and blue bits, is considered. */
+ public void setRedBits(int redBits) {
+ this.redBits = redBits;
+ }
+
+ /** Returns the number of bits requested for the color buffer's
+ green component. On some systems only the color depth, which is
+ the sum of the red, green, and blue bits, is considered. */
+ public int getGreenBits() {
+ return greenBits;
+ }
+
+ /** Sets the number of bits requested for the color buffer's green
+ component. On some systems only the color depth, which is the
+ sum of the red, green, and blue bits, is considered. */
+ public void setGreenBits(int greenBits) {
+ this.greenBits = greenBits;
+ }
+
+ /** Returns the number of bits requested for the color buffer's blue
+ component. On some systems only the color depth, which is the
+ sum of the red, green, and blue bits, is considered. */
+ public int getBlueBits() {
+ return blueBits;
+ }
+
+ /** Sets the number of bits requested for the color buffer's blue
+ component. On some systems only the color depth, which is the
+ sum of the red, green, and blue bits, is considered. */
+ public void setBlueBits(int blueBits) {
+ this.blueBits = blueBits;
+ }
+
+ /** Returns the number of bits requested for the color buffer's
+ alpha component. On some systems only the color depth, which is
+ the sum of the red, green, and blue bits, is considered. */
+ public int getAlphaBits() {
+ return alphaBits;
+ }
+
+ /** Sets the number of bits requested for the color buffer's alpha
+ component. On some systems only the color depth, which is the
+ sum of the red, green, and blue bits, is considered. */
+ public void setAlphaBits(int alphaBits) {
+ this.alphaBits = alphaBits;
+ }
+
+ /** For on-screen OpenGL contexts on some platforms, sets whether
+ the background of the context should be considered opaque. On
+ supported platforms, setting this to false, in conjunction with
+ the transparency values, may allow
+ hardware-accelerated OpenGL content inside of windows of
+ arbitrary shape. To achieve this effect it is necessary to use
+ an OpenGL clear color with an alpha less than 1.0. The default
+ value for this flag is <code>true</code>; setting it to false
+ may incur a certain performance penalty, so it is not
+ recommended to arbitrarily set it to false.<br>
+ If not set already, the transparency values for red, green, blue and alpha
+ are set to their default value, which is half of the value range
+ of the framebuffer's corresponding component,
+ ie <code> redValue = ( 1 << ( redBits - 1 ) ) -1 </code>.
+ */
+ public void setBackgroundOpaque(boolean opaque) {
+ backgroundOpaque = opaque;
+ if(!opaque) {
+ if(transparentValueRed<0)
+ transparentValueRed = ( 1 << ( getRedBits() - 1 ) ) - 1 ;
+ if(transparentValueGreen<0)
+ transparentValueGreen = ( 1 << ( getGreenBits() - 1 ) ) - 1 ;
+ if(transparentValueBlue<0)
+ transparentValueBlue = ( 1 << ( getBlueBits() - 1 ) ) - 1 ;
+ if(transparentValueAlpha<0)
+ transparentValueAlpha = ( 1 << ( getAlphaBits() - 1 ) ) - 1 ;
+ }
+ }
+
+ /** Indicates whether the background of this OpenGL context should
+ be considered opaque. Defaults to true.
+
+ @see #setBackgroundOpaque
+ */
+ public boolean isBackgroundOpaque() {
+ return backgroundOpaque;
+ }
+
+ /** Gets the transparent red value for the frame buffer configuration.
+ * This value is undefined if {@link #isBackgroundOpaque()} equals true.
+ * @see #setTransparentRedValue
+ */
+ public int getTransparentRedValue() { return transparentValueRed; }
+
+ /** Gets the transparent green value for the frame buffer configuration.
+ * This value is undefined if {@link #isBackgroundOpaque()} equals true.
+ * @see #setTransparentGreenValue
+ */
+ public int getTransparentGreenValue() { return transparentValueGreen; }
+
+ /** Gets the transparent blue value for the frame buffer configuration.
+ * This value is undefined if {@link #isBackgroundOpaque()} equals true.
+ * @see #setTransparentBlueValue
+ */
+ public int getTransparentBlueValue() { return transparentValueBlue; }
+
+ /** Gets the transparent alpha value for the frame buffer configuration.
+ * This value is undefined if {@link #isBackgroundOpaque()} equals true.
+ * @see #setTransparentAlphaValue
+ */
+ public int getTransparentAlphaValue() { return transparentValueAlpha; }
+
+ /** Sets the transparent red value for the frame buffer configuration,
+ ranging from 0 to the maximum frame buffer value for red.
+ This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
+ It defaults to half of the frambuffer value for red. <br>
+ A value of -1 is interpreted as any value. */
+ public void setTransparentRedValue(int transValueRed) { transparentValueRed=transValueRed; }
+
+ /** Sets the transparent green value for the frame buffer configuration,
+ ranging from 0 to the maximum frame buffer value for green.
+ This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
+ It defaults to half of the frambuffer value for green.<br>
+ A value of -1 is interpreted as any value. */
+ public void setTransparentGreenValue(int transValueGreen) { transparentValueGreen=transValueGreen; }
+
+ /** Sets the transparent blue value for the frame buffer configuration,
+ ranging from 0 to the maximum frame buffer value for blue.
+ This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
+ It defaults to half of the frambuffer value for blue.<br>
+ A value of -1 is interpreted as any value. */
+ public void setTransparentBlueValue(int transValueBlue) { transparentValueBlue=transValueBlue; }
+
+ /** Sets the transparent alpha value for the frame buffer configuration,
+ ranging from 0 to the maximum frame buffer value for alpha.
+ This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
+ It defaults to half of the frambuffer value for alpha.<br>
+ A value of -1 is interpreted as any value. */
+ public void setTransparentAlphaValue(int transValueAlpha) { transparentValueAlpha=transValueAlpha; }
+
+
+ /** Returns a textual representation of this Capabilities
+ object. */
+ public String toString() {
+ StringBuffer msg = new StringBuffer();
+ msg.append("Capabilities[");
+ msg.append("Red: " + redBits +
+ ", Green: " + greenBits +
+ ", Blue: " + blueBits +
+ ", Alpha: " + alphaBits +
+ ", Opaque: " + backgroundOpaque);
+ if(!backgroundOpaque) {
+ msg.append(", Transparent RGBA: [0x"+ Integer.toHexString(transparentValueRed)+
+ " 0x"+ Integer.toHexString(transparentValueGreen)+
+ " 0x"+ Integer.toHexString(transparentValueBlue)+
+ " 0x"+ Integer.toHexString(transparentValueAlpha)+"] ");
+ }
+ msg.append("]");
+ return msg.toString();
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
new file mode 100644
index 000000000..d61ebd4ef
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/CapabilitiesChooser.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** Provides a mechanism by which applications can customize the
+ window type selection for a given {@link Capabilities}.
+ Developers can implement this interface and pass an instance into
+ the method {@link GraphicsConfigurationFactory#chooseGraphicsConfiguration}; the chooser
+ will be called at window creation time. */
+
+public interface CapabilitiesChooser {
+ /** Chooses the index (0..available.length - 1) of the {@link
+ Capabilities} most closely matching the desired one from the
+ list of all supported. Some of the entries in the
+ <code>available</code> array may be null; the chooser must
+ ignore these. The <em>windowSystemRecommendedChoice</em>
+ parameter may be provided to the chooser by the underlying
+ window system; if this index is valid, it is recommended, but
+ not necessarily required, that the chooser select that entry.
+
+ <P> <em>Note:</em> this method is called automatically by the
+ {@link GraphicsConfigurationFactory#chooseGraphicsConfiguration} method
+ when an instance of this class is passed in to it.
+ It should generally not be
+ invoked by users directly, unless it is desired to delegate the
+ choice to some other CapabilitiesChooser object.
+ */
+ public int chooseCapabilities(Capabilities desired,
+ Capabilities[] available,
+ int windowSystemRecommendedChoice);
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
new file mode 100644
index 000000000..cead0a4a8
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** <P> The default implementation of the {@link
+ CapabilitiesChooser} interface, which provides consistent visual
+ selection behavior across platforms. The precise algorithm is
+ deliberately left loosely specified. Some properties are: </P>
+
+ <LI> Attempts to match as closely as possible the given
+ Capabilities, but will select one with fewer capabilities (i.e.,
+ lower color depth) if necessary.
+
+ <LI> If there is no exact match, prefers a more-capable visual to
+ a less-capable one.
+
+ <LI> If there is more than one exact match, chooses an arbitrary
+ one.
+
+ <LI> If a valid windowSystemRecommendedChoice parameter is
+ supplied, chooses that instead of using the cross-platform code.
+
+ </UL>
+*/
+
+public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
+ private static final boolean DEBUG = false; // FIXME: Debug.debug("DefaultCapabilitiesChooser");
+
+ public int chooseCapabilities(Capabilities desired,
+ Capabilities[] available,
+ int windowSystemRecommendedChoice) {
+ if (DEBUG) {
+ System.err.println("Desired: " + desired);
+ for (int i = 0; i < available.length; i++) {
+ System.err.println("Available " + i + ": " + available[i]);
+ }
+ System.err.println("Window system's recommended choice: " + windowSystemRecommendedChoice);
+ }
+
+ if (windowSystemRecommendedChoice >= 0 &&
+ windowSystemRecommendedChoice < available.length &&
+ available[windowSystemRecommendedChoice] != null) {
+ if (DEBUG) {
+ System.err.println("Choosing window system's recommended choice of " + windowSystemRecommendedChoice);
+ System.err.println(available[windowSystemRecommendedChoice]);
+ }
+ return windowSystemRecommendedChoice;
+ }
+
+ // Create score array
+ int[] scores = new int[available.length];
+ int NO_SCORE = -9999999;
+ int COLOR_MISMATCH_PENALTY_SCALE = 36;
+ for (int i = 0; i < scores.length; i++) {
+ scores[i] = NO_SCORE;
+ }
+ // Compute score for each
+ for (int i = 0; i < scores.length; i++) {
+ Capabilities cur = available[i];
+ if (cur == null) {
+ continue;
+ }
+ int score = 0;
+ // Compute difference in color depth
+ score += (COLOR_MISMATCH_PENALTY_SCALE *
+ ((cur.getRedBits() + cur.getGreenBits() + cur.getBlueBits() + cur.getAlphaBits()) -
+ (desired.getRedBits() + desired.getGreenBits() + desired.getBlueBits() + desired.getAlphaBits())));
+ scores[i] = score;
+ }
+
+ if (DEBUG) {
+ System.err.print("Scores: [");
+ for (int i = 0; i < available.length; i++) {
+ if (i > 0) {
+ System.err.print(",");
+ }
+ System.err.print(" " + scores[i]);
+ }
+ System.err.println(" ]");
+ }
+
+ // Ready to select. Choose score closest to 0.
+ int scoreClosestToZero = NO_SCORE;
+ int chosenIndex = -1;
+ for (int i = 0; i < scores.length; i++) {
+ int score = scores[i];
+ if (score == NO_SCORE) {
+ continue;
+ }
+ // Don't substitute a positive score for a smaller negative score
+ if ((scoreClosestToZero == NO_SCORE) ||
+ (Math.abs(score) < Math.abs(scoreClosestToZero) &&
+ ((sign(scoreClosestToZero) < 0) || (sign(score) > 0)))) {
+ scoreClosestToZero = score;
+ chosenIndex = i;
+ }
+ }
+ if (chosenIndex < 0) {
+ throw new NativeWindowException("Unable to select one of the provided Capabilities");
+ }
+ if (DEBUG) {
+ System.err.println("Chosen index: " + chosenIndex);
+ System.err.println("Chosen capabilities:");
+ System.err.println(available[chosenIndex]);
+ }
+
+ return chosenIndex;
+ }
+
+ private static int sign(int score) {
+ if (score < 0) {
+ return -1;
+ }
+ return 1;
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
new file mode 100644
index 000000000..f88632476
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow;
+
+public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphicsConfiguration {
+ private AbstractGraphicsScreen screen;
+ protected Capabilities capabilitiesChosen;
+ protected Capabilities capabilitiesRequested;
+
+ public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen,
+ Capabilities capsChosen, Capabilities capsRequested) {
+ this.screen = screen;
+ this.capabilitiesChosen = capsChosen;
+ this.capabilitiesRequested = capsRequested;
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new NativeWindowException(e);
+ }
+ }
+
+ public AbstractGraphicsScreen getScreen() {
+ return screen;
+ }
+
+ public Capabilities getChosenCapabilities() {
+ return (Capabilities)capabilitiesChosen.clone();
+ }
+
+ public Capabilities getRequestedCapabilities() {
+ return (Capabilities)capabilitiesRequested.clone();
+ }
+
+ public AbstractGraphicsConfiguration getNativeGraphicsConfiguration() {
+ return this;
+ }
+
+ /**
+ * Set the capabilities to a new value.
+ *
+ * The use case for setting the Capabilities at a later time is
+ * a change of the graphics device in a multi-screen environment.<br>
+ *
+ * A copy of the passed object is being used.
+ *
+ * @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
+ */
+ protected void setChosenCapabilities(Capabilities capsChosen) {
+ capabilitiesChosen = (Capabilities) capsChosen.clone();
+ }
+
+ /**
+ * Set a new screen.
+ *
+ * the use case for setting a new screen at a later time is
+ * a change of the graphics device in a multi-screen environment.<br>
+ *
+ * A copy of the passed object is being used.
+ */
+ protected void setScreen(DefaultGraphicsScreen screen) {
+ this.screen = (AbstractGraphicsScreen) screen.clone();
+ }
+
+ public String toString() {
+ return getClass().toString()+"[" + screen +
+ ",\n\tchosen " + capabilitiesChosen+
+ ",\n\trequested " + capabilitiesRequested+
+ "]";
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
new file mode 100644
index 000000000..fdc849d0f
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow;
+
+public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice {
+ private String type;
+ protected long handle;
+
+ public DefaultGraphicsDevice(String type) {
+ this.type = type;
+ this.handle = 0;
+ }
+
+ public DefaultGraphicsDevice(String type, long handle) {
+ this.type = type;
+ this.handle = handle;
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new NativeWindowException(e);
+ }
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public long getHandle() {
+ return handle;
+ }
+
+ public String toString() {
+ return getClass().toString()+"[type "+getType()+", handle 0x"+Long.toHexString(getHandle())+"]";
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
new file mode 100644
index 000000000..0af32c9ec
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow;
+
+public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen {
+ AbstractGraphicsDevice device;
+ private int idx;
+
+ public DefaultGraphicsScreen(AbstractGraphicsDevice device, int idx) {
+ this.device = device;
+ this.idx = idx;
+ }
+
+ public static AbstractGraphicsScreen createScreenDevice(int screenIdx) {
+ return new DefaultGraphicsScreen(new DefaultGraphicsDevice(NativeWindowFactory.TYPE_DEFAULT), screenIdx);
+ }
+
+ public static AbstractGraphicsScreen createDefault() {
+ return createScreenDevice(0);
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new NativeWindowException(e);
+ }
+ }
+
+ public AbstractGraphicsDevice getDevice() {
+ return device;
+ }
+
+ public int getIndex() {
+ return idx;
+ }
+
+ public String toString() {
+ return getClass().toString()+"["+device+", idx "+idx+"]";
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
new file mode 100644
index 000000000..023a9d488
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.sun.nativewindow.impl.*;
+
+/**
+ * Provides the mechanism by which the graphics configuration for a
+ * window can be chosen before the window is created. The graphics
+ * configuration decides parameters related to hardware accelerated rendering such
+ * as the OpenGL pixel format. <br>
+ * On some window systems (EGL/OpenKODE and X11 in particular) it is necessary to
+ * choose the graphics configuration early at window creation time. <br>
+ * Note that the selection of the graphics configuration is an algorithm which does not have
+ * strong dependencies on the particular Java window toolkit in use
+ * (e.g., AWT) and therefore it is strongly desirable to factor this
+ * functionality out of the core {@link NativeWindowFactory} so that
+ * new window toolkits can replace just the {@link
+ * NativeWindowFactory} and reuse the graphics configuration selection
+ * algorithm provided by, for example, an OpenGL binding.
+ */
+
+public abstract class GraphicsConfigurationFactory {
+ protected static final boolean DEBUG = Debug.debug("GraphicsConfiguration");
+
+ private static Map/*<Class, NativeWindowFactory>*/ registeredFactories =
+ Collections.synchronizedMap(new HashMap());
+ private static Class abstractGraphicsDeviceClass;
+
+ static {
+ initialize();
+ }
+
+ /** Creates a new NativeWindowFactory instance. End users do not
+ need to call this method. */
+ protected GraphicsConfigurationFactory() {
+ }
+
+ private static void initialize() {
+ String osName = System.getProperty("os.name");
+ String osNameLowerCase = osName.toLowerCase();
+ String factoryClassName = null;
+
+ abstractGraphicsDeviceClass = javax.media.nativewindow.AbstractGraphicsDevice.class;
+
+ if (!osNameLowerCase.startsWith("wind") &&
+ !osNameLowerCase.startsWith("mac os x")) {
+ // Assume X11 platform -- should probably test for these explicitly
+ try {
+ GraphicsConfigurationFactory factory = (GraphicsConfigurationFactory)
+ NWReflection.createInstance("com.sun.nativewindow.impl.x11.X11GraphicsConfigurationFactory", new Object[] {});
+ registerFactory(javax.media.nativewindow.x11.X11GraphicsDevice.class, factory);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ // Register the default no-op factory for arbitrary
+ // AbstractGraphicsDevice implementations, including
+ // AWTGraphicsDevice instances -- the OpenGL binding will take
+ // care of handling AWTGraphicsDevices on X11 platforms (as
+ // well as X11GraphicsDevices in non-AWT situations)
+ registerFactory(abstractGraphicsDeviceClass, new GraphicsConfigurationFactoryImpl());
+ }
+
+ /** Returns the factory for use with the given type of
+ AbstractGraphicsDevice. */
+ public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device) {
+ if (device == null) {
+ return getFactory(AbstractGraphicsDevice.class);
+ }
+ return getFactory(device.getClass());
+ }
+
+ /**
+ * Returns the graphics configuration factory for use with the
+ * given class, which must implement the {@link
+ * AbstractGraphicsDevice} interface.
+ *
+ * @throws IllegalArgumentException if the given class does not implement AbstractGraphicsDevice
+ */
+ public static GraphicsConfigurationFactory getFactory(Class abstractGraphicsDeviceImplementor)
+ throws IllegalArgumentException, NativeWindowException
+ {
+ if (!(abstractGraphicsDeviceClass.isAssignableFrom(abstractGraphicsDeviceImplementor))) {
+ throw new IllegalArgumentException("Given class must implement AbstractGraphicsDevice");
+ }
+
+ GraphicsConfigurationFactory factory = null;
+ Class clazz = abstractGraphicsDeviceImplementor;
+ while (clazz != null) {
+ factory =
+ (GraphicsConfigurationFactory) registeredFactories.get(clazz);
+ if (factory != null) {
+ if(DEBUG) {
+ System.err.println("GraphicsConfigurationFactory.getFactory() "+abstractGraphicsDeviceImplementor+" -> "+factory);
+ }
+ return factory;
+ }
+ clazz = clazz.getSuperclass();
+ }
+ // Return the default
+ factory = (GraphicsConfigurationFactory)registeredFactories.get(abstractGraphicsDeviceClass);
+ if(DEBUG) {
+ System.err.println("GraphicsConfigurationFactory.getFactory() DEFAULT "+abstractGraphicsDeviceClass+" -> "+factory);
+ }
+ return factory;
+ }
+
+ /** Registers a GraphicsConfigurationFactory handling graphics
+ * device objects of the given class. This does not need to be
+ * called by end users, only implementors of new
+ * GraphicsConfigurationFactory subclasses.
+ *
+ * @throws IllegalArgumentException if the given class does not implement AbstractGraphicsDevice
+ */
+ protected static void registerFactory(Class abstractGraphicsDeviceImplementor, GraphicsConfigurationFactory factory)
+ throws IllegalArgumentException
+ {
+ if (!(abstractGraphicsDeviceClass.isAssignableFrom(abstractGraphicsDeviceImplementor))) {
+ throw new IllegalArgumentException("Given class must implement AbstractGraphicsDevice");
+ }
+ if(DEBUG) {
+ System.err.println("GraphicsConfigurationFactory.registerFactory() "+abstractGraphicsDeviceImplementor+" -> "+factory);
+ }
+ registeredFactories.put(abstractGraphicsDeviceImplementor, factory);
+ }
+
+ /**
+ * <P> Selects a graphics configuration on the specified graphics
+ * device compatible with the supplied {@link Capabilities}. Some
+ * platforms (e.g.: X11, EGL, KD) require the graphics configuration
+ * to be specified when the native window is created.
+ * These architectures have seperated their device, screen, window and drawable
+ * context and hence are capable of quering the capabilities for each screen.
+ * A fully established window is not required.</P>
+ *
+ * <P>Other platforms (e.g. Windows, MacOSX) don't offer the mentioned seperation
+ * and hence need a fully established window and it's drawable.
+ * Here the validation of the capabilities is performed later.
+ * In this case, the AbstractGraphicsConfiguration implementation
+ * must allow an overwrite of the Capabilites, for example
+ * {@link DefaultGraphicsConfiguration#setChosenCapabilities DefaultGraphicsConfiguration.setChosenCapabilities(..)}.
+ * </P>
+ *
+ * <P>
+ * This method is mainly intended to be both used and implemented by the
+ * OpenGL binding.</P>
+ *
+ * <P> The concrete data type of the passed graphics device and
+ * returned graphics configuration must be specified in the
+ * documentation binding this particular API to the underlying
+ * window toolkit. The Reference Implementation accepts {@link
+ * javax.media.nativewindow.awt.AWTGraphicsDevice AWTGraphicsDevice} objects and returns {@link
+ * javax.media.nativewindow.awt.AWTGraphicsConfiguration AWTGraphicsConfiguration} objects. On
+ * X11 platforms where the AWT is not in use, it also accepts
+ * {@link javax.media.nativewindow.x11.X11GraphicsDevice
+ * X11GraphicsDevice} objects and returns {@link
+ * javax.media.nativewindow.x11.X11GraphicsConfiguration
+ * X11GraphicsConfiguration} objects.</P>
+ *
+ * @throws IllegalArgumentException if the data type of the passed
+ * AbstractGraphicsDevice is not supported by this
+ * NativeWindowFactory.
+ * @throws NativeWindowException if any window system-specific errors caused
+ * the selection of the graphics configuration to fail.
+ *
+ * @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
+ * @see javax.media.nativewindow.DefaultGraphicsConfiguration#setChosenCapabilities(Capabilities caps)
+ */
+ public abstract AbstractGraphicsConfiguration
+ chooseGraphicsConfiguration(Capabilities capabilities,
+ CapabilitiesChooser chooser,
+ AbstractGraphicsScreen screen)
+ throws IllegalArgumentException, NativeWindowException;
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java
new file mode 100644
index 000000000..2a9782c12
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** Provides the low-level information required for
+ hardware-accelerated rendering in a platform-independent manner. A
+ window toolkit such as the AWT may either implement this interface
+ directly with one of its components, or provide and register an
+ implementation of {@link NativeWindowFactory NativeWindowFactory}
+ which can create NativeWindow objects for its components. <P>
+
+ A NativeWindow created for a particular on-screen component is
+ expected to have the same lifetime as that component. As long as
+ the component is alive, the NativeWindow must be able to control
+ it, and any time it is visible and locked, provide information
+ such as the window handle.
+*/
+public interface NativeWindow {
+ /** Returned by {@link #lockSurface()} if the surface is not ready to be locked. */
+ public static final int LOCK_SURFACE_NOT_READY = 1;
+
+ /** Returned by {@link #lockSurface()} if the surface is locked, but has changed. */
+ public static final int LOCK_SURFACE_CHANGED = 2;
+
+ /** Returned by {@link #lockSurface()} if the surface is locked, and is unchanged. */
+ public static final int LOCK_SUCCESS = 3;
+
+ /**
+ * Lock the surface of this native window<P>
+ *
+ * The window handle, see {@link #getWindowHandle()},
+ * and the surface handle, see {@link #lockSurface()}, <br>
+ * shall be set and be valid after a successfull call,
+ * ie a return value other than {@link #LOCK_SURFACE_NOT_READY}.<P>
+ *
+ * The semantics of the underlying native locked resource
+ * may be related to the {@link ToolkitLock} one. Hence it is
+ * important that implementation of both harmonize well.<br>
+ * The implementation may want to aquire the {@link ToolkitLock}
+ * first to become it's owner before proceeding with it's
+ * actual surface lock. <P>
+ *
+ * @return {@link #LOCK_SUCCESS}, {@link #LOCK_SURFACE_CHANGED} or {@link #LOCK_SURFACE_NOT_READY}.
+ *
+ * @throws NativeWindowException if surface is already locked
+ *
+ * @see ToolkitLock
+ */
+ public int lockSurface() throws NativeWindowException ;
+
+ /**
+ * Unlock the surface of this native window
+ *
+ * Shall not modify the window handle, see {@link #getWindowHandle()},
+ * or the surface handle, see {@link #lockSurface()} <P>
+ *
+ * @throws NativeWindowException if surface is not locked
+ *
+ * @see #lockSurface
+ * @see ToolkitLock
+ */
+ public void unlockSurface() throws NativeWindowException ;
+
+ /**
+ * Return if surface is locked
+ */
+ public boolean isSurfaceLocked();
+
+ /**
+ * Return the lock-exception, or null if not locked.
+ *
+ * The lock-exception is created at {@link #lockSurface()}
+ * and hence holds the locker's call stack.
+ */
+ public Exception getLockedStack();
+
+ /**
+ * render all native window information invalid,
+ * as if the native window was destroyed
+ */
+ public void invalidate();
+
+ /**
+ * Returns the window handle for this NativeWindow. <P>
+ *
+ * The window handle should be set/update by {@link #lockSurface()},
+ * where {@link #unlockSurface()} is not allowed to modify it.<br>
+ * After {@link #unlockSurface()} it is no more guaranteed
+ * that the window handle is still valid.<p>
+ *
+ * The window handle shall reflect the platform one
+ * for all window related operations, e.g. open, close, resize. <P>
+ *
+ * On X11 this returns an entity of type Window. <BR>
+ * On Microsoft Windows this returns an entity of type HWND.
+ */
+ public long getWindowHandle();
+
+ /**
+ * Returns the handle to the surface for this NativeWindow. <P>
+ *
+ * The surface handle should be set/update by {@link #lockSurface()},
+ * where {@link #unlockSurface()} is not allowed to modify it.
+ * After {@link #unlockSurface()} it is no more guaranteed
+ * that the surface handle is still valid.
+ *
+ * The surface handle shall reflect the platform one
+ * for all drawable surface operations, e.g. opengl, swap-buffer. <P>
+ *
+ * On X11 this returns an entity of type Window,
+ * since there is no differentiation of surface and window there. <BR>
+ * On Microsoft Windows this returns an entity of type HDC.
+ */
+ public long getSurfaceHandle();
+
+ /** Returns the current width of this window. */
+ public int getWidth();
+
+ /** Returns the current height of this window. */
+ public int getHeight();
+
+ /**
+ * Returns the graphics configuration corresponding to this window.
+ * @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
+ */
+ public AbstractGraphicsConfiguration getGraphicsConfiguration();
+
+ /**
+ * Convenience: Get display handle from
+ * AbstractGraphicsConfiguration . AbstractGraphicsScreen . AbstractGraphicsDevice
+ */
+ public long getDisplayHandle();
+
+ /**
+ * Convenience: Get display handle from
+ * AbstractGraphicsConfiguration . AbstractGraphicsScreen
+ */
+ public int getScreenIndex();
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
new file mode 100644
index 000000000..593c1e7d6
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow;
+
+/** A generic exception for OpenGL errors used throughout the binding
+ as a substitute for {@link RuntimeException}. */
+
+public class NativeWindowException extends RuntimeException {
+ /** Constructs a NativeWindowException object. */
+ public NativeWindowException() {
+ super();
+ }
+
+ /** Constructs a NativeWindowException object with the specified detail
+ message. */
+ public NativeWindowException(String message) {
+ super(message);
+ }
+
+ /** Constructs a NativeWindowException object with the specified detail
+ message and root cause. */
+ public NativeWindowException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /** Constructs a NativeWindowException object with the specified root
+ cause. */
+ public NativeWindowException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
new file mode 100644
index 000000000..39ec18bc4
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -0,0 +1,352 @@
+/*
+ * Copyright (c) 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow;
+
+import java.lang.reflect.*;
+import java.security.*;
+import java.util.*;
+
+import com.sun.nativewindow.impl.*;
+
+/** Provides a pluggable mechanism for arbitrary window toolkits to
+ adapt their components to the {@link NativeWindow} interface,
+ which provides a platform-independent mechanism of accessing the
+ information required to perform operations like
+ hardware-accelerated rendering using the OpenGL API. */
+
+public abstract class NativeWindowFactory {
+ protected static final boolean DEBUG = Debug.debug("NativeWindow");
+
+ /** OpenKODE/EGL type */
+ public static final String TYPE_EGL = "EGL";
+
+ /** Microsoft Windows type */
+ public static final String TYPE_WINDOWS = "Windows";
+
+ /** X11 type */
+ public static final String TYPE_X11 = "X11";
+
+ /** Mac OS X type */
+ public static final String TYPE_MACOSX = "MacOSX";
+
+ /** Generic AWT type */
+ public static final String TYPE_AWT = "AWT";
+
+ /** Generic DEFAULT type, where platform implementation don't care */
+ public static final String TYPE_DEFAULT = "default";
+
+ private static NativeWindowFactory defaultFactory;
+ private static Map/*<Class, NativeWindowFactory>*/ registeredFactories;
+ private static Class nativeWindowClass;
+ private static String nativeWindowingTypePure;
+ private static String nativeOSNamePure;
+ private static String nativeWindowingTypeCustom;
+ private static String nativeOSNameCustom;
+
+ /** Creates a new NativeWindowFactory instance. End users do not
+ need to call this method. */
+ protected NativeWindowFactory() {
+ }
+
+ private static String _getNativeWindowingType(String osNameLowerCase) {
+ if (osNameLowerCase.startsWith("kd")) {
+ return TYPE_EGL;
+ } else if (osNameLowerCase.startsWith("wind")) {
+ return TYPE_WINDOWS;
+ } else if (osNameLowerCase.startsWith("mac os x") ||
+ osNameLowerCase.startsWith("darwin")) {
+ return TYPE_MACOSX;
+ } else if (osNameLowerCase.equals("awt")) {
+ return TYPE_AWT;
+ } else {
+ return TYPE_X11;
+ }
+ }
+
+ static {
+ // Gather the windowing OS first
+ nativeOSNamePure = System.getProperty("os.name");
+ nativeOSNameCustom = System.getProperty("nativewindow.ws.name");
+ if(null==nativeOSNameCustom||nativeOSNameCustom.length()==0) {
+ nativeOSNameCustom = nativeOSNamePure;
+ }
+ nativeWindowingTypePure = _getNativeWindowingType(nativeOSNamePure.toLowerCase());
+ nativeWindowingTypeCustom = _getNativeWindowingType(nativeOSNameCustom.toLowerCase());
+
+ registeredFactories = Collections.synchronizedMap(new HashMap());
+
+ String factoryClassName = null;
+
+ // register our default factory -> NativeWindow
+ NativeWindowFactory factory = new NativeWindowFactoryImpl();
+ nativeWindowClass = javax.media.nativewindow.NativeWindow.class;
+ registerFactory(nativeWindowClass, factory);
+ defaultFactory = factory;
+
+ // We break compile-time dependencies on the AWT here to
+ // make it easier to run this code on mobile devices
+
+ Class componentClass = null;
+ if ( NWReflection.isClassAvailable("java.awt.Component") &&
+ NWReflection.isClassAvailable("javax.media.nativewindow.awt.AWTGraphicsDevice") ) {
+ try {
+ componentClass = NWReflection.getClass("java.awt.Component", false);
+ } catch (Exception e) { }
+ }
+
+ boolean toolkitLockDisabled = Boolean.getBoolean("nativewindow.toolkitlock.disabled"); // test ..
+
+ if(TYPE_X11.equals(nativeWindowingTypeCustom) && !toolkitLockDisabled) {
+ NativeWindowFactory _factory = null;
+
+ // FIXME: there are regressions in functionality in the
+ // JOGL 2 rewrite compared to JOGL 1.1.1 which are
+ // described in the writeup below.
+ //
+ // There are certain operations that may be done by
+ // user-level native code which must share the display
+ // connection with the underlying window toolkit. In JOGL,
+ // for example, the AWT GLCanvas makes GLX and OpenGL
+ // calls against an X Drawable that was created by the
+ // AWT. In this case, the AWT Native Interface ("JAWT") is
+ // used to lock and unlock this surface, which grabs and
+ // releases a lock which is also used internally to the
+ // AWT implementation. This is required because the AWT
+ // makes X calls from multiple threads: for example, the
+ // AWT Toolkit thread and one or more Event Dispatch
+ // Threads.
+ // CHECK: OK
+ //
+ // In the JOGL API, there are other operations that use an
+ // X display connection which do not involve locking an
+ // on-screen window created by the toolkit: visual
+ // selection, pbuffers, external contexts and external
+ // drawables.
+ //
+ // The JOGL GLPbuffer implementation uses its own display
+ // connection via "XOpenDisplay(null)". This was true even
+ // in JOGL 1.1.1. It is believed, but not 100% clear,
+ // whether X implementations are robust enough to handle
+ // the opening of a new display connection in a
+ // multithreaded fashion with no synchronization.
+ // (Semantically this should be allowed, but practically,
+ // it is unclear.) Currently the JOGL implementation locks
+ // the ToolkitLock around pbuffer-related operations.
+ // CHECK: OK - Using X11GraphicsScreen.createDefault() now,
+ // utilizing one display per thread.
+ // However, locking code is still intact.
+ // FIXME: Shall it really have one new display per
+ // Pbuffer ?
+ //
+ // Even if the pbuffer case is over-synchronized, there
+ // are definitely cases where synchronization with the
+ // toolkit is required. From recollection, visual
+ // selection is performed outside of the cover of the
+ // toolkit's lock, and the toolkit's display connection is
+ // used for this operation, so for correctness the toolkit
+ // must be locked during glXChooseFBConfig /
+ // glXChooseVisual. Synchronization with the toolkit is
+ // definitely needed for support of external GLDrawables,
+ // where JOGL creates additional OpenGL contexts on a
+ // surface that was created by a third party. External
+ // GLDrawables are the foundation of the Java 2D / JOGL
+ // bridge. While this bridge may be historical at this
+ // point, support for external GLDrawables on platforms
+ // that can support them (namely, WGL and X11 platforms;
+ // Mac OS X does not currently have the required
+ // primitives in its OpenGL window system binding) makes
+ // the JOGL library more powerful.
+ //
+ // (FIXME: from code examination, it looks like there are
+ // regressions in the support for external GLDrawables in
+ // JOGL 2 compared to JOGL 1.1.1. Note that the "default"
+ // X display connection from X11Util is being used during
+ // construction of the X11ExternalGLXDrawable instead of
+ // the result of glXGetCurrentDisplay().)
+ //
+ // The X11AWTNativeWindowFactory provides a locking
+ // mechanism compatible with the AWT. It may be desirable
+ // to replace this window factory when using third-party
+ // toolkits like Newt even when running on Java SE when
+ // the AWT is available.
+
+ if (componentClass != null) {
+ try {
+ Constructor factoryConstructor =
+ NWReflection.getConstructor("com.sun.nativewindow.impl.x11.awt.X11AWTNativeWindowFactory", new Class[] {});
+ _factory = (NativeWindowFactory) factoryConstructor.newInstance(null);
+ } catch (Exception e) { }
+ }
+
+ // If it turns out that the AWT is not available, for
+ // example on embedded profiles (CDC / FP), then
+ // synchronization is still needed, for example among
+ // multiple threads that might create pbuffers
+ // or for threads using the static default display to query information.
+ // The X11NativeWindowFactory provides a simple reentrant lock
+ // for this purpose. It is expected that third-party
+ // toolkits will either replace this factory, and thereby
+ // the implementation of this lock, if stronger
+ // interoperability is desired, for example full support
+ // for external GLDrawables.
+ if (null ==_factory) {
+ // Try the non-AWT X11 native window factory
+ try {
+ Constructor factoryConstructor =
+ NWReflection.getConstructor("com.sun.nativewindow.impl.x11.X11NativeWindowFactory", new Class[] {});
+ _factory = (NativeWindowFactory) factoryConstructor.newInstance(null);
+ } catch (Exception e) { }
+ }
+
+ if (null !=_factory) {
+ factory = _factory;
+ }
+ }
+
+ if(null!=componentClass) {
+ // register either our default factory or (if exist) the X11/AWT one -> AWT Component
+ registerFactory(componentClass, factory);
+ }
+ defaultFactory = factory;
+ if(DEBUG) {
+ System.err.println("NativeWindowFactory defaultFactory "+factory);
+ }
+ }
+
+ public static String getNativeOSName(boolean useCustom) {
+ return useCustom?nativeOSNameCustom:nativeOSNamePure;
+ }
+
+ public static String getNativeWindowType(boolean useCustom) {
+ return useCustom?nativeWindowingTypeCustom:nativeWindowingTypePure;
+ }
+
+ /** Sets the default NativeWindowFactory. Certain operations on
+ X11 platforms require synchronization, and the implementation
+ of this synchronization may be specific to the window toolkit
+ in use. It is impractical to require that all of the APIs that
+ might require synchronization receive a {@link ToolkitLock
+ ToolkitLock} as argument. For this reason the concept of a
+ default NativeWindowFactory is introduced. The toolkit lock
+ provided via {@link #getToolkitLock getToolkitLock} from this
+ default NativeWindowFactory will be used for synchronization
+ within the Java binding to OpenGL. By default, if the AWT is
+ available, the default toolkit will support the AWT. */
+ public static void setDefaultFactory(NativeWindowFactory factory) {
+ defaultFactory = factory;
+ }
+
+ /** Gets the default NativeWindowFactory. Certain operations on
+ X11 platforms require synchronization, and the implementation
+ of this synchronization may be specific to the window toolkit
+ in use. It is impractical to require that all of the APIs that
+ might require synchronization receive a {@link ToolkitLock
+ ToolkitLock} as argument. For this reason the concept of a
+ default NativeWindowFactory is introduced. The toolkit lock
+ provided via {@link #getToolkitLock getToolkitLock} from this
+ default NativeWindowFactory will be used for synchronization
+ within the Java binding to OpenGL. By default, if the AWT is
+ available, the default toolkit will support the AWT. */
+ public static NativeWindowFactory getDefaultFactory() {
+ return defaultFactory;
+ }
+
+ /** Returns the appropriate NativeWindowFactory to handle window
+ objects of the given type. The windowClass might be {@link
+ NativeWindow NativeWindow}, in which case the client has
+ already assumed the responsibility of creating a compatible
+ NativeWindow implementation, or it might be that of a toolkit
+ class like {@link java.awt.Component Component}. */
+ public static NativeWindowFactory getFactory(Class windowClass) throws IllegalArgumentException {
+ if (nativeWindowClass.isAssignableFrom(windowClass)) {
+ return (NativeWindowFactory) registeredFactories.get(nativeWindowClass);
+ }
+ Class clazz = windowClass;
+ while (clazz != null) {
+ NativeWindowFactory factory = (NativeWindowFactory) registeredFactories.get(clazz);
+ if (factory != null) {
+ return factory;
+ }
+ clazz = clazz.getSuperclass();
+ }
+ throw new IllegalArgumentException("No registered NativeWindowFactory for class " + windowClass.getName());
+ }
+
+ /** Registers a NativeWindowFactory handling window objects of the
+ given class. This does not need to be called by end users,
+ only implementors of new NativeWindowFactory subclasses. */
+ protected static void registerFactory(Class windowClass, NativeWindowFactory factory) {
+ if(DEBUG) {
+ System.err.println("NativeWindowFactory.registerFactory() "+windowClass+" -> "+factory);
+ }
+ registeredFactories.put(windowClass, factory);
+ }
+
+ /** Converts the given window object and it's
+ {@link AbstractGraphicsConfiguration AbstractGraphicsConfiguration} into a
+ {@link NativeWindow NativeWindow} which can be operated upon by a custom
+ toolkit, e.g. {@link javax.media.opengl.GLDrawableFactory javax.media.opengl.GLDrawableFactory}.<br>
+ The object may be a component for a particular window toolkit, such as an AWT
+ Canvas. It may also be a NativeWindow object itself.<br>
+ You shall utilize {@link javax.media.nativewindow.GraphicsConfigurationFactory GraphicsConfigurationFactory}
+ to construct a proper {@link AbstractGraphicsConfiguration AbstractGraphicsConfiguration}.<br>
+ The particular implementation of the
+ NativeWindowFactory is responsible for handling objects from a
+ particular window toolkit. The built-in NativeWindowFactory
+ handles NativeWindow instances as well as AWT Components.<br>
+
+ @throws IllegalArgumentException if the given window object
+ could not be handled by any of the registered
+ NativeWindowFactory instances
+
+ @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
+ */
+ public static NativeWindow getNativeWindow(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException {
+ if (winObj == null) {
+ throw new IllegalArgumentException("Null window object");
+ }
+
+ return getFactory(winObj.getClass()).getNativeWindowImpl(winObj, config);
+ }
+
+ /** Performs the conversion from a toolkit's window object to a
+ NativeWindow. Implementors of concrete NativeWindowFactory
+ subclasses should override this method. */
+ protected abstract NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException;
+
+ /** Returns the object which provides support for synchronizing
+ with the underlying window toolkit.<br>
+ @see ToolkitLock
+ */
+ public abstract ToolkitLock getToolkitLock();
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
new file mode 100644
index 000000000..27e59d8c8
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow;
+
+/** Provides an interface for locking and unlocking the underlying
+ window toolkit, where this is necessary in the OpenGL
+ implementation. This mechanism is generally only needed on X11
+ platforms. Currently it is only used when the AWT is in use.
+ Implementations of this lock, if they are not no-ops, must support
+ reentrant locking and unlocking. <P>
+
+ The ToolkitLock implementation can be aquired by
+ {@link NativeWindowFactory#getToolkitLock NativeWindowFactory's getToolkitLock()}.<P>
+
+ All toolkit shared resources shall be accessed by encapsulating the
+ code with a locking block as follows.
+ <PRE>
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ long displayHandle = X11Util.getStaticDefaultDisplay();
+ ...
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+ </PRE><P>
+
+ The underlying toolkit's locking mechanism may relate to {@link NativeWindow}'s
+ {@link NativeWindow#lockSurface lockSurface()}. Hence it is important
+ that both implementation harmonize well, ie {@link NativeWindow#lockSurface lockSurface()}
+ shall issue a ToolkitLock lock befor it aquires it's surface lock. This is true
+ in the AWT implementation for example. Otherwise the surface lock would <i>steal</i>
+ the ToolkitLock's lock and a deadlock would be unavoidable.<P>
+
+ However the necessity of needing a global state synchronization will of course
+ impact your performance very much, especially in case of a multithreaded/multiwindow case.
+ */
+public interface ToolkitLock {
+ /** Locks the toolkit. */
+ public void lock();
+
+ /** Unlocks the toolkit. */
+ public void unlock();
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
new file mode 100644
index 000000000..7373e7b97
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow.awt;
+
+import javax.media.nativewindow.*;
+import java.awt.GraphicsConfiguration;
+import java.awt.Transparency;
+import java.awt.image.ColorModel;
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import com.sun.nativewindow.impl.Debug;
+
+/** A wrapper for an AWT GraphicsConfiguration allowing it to be
+ handled in a toolkit-independent manner. */
+
+public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
+ private GraphicsConfiguration config;
+ AbstractGraphicsConfiguration encapsulated;
+
+ public AWTGraphicsConfiguration(AWTGraphicsScreen screen,
+ Capabilities capsChosen, Capabilities capsRequested,
+ GraphicsConfiguration config, AbstractGraphicsConfiguration encapsulated) {
+ super(screen, capsChosen, capsRequested);
+ this.config = config;
+ this.encapsulated=encapsulated;
+ }
+
+ public AWTGraphicsConfiguration(AWTGraphicsScreen screen, Capabilities capsChosen, Capabilities capsRequested, GraphicsConfiguration config) {
+ super(screen, capsChosen, capsRequested);
+ this.config = config;
+ this.encapsulated=null;
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ public GraphicsConfiguration getGraphicsConfiguration() {
+ return config;
+ }
+
+ public AbstractGraphicsConfiguration getNativeGraphicsConfiguration() {
+ return (null!=encapsulated)?encapsulated:this;
+ }
+
+ /**
+ * Sets up the Capabilities' RGBA size based on the given GraphicsConfiguration's ColorModel.
+ *
+ * @param capabilities the Capabilities object whose red, green, blue, and alpha bits will be set
+ * @param gc the GraphicsConfiguration from which to derive the RGBA bit depths
+ * @return the passed Capabilities
+ */
+ public static Capabilities setupCapabilitiesRGBABits(Capabilities capabilities, GraphicsConfiguration gc) {
+ int cmTransparency = capabilities.isBackgroundOpaque()?Transparency.OPAQUE:Transparency.TRANSLUCENT;
+ ColorModel cm = gc.getColorModel(cmTransparency);
+ if(null==cm && !capabilities.isBackgroundOpaque()) {
+ capabilities.setBackgroundOpaque(true);
+ cmTransparency = Transparency.OPAQUE;
+ cm = gc.getColorModel(cmTransparency);
+ }
+ if(null==cm) {
+ throw new NativeWindowException("Could not determine AWT ColorModel");
+ }
+ int cmBitsPerPixel = cm.getPixelSize();
+ int bitsPerPixel = 0;
+ int[] bitesPerComponent = cm.getComponentSize();
+ if(bitesPerComponent.length>=3) {
+ capabilities.setRedBits(bitesPerComponent[0]);
+ bitsPerPixel += bitesPerComponent[0];
+ capabilities.setGreenBits(bitesPerComponent[1]);
+ bitsPerPixel += bitesPerComponent[1];
+ capabilities.setBlueBits(bitesPerComponent[2]);
+ bitsPerPixel += bitesPerComponent[2];
+ }
+ if(bitesPerComponent.length>=4) {
+ capabilities.setAlphaBits(bitesPerComponent[3]);
+ bitsPerPixel += bitesPerComponent[3];
+ } else {
+ capabilities.setAlphaBits(0);
+ }
+ if(Debug.debugAll()) {
+ if(cmBitsPerPixel!=bitsPerPixel) {
+ System.err.println("AWT Colormodel bits per components/pixel mismatch: "+bitsPerPixel+" != "+cmBitsPerPixel);
+ }
+ }
+ return capabilities;
+ }
+
+ public String toString() {
+ return getClass().toString()+"[" + getScreen() +
+ ",\n\tchosen " + capabilitiesChosen+
+ ",\n\trequested " + capabilitiesRequested+
+ ",\n\t" + config +
+ ",\n\tencapsulated "+encapsulated+"]";
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
new file mode 100644
index 000000000..077cbf8aa
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow.awt;
+
+import javax.media.nativewindow.*;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import com.sun.nativewindow.impl.*;
+
+/** A wrapper for an AWT GraphicsDevice allowing it to be
+ handled in a toolkit-independent manner. */
+
+public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+ private GraphicsDevice device;
+
+ protected AWTGraphicsDevice(GraphicsDevice device) {
+ super(NativeWindowFactory.TYPE_AWT);
+ this.device = device;
+ }
+
+ public static AbstractGraphicsDevice createDevice(GraphicsDevice awtDevice) {
+ if(null==awtDevice) {
+ awtDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
+ }
+ return new AWTGraphicsDevice(awtDevice);
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ public GraphicsDevice getGraphicsDevice() {
+ return device;
+ }
+
+ /**
+ * In case the native handle was specified, e.g. using X11,
+ * we shall be able to mark it.
+ */
+ public void setHandle(long handle) {
+ this.handle = handle;
+ }
+
+ public String toString() {
+ return getClass().toString()+"[type "+getType()+", awtDevice "+device+", handle 0x"+Long.toHexString(getHandle())+"]";
+ }
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java
new file mode 100644
index 000000000..2ad8a99af
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsScreen.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.nativewindow.awt;
+
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.AbstractGraphicsDevice;
+import com.sun.nativewindow.impl.*;
+
+/** A wrapper for an AWT GraphicsDevice (screen) allowing it to be
+ handled in a toolkit-independent manner. */
+
+public class AWTGraphicsScreen extends DefaultGraphicsScreen implements Cloneable {
+
+ public AWTGraphicsScreen(AWTGraphicsDevice device) {
+ super(device, findScreenIndex(device.getGraphicsDevice()));
+ }
+
+ public static GraphicsDevice getScreenDevice(int index) {
+ if(index<0) return null;
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice[] gs = ge.getScreenDevices();
+ if(index<gs.length) {
+ return gs[index];
+ }
+ return null;
+ }
+
+ public static int findScreenIndex(GraphicsDevice awtDevice) {
+ if(null==awtDevice) return -1;
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice[] gs = ge.getScreenDevices();
+ for (int j = 0; j < gs.length; j++) {
+ if(gs[j] == awtDevice) return j;
+ }
+ return -1;
+ }
+
+ public static AbstractGraphicsScreen createScreenDevice(GraphicsDevice awtDevice) {
+ AWTGraphicsDevice device = (AWTGraphicsDevice) AWTGraphicsDevice.createDevice(awtDevice);
+ return new AWTGraphicsScreen(device);
+ }
+
+ public static AbstractGraphicsScreen createScreenDevice(int index) {
+ GraphicsDevice awtDevice = getScreenDevice(index);
+ return createScreenDevice(awtDevice);
+ }
+
+ public static AbstractGraphicsScreen createDefault() {
+ return createScreenDevice(-1);
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java
new file mode 100644
index 000000000..49c337359
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/egl/EGLGraphicsDevice.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow.egl;
+
+import javax.media.nativewindow.*;
+
+/** Encapsulates a graphics device on EGL platforms.
+ */
+
+public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+ /** Constructs a new EGLGraphicsDevice corresponding to the given EGL display handle. */
+ public EGLGraphicsDevice(long eglDisplay) {
+ super(NativeWindowFactory.TYPE_EGL, eglDisplay);
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/macosx/MacOSXGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/macosx/MacOSXGraphicsDevice.java
new file mode 100644
index 000000000..3669ebd12
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/macosx/MacOSXGraphicsDevice.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow.macosx;
+
+import javax.media.nativewindow.*;
+
+/** Encapsulates a graphics device on MacOSX platforms.
+ */
+
+public class MacOSXGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+ /** Constructs a new MacOSXGraphicsDevice */
+ public MacOSXGraphicsDevice() {
+ super(NativeWindowFactory.TYPE_MACOSX);
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/package.html b/src/nativewindow/classes/javax/media/nativewindow/package.html
new file mode 100644
index 000000000..ce9dbbb7a
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/package.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>NativeWindow Protocol Draft Public Review Specification</title>
+</head>
+ <body>
+
+<h2><i>NativeWindow Protocol</i> Specification Overview</h2>
+
+<h3>Preface</h3>
+ This specification, an optional set of packages, describing a <i>protocol</i> for a
+ <i>native windowing interface</i> binding to Java(TM).<br>
+ Currently specified <i>native windowing systems</i> are:<br><br>
+ <ul>
+ <li> EGL/OpenKODE Windowing System</li>
+ <li> X11 Windowing System</li>
+ <li> Microsoft Windows</li>
+ <li> Apple MacOSX</li>
+ <li> Java's AWT</li>
+ </ul>
+ <br>
+ However, any other native windowing system may be added to the implementation,
+ using a generic string identifier and an optional specialisation of:<br><br>
+ <ul>
+ <li>{@link javax.media.nativewindow.AbstractGraphicsDevice AbstractGraphicsDevice},<br>
+ <br>
+ Shall return the new string identifier with {@link javax.media.nativewindow.AbstractGraphicsDevice#getType() getType()}</li><br>
+ <li>{@link javax.media.nativewindow.AbstractGraphicsScreen AbstractGraphicsScreen}</li>
+ <li>{@link javax.media.nativewindow.AbstractGraphicsConfiguration AbstractGraphicsConfiguration}</li><br>
+ </ul>
+ <br>
+ The implementor has to provide the following:<br><br>
+ <ul>
+ <li> The specialisation of the abstract class {@link javax.media.nativewindow.NativeWindowFactory NativeWindowFactory}<br>
+ <br>
+ shall be registered with {@link javax.media.nativewindow.NativeWindowFactory#registerFactory NativeWindowFactory.registerFactory(..)}.</li><br>
+
+ <li> The specialisation of the abstract class {@link javax.media.nativewindow.GraphicsConfigurationFactory GraphicsConfigurationFactory}<br>
+ <br>
+ shall be registered with {@link javax.media.nativewindow.GraphicsConfigurationFactory#registerFactory GraphicsConfigurationFactory.registerFactory(..)}.</li><br>
+ </ul><br>
+ This protocol <i>does not</i> describe how to <i>create</i> native windows, but how to <i>bind</i> a native window to an implementation of
+ {@link javax.media.nativewindow.NativeWindow NativeWindow}.<br>
+ However, an implementation of this protocol (e.g. {@link com.sun.javafx.newt}) may support the creation.<br>
+
+<h3>Dependencies</h3>
+ This binding has dependencies to the following:<br><br>
+ <ul>
+ <li> Either of the following Java implementations:<br>
+ <ul>
+ <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/">Java SE 1.4 or later</a> </li><br>
+ <li> <a href="http://java.sun.com/javame/technology/cdc/">Java ME CDC 1.1.2 (JSR 218)</a> and
+ <a href="http://java.sun.com/products/foundation/">Foundation Profile 1.1.2 (JSR 219)</a><br>
+ and either of the following <i>java.nio</i> implementations:<br>
+ <ul>
+ <li> <a href="http://java.sun.com/javame/reference/apis/jsr239/java/nio/package-summary.html"> JSR239 <i>java.nio</i> subset</a> </li>
+ <li> <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/package-summary.html"> Java 1.4 <i>java.nio</i> implementation</a> </li>
+ </ul><br>
+ </ul>
+ </ul>
+ <br>
+
+<h3>Package Structure</h3>
+ The packages defined by this specification include:<br><br>
+<ul>
+ <li>The <b>javax.media.nativewindow</b> package<br>
+ <br>
+ This package contains Java bindings for a native windowing system.<br>
+ Subsequent packages contain marker type classes, containing native characteristics of the windowing system.</li><br><br>
+ <ul>
+ <li>The <b>javax.media.nativewindow.awt</b> package<br>
+ <br>
+ This sub package contains classes to cover the native characteristics of the AWT windowing system.</li><br>
+
+ <li>The <b>javax.media.nativewindow.x11</b> package<br>
+ <br>
+ This sub package contains classes to cover the native characteristics of the X11 windowing system.</li><br>
+
+ <li>The <b>javax.media.nativewindow.windows</b> package<br>
+ <br>
+ This sub package contains classes to cover the native characteristics of the Windows windowing system.</li><br>
+
+ <li>The <b>javax.media.nativewindow.macosx</b> package<br>
+ <br>
+ This sub package contains classes to cover the native characteristics of the MacOSX windowing system.</li><br>
+
+ <li>The <b>javax.media.nativewindow.egl</b> package<br>
+ <br>
+ This sub package contains classes to cover the native characteristics of the EGL/OpenKODE windowing system.</li><br>
+ </ul>
+</ul>
+
+<h3>Factory Model</h3>
+Running on a platform with a supported windowing system, the factory model shall be used
+to instantiate a native window, see {@link javax.media.nativewindow.NativeWindowFactory NativeWindowFactory}.<br>
+The implementor has to specialize
+All supported
+Regardless of the knowledge of the underly
+<br>
+
+<h3>Revision History<br>
+ </h3>
+
+<ul>
+<li> Early Draft Review, June 2009
+</ul>
+ <br>
+ <br>
+ <br>
+</body>
+</html>
diff --git a/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java
new file mode 100644
index 000000000..69dde49af
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/windows/WindowsGraphicsDevice.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow.windows;
+
+import javax.media.nativewindow.*;
+
+/** Encapsulates a graphics device on Windows platforms.
+ */
+
+public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+ /** Constructs a new WindowsGraphicsDevice */
+ public WindowsGraphicsDevice() {
+ super(NativeWindowFactory.TYPE_WINDOWS);
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
new file mode 100644
index 000000000..fdecac8fc
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsConfiguration.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow.x11;
+
+import javax.media.nativewindow.*;
+import com.sun.nativewindow.impl.x11.XVisualInfo;
+
+/** Encapsulates a graphics configuration, or OpenGL pixel format, on
+ X11 platforms. Objects of this type are returned from {@link
+ javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration
+ GraphicsConfigurationFactory.chooseGraphicsConfiguration()} on X11
+ platforms when toolkits other than the AWT are being used. */
+
+public class X11GraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
+ private XVisualInfo info;
+
+ public X11GraphicsConfiguration(X11GraphicsScreen screen,
+ Capabilities capsChosen, Capabilities capsRequested,
+ XVisualInfo info) {
+ super(screen, capsChosen, capsRequested);
+ this.info = info;
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+
+ public XVisualInfo getXVisualInfo() {
+ return info;
+ }
+
+ protected void setXVisualInfo(XVisualInfo info) {
+ this.info = info;
+ }
+
+ public long getVisualID() {
+ return (null!=info)?info.visualid():0;
+ }
+
+ public String toString() {
+ return getClass().toString()+"["+getScreen()+", visualID 0x" + Long.toHexString(getVisualID()) +
+ ",\n\tchosen " + capabilitiesChosen+
+ ",\n\trequested " + capabilitiesRequested+
+ "]";
+ }
+}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java
new file mode 100644
index 000000000..911b8f416
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow.x11;
+
+import javax.media.nativewindow.*;
+
+import com.sun.nativewindow.impl.x11.*;
+
+/** Encapsulates a graphics device on X11 platforms.
+ */
+
+public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
+ /** Constructs a new X11GraphicsDevice corresponding to the given native display handle. */
+ public X11GraphicsDevice(long display) {
+ super(NativeWindowFactory.TYPE_X11, display);
+ if(0==display) {
+ throw new NativeWindowException("null display");
+ }
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
new file mode 100644
index 000000000..f434050f2
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+package javax.media.nativewindow.x11;
+
+import javax.media.nativewindow.*;
+
+import com.sun.nativewindow.impl.x11.*;
+
+/** Encapsulates a screen index on X11
+ platforms. Objects of this type are passed to {@link
+ javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration
+ GraphicsConfigurationFactory.chooseGraphicsConfiguration()} on X11
+ platforms when toolkits other than the AWT are being used. */
+
+public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneable {
+
+ /** Constructs a new X11GraphicsScreen corresponding to the given native screen index. */
+ public X11GraphicsScreen(X11GraphicsDevice device, int screen) {
+ super(device, fetchScreen(screen));
+ }
+
+ public static AbstractGraphicsScreen createScreenDevice(long display, int screenIdx) {
+ if(0==display) throw new NativeWindowException("display is null");
+ return new X11GraphicsScreen(new X11GraphicsDevice(display), screenIdx);
+ }
+
+ /** Creates a new X11GraphicsScreen using a thread local display connection */
+ public static AbstractGraphicsScreen createDefault() {
+ long display = X11Util.getThreadLocalDefaultDisplay();
+ int scrnIdx = X11Lib.DefaultScreen(display);
+ return createScreenDevice(display, scrnIdx);
+ }
+
+ public long getDefaultVisualID() {
+ // It still could be an AWT hold handle ..
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ long display = getDevice().getHandle();
+ int scrnIdx = X11Lib.DefaultScreen(display);
+ return X11Lib.DefaultVisualID(display, scrnIdx);
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+ }
+
+ private static int fetchScreen(int screen) {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().lock();
+ try {
+ if(!com.sun.nativewindow.impl.x11.X11Util.isXineramaEnabledOnStaticDefaultDisplay()) {
+ return screen;
+ }
+ } finally {
+ NativeWindowFactory.getDefaultFactory().getToolkitLock().unlock();
+ }
+ return 0;
+ }
+
+ public Object clone() {
+ return super.clone();
+ }
+}
diff --git a/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
new file mode 100644
index 000000000..e4afbdb70
--- /dev/null
+++ b/src/nativewindow/native/JAWT_DrawingSurfaceInfo.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+#include <jawt_md.h>
+
+#ifdef WIN32
+ #define PLATFORM_DSI_SIZE sizeof(JAWT_Win32DrawingSurfaceInfo)
+#elif defined(linux) || defined(__sun) || defined(__FreeBSD__) || defined(_HPUX)
+ #define PLATFORM_DSI_SIZE sizeof(JAWT_X11DrawingSurfaceInfo)
+#elif defined(macosx)
+ #define PLATFORM_DSI_SIZE sizeof(JAWT_MacOSXDrawingSurfaceInfo)
+#else
+ ERROR: port JAWT_DrawingSurfaceInfo.c to your platform
+#endif
+
+JNIEXPORT jobject JNICALL
+Java_com_sun_nativewindow_impl_jawt_JAWT_1DrawingSurfaceInfo_platformInfo0(JNIEnv* env, jobject unused, jobject jthis0) {
+ JAWT_DrawingSurfaceInfo* dsi;
+ dsi = (*env)->GetDirectBufferAddress(env, jthis0);
+ if (dsi == NULL) {
+ (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/RuntimeException"),
+ "Argument \"jthis0\" was not a direct buffer");
+ return NULL;
+ }
+ if (dsi->platformInfo == NULL) {
+ return NULL;
+ }
+ return (*env)->NewDirectByteBuffer(env, dsi->platformInfo, PLATFORM_DSI_SIZE);
+}
diff --git a/src/nativewindow/native/x11/Xinerama.c b/src/nativewindow/native/x11/Xinerama.c
new file mode 100644
index 000000000..98dcfe095
--- /dev/null
+++ b/src/nativewindow/native/x11/Xinerama.c
@@ -0,0 +1,316 @@
+/* $TOG: XPanoramiX.c /main/2 1997/11/16 08:45:41 kaleb $ */
+/****************************************************************
+* *
+* Copyright (c) Digital Equipment Corporation, 1991, 1997 *
+* *
+* All Rights Reserved. Unpublished rights reserved under *
+* the copyright laws of the United States. *
+* *
+* The software contained on this media is proprietary to *
+* and embodies the confidential technology of Digital *
+* Equipment Corporation. Possession, use, duplication or *
+* dissemination of the software and media is authorized only *
+* pursuant to a valid written license from Digital Equipment *
+* Corporation. *
+* *
+* RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure *
+* by the U.S. Government is subject to restrictions as set *
+* forth in Subparagraph (c)(1)(ii) of DFARS 252.227-7013, *
+* or in FAR 52.227-19, as applicable. *
+* *
+*****************************************************************/
+/* $XFree86: xc/lib/Xinerama/Xinerama.c,v 1.1 2000/02/27 23:10:04 mvojkovi Exp $ */
+
+#ifndef __linux__
+ #error This file should only be built under Linux
+#endif
+
+#define NEED_EVENTS
+#define NEED_REPLIES
+#include <X11/Xlibint.h>
+#include <X11/Xutil.h>
+/* #include "Xext.h" */ /* in ../include */
+#include "extutil.h" /* in ../include */
+#include "panoramiXext.h"
+#include "panoramiXproto.h" /* in ../include */
+#include "Xinerama.h"
+
+
+static XExtensionInfo _panoramiX_ext_info_data;
+static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data;
+static /* const */ char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
+
+#define PanoramiXCheckExtension(dpy,i,val) \
+ XextCheckExtension (dpy, i, panoramiX_extension_name, val)
+#define PanoramiXSimpleCheckExtension(dpy,i) \
+ XextSimpleCheckExtension (dpy, i, panoramiX_extension_name)
+
+static int close_display();
+static /* const */ XExtensionHooks panoramiX_extension_hooks = {
+ NULL, /* create_gc */
+ NULL, /* copy_gc */
+ NULL, /* flush_gc */
+ NULL, /* free_gc */
+ NULL, /* create_font */
+ NULL, /* free_font */
+ close_display, /* close_display */
+ NULL, /* wire_to_event */
+ NULL, /* event_to_wire */
+ NULL, /* error */
+ NULL, /* error_string */
+};
+
+static XEXT_GENERATE_FIND_DISPLAY (find_display, panoramiX_ext_info,
+ panoramiX_extension_name,
+ &panoramiX_extension_hooks,
+ 0, NULL)
+
+static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info)
+
+
+
+/****************************************************************************
+ * *
+ * PanoramiX public interfaces *
+ * *
+ ****************************************************************************/
+
+Bool XPanoramiXQueryExtension (
+ Display *dpy,
+ int *event_basep,
+ int *error_basep
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+
+ if (XextHasExtension(info)) {
+ *event_basep = info->codes->first_event;
+ *error_basep = info->codes->first_error;
+ return True;
+ } else {
+ return False;
+ }
+}
+
+
+Status XPanoramiXQueryVersion(
+ Display *dpy,
+ int *major_versionp,
+ int *minor_versionp
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXQueryVersionReply rep;
+ register xPanoramiXQueryVersionReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXQueryVersion, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXQueryVersion;
+ req->clientMajor = PANORAMIX_MAJOR_VERSION;
+ req->clientMinor = PANORAMIX_MINOR_VERSION;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ *major_versionp = rep.majorVersion;
+ *minor_versionp = rep.minorVersion;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 1;
+}
+
+XPanoramiXInfo *XPanoramiXAllocInfo(void)
+{
+ return (XPanoramiXInfo *) Xmalloc (sizeof (XPanoramiXInfo));
+}
+
+Status XPanoramiXGetState (
+ Display *dpy,
+ Drawable drawable,
+ XPanoramiXInfo *panoramiX_info
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXGetStateReply rep;
+ register xPanoramiXGetStateReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXGetState, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXGetState;
+ req->window = drawable;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ panoramiX_info->window = rep.window;
+ panoramiX_info->State = rep.state;
+ return 1;
+}
+
+Status XPanoramiXGetScreenCount (
+ Display *dpy,
+ Drawable drawable,
+ XPanoramiXInfo *panoramiX_info
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXGetScreenCountReply rep;
+ register xPanoramiXGetScreenCountReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXGetScreenCount, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXGetScreenCount;
+ req->window = drawable;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ panoramiX_info->window = rep.window;
+ panoramiX_info->ScreenCount = rep.ScreenCount;
+ return 1;
+}
+
+Status XPanoramiXGetScreenSize (
+ Display *dpy,
+ Drawable drawable,
+ int screen_num,
+ XPanoramiXInfo *panoramiX_info
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xPanoramiXGetScreenSizeReply rep;
+ register xPanoramiXGetScreenSizeReq *req;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (PanoramiXGetScreenSize, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_PanoramiXGetScreenSize;
+ req->window = drawable;
+ req->screen = screen_num; /* need to define */
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return 0;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ panoramiX_info->window = rep.window;
+ panoramiX_info->screen = rep.screen;
+ panoramiX_info->width = rep.width;
+ panoramiX_info->height = rep.height;
+ return 1;
+}
+
+/*******************************************************************\
+ Alternate interface to make up for shortcomings in the original,
+ namely, the omission of the screen origin. The new interface is
+ in the "Xinerama" namespace instead of "PanoramiX".
+\*******************************************************************/
+
+Bool XineramaQueryExtension (
+ Display *dpy,
+ int *event_base,
+ int *error_base
+)
+{
+ return XPanoramiXQueryExtension(dpy, event_base, error_base);
+}
+
+Status XineramaQueryVersion(
+ Display *dpy,
+ int *major,
+ int *minor
+)
+{
+ return XPanoramiXQueryVersion(dpy, major, minor);
+}
+
+Bool XineramaIsActive(Display *dpy)
+{
+ xXineramaIsActiveReply rep;
+ xXineramaIsActiveReq *req;
+ XExtDisplayInfo *info = find_display (dpy);
+
+ if(!XextHasExtension(info))
+ return False; /* server doesn't even have the extension */
+
+ LockDisplay (dpy);
+ GetReq (XineramaIsActive, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_XineramaIsActive;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return False;
+ }
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return rep.state;
+}
+
+#include <stdio.h>
+
+XineramaScreenInfo *
+XineramaQueryScreens(
+ Display *dpy,
+ int *number
+)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xXineramaQueryScreensReply rep;
+ xXineramaQueryScreensReq *req;
+ XineramaScreenInfo *scrnInfo = NULL;
+
+ PanoramiXCheckExtension (dpy, info, 0);
+
+ LockDisplay (dpy);
+ GetReq (XineramaQueryScreens, req);
+ req->reqType = info->codes->major_opcode;
+ req->panoramiXReqType = X_XineramaQueryScreens;
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return NULL;
+ }
+
+ if(rep.number) {
+ if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number))) {
+ xXineramaScreenInfo scratch;
+ CARD32 i;
+
+ for(i = 0; i < rep.number; i++) {
+ _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
+ scrnInfo[i].screen_number = i;
+ scrnInfo[i].x_org = scratch.x_org;
+ scrnInfo[i].y_org = scratch.y_org;
+ scrnInfo[i].width = scratch.width;
+ scrnInfo[i].height = scratch.height;
+ }
+
+ *number = rep.number;
+ } else
+ _XEatData(dpy, rep.length << 2);
+ }
+
+ UnlockDisplay (dpy);
+ SyncHandle ();
+ return scrnInfo;
+}
diff --git a/src/nativewindow/native/x11/Xinerama.h b/src/nativewindow/native/x11/Xinerama.h
new file mode 100644
index 000000000..7177f5131
--- /dev/null
+++ b/src/nativewindow/native/x11/Xinerama.h
@@ -0,0 +1,76 @@
+/*
+Copyright (C) 1994-2001 The XFree86 Project, Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Soft-
+ware"), to deal in the Software without restriction, including without
+limitation the rights to use, copy, modify, merge, publish, distribute,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, provided that the above copyright
+notice(s) and this permission notice appear in all copies of the Soft-
+ware and that both the above copyright notice(s) and this permission
+notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
+MANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization of
+the copyright holder.
+*/
+
+/* $XFree86: xc/include/extensions/Xinerama.h,v 3.2 2000/03/01 01:04:20 dawes Exp $ */
+
+#ifdef __linux__
+
+#ifndef _Xinerama_h
+#define _Xinerama_h
+
+typedef struct {
+ int screen_number;
+ short x_org;
+ short y_org;
+ short width;
+ short height;
+} XineramaScreenInfo;
+
+Bool XineramaQueryExtension (
+ Display *dpy,
+ int *event_base,
+ int *error_base
+);
+
+Status XineramaQueryVersion(
+ Display *dpy,
+ int *major,
+ int *minor
+);
+
+Bool XineramaIsActive(Display *dpy);
+
+
+/*
+ Returns the number of heads and a pointer to an array of
+ structures describing the position and size of the individual
+ heads. Returns NULL and number = 0 if Xinerama is not active.
+
+ Returned array should be freed with XFree().
+*/
+
+XineramaScreenInfo *
+XineramaQueryScreens(
+ Display *dpy,
+ int *number
+);
+
+#endif /* _Xinerama_h */
+
+#endif /* __linux__ */
diff --git a/src/nativewindow/native/x11/XineramaHelper.c b/src/nativewindow/native/x11/XineramaHelper.c
new file mode 100644
index 000000000..09ad0b706
--- /dev/null
+++ b/src/nativewindow/native/x11/XineramaHelper.c
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ */
+
+/* This file contains a helper routine to be called by Java code to
+ determine whether the Xinerama extension is in use and therefore to
+ treat the multiple AWT screens as one large screen. */
+
+#include <inttypes.h>
+#include <X11/Xlib.h>
+
+#ifdef __sun
+
+typedef Status XineramaGetInfoFunc(Display* display, int screen_number,
+ XRectangle* framebuffer_rects, unsigned char* framebuffer_hints,
+ int* num_framebuffers);
+typedef Status XineramaGetCenterHintFunc(Display* display, int screen_number,
+ int* x, int* y);
+
+XineramaGetCenterHintFunc* XineramaSolarisCenterFunc = NULL;
+#include <dlfcn.h>
+
+#elif defined(__linux__)
+
+#include "Xinerama.h"
+
+#endif
+
+Bool XineramaEnabled(Display* display) {
+#ifdef __sun
+
+#define MAXFRAMEBUFFERS 16
+ char* XinExtName = "XINERAMA";
+ int32_t major_opcode, first_event, first_error;
+ Bool gotXinExt = False;
+ void* libHandle = 0;
+ unsigned char fbhints[MAXFRAMEBUFFERS];
+ XRectangle fbrects[MAXFRAMEBUFFERS];
+ int locNumScr = 0;
+ Bool usingXinerama = False;
+
+ char* XineramaLibName= "libXext.so";
+ char* XineramaGetInfoName = "XineramaGetInfo";
+ char* XineramaGetCenterHintName = "XineramaGetCenterHint";
+ XineramaGetInfoFunc* XineramaSolarisFunc = NULL;
+
+ gotXinExt = XQueryExtension(display, XinExtName, &major_opcode,
+ &first_event, &first_error);
+
+ if (gotXinExt) {
+ /* load library, load and run XineramaGetInfo */
+ libHandle = dlopen(XineramaLibName, RTLD_LAZY | RTLD_GLOBAL);
+ if (libHandle != 0) {
+ XineramaSolarisFunc = (XineramaGetInfoFunc*)dlsym(libHandle, XineramaGetInfoName);
+ XineramaSolarisCenterFunc =
+ (XineramaGetCenterHintFunc*)dlsym(libHandle,
+ XineramaGetCenterHintName);
+ if (XineramaSolarisFunc != NULL) {
+ if ((*XineramaSolarisFunc)(display, 0, &fbrects[0],
+ &fbhints[0], &locNumScr) != 0) {
+
+ usingXinerama = True;
+ }
+ }
+ dlclose(libHandle);
+ }
+ }
+ return usingXinerama;
+
+#elif defined(__linux__)
+
+ char* XinExtName = "XINERAMA";
+ int32_t major_opcode, first_event, first_error;
+ Bool gotXinExt = False;
+ int32_t locNumScr = 0;
+
+ XineramaScreenInfo *xinInfo;
+
+ gotXinExt = XQueryExtension(display, XinExtName, &major_opcode,
+ &first_event, &first_error);
+
+ if (gotXinExt) {
+ xinInfo = XineramaQueryScreens(display, &locNumScr);
+ if (xinInfo != NULL) {
+ return True;
+ }
+ }
+ return False;
+
+#else
+ return False;
+#endif
+}
diff --git a/src/nativewindow/native/x11/extutil.h b/src/nativewindow/native/x11/extutil.h
new file mode 100644
index 000000000..f0d3b59c3
--- /dev/null
+++ b/src/nativewindow/native/x11/extutil.h
@@ -0,0 +1,222 @@
+/*
+ * $Xorg: extutil.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $
+ *
+Copyright 1989, 1998 The Open Group
+
+All Rights Reserved.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+ *
+ * Author: Jim Fulton, MIT The Open Group
+ *
+ * Xlib Extension-Writing Utilities
+ *
+ * This package contains utilities for writing the client API for various
+ * protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
+ * ARE SUBJECT TO CHANGE!
+ */
+/* $XFree86: xc/include/extensions/extutil.h,v 1.5 2001/01/17 17:53:20 dawes Exp $ */
+
+#ifdef __linux__
+
+#ifndef _EXTUTIL_H_
+#define _EXTUTIL_H_
+
+/*
+ * We need to keep a list of open displays since the Xlib display list isn't
+ * public. We also have to per-display info in a separate block since it isn't
+ * stored directly in the Display structure.
+ */
+typedef struct _XExtDisplayInfo {
+ struct _XExtDisplayInfo *next; /* keep a linked list */
+ Display *display; /* which display this is */
+ XExtCodes *codes; /* the extension protocol codes */
+ XPointer data; /* extra data for extension to use */
+} XExtDisplayInfo;
+
+typedef struct _XExtensionInfo {
+ XExtDisplayInfo *head; /* start of list */
+ XExtDisplayInfo *cur; /* most recently used */
+ int ndisplays; /* number of displays */
+} XExtensionInfo;
+
+typedef struct _XExtensionHooks {
+ int (*create_gc)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+#endif
+);
+ int (*copy_gc)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+#endif
+);
+ int (*flush_gc)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+#endif
+);
+ int (*free_gc)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ GC /* gc */,
+ XExtCodes* /* codes */
+#endif
+);
+ int (*create_font)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+#endif
+);
+ int (*free_font)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ XFontStruct* /* fs */,
+ XExtCodes* /* codes */
+#endif
+);
+ int (*close_display)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ XExtCodes* /* codes */
+#endif
+);
+ Bool (*wire_to_event)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+#endif
+);
+ Status (*event_to_wire)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ XEvent* /* re */,
+ xEvent* /* event */
+#endif
+);
+ int (*error)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ xError* /* err */,
+ XExtCodes* /* codes */,
+ int* /* ret_code */
+#endif
+);
+ char *(*error_string)(
+#if NeedNestedPrototypes
+ Display* /* display */,
+ int /* code */,
+ XExtCodes* /* codes */,
+ char* /* buffer */,
+ int /* nbytes */
+#endif
+);
+} XExtensionHooks;
+
+extern XExtensionInfo *XextCreateExtension(
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+extern void XextDestroyExtension(
+#if NeedFunctionPrototypes
+ XExtensionInfo* /* info */
+#endif
+);
+extern XExtDisplayInfo *XextAddDisplay(
+#if NeedFunctionPrototypes
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */,
+ char* /* ext_name */,
+ XExtensionHooks* /* hooks */,
+ int /* nevents */,
+ XPointer /* data */
+#endif
+);
+extern int XextRemoveDisplay(
+#if NeedFunctionPrototypes
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */
+#endif
+);
+extern XExtDisplayInfo *XextFindDisplay(
+#if NeedFunctionPrototypes
+ XExtensionInfo* /* extinfo */,
+ Display* /* dpy */
+#endif
+);
+
+#define XextHasExtension(i) ((i) && ((i)->codes))
+#define XextCheckExtension(dpy,i,name,val) \
+ if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return val; }
+#define XextSimpleCheckExtension(dpy,i,name) \
+ if (!XextHasExtension(i)) { XMissingExtension (dpy, name); return; }
+
+
+/*
+ * helper macros to generate code that is common to all extensions; caller
+ * should prefix it with static if extension source is in one file; this
+ * could be a utility function, but have to stack 6 unused arguments for
+ * something that is called many, many times would be bad.
+ */
+#define XEXT_GENERATE_FIND_DISPLAY(proc,extinfo,extname,hooks,nev,data) \
+XExtDisplayInfo *proc (Display *dpy) \
+{ \
+ XExtDisplayInfo *dpyinfo; \
+ if (!extinfo) { if (!(extinfo = XextCreateExtension())) return NULL; } \
+ if (!(dpyinfo = XextFindDisplay (extinfo, dpy))) \
+ dpyinfo = XextAddDisplay (extinfo,dpy,extname,hooks,nev,data); \
+ return dpyinfo; \
+}
+
+#define XEXT_FIND_DISPLAY_PROTO(proc) \
+ XExtDisplayInfo *proc(Display *dpy)
+
+#define XEXT_GENERATE_CLOSE_DISPLAY(proc,extinfo) \
+int proc (Display *dpy, XExtCodes *codes) \
+{ \
+ return XextRemoveDisplay (extinfo, dpy); \
+}
+
+#define XEXT_CLOSE_DISPLAY_PROTO(proc) \
+ int proc(Display *dpy, XExtCodes *codes)
+
+#define XEXT_GENERATE_ERROR_STRING(proc,extname,nerr,errl) \
+char *proc (Display *dpy, int code, XExtCodes *codes, char *buf, int n) \
+{ \
+ code -= codes->first_error; \
+ if (code >= 0 && code < nerr) { \
+ char tmp[256]; \
+ sprintf (tmp, "%s.%d", extname, code); \
+ XGetErrorDatabaseText (dpy, "XProtoError", tmp, errl[code], buf, n); \
+ return buf; \
+ } \
+ return (char *)0; \
+}
+
+#define XEXT_ERROR_STRING_PROTO(proc) \
+ char *proc(Display *dpy, int code, XExtCodes *codes, char *buf, int n)
+#endif
+
+#endif /* __linux__ */
diff --git a/src/nativewindow/native/x11/panoramiXext.h b/src/nativewindow/native/x11/panoramiXext.h
new file mode 100644
index 000000000..11267d0c1
--- /dev/null
+++ b/src/nativewindow/native/x11/panoramiXext.h
@@ -0,0 +1,54 @@
+/* $Xorg: panoramiXext.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */
+/*****************************************************************
+Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+******************************************************************/
+/*
+ * PanoramiX definitions
+ */
+/* $XFree86: xc/include/extensions/panoramiXext.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */
+
+#ifdef __linux__
+
+/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
+
+#define PANORAMIX_MAJOR_VERSION 1 /* current version number */
+#define PANORAMIX_MINOR_VERSION 1
+
+typedef struct {
+ Window window; /* PanoramiX window - may not exist */
+ int screen;
+ int State; /* PanroamiXOff, PanoramiXOn */
+ int width; /* width of this screen */
+ int height; /* height of this screen */
+ int ScreenCount; /* real physical number of screens */
+ XID eventMask; /* selected events for this client */
+} XPanoramiXInfo;
+
+extern XPanoramiXInfo *XPanoramiXAllocInfo (
+#if NeedFunctionPrototypes
+ void
+#endif
+);
+
+#endif /* __linux__*/
diff --git a/src/nativewindow/native/x11/panoramiXproto.h b/src/nativewindow/native/x11/panoramiXproto.h
new file mode 100644
index 000000000..1a66940f7
--- /dev/null
+++ b/src/nativewindow/native/x11/panoramiXproto.h
@@ -0,0 +1,196 @@
+/* $Xorg: panoramiXproto.h,v 1.4 2000/08/18 04:05:45 coskrey Exp $ */
+/*****************************************************************
+Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+******************************************************************/
+/* $XFree86: xc/include/extensions/panoramiXproto.h,v 3.6 2001/01/17 17:53:22 dawes Exp $ */
+
+#ifdef __linux__
+
+/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
+
+#ifndef _PANORAMIXPROTO_H_
+#define _PANORAMIXPROTO_H_
+
+#define PANORAMIX_PROTOCOL_NAME "XINERAMA"
+
+#define X_PanoramiXQueryVersion 0
+#define X_PanoramiXGetState 1
+#define X_PanoramiXGetScreenCount 2
+#define X_PanoramiXGetScreenSize 3
+
+#define X_XineramaIsActive 4
+#define X_XineramaQueryScreens 5
+
+typedef struct _PanoramiXQueryVersion {
+ CARD8 reqType; /* always PanoramiXReqCode */
+ CARD8 panoramiXReqType; /* always X_PanoramiXQueryVersion */
+ CARD16 length B16;
+ CARD8 clientMajor;
+ CARD8 clientMinor;
+ CARD16 unused B16;
+} xPanoramiXQueryVersionReq;
+
+#define sz_xPanoramiXQueryVersionReq 8
+
+typedef struct {
+ CARD8 type; /* must be X_Reply */
+ CARD8 pad1; /* unused */
+ CARD16 sequenceNumber B16; /* last sequence number */
+ CARD32 length B32; /* 0 */
+ CARD16 majorVersion B16;
+ CARD16 minorVersion B16;
+ CARD32 pad2 B32; /* unused */
+ CARD32 pad3 B32; /* unused */
+ CARD32 pad4 B32; /* unused */
+ CARD32 pad5 B32; /* unused */
+ CARD32 pad6 B32; /* unused */
+} xPanoramiXQueryVersionReply;
+
+#define sz_xPanoramiXQueryVersionReply 32
+
+
+typedef struct _PanoramiXGetState {
+ CARD8 reqType; /* always PanoramiXReqCode */
+ CARD8 panoramiXReqType; /* always X_PanoramiXGetState */
+ CARD16 length B16;
+ CARD32 window B32;
+} xPanoramiXGetStateReq;
+#define sz_xPanoramiXGetStateReq 8
+
+typedef struct {
+ BYTE type;
+ BYTE state;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 window B32;
+ CARD32 pad1 B32; /* unused */
+ CARD32 pad2 B32; /* unused */
+ CARD32 pad3 B32; /* unused */
+ CARD32 pad4 B32; /* unused */
+ CARD32 pad5 B32; /* unused */
+} xPanoramiXGetStateReply;
+
+#define sz_panoramiXGetStateReply 32
+
+typedef struct _PanoramiXGetScreenCount {
+ CARD8 reqType; /* always PanoramiXReqCode */
+ CARD8 panoramiXReqType; /* always X_PanoramiXGetScreenCount */
+ CARD16 length B16;
+ CARD32 window B32;
+} xPanoramiXGetScreenCountReq;
+#define sz_xPanoramiXGetScreenCountReq 8
+
+typedef struct {
+ BYTE type;
+ BYTE ScreenCount;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 window B32;
+ CARD32 pad1 B32; /* unused */
+ CARD32 pad2 B32; /* unused */
+ CARD32 pad3 B32; /* unused */
+ CARD32 pad4 B32; /* unused */
+ CARD32 pad5 B32; /* unused */
+} xPanoramiXGetScreenCountReply;
+#define sz_panoramiXGetScreenCountReply 32
+
+typedef struct _PanoramiXGetScreenSize {
+ CARD8 reqType; /* always PanoramiXReqCode */
+ CARD8 panoramiXReqType; /* always X_PanoramiXGetState */
+ CARD16 length B16;
+ CARD32 window B32;
+ CARD32 screen B32;
+} xPanoramiXGetScreenSizeReq;
+#define sz_xPanoramiXGetScreenSizeReq 12
+
+typedef struct {
+ BYTE type;
+ CARD8 pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 width B32;
+ CARD32 height B32;
+ CARD32 window B32;
+ CARD32 screen B32;
+ CARD32 pad2 B32; /* unused */
+ CARD32 pad3 B32; /* unused */
+} xPanoramiXGetScreenSizeReply;
+#define sz_panoramiXGetScreenSizeReply 32
+
+/************ Alternate protocol ******************/
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 panoramiXReqType;
+ CARD16 length B16;
+} xXineramaIsActiveReq;
+#define sz_xXineramaIsActiveReq 4
+
+typedef struct {
+ BYTE type;
+ CARD8 pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 state B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXineramaIsActiveReply;
+#define sz_XineramaIsActiveReply 32
+
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 panoramiXReqType;
+ CARD16 length B16;
+} xXineramaQueryScreensReq;
+#define sz_xXineramaQueryScreensReq 4
+
+typedef struct {
+ BYTE type;
+ CARD8 pad1;
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 number B32;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xXineramaQueryScreensReply;
+#define sz_XineramaQueryScreensReply 32
+
+typedef struct {
+ INT16 x_org B16;
+ INT16 y_org B16;
+ CARD16 width B16;
+ CARD16 height B16;
+} xXineramaScreenInfo;
+#define sz_XineramaScreenInfo 8
+
+#endif
+
+#endif /* __linux__ */
diff --git a/src/newt/classes/com/sun/javafx/newt/Display.java b/src/newt/classes/com/sun/javafx/newt/Display.java
new file mode 100755
index 000000000..b5d3c8520
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/Display.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+import javax.media.nativewindow.*;
+
+public abstract class Display {
+
+ private static Class getDisplayClass(String type)
+ throws ClassNotFoundException
+ {
+ Class displayClass = null;
+ if (NativeWindowFactory.TYPE_EGL.equals(type)) {
+ displayClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDDisplay");
+ } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
+ displayClass = Class.forName("com.sun.javafx.newt.windows.WindowsDisplay");
+ } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+ displayClass = Class.forName("com.sun.javafx.newt.macosx.MacDisplay");
+ } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
+ displayClass = Class.forName("com.sun.javafx.newt.x11.X11Display");
+ } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
+ displayClass = Class.forName("com.sun.javafx.newt.awt.AWTDisplay");
+ } else {
+ throw new RuntimeException("Unknown display type \"" + type + "\"");
+ }
+ return displayClass;
+ }
+
+ protected static Display create(String type, String name) {
+ try {
+ Class displayClass = getDisplayClass(type);
+ Display display = (Display) displayClass.newInstance();
+ display.name=name;
+ display.createNative();
+ if(null==display.aDevice) {
+ throw new RuntimeException("Display.createNative() failed to instanciate an AbstractGraphicsDevice");
+ }
+ return display;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public synchronized void destroy() {
+ closeNative();
+ }
+
+ protected static Display wrapHandle(String type, String name, AbstractGraphicsDevice aDevice) {
+ try {
+ Class displayClass = getDisplayClass(type);
+ Display display = (Display) displayClass.newInstance();
+ display.name=name;
+ display.aDevice=aDevice;
+ return display;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected abstract void createNative();
+ protected abstract void closeNative();
+
+ public String getName() {
+ return name;
+ }
+
+ public long getHandle() {
+ return aDevice.getHandle();
+ }
+
+ public AbstractGraphicsDevice getGraphicsDevice() {
+ return aDevice;
+ }
+
+ protected String name;
+ protected AbstractGraphicsDevice aDevice;
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/Event.java b/src/newt/classes/com/sun/javafx/newt/Event.java
new file mode 100644
index 000000000..7d2b24ba5
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/Event.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public class Event {
+ private boolean isSystemEvent;
+ private int eventType;
+ private Window source;
+ private long when;
+
+ Event(boolean isSystemEvent, int eventType, Window source, long when) {
+ this.isSystemEvent = isSystemEvent;
+ this.eventType = eventType;
+ this.source = source;
+ this.when = when;
+ }
+
+ protected Event(int eventType, Window source, long when) {
+ this(false, eventType, source, when);
+ }
+
+ /** Indicates whether this event was produced by the system or
+ generated by user code. */
+ public final boolean isSystemEvent() {
+ return isSystemEvent;
+ }
+
+ /** Returns the event type of this event. */
+ public final int getEventType() {
+ return eventType;
+ }
+
+ /** Returns the source Window which produced this Event. */
+ public final Window getSource() {
+ return source;
+ }
+
+ /** Returns the timestamp, in milliseconds, of this event. */
+ public final long getWhen() {
+ return when;
+ }
+
+ public String toString() {
+ return "Event[sys:"+isSystemEvent()+", source:"+getSource()+", when:"+getWhen()+"]";
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/EventListener.java b/src/newt/classes/com/sun/javafx/newt/EventListener.java
new file mode 100644
index 000000000..2af63bd7c
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/EventListener.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public interface EventListener
+{
+ public static final int WINDOW = 1 << 0;
+ public static final int MOUSE = 1 << 1;
+ public static final int KEY = 1 << 2;
+
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/InputEvent.java b/src/newt/classes/com/sun/javafx/newt/InputEvent.java
new file mode 100644
index 000000000..b49c72e75
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/InputEvent.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public abstract class InputEvent extends Event
+{
+ public static final int SHIFT_MASK = 1 << 0;
+ public static final int CTRL_MASK = 1 << 1;
+ public static final int META_MASK = 1 << 2;
+ public static final int ALT_MASK = 1 << 3;
+ public static final int ALT_GRAPH_MASK = 1 << 5;
+ public static final int BUTTON1_MASK = 1 << 6;
+ public static final int BUTTON2_MASK = 1 << 7;
+ public static final int BUTTON3_MASK = 1 << 8;
+
+ protected InputEvent(boolean sysEvent, int eventType, Window source, long when, int modifiers) {
+ super(sysEvent, eventType, source, when);
+ this.consumed=false;
+ this.modifiers=modifiers;
+ }
+
+ public void consume() {
+ consumed=true;
+ }
+
+ public boolean isConsumed() {
+ return consumed;
+ }
+ public int getModifiers() {
+ return modifiers;
+ }
+ public boolean isAltDown() {
+ return (modifiers&ALT_MASK)!=0;
+ }
+ public boolean isAltGraphDown() {
+ return (modifiers&ALT_GRAPH_MASK)!=0;
+ }
+ public boolean isControlDown() {
+ return (modifiers&CTRL_MASK)!=0;
+ }
+ public boolean isMetaDown() {
+ return (modifiers&META_MASK)!=0;
+ }
+ public boolean isShiftDown() {
+ return (modifiers&SHIFT_MASK)!=0;
+ }
+
+ public boolean isButton1Down() {
+ return (modifiers&BUTTON1_MASK)!=0;
+ }
+
+ public boolean isButton2Down() {
+ return (modifiers&BUTTON2_MASK)!=0;
+ }
+
+ public boolean isButton3Down() {
+ return (modifiers&BUTTON3_MASK)!=0;
+ }
+
+ public String toString() {
+ return "InputEvent[modifiers:"+modifiers+"]";
+ }
+
+ private boolean consumed;
+ private int modifiers;
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/KeyEvent.java b/src/newt/classes/com/sun/javafx/newt/KeyEvent.java
new file mode 100644
index 000000000..7e224dbad
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/KeyEvent.java
@@ -0,0 +1,738 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public class KeyEvent extends InputEvent
+{
+ KeyEvent(boolean sysEvent, int eventType, Window source, long when, int modifiers, int keyCode, char keyChar) {
+ super(sysEvent, eventType, source, when, modifiers);
+ this.keyCode=keyCode;
+ this.keyChar=keyChar;
+ }
+ public KeyEvent(int eventType, Window source, long when, int modifiers, int keyCode, char keyChar) {
+ this(false, eventType, source, when, modifiers, keyCode, keyChar);
+ }
+
+ public char getKeyChar() {
+ return keyChar;
+ }
+ public int getKeyCode() {
+ return keyCode;
+ }
+
+ public String toString() {
+ return "KeyEvent["+getEventTypeString(getEventType())+
+ ", code "+keyCode+"(0x"+Integer.toHexString(keyCode)+"), char <"+keyChar+"> (0x"+Integer.toHexString((int)keyChar)+"), isActionKey "+isActionKey()+", "+super.toString()+"]";
+ }
+
+ public static String getEventTypeString(int type) {
+ switch(type) {
+ case EVENT_KEY_PRESSED: return "EVENT_KEY_PRESSED";
+ case EVENT_KEY_RELEASED: return "EVENT_KEY_RELEASED";
+ case EVENT_KEY_TYPED: return "EVENT_KEY_TYPED";
+ default: return "unknown (" + type + ")";
+ }
+ }
+
+ public boolean isActionKey() {
+ switch (keyCode) {
+ case VK_HOME:
+ case VK_END:
+ case VK_PAGE_UP:
+ case VK_PAGE_DOWN:
+ case VK_UP:
+ case VK_DOWN:
+ case VK_LEFT:
+ case VK_RIGHT:
+
+ case VK_F1:
+ case VK_F2:
+ case VK_F3:
+ case VK_F4:
+ case VK_F5:
+ case VK_F6:
+ case VK_F7:
+ case VK_F8:
+ case VK_F9:
+ case VK_F10:
+ case VK_F11:
+ case VK_F12:
+ case VK_F13:
+ case VK_F14:
+ case VK_F15:
+ case VK_F16:
+ case VK_F17:
+ case VK_F18:
+ case VK_F19:
+ case VK_F20:
+ case VK_F21:
+ case VK_F22:
+ case VK_F23:
+ case VK_F24:
+ case VK_PRINTSCREEN:
+ case VK_CAPS_LOCK:
+ case VK_PAUSE:
+ case VK_INSERT:
+
+ case VK_HELP:
+ case VK_WINDOWS:
+ return true;
+ }
+ return false;
+ }
+
+ private int keyCode;
+ private char keyChar;
+
+ public static final int EVENT_KEY_PRESSED = 300;
+ public static final int EVENT_KEY_RELEASED= 301;
+ public static final int EVENT_KEY_TYPED = 302;
+
+ /* Virtual key codes. */
+
+ public static final int VK_ENTER = '\n';
+ public static final int VK_BACK_SPACE = '\b';
+ public static final int VK_TAB = '\t';
+ public static final int VK_CANCEL = 0x03;
+ public static final int VK_CLEAR = 0x0C;
+ public static final int VK_SHIFT = 0x10;
+ public static final int VK_CONTROL = 0x11;
+ public static final int VK_ALT = 0x12;
+ public static final int VK_PAUSE = 0x13;
+ public static final int VK_CAPS_LOCK = 0x14;
+ public static final int VK_ESCAPE = 0x1B;
+ public static final int VK_SPACE = 0x20;
+ public static final int VK_PAGE_UP = 0x21;
+ public static final int VK_PAGE_DOWN = 0x22;
+ public static final int VK_END = 0x23;
+ public static final int VK_HOME = 0x24;
+
+ /**
+ * Constant for the non-numpad <b>left</b> arrow key.
+ * @see #VK_KP_LEFT
+ */
+ public static final int VK_LEFT = 0x25;
+
+ /**
+ * Constant for the non-numpad <b>up</b> arrow key.
+ * @see #VK_KP_UP
+ */
+ public static final int VK_UP = 0x26;
+
+ /**
+ * Constant for the non-numpad <b>right</b> arrow key.
+ * @see #VK_KP_RIGHT
+ */
+ public static final int VK_RIGHT = 0x27;
+
+ /**
+ * Constant for the non-numpad <b>down</b> arrow key.
+ * @see #VK_KP_DOWN
+ */
+ public static final int VK_DOWN = 0x28;
+
+ /**
+ * Constant for the comma key, ","
+ */
+ public static final int VK_COMMA = 0x2C;
+
+ /**
+ * Constant for the minus key, "-"
+ * @since 1.2
+ */
+ public static final int VK_MINUS = 0x2D;
+
+ /**
+ * Constant for the period key, "."
+ */
+ public static final int VK_PERIOD = 0x2E;
+
+ /**
+ * Constant for the forward slash key, "/"
+ */
+ public static final int VK_SLASH = 0x2F;
+
+ /** VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
+ public static final int VK_0 = 0x30;
+ public static final int VK_1 = 0x31;
+ public static final int VK_2 = 0x32;
+ public static final int VK_3 = 0x33;
+ public static final int VK_4 = 0x34;
+ public static final int VK_5 = 0x35;
+ public static final int VK_6 = 0x36;
+ public static final int VK_7 = 0x37;
+ public static final int VK_8 = 0x38;
+ public static final int VK_9 = 0x39;
+
+ /**
+ * Constant for the semicolon key, ";"
+ */
+ public static final int VK_SEMICOLON = 0x3B;
+
+ /**
+ * Constant for the equals key, "="
+ */
+ public static final int VK_EQUALS = 0x3D;
+
+ /** VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
+ public static final int VK_A = 0x41;
+ public static final int VK_B = 0x42;
+ public static final int VK_C = 0x43;
+ public static final int VK_D = 0x44;
+ public static final int VK_E = 0x45;
+ public static final int VK_F = 0x46;
+ public static final int VK_G = 0x47;
+ public static final int VK_H = 0x48;
+ public static final int VK_I = 0x49;
+ public static final int VK_J = 0x4A;
+ public static final int VK_K = 0x4B;
+ public static final int VK_L = 0x4C;
+ public static final int VK_M = 0x4D;
+ public static final int VK_N = 0x4E;
+ public static final int VK_O = 0x4F;
+ public static final int VK_P = 0x50;
+ public static final int VK_Q = 0x51;
+ public static final int VK_R = 0x52;
+ public static final int VK_S = 0x53;
+ public static final int VK_T = 0x54;
+ public static final int VK_U = 0x55;
+ public static final int VK_V = 0x56;
+ public static final int VK_W = 0x57;
+ public static final int VK_X = 0x58;
+ public static final int VK_Y = 0x59;
+ public static final int VK_Z = 0x5A;
+
+ /**
+ * Constant for the open bracket key, "["
+ */
+ public static final int VK_OPEN_BRACKET = 0x5B;
+
+ /**
+ * Constant for the back slash key, "\"
+ */
+ public static final int VK_BACK_SLASH = 0x5C;
+
+ /**
+ * Constant for the close bracket key, "]"
+ */
+ public static final int VK_CLOSE_BRACKET = 0x5D;
+
+ public static final int VK_NUMPAD0 = 0x60;
+ public static final int VK_NUMPAD1 = 0x61;
+ public static final int VK_NUMPAD2 = 0x62;
+ public static final int VK_NUMPAD3 = 0x63;
+ public static final int VK_NUMPAD4 = 0x64;
+ public static final int VK_NUMPAD5 = 0x65;
+ public static final int VK_NUMPAD6 = 0x66;
+ public static final int VK_NUMPAD7 = 0x67;
+ public static final int VK_NUMPAD8 = 0x68;
+ public static final int VK_NUMPAD9 = 0x69;
+ public static final int VK_MULTIPLY = 0x6A;
+ public static final int VK_ADD = 0x6B;
+
+ /**
+ * This constant is obsolete, and is included only for backwards
+ * compatibility.
+ * @see #VK_SEPARATOR
+ */
+ public static final int VK_SEPARATER = 0x6C;
+
+ /**
+ * Constant for the Numpad Separator key.
+ * @since 1.4
+ */
+ public static final int VK_SEPARATOR = VK_SEPARATER;
+
+ public static final int VK_SUBTRACT = 0x6D;
+ public static final int VK_DECIMAL = 0x6E;
+ public static final int VK_DIVIDE = 0x6F;
+ public static final int VK_DELETE = 0x7F; /* ASCII DEL */
+ public static final int VK_NUM_LOCK = 0x90;
+ public static final int VK_SCROLL_LOCK = 0x91;
+
+ /** Constant for the F1 function key. */
+ public static final int VK_F1 = 0x70;
+
+ /** Constant for the F2 function key. */
+ public static final int VK_F2 = 0x71;
+
+ /** Constant for the F3 function key. */
+ public static final int VK_F3 = 0x72;
+
+ /** Constant for the F4 function key. */
+ public static final int VK_F4 = 0x73;
+
+ /** Constant for the F5 function key. */
+ public static final int VK_F5 = 0x74;
+
+ /** Constant for the F6 function key. */
+ public static final int VK_F6 = 0x75;
+
+ /** Constant for the F7 function key. */
+ public static final int VK_F7 = 0x76;
+
+ /** Constant for the F8 function key. */
+ public static final int VK_F8 = 0x77;
+
+ /** Constant for the F9 function key. */
+ public static final int VK_F9 = 0x78;
+
+ /** Constant for the F10 function key. */
+ public static final int VK_F10 = 0x79;
+
+ /** Constant for the F11 function key. */
+ public static final int VK_F11 = 0x7A;
+
+ /** Constant for the F12 function key. */
+ public static final int VK_F12 = 0x7B;
+
+ /**
+ * Constant for the F13 function key.
+ * @since 1.2
+ */
+ /* F13 - F24 are used on IBM 3270 keyboard; use random range for constants. */
+ public static final int VK_F13 = 0xF000;
+
+ /**
+ * Constant for the F14 function key.
+ * @since 1.2
+ */
+ public static final int VK_F14 = 0xF001;
+
+ /**
+ * Constant for the F15 function key.
+ * @since 1.2
+ */
+ public static final int VK_F15 = 0xF002;
+
+ /**
+ * Constant for the F16 function key.
+ * @since 1.2
+ */
+ public static final int VK_F16 = 0xF003;
+
+ /**
+ * Constant for the F17 function key.
+ * @since 1.2
+ */
+ public static final int VK_F17 = 0xF004;
+
+ /**
+ * Constant for the F18 function key.
+ * @since 1.2
+ */
+ public static final int VK_F18 = 0xF005;
+
+ /**
+ * Constant for the F19 function key.
+ * @since 1.2
+ */
+ public static final int VK_F19 = 0xF006;
+
+ /**
+ * Constant for the F20 function key.
+ * @since 1.2
+ */
+ public static final int VK_F20 = 0xF007;
+
+ /**
+ * Constant for the F21 function key.
+ * @since 1.2
+ */
+ public static final int VK_F21 = 0xF008;
+
+ /**
+ * Constant for the F22 function key.
+ * @since 1.2
+ */
+ public static final int VK_F22 = 0xF009;
+
+ /**
+ * Constant for the F23 function key.
+ * @since 1.2
+ */
+ public static final int VK_F23 = 0xF00A;
+
+ /**
+ * Constant for the F24 function key.
+ * @since 1.2
+ */
+ public static final int VK_F24 = 0xF00B;
+
+ public static final int VK_PRINTSCREEN = 0x9A;
+ public static final int VK_INSERT = 0x9B;
+ public static final int VK_HELP = 0x9C;
+ public static final int VK_META = 0x9D;
+
+ public static final int VK_BACK_QUOTE = 0xC0;
+ public static final int VK_QUOTE = 0xDE;
+
+ /**
+ * Constant for the numeric keypad <b>up</b> arrow key.
+ * @see #VK_UP
+ * @since 1.2
+ */
+ public static final int VK_KP_UP = 0xE0;
+
+ /**
+ * Constant for the numeric keypad <b>down</b> arrow key.
+ * @see #VK_DOWN
+ * @since 1.2
+ */
+ public static final int VK_KP_DOWN = 0xE1;
+
+ /**
+ * Constant for the numeric keypad <b>left</b> arrow key.
+ * @see #VK_LEFT
+ * @since 1.2
+ */
+ public static final int VK_KP_LEFT = 0xE2;
+
+ /**
+ * Constant for the numeric keypad <b>right</b> arrow key.
+ * @see #VK_RIGHT
+ * @since 1.2
+ */
+ public static final int VK_KP_RIGHT = 0xE3;
+
+ /* For European keyboards */
+ /** @since 1.2 */
+ public static final int VK_DEAD_GRAVE = 0x80;
+ /** @since 1.2 */
+ public static final int VK_DEAD_ACUTE = 0x81;
+ /** @since 1.2 */
+ public static final int VK_DEAD_CIRCUMFLEX = 0x82;
+ /** @since 1.2 */
+ public static final int VK_DEAD_TILDE = 0x83;
+ /** @since 1.2 */
+ public static final int VK_DEAD_MACRON = 0x84;
+ /** @since 1.2 */
+ public static final int VK_DEAD_BREVE = 0x85;
+ /** @since 1.2 */
+ public static final int VK_DEAD_ABOVEDOT = 0x86;
+ /** @since 1.2 */
+ public static final int VK_DEAD_DIAERESIS = 0x87;
+ /** @since 1.2 */
+ public static final int VK_DEAD_ABOVERING = 0x88;
+ /** @since 1.2 */
+ public static final int VK_DEAD_DOUBLEACUTE = 0x89;
+ /** @since 1.2 */
+ public static final int VK_DEAD_CARON = 0x8a;
+ /** @since 1.2 */
+ public static final int VK_DEAD_CEDILLA = 0x8b;
+ /** @since 1.2 */
+ public static final int VK_DEAD_OGONEK = 0x8c;
+ /** @since 1.2 */
+ public static final int VK_DEAD_IOTA = 0x8d;
+ /** @since 1.2 */
+ public static final int VK_DEAD_VOICED_SOUND = 0x8e;
+ /** @since 1.2 */
+ public static final int VK_DEAD_SEMIVOICED_SOUND = 0x8f;
+
+ /** @since 1.2 */
+ public static final int VK_AMPERSAND = 0x96;
+ /** @since 1.2 */
+ public static final int VK_ASTERISK = 0x97;
+ /** @since 1.2 */
+ public static final int VK_QUOTEDBL = 0x98;
+ /** @since 1.2 */
+ public static final int VK_LESS = 0x99;
+
+ /** @since 1.2 */
+ public static final int VK_GREATER = 0xa0;
+ /** @since 1.2 */
+ public static final int VK_BRACELEFT = 0xa1;
+ /** @since 1.2 */
+ public static final int VK_BRACERIGHT = 0xa2;
+
+ /**
+ * Constant for the "@" key.
+ * @since 1.2
+ */
+ public static final int VK_AT = 0x0200;
+
+ /**
+ * Constant for the ":" key.
+ * @since 1.2
+ */
+ public static final int VK_COLON = 0x0201;
+
+ /**
+ * Constant for the "^" key.
+ * @since 1.2
+ */
+ public static final int VK_CIRCUMFLEX = 0x0202;
+
+ /**
+ * Constant for the "$" key.
+ * @since 1.2
+ */
+ public static final int VK_DOLLAR = 0x0203;
+
+ /**
+ * Constant for the Euro currency sign key.
+ * @since 1.2
+ */
+ public static final int VK_EURO_SIGN = 0x0204;
+
+ /**
+ * Constant for the "!" key.
+ * @since 1.2
+ */
+ public static final int VK_EXCLAMATION_MARK = 0x0205;
+
+ /**
+ * Constant for the inverted exclamation mark key.
+ * @since 1.2
+ */
+ public static final int VK_INVERTED_EXCLAMATION_MARK = 0x0206;
+
+ /**
+ * Constant for the "(" key.
+ * @since 1.2
+ */
+ public static final int VK_LEFT_PARENTHESIS = 0x0207;
+
+ /**
+ * Constant for the "#" key.
+ * @since 1.2
+ */
+ public static final int VK_NUMBER_SIGN = 0x0208;
+
+ /**
+ * Constant for the "+" key.
+ * @since 1.2
+ */
+ public static final int VK_PLUS = 0x0209;
+
+ /**
+ * Constant for the ")" key.
+ * @since 1.2
+ */
+ public static final int VK_RIGHT_PARENTHESIS = 0x020A;
+
+ /**
+ * Constant for the "_" key.
+ * @since 1.2
+ */
+ public static final int VK_UNDERSCORE = 0x020B;
+
+ /**
+ * Constant for the Microsoft Windows "Windows" key.
+ * It is used for both the left and right version of the key.
+ * @see #getKeyLocation()
+ * @since 1.5
+ */
+ public static final int VK_WINDOWS = 0x020C;
+
+ /**
+ * Constant for the Microsoft Windows Context Menu key.
+ * @since 1.5
+ */
+ public static final int VK_CONTEXT_MENU = 0x020D;
+
+ /* for input method support on Asian Keyboards */
+
+ /* not clear what this means - listed in Microsoft Windows API */
+ public static final int VK_FINAL = 0x0018;
+
+ /** Constant for the Convert function key. */
+ /* Japanese PC 106 keyboard, Japanese Solaris keyboard: henkan */
+ public static final int VK_CONVERT = 0x001C;
+
+ /** Constant for the Don't Convert function key. */
+ /* Japanese PC 106 keyboard: muhenkan */
+ public static final int VK_NONCONVERT = 0x001D;
+
+ /** Constant for the Accept or Commit function key. */
+ /* Japanese Solaris keyboard: kakutei */
+ public static final int VK_ACCEPT = 0x001E;
+
+ /* not clear what this means - listed in Microsoft Windows API */
+ public static final int VK_MODECHANGE = 0x001F;
+
+ /* replaced by VK_KANA_LOCK for Microsoft Windows and Solaris;
+ might still be used on other platforms */
+ public static final int VK_KANA = 0x0015;
+
+ /* replaced by VK_INPUT_METHOD_ON_OFF for Microsoft Windows and Solaris;
+ might still be used for other platforms */
+ public static final int VK_KANJI = 0x0019;
+
+ /**
+ * Constant for the Alphanumeric function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard: eisuu */
+ public static final int VK_ALPHANUMERIC = 0x00F0;
+
+ /**
+ * Constant for the Katakana function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard: katakana */
+ public static final int VK_KATAKANA = 0x00F1;
+
+ /**
+ * Constant for the Hiragana function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard: hiragana */
+ public static final int VK_HIRAGANA = 0x00F2;
+
+ /**
+ * Constant for the Full-Width Characters function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard: zenkaku */
+ public static final int VK_FULL_WIDTH = 0x00F3;
+
+ /**
+ * Constant for the Half-Width Characters function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard: hankaku */
+ public static final int VK_HALF_WIDTH = 0x00F4;
+
+ /**
+ * Constant for the Roman Characters function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard: roumaji */
+ public static final int VK_ROMAN_CHARACTERS = 0x00F5;
+
+ /**
+ * Constant for the All Candidates function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard - VK_CONVERT + ALT: zenkouho */
+ public static final int VK_ALL_CANDIDATES = 0x0100;
+
+ /**
+ * Constant for the Previous Candidate function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard - VK_CONVERT + SHIFT: maekouho */
+ public static final int VK_PREVIOUS_CANDIDATE = 0x0101;
+
+ /**
+ * Constant for the Code Input function key.
+ * @since 1.2
+ */
+ /* Japanese PC 106 keyboard - VK_ALPHANUMERIC + ALT: kanji bangou */
+ public static final int VK_CODE_INPUT = 0x0102;
+
+ /**
+ * Constant for the Japanese-Katakana function key.
+ * This key switches to a Japanese input method and selects its Katakana input mode.
+ * @since 1.2
+ */
+ /* Japanese Macintosh keyboard - VK_JAPANESE_HIRAGANA + SHIFT */
+ public static final int VK_JAPANESE_KATAKANA = 0x0103;
+
+ /**
+ * Constant for the Japanese-Hiragana function key.
+ * This key switches to a Japanese input method and selects its Hiragana input mode.
+ * @since 1.2
+ */
+ /* Japanese Macintosh keyboard */
+ public static final int VK_JAPANESE_HIRAGANA = 0x0104;
+
+ /**
+ * Constant for the Japanese-Roman function key.
+ * This key switches to a Japanese input method and selects its Roman-Direct input mode.
+ * @since 1.2
+ */
+ /* Japanese Macintosh keyboard */
+ public static final int VK_JAPANESE_ROMAN = 0x0105;
+
+ /**
+ * Constant for the locking Kana function key.
+ * This key locks the keyboard into a Kana layout.
+ * @since 1.3
+ */
+ /* Japanese PC 106 keyboard with special Windows driver - eisuu + Control; Japanese Solaris keyboard: kana */
+ public static final int VK_KANA_LOCK = 0x0106;
+
+ /**
+ * Constant for the input method on/off key.
+ * @since 1.3
+ */
+ /* Japanese PC 106 keyboard: kanji. Japanese Solaris keyboard: nihongo */
+ public static final int VK_INPUT_METHOD_ON_OFF = 0x0107;
+
+ /* for Sun keyboards */
+ /** @since 1.2 */
+ public static final int VK_CUT = 0xFFD1;
+ /** @since 1.2 */
+ public static final int VK_COPY = 0xFFCD;
+ /** @since 1.2 */
+ public static final int VK_PASTE = 0xFFCF;
+ /** @since 1.2 */
+ public static final int VK_UNDO = 0xFFCB;
+ /** @since 1.2 */
+ public static final int VK_AGAIN = 0xFFC9;
+ /** @since 1.2 */
+ public static final int VK_FIND = 0xFFD0;
+ /** @since 1.2 */
+ public static final int VK_PROPS = 0xFFCA;
+ /** @since 1.2 */
+ public static final int VK_STOP = 0xFFC8;
+
+ /**
+ * Constant for the Compose function key.
+ * @since 1.2
+ */
+ public static final int VK_COMPOSE = 0xFF20;
+
+ /**
+ * Constant for the AltGraph function key.
+ * @since 1.2
+ */
+ public static final int VK_ALT_GRAPH = 0xFF7E;
+
+ /**
+ * Constant for the Begin key.
+ * @since 1.5
+ */
+ public static final int VK_BEGIN = 0xFF58;
+
+ /**
+ * This value is used to indicate that the keyCode is unknown.
+ * KEY_TYPED events do not have a keyCode value; this value
+ * is used instead.
+ */
+ public static final int VK_UNDEFINED = 0x0;
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/KeyListener.java b/src/newt/classes/com/sun/javafx/newt/KeyListener.java
new file mode 100644
index 000000000..6f022c45a
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/KeyListener.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public interface KeyListener extends EventListener
+{
+ public void keyPressed(KeyEvent e);
+ public void keyReleased(KeyEvent e);
+ public void keyTyped(KeyEvent e) ;
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/MouseEvent.java b/src/newt/classes/com/sun/javafx/newt/MouseEvent.java
new file mode 100644
index 000000000..ede193e1c
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/MouseEvent.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public class MouseEvent extends InputEvent
+{
+ public static final int BUTTON1 = 1;
+ public static final int BUTTON2 = 2;
+ public static final int BUTTON3 = 3;
+ public static final int BUTTON4 = 4;
+ public static final int BUTTON5 = 5;
+ public static final int BUTTON6 = 6;
+ public static final int BUTTON_NUMBER = 6;
+
+ protected MouseEvent(boolean sysEvent, int eventType, Window source, long when,
+ int modifiers, int x, int y, int clickCount, int button,
+ int rotation)
+ {
+ super(sysEvent, eventType, source, when, modifiers);
+ this.x=x;
+ this.y=y;
+ this.clickCount=clickCount;
+ this.button=button;
+ this.wheelRotation = rotation;
+ }
+ public MouseEvent(int eventType, Window source, long when, int modifiers,
+ int x, int y, int clickCount, int button, int rotation) {
+ this(false, eventType, source, when, modifiers, x, y, clickCount, button,
+ rotation);
+ }
+
+ public int getButton() {
+ return button;
+ }
+ public int getClickCount() {
+ return clickCount;
+ }
+ public int getX() {
+ return x;
+ }
+ public int getY() {
+ return y;
+ }
+ public int getWheelRotation() {
+ return wheelRotation;
+ }
+
+ public String toString() {
+ return "MouseEvent["+getEventTypeString(getEventType())+
+ ", "+x+"/"+y+", button "+button+", count "+clickCount+
+ ", wheel rotation "+wheelRotation+
+ ", "+super.toString()+"]";
+ }
+
+ public static String getEventTypeString(int type) {
+ switch(type) {
+ case EVENT_MOUSE_CLICKED: return "EVENT_MOUSE_CLICKED";
+ case EVENT_MOUSE_ENTERED: return "EVENT_MOUSE_ENTERED";
+ case EVENT_MOUSE_EXITED: return "EVENT_MOUSE_EXITED";
+ case EVENT_MOUSE_PRESSED: return "EVENT_MOUSE_PRESSED";
+ case EVENT_MOUSE_RELEASED: return "EVENT_MOUSE_RELEASED";
+ case EVENT_MOUSE_MOVED: return "EVENT_MOUSE_MOVED";
+ case EVENT_MOUSE_DRAGGED: return "EVENT_MOUSE_DRAGGED";
+ case EVENT_MOUSE_WHEEL_MOVED: return "EVENT_MOUSE_WHEEL_MOVED";
+ default: return "unknown (" + type + ")";
+ }
+ }
+
+ private int x, y, clickCount, button, wheelRotation;
+
+ public static final int EVENT_MOUSE_CLICKED = 200;
+ public static final int EVENT_MOUSE_ENTERED = 201;
+ public static final int EVENT_MOUSE_EXITED = 202;
+ public static final int EVENT_MOUSE_PRESSED = 203;
+ public static final int EVENT_MOUSE_RELEASED = 204;
+ public static final int EVENT_MOUSE_MOVED = 205;
+ public static final int EVENT_MOUSE_DRAGGED = 206;
+ public static final int EVENT_MOUSE_WHEEL_MOVED = 207;
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/MouseListener.java b/src/newt/classes/com/sun/javafx/newt/MouseListener.java
new file mode 100644
index 000000000..3d2031f2a
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/MouseListener.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public interface MouseListener extends EventListener
+{
+ public void mouseClicked(MouseEvent e);
+ public void mouseEntered(MouseEvent e);
+ public void mouseExited(MouseEvent e);
+ public void mousePressed(MouseEvent e);
+ public void mouseReleased(MouseEvent e);
+ public void mouseMoved(MouseEvent e);
+ public void mouseDragged(MouseEvent e);
+ public void mouseWheelMoved(MouseEvent e);
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java b/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
new file mode 100755
index 000000000..c9b230355
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+import javax.media.nativewindow.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public abstract class NewtFactory {
+ // Work-around for initialization order problems on Mac OS X
+ // between native Newt and (apparently) Fmod
+ static {
+ Window.init(NativeWindowFactory.getNativeWindowType(true));
+ }
+
+ static int getPropertyIntValue(String propname) {
+ int i=0;
+ String s = System.getProperty(propname);
+ if(null!=s) {
+ try {
+ i = Integer.valueOf(s).intValue();
+ } catch (NumberFormatException nfe) {}
+ }
+ return i;
+ }
+
+ /**
+ * Create a Display entity, incl native creation
+ */
+ public static Display createDisplay(String name) {
+ return Display.create(NativeWindowFactory.getNativeWindowType(true), name);
+ }
+
+ /**
+ * Create a Display entity using the given implementation type, incl native creation
+ */
+ public static Display createDisplay(String type, String name) {
+ return Display.create(type, name);
+ }
+
+ /**
+ * Create a Screen entity, incl native creation
+ */
+ public static Screen createScreen(Display display, int index) {
+ return Screen.create(NativeWindowFactory.getNativeWindowType(true), display, index);
+ }
+
+ /**
+ * Create a Screen entity using the given implementation type, incl native creation
+ */
+ public static Screen createScreen(String type, Display display, int index) {
+ return Screen.create(type, display, index);
+ }
+
+ /**
+ * Create a Window entity, incl native creation
+ */
+ public static Window createWindow(Screen screen, Capabilities caps) {
+ return Window.create(NativeWindowFactory.getNativeWindowType(true), screen, caps);
+ }
+
+ public static Window createWindow(Screen screen, Capabilities caps, boolean undecorated) {
+ return Window.create(NativeWindowFactory.getNativeWindowType(true), screen, caps, undecorated);
+ }
+
+ /**
+ * Create a Window entity using the given implementation type, incl native creation
+ */
+ public static Window createWindow(String type, Screen screen, Capabilities caps) {
+ return Window.create(type, screen, caps);
+ }
+
+ /**
+ * Instantiate a Display entity using the native handle.
+ */
+ public static Display wrapDisplay(String name, AbstractGraphicsDevice device) {
+ return Display.wrapHandle(NativeWindowFactory.getNativeWindowType(true), name, device);
+ }
+
+ /**
+ * Instantiate a Screen entity using the native handle.
+ */
+ public static Screen wrapScreen(Display display, AbstractGraphicsScreen screen) {
+ return Screen.wrapHandle(NativeWindowFactory.getNativeWindowType(true), display, screen);
+ }
+
+ /**
+ * Instantiate a Window entity using the native handle.
+ */
+ public static Window wrapWindow(Screen screen, AbstractGraphicsConfiguration config,
+ long windowHandle, boolean fullscreen, boolean visible,
+ int x, int y, int width, int height) {
+ return Window.wrapHandle(NativeWindowFactory.getNativeWindowType(true), screen, config,
+ windowHandle, fullscreen, visible, x, y, width, height);
+ }
+
+ private static final boolean instanceOf(Object obj, String clazzName) {
+ Class clazz = obj.getClass();
+ do {
+ if(clazz.getName().equals(clazzName)) {
+ return true;
+ }
+ clazz = clazz.getSuperclass();
+ } while (clazz!=null);
+ return false;
+ }
+
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/Screen.java b/src/newt/classes/com/sun/javafx/newt/Screen.java
new file mode 100755
index 000000000..346257f6c
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/Screen.java
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+import javax.media.nativewindow.*;
+
+public abstract class Screen {
+
+ private static Class getScreenClass(String type)
+ throws ClassNotFoundException
+ {
+ Class screenClass = null;
+ if (NativeWindowFactory.TYPE_EGL.equals(type)) {
+ screenClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDScreen");
+ } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
+ screenClass = Class.forName("com.sun.javafx.newt.windows.WindowsScreen");
+ } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+ screenClass = Class.forName("com.sun.javafx.newt.macosx.MacScreen");
+ } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
+ screenClass = Class.forName("com.sun.javafx.newt.x11.X11Screen");
+ } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
+ screenClass = Class.forName("com.sun.javafx.newt.awt.AWTScreen");
+ } else {
+ throw new RuntimeException("Unknown window type \"" + type + "\"");
+ }
+ return screenClass;
+ }
+
+ protected static Screen create(String type, Display display, int idx) {
+ try {
+ if(usrWidth<0 || usrHeight<0) {
+ usrWidth = NewtFactory.getPropertyIntValue("newt.ws.swidth");
+ usrHeight = NewtFactory.getPropertyIntValue("newt.ws.sheight");
+ System.out.println("User screen size "+usrWidth+"x"+usrHeight);
+ }
+ Class screenClass = getScreenClass(type);
+ Screen screen = (Screen) screenClass.newInstance();
+ screen.display = display;
+ screen.createNative(idx);
+ if(null==screen.aScreen) {
+ throw new RuntimeException("Screen.createNative() failed to instanciate an AbstractGraphicsScreen");
+ }
+ return screen;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public synchronized void destroy() {
+ closeNative();
+ }
+
+ protected static Screen wrapHandle(String type, Display display, AbstractGraphicsScreen aScreen) {
+ try {
+ Class screenClass = getScreenClass(type);
+ Screen screen = (Screen) screenClass.newInstance();
+ screen.display = display;
+ screen.aScreen = aScreen;
+ return screen;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected abstract void createNative(int index);
+ protected abstract void closeNative();
+
+ protected void setScreenSize(int w, int h) {
+ System.out.println("Detected screen size "+w+"x"+h);
+ width=w; height=h;
+ }
+
+ public Display getDisplay() {
+ return display;
+ }
+
+ public int getIndex() {
+ return aScreen.getIndex();
+ }
+
+ public AbstractGraphicsScreen getGraphicsScreen() {
+ return aScreen;
+ }
+
+ /**
+ * The actual implementation shall return the detected display value,
+ * if not we return 800.
+ * This can be overwritten with the user property 'newt.ws.swidth',
+ */
+ public int getWidth() {
+ return (usrWidth>0) ? usrWidth : (width>0) ? width : 480;
+ }
+
+ /**
+ * The actual implementation shall return the detected display value,
+ * if not we return 480.
+ * This can be overwritten with the user property 'newt.ws.sheight',
+ */
+ public int getHeight() {
+ return (usrHeight>0) ? usrHeight : (height>0) ? height : 480;
+ }
+
+ protected Display display;
+ protected AbstractGraphicsScreen aScreen;
+ protected int width=-1, height=-1; // detected values: set using setScreenSize
+ protected static int usrWidth=-1, usrHeight=-1; // property values: newt.ws.swidth and newt.ws.sheight
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/Window.java b/src/newt/classes/com/sun/javafx/newt/Window.java
new file mode 100755
index 000000000..68cb97834
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/Window.java
@@ -0,0 +1,664 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+import com.sun.javafx.newt.impl.Debug;
+import javax.media.nativewindow.*;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public abstract class Window implements NativeWindow
+{
+ public static final boolean DEBUG_MOUSE_EVENT = Debug.debug("Window.MouseEvent");
+ public static final boolean DEBUG_KEY_EVENT = Debug.debug("Window.KeyEvent");
+ public static final boolean DEBUG_WINDOW_EVENT = Debug.debug("Window.WindowEvent");
+ public static final boolean DEBUG_IMPLEMENTATION = Debug.debug("Window");
+
+ // Workaround for initialization order problems on Mac OS X
+ // between native Newt and (apparently) Fmod -- if Fmod is
+ // initialized first then the connection to the window server
+ // breaks, leading to errors from deep within the AppKit
+ static void init(String type) {
+ if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+ try {
+ getWindowClass(type);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static Class getWindowClass(String type)
+ throws ClassNotFoundException
+ {
+ Class windowClass = null;
+ if (NativeWindowFactory.TYPE_EGL.equals(type)) {
+ windowClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDWindow");
+ } else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
+ windowClass = Class.forName("com.sun.javafx.newt.windows.WindowsWindow");
+ } else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
+ windowClass = Class.forName("com.sun.javafx.newt.macosx.MacWindow");
+ } else if (NativeWindowFactory.TYPE_X11.equals(type)) {
+ windowClass = Class.forName("com.sun.javafx.newt.x11.X11Window");
+ } else if (NativeWindowFactory.TYPE_AWT.equals(type)) {
+ windowClass = Class.forName("com.sun.javafx.newt.awt.AWTWindow");
+ } else {
+ throw new NativeWindowException("Unknown window type \"" + type + "\"");
+ }
+ return windowClass;
+ }
+
+ protected static Window create(String type, Screen screen, Capabilities caps) {
+ return create(type, screen, caps, false);
+ }
+
+ protected static Window create(String type, Screen screen, Capabilities caps, boolean undecorated) {
+ try {
+ Class windowClass = getWindowClass(type);
+ Window window = (Window) windowClass.newInstance();
+ window.invalidate();
+ window.screen = screen;
+ window.setUndecorated(undecorated);
+ window.createNative(caps);
+ return window;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw new NativeWindowException(t);
+ }
+ }
+
+ protected static Window wrapHandle(String type, Screen screen, AbstractGraphicsConfiguration config,
+ long windowHandle, boolean fullscreen, boolean visible,
+ int x, int y, int width, int height)
+ {
+ try {
+ Class windowClass = getWindowClass(type);
+ Window window = (Window) windowClass.newInstance();
+ window.invalidate();
+ window.screen = screen;
+ window.config = config;
+ window.windowHandle = windowHandle;
+ window.fullscreen=fullscreen;
+ window.visible=visible;
+ window.x=x;
+ window.y=y;
+ window.width=width;
+ window.height=height;
+ return window;
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw new NativeWindowException(t);
+ }
+ }
+
+ /**
+ * Create native windowHandle, ie creates a new native invisible window.
+ *
+ * Shall use the capabilities to determine the graphics configuration
+ * and shall set the chosen capabilities.
+ */
+ protected abstract void createNative(Capabilities caps);
+
+ protected abstract void closeNative();
+
+ public Screen getScreen() {
+ return screen;
+ }
+
+ /**
+ * eventMask is a bitfield of EventListener event flags
+ */
+ public void pumpMessages(int eventMask) {
+ if(this.eventMask!=eventMask && eventMask>0) {
+ this.eventMask=eventMask;
+ eventMask*=-1;
+ }
+ dispatchMessages(eventMask);
+ }
+
+ public void pumpMessages() {
+ int em = 0;
+ if(windowListeners.size()>0) em |= EventListener.WINDOW;
+ if(mouseListeners.size()>0) em |= EventListener.MOUSE;
+ if(keyListeners.size()>0) em |= EventListener.KEY;
+ pumpMessages(em);
+ }
+
+ protected abstract void dispatchMessages(int eventMask);
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+
+ sb.append("NEWT-Window[config "+config+
+ ", windowHandle 0x"+Long.toHexString(getWindowHandle())+
+ ", surfaceHandle 0x"+Long.toHexString(getSurfaceHandle())+
+ ", pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
+ ", visible "+isVisible()+
+ ", "+screen+
+ ", wrappedWindow "+getWrappedWindow());
+
+ sb.append(", WindowListeners num "+windowListeners.size()+" [");
+ for (Iterator iter = windowListeners.iterator(); iter.hasNext(); ) {
+ sb.append(iter.next()+", ");
+ }
+ sb.append("], MouseListeners num "+mouseListeners.size()+" [");
+ for (Iterator iter = mouseListeners.iterator(); iter.hasNext(); ) {
+ sb.append(iter.next()+", ");
+ }
+ sb.append("], KeyListeners num "+keyListeners.size()+" [");
+ for (Iterator iter = keyListeners.iterator(); iter.hasNext(); ) {
+ sb.append(iter.next()+", ");
+ }
+ sb.append("] ]");
+ return sb.toString();
+ }
+
+ protected Screen screen;
+
+ protected AbstractGraphicsConfiguration config;
+ protected long windowHandle;
+ protected Exception lockedStack = null;
+ protected boolean fullscreen, visible;
+ protected int width, height, x, y;
+ protected int eventMask;
+
+ protected String title = "Newt Window";
+ protected boolean undecorated = false;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setUndecorated(boolean value) {
+ undecorated = value;
+ }
+
+ public boolean isUndecorated() {
+ return undecorated;
+ }
+
+ public void requestFocus() {
+ }
+
+ //
+ // NativeWindow impl
+ //
+
+ public synchronized int lockSurface() throws NativeWindowException {
+ // We leave the ToolkitLock lock to the specializtion's discretion,
+ // ie the implicit JAWTWindow in case of AWTWindow
+ if (null!=lockedStack) {
+ lockedStack.printStackTrace();
+ throw new NativeWindowException("NEWT Surface already locked - "+Thread.currentThread().getName()+" "+this);
+ }
+
+ lockedStack = new Exception("NEWT Surface previously locked by "+Thread.currentThread().getName());
+ return LOCK_SUCCESS;
+ }
+
+ public synchronized void unlockSurface() {
+ if (null!=lockedStack) {
+ lockedStack = null;
+ } else {
+ throw new NativeWindowException("NEWT Surface not locked");
+ }
+ // We leave the ToolkitLock unlock to the specializtion's discretion,
+ // ie the implicit JAWTWindow in case of AWTWindow
+ }
+
+ public synchronized boolean isSurfaceLocked() {
+ return null!=lockedStack;
+ }
+
+ public synchronized Exception getLockedStack() {
+ return lockedStack;
+ }
+
+ public synchronized void destroy() {
+ if(DEBUG_WINDOW_EVENT) {
+ System.out.println("Window.destroy() start "+Thread.currentThread().getName());
+ }
+ synchronized(windowListeners) {
+ windowListeners = new ArrayList();
+ }
+ synchronized(mouseListeners) {
+ mouseListeners = new ArrayList();
+ }
+ synchronized(keyListeners) {
+ keyListeners = new ArrayList();
+ }
+ closeNative();
+ invalidate();
+ if(DEBUG_WINDOW_EVENT) {
+ System.out.println("Window.destroy() end "+Thread.currentThread().getName());
+ }
+ }
+
+ public void invalidate() {
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ Exception e = new Exception("!!! Window Invalidate "+Thread.currentThread().getName());
+ e.printStackTrace();
+ }
+ screen = null;
+ windowHandle = 0;
+ fullscreen=false;
+ visible=false;
+ eventMask = 0;
+
+ // Default position and dimension will be re-set immediately by user
+ width = 100;
+ height = 100;
+ x=0;
+ y=0;
+ }
+
+ protected void clearEventMask() {
+ eventMask=0;
+ }
+
+ public long getDisplayHandle() {
+ return screen.getDisplay().getHandle();
+ }
+
+ public int getScreenIndex() {
+ return screen.getIndex();
+ }
+
+ public long getWindowHandle() {
+ return windowHandle;
+ }
+
+ public long getSurfaceHandle() {
+ return windowHandle; // default: return window handle
+ }
+
+ /** Special method to dispose a surface handle,
+ in case of a device change _and_ where there
+ is a different semantics of window handle and surface handle.
+ This is currently only true for Windows. */
+ public void disposeSurfaceHandle() {
+ }
+
+ public AbstractGraphicsConfiguration getGraphicsConfiguration() {
+ return config;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ /** If this Window actually wraps one from another toolkit such as
+ the AWT, this will return a non-null value. */
+ public Object getWrappedWindow() {
+ return null;
+ }
+
+ //
+ // Additional methods
+ //
+
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
+ public boolean isVisible() {
+ return visible;
+ }
+
+ public boolean isFullscreen() {
+ return fullscreen;
+ }
+
+ private boolean autoDrawableMember = false;
+
+ /** If the implementation is capable of detecting a device change
+ return true and clear the status/reason of the change. */
+ public boolean hasDeviceChanged() {
+ return false;
+ }
+
+ /**
+ * If set to true,
+ * certain action will be performed by the owning
+ * AutoDrawable, ie the destroy() call within windowDestroyNotify()
+ */
+ public void setAutoDrawableClient(boolean b) {
+ autoDrawableMember = b;
+ }
+
+ protected void windowDestroyNotify() {
+ if(DEBUG_WINDOW_EVENT) {
+ System.out.println("Window.windowDestroyeNotify start "+Thread.currentThread().getName());
+ }
+
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
+
+ if(!autoDrawableMember) {
+ destroy();
+ }
+
+ if(DEBUG_WINDOW_EVENT) {
+ System.out.println("Window.windowDestroyeNotify end "+Thread.currentThread().getName());
+ }
+ }
+
+ protected void windowDestroyed() {
+ if(DEBUG_WINDOW_EVENT) {
+ System.out.println("Window.windowDestroyed "+Thread.currentThread().getName());
+ }
+ invalidate();
+ }
+
+ public abstract void setVisible(boolean visible);
+ public abstract void setSize(int width, int height);
+ public abstract void setPosition(int x, int y);
+ public abstract boolean setFullscreen(boolean fullscreen);
+
+ //
+ // MouseListener Support
+ //
+
+ public void addMouseListener(MouseListener l) {
+ if(l == null) {
+ return;
+ }
+ synchronized(mouseListeners) {
+ ArrayList newMouseListeners = (ArrayList) mouseListeners.clone();
+ newMouseListeners.add(l);
+ mouseListeners = newMouseListeners;
+ }
+ }
+
+ public void removeMouseListener(MouseListener l) {
+ if (l == null) {
+ return;
+ }
+ synchronized(mouseListeners) {
+ ArrayList newMouseListeners = (ArrayList) mouseListeners.clone();
+ newMouseListeners.remove(l);
+ mouseListeners = newMouseListeners;
+ }
+ }
+
+ public MouseListener[] getMouseListeners() {
+ synchronized(mouseListeners) {
+ return (MouseListener[]) mouseListeners.toArray();
+ }
+ }
+
+ private ArrayList mouseListeners = new ArrayList();
+ private int mouseButtonPressed = 0; // current pressed mouse button number
+ private long lastMousePressed = 0; // last time when a mouse button was pressed
+ private int lastMouseClickCount = 0; // last mouse button click count
+ public static final int ClickTimeout = 300;
+
+ protected void sendMouseEvent(int eventType, int modifiers,
+ int x, int y, int button, int rotation) {
+ if(DEBUG_MOUSE_EVENT) {
+ System.out.println("sendMouseEvent: "+MouseEvent.getEventTypeString(eventType)+
+ ", mod "+modifiers+", pos "+x+"/"+y+", button "+button);
+ }
+ if(button<0||button>MouseEvent.BUTTON_NUMBER) {
+ throw new NativeWindowException("Invalid mouse button number" + button);
+ }
+ long when = System.currentTimeMillis();
+ MouseEvent eClicked = null;
+ MouseEvent e = null;
+
+ if(MouseEvent.EVENT_MOUSE_PRESSED==eventType) {
+ if(when-lastMousePressed<ClickTimeout) {
+ lastMouseClickCount++;
+ } else {
+ lastMouseClickCount=1;
+ }
+ lastMousePressed=when;
+ mouseButtonPressed=button;
+ e = new MouseEvent(true, eventType, this, when,
+ modifiers, x, y, lastMouseClickCount, button, 0);
+ } else if(MouseEvent.EVENT_MOUSE_RELEASED==eventType) {
+ e = new MouseEvent(true, eventType, this, when,
+ modifiers, x, y, lastMouseClickCount, button, 0);
+ if(when-lastMousePressed<ClickTimeout) {
+ eClicked = new MouseEvent(true, MouseEvent.EVENT_MOUSE_CLICKED, this, when,
+ modifiers, x, y, lastMouseClickCount, button, 0);
+ } else {
+ lastMouseClickCount=0;
+ lastMousePressed=0;
+ }
+ mouseButtonPressed=0;
+ } else if(MouseEvent.EVENT_MOUSE_MOVED==eventType) {
+ if (mouseButtonPressed>0) {
+ e = new MouseEvent(true, MouseEvent.EVENT_MOUSE_DRAGGED, this, when,
+ modifiers, x, y, 1, mouseButtonPressed, 0);
+ } else {
+ e = new MouseEvent(true, eventType, this, when,
+ modifiers, x, y, 0, button, 0);
+ }
+ } else if(MouseEvent.EVENT_MOUSE_WHEEL_MOVED==eventType) {
+ e = new MouseEvent(true, eventType, this, when, modifiers, x, y, 0, button, rotation);
+ } else {
+ e = new MouseEvent(true, eventType, this, when, modifiers, x, y, 0, button, 0);
+ }
+
+ if(DEBUG_MOUSE_EVENT) {
+ System.out.println("sendMouseEvent: event: "+e);
+ if(null!=eClicked) {
+ System.out.println("sendMouseEvent: event Clicked: "+eClicked);
+ }
+ }
+
+ ArrayList listeners = null;
+ synchronized(mouseListeners) {
+ listeners = mouseListeners;
+ }
+ for(Iterator i = listeners.iterator(); i.hasNext(); ) {
+ MouseListener l = (MouseListener) i.next();
+ switch(e.getEventType()) {
+ case MouseEvent.EVENT_MOUSE_CLICKED:
+ l.mouseClicked(e);
+ break;
+ case MouseEvent.EVENT_MOUSE_ENTERED:
+ l.mouseEntered(e);
+ break;
+ case MouseEvent.EVENT_MOUSE_EXITED:
+ l.mouseExited(e);
+ break;
+ case MouseEvent.EVENT_MOUSE_PRESSED:
+ l.mousePressed(e);
+ break;
+ case MouseEvent.EVENT_MOUSE_RELEASED:
+ l.mouseReleased(e);
+ if(null!=eClicked) {
+ l.mouseClicked(eClicked);
+ }
+ break;
+ case MouseEvent.EVENT_MOUSE_MOVED:
+ l.mouseMoved(e);
+ break;
+ case MouseEvent.EVENT_MOUSE_DRAGGED:
+ l.mouseDragged(e);
+ break;
+ case MouseEvent.EVENT_MOUSE_WHEEL_MOVED:
+ l.mouseWheelMoved(e);
+ break;
+ default:
+ throw new NativeWindowException("Unexpected mouse event type " + e.getEventType());
+ }
+ }
+ }
+
+ //
+ // KeyListener Support
+ //
+
+ public void addKeyListener(KeyListener l) {
+ if(l == null) {
+ return;
+ }
+ synchronized(keyListeners) {
+ ArrayList newKeyListeners = (ArrayList) keyListeners.clone();
+ newKeyListeners.add(l);
+ keyListeners = newKeyListeners;
+ }
+ }
+
+ public void removeKeyListener(KeyListener l) {
+ if (l == null) {
+ return;
+ }
+ synchronized(keyListeners) {
+ ArrayList newKeyListeners = (ArrayList) keyListeners.clone();
+ newKeyListeners.remove(l);
+ keyListeners = newKeyListeners;
+ }
+ }
+
+ public KeyListener[] getKeyListeners() {
+ synchronized(keyListeners) {
+ return (KeyListener[]) keyListeners.toArray();
+ }
+ }
+
+ private ArrayList keyListeners = new ArrayList();
+
+ protected void sendKeyEvent(int eventType, int modifiers, int keyCode, char keyChar) {
+ KeyEvent e = new KeyEvent(true, eventType, this, System.currentTimeMillis(),
+ modifiers, keyCode, keyChar);
+ if(DEBUG_KEY_EVENT) {
+ System.out.println("sendKeyEvent: "+e);
+ }
+ ArrayList listeners = null;
+ synchronized(keyListeners) {
+ listeners = keyListeners;
+ }
+ for(Iterator i = listeners.iterator(); i.hasNext(); ) {
+ KeyListener l = (KeyListener) i.next();
+ switch(eventType) {
+ case KeyEvent.EVENT_KEY_PRESSED:
+ l.keyPressed(e);
+ break;
+ case KeyEvent.EVENT_KEY_RELEASED:
+ l.keyReleased(e);
+ break;
+ case KeyEvent.EVENT_KEY_TYPED:
+ l.keyTyped(e);
+ break;
+ default:
+ throw new NativeWindowException("Unexpected key event type " + e.getEventType());
+ }
+ }
+ }
+
+ //
+ // WindowListener Support
+ //
+
+ private ArrayList windowListeners = new ArrayList();
+
+ public void addWindowListener(WindowListener l) {
+ if(l == null) {
+ return;
+ }
+ synchronized(windowListeners) {
+ ArrayList newWindowListeners = (ArrayList) windowListeners.clone();
+ newWindowListeners.add(l);
+ windowListeners = newWindowListeners;
+ }
+ }
+
+ public void removeWindowListener(WindowListener l) {
+ if (l == null) {
+ return;
+ }
+ synchronized(windowListeners) {
+ ArrayList newWindowListeners = (ArrayList) windowListeners.clone();
+ newWindowListeners.remove(l);
+ windowListeners = newWindowListeners;
+ }
+ }
+
+ public WindowListener[] getWindowListeners() {
+ synchronized(windowListeners) {
+ return (WindowListener[]) windowListeners.toArray();
+ }
+ }
+
+ protected void sendWindowEvent(int eventType) {
+ WindowEvent e = new WindowEvent(true, eventType, this, System.currentTimeMillis());
+ if(DEBUG_WINDOW_EVENT) {
+ System.out.println("sendWindowEvent: "+e);
+ }
+ ArrayList listeners = null;
+ synchronized(windowListeners) {
+ listeners = windowListeners;
+ }
+ for(Iterator i = listeners.iterator(); i.hasNext(); ) {
+ WindowListener l = (WindowListener) i.next();
+ switch(eventType) {
+ case WindowEvent.EVENT_WINDOW_RESIZED:
+ l.windowResized(e);
+ break;
+ case WindowEvent.EVENT_WINDOW_MOVED:
+ l.windowMoved(e);
+ break;
+ case WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY:
+ l.windowDestroyNotify(e);
+ break;
+ case WindowEvent.EVENT_WINDOW_GAINED_FOCUS:
+ l.windowGainedFocus(e);
+ break;
+ case WindowEvent.EVENT_WINDOW_LOST_FOCUS:
+ l.windowLostFocus(e);
+ break;
+ default:
+ throw
+ new NativeWindowException("Unexpected window event type "
+ + e.getEventType());
+ }
+ }
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/WindowEvent.java b/src/newt/classes/com/sun/javafx/newt/WindowEvent.java
new file mode 100644
index 000000000..c5aa65e3d
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/WindowEvent.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public class WindowEvent extends Event {
+ public static final int EVENT_WINDOW_RESIZED = 100;
+ public static final int EVENT_WINDOW_MOVED = 101;
+ public static final int EVENT_WINDOW_DESTROY_NOTIFY = 102;
+ public static final int EVENT_WINDOW_GAINED_FOCUS = 103;
+ public static final int EVENT_WINDOW_LOST_FOCUS = 104;
+ // public static final int EVENT_WINDOW_REPAINT = 105; // TODO
+
+ public WindowEvent(int eventType, Window source, long when) {
+ this(false, eventType, source, when);
+ }
+
+ WindowEvent(boolean isSystemEvent, int eventType, Window source, long when) {
+ super(isSystemEvent, eventType, source, when);
+ }
+
+ public static String getEventTypeString(int type) {
+ switch(type) {
+ case EVENT_WINDOW_RESIZED: return "WINDOW_RESIZED";
+ case EVENT_WINDOW_MOVED: return "WINDOW_MOVED";
+ case EVENT_WINDOW_DESTROY_NOTIFY: return "EVENT_WINDOW_DESTROY_NOTIFY";
+ case EVENT_WINDOW_GAINED_FOCUS: return "EVENT_WINDOW_GAINED_FOCUS";
+ case EVENT_WINDOW_LOST_FOCUS: return "EVENT_WINDOW_LOST_FOCUS";
+ // case EVENT_WINDOW_REPAINT: return "EVENT_WINDOW_REPAINT";
+ default: return "unknown (" + type + ")";
+ }
+ }
+ public String toString() {
+ return "WindowEvent["+getEventTypeString(getEventType()) +
+ ", " + super.toString() + "]";
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/WindowListener.java b/src/newt/classes/com/sun/javafx/newt/WindowListener.java
new file mode 100644
index 000000000..81624fa75
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/WindowListener.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt;
+
+public interface WindowListener extends EventListener {
+ public void windowResized(WindowEvent e);
+ public void windowMoved(WindowEvent e);
+ public void windowDestroyNotify(WindowEvent e);
+ public void windowGainedFocus(WindowEvent e);
+ public void windowLostFocus(WindowEvent e);
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java b/src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java
new file mode 100644
index 000000000..6b8fc43c7
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/awt/AWTCanvas.java
@@ -0,0 +1,264 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.awt;
+
+import com.sun.javafx.newt.Window;
+
+import java.awt.Canvas;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.GraphicsConfiguration;
+
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+import com.sun.javafx.newt.impl.Debug;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+public class AWTCanvas extends Canvas {
+ private GraphicsDevice device;
+ private GraphicsConfiguration chosen;
+ private AWTGraphicsConfiguration awtConfig;
+
+ private Capabilities capabilities;
+
+ private boolean displayConfigChanged=false;
+
+ public AWTCanvas(Capabilities capabilities) {
+ super();
+
+ if(null==capabilities) {
+ throw new NativeWindowException("Capabilities null");
+ }
+ this.capabilities=capabilities;
+ }
+
+ public AWTGraphicsConfiguration getAWTGraphicsConfiguration() {
+ return awtConfig;
+ }
+
+ public boolean hasDeviceChanged() {
+ boolean res = displayConfigChanged;
+ displayConfigChanged=false;
+ return res;
+ }
+
+ public void addNotify() {
+ super.addNotify();
+
+ disableBackgroundErase();
+
+ GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ if(null!=gc) {
+ device = gc.getDevice();
+ }
+
+ /*
+ * Save the chosen capabilities for use in getGraphicsConfiguration().
+ */
+ awtConfig = chooseGraphicsConfiguration(capabilities, device);
+ if(Window.DEBUG_IMPLEMENTATION) {
+ Exception e = new Exception("Created Config: "+awtConfig);
+ e.printStackTrace();
+ }
+ if(null!=awtConfig) {
+ // update ..
+ chosen = awtConfig.getGraphicsConfiguration();
+ }
+ if(null==awtConfig) {
+ throw new NativeWindowException("Error: AWTGraphicsConfiguration is null");
+ }
+ }
+
+ /**
+ * Overridden to choose a GraphicsConfiguration on a parent container's
+ * GraphicsDevice because both devices
+ */
+ public GraphicsConfiguration getGraphicsConfiguration() {
+ /*
+ * Workaround for problems with Xinerama and java.awt.Component.checkGD
+ * when adding to a container on a different graphics device than the
+ * one that this Canvas is associated with.
+ *
+ * GC will be null unless:
+ * - A native peer has assigned it. This means we have a native
+ * peer, and are already comitted to a graphics configuration.
+ * - This canvas has been added to a component hierarchy and has
+ * an ancestor with a non-null GC, but the native peer has not
+ * yet been created. This means we can still choose the GC on
+ * all platforms since the peer hasn't been created.
+ */
+ final GraphicsConfiguration gc = super.getGraphicsConfiguration();
+ /*
+ * chosen is only non-null on platforms where the GLDrawableFactory
+ * returns a non-null GraphicsConfiguration (in the GLCanvas
+ * constructor).
+ *
+ * if gc is from this Canvas' native peer then it should equal chosen,
+ * otherwise it is from an ancestor component that this Canvas is being
+ * added to, and we go into this block.
+ */
+ if (gc != null && chosen != null && !chosen.equals(gc)) {
+ /*
+ * Check for compatibility with gc. If they differ by only the
+ * device then return a new GCconfig with the super-class' GDevice
+ * (and presumably the same visual ID in Xinerama).
+ *
+ */
+ if (!chosen.getDevice().getIDstring().equals(gc.getDevice().getIDstring())) {
+ /*
+ * Here we select a GraphicsConfiguration on the alternate
+ * device that is presumably identical to the chosen
+ * configuration, but on the other device.
+ *
+ * Should really check to ensure that we select a configuration
+ * with the same X visual ID for Xinerama screens, otherwise the
+ * GLDrawable may have the wrong visual ID (I don't think this
+ * ever gets updated). May need to add a method to
+ * X11GLDrawableFactory to do this in a platform specific
+ * manner.
+ *
+ * However, on platforms where we can actually get into this
+ * block, both devices should have the same visual list, and the
+ * same configuration should be selected here.
+ */
+ AWTGraphicsConfiguration config = chooseGraphicsConfiguration((Capabilities)awtConfig.getRequestedCapabilities(), gc.getDevice());
+ final GraphicsConfiguration compatible = (null!=config)?config.getGraphicsConfiguration():null;
+ if(Window.DEBUG_IMPLEMENTATION) {
+ Exception e = new Exception("Call Stack: "+Thread.currentThread().getName());
+ e.printStackTrace();
+ System.err.println("!!! Created Config (n): HAVE GC "+chosen);
+ System.err.println("!!! Created Config (n): THIS GC "+gc);
+ System.err.println("!!! Created Config (n): Choosen GC "+compatible);
+ System.err.println("!!! Created Config (n): HAVE CF "+awtConfig);
+ System.err.println("!!! Created Config (n): Choosen CF "+config);
+ System.err.println("!!! Created Config (n): EQUALS CAPS "+config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities()));
+ }
+
+ if (compatible != null) {
+ /*
+ * Save the new GC for equals test above, and to return to
+ * any outside callers of this method.
+ */
+ chosen = compatible;
+ if( !config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())) {
+ displayConfigChanged=true;
+ }
+ awtConfig = config;
+ }
+ }
+
+ /*
+ * If a compatible GC was not found in the block above, this will
+ * return the GC that was selected in the constructor (and might
+ * cause an exception in Component.checkGD when adding to a
+ * container, but in this case that would be the desired behavior).
+ *
+ */
+ return chosen;
+ } else if (gc == null) {
+ /*
+ * The GC is null, which means we have no native peer, and are not
+ * part of a (realized) component hierarchy. So we return the
+ * desired visual that was selected in the constructor (possibly
+ * null).
+ */
+ return chosen;
+ }
+
+ /*
+ * Otherwise we have not explicitly selected a GC in the constructor, so
+ * just return what Canvas would have.
+ */
+ return gc;
+ }
+
+ private static AWTGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ GraphicsDevice device) {
+ AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device);
+ AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
+ GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capabilities,
+ null,
+ aScreen);
+ if (config == null) {
+ throw new NativeWindowException("Error: Couldn't fetch AWTGraphicsConfiguration");
+ }
+
+ return config;
+ }
+
+ // Disables the AWT's erasing of this Canvas's background on Windows
+ // in Java SE 6. This internal API is not available in previous
+ // releases, but the system property
+ // -Dsun.awt.noerasebackground=true can be specified to get similar
+ // results globally in previous releases.
+ private static boolean disableBackgroundEraseInitialized;
+ private static Method disableBackgroundEraseMethod;
+ private void disableBackgroundErase() {
+ if (!disableBackgroundEraseInitialized) {
+ try {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ try {
+ Class clazz = getToolkit().getClass();
+ while (clazz != null && disableBackgroundEraseMethod == null) {
+ try {
+ disableBackgroundEraseMethod =
+ clazz.getDeclaredMethod("disableBackgroundErase",
+ new Class[] { Canvas.class });
+ disableBackgroundEraseMethod.setAccessible(true);
+ } catch (Exception e) {
+ clazz = clazz.getSuperclass();
+ }
+ }
+ } catch (Exception e) {
+ }
+ return null;
+ }
+ });
+ } catch (Exception e) {
+ }
+ disableBackgroundEraseInitialized = true;
+ }
+ if (disableBackgroundEraseMethod != null) {
+ try {
+ disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
+ } catch (Exception e) {
+ // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
+ // throw new GLException(e);
+ }
+ }
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java b/src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java
new file mode 100644
index 000000000..099125630
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/awt/AWTDisplay.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.awt;
+
+import java.awt.*;
+import com.sun.javafx.newt.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+
+public class AWTDisplay extends Display {
+ public AWTDisplay() {
+ }
+
+ protected void createNative() {
+ aDevice = (AWTGraphicsDevice) AWTGraphicsDevice.createDevice(null); // default
+ }
+
+ protected void setAWTGraphicsDevice(AWTGraphicsDevice d) {
+ aDevice = d;
+ }
+
+ protected void closeNative() { }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java b/src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java
new file mode 100644
index 000000000..9bda5893b
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/awt/AWTScreen.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.awt;
+
+import com.sun.javafx.newt.*;
+import java.awt.DisplayMode;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+
+public class AWTScreen extends Screen {
+ public AWTScreen() {
+ }
+
+ protected void createNative(int index) {
+ aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
+
+ DisplayMode mode = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice().getDisplayMode();
+ int w = mode.getWidth();
+ int h = mode.getHeight();
+ setScreenSize(w, h);
+ }
+
+ protected void setAWTGraphicsScreen(AWTGraphicsScreen s) {
+ aScreen = s;
+ }
+
+ // done by AWTWindow ..
+ protected void setScreenSize(int w, int h) {
+ super.setScreenSize(w, h);
+ }
+
+ protected void closeNative() { }
+
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java b/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java
new file mode 100644
index 000000000..3742a0e57
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java
@@ -0,0 +1,437 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.awt;
+
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.DisplayMode;
+import java.awt.EventQueue;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.awt.event.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.*;
+import com.sun.javafx.newt.Window;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.awt.*;
+
+/** An implementation of the Newt Window class built using the
+ AWT. This is provided for convenience of porting to platforms
+ supporting Java SE. */
+
+public class AWTWindow extends Window {
+
+ public AWTWindow() {
+ super();
+ title = "AWT NewtWindow";
+ }
+
+ private Frame frame;
+ private AWTCanvas canvas;
+ private LinkedList/*<AWTEventWrapper>*/ events = new LinkedList();
+ // non fullscreen dimensions ..
+ private int nfs_width, nfs_height, nfs_x, nfs_y;
+
+ public void setTitle(final String title) {
+ super.setTitle(title);
+ runOnEDT(true, new Runnable() {
+ public void run() {
+ if (frame != null) {
+ frame.setTitle(title);
+ }
+ }
+ });
+ }
+
+ protected void createNative(final Capabilities caps) {
+
+ runOnEDT(true, new Runnable() {
+ public void run() {
+ frame = new Frame(getTitle());
+ frame.setUndecorated(isUndecorated());
+ frame.setLayout(new BorderLayout());
+ canvas = new AWTCanvas(caps);
+ Listener listener = new Listener();
+ canvas.addMouseListener(listener);
+ canvas.addMouseMotionListener(listener);
+ canvas.addKeyListener(listener);
+ canvas.addComponentListener(listener);
+ frame.add(canvas, BorderLayout.CENTER);
+ frame.setSize(width, height);
+ frame.setLocation(x, y);
+ frame.addComponentListener(new MoveListener());
+ frame.addWindowListener(new WindowEventListener());
+ }
+ });
+ }
+
+ protected void closeNative() {
+ runOnEDT(true, new Runnable() {
+ public void run() {
+ frame.dispose();
+ frame = null;
+ }
+ });
+ }
+
+ public boolean hasDeviceChanged() {
+ boolean res = canvas.hasDeviceChanged();
+ if(res) {
+ config = canvas.getAWTGraphicsConfiguration();
+ if (config == null) {
+ throw new NativeWindowException("Error Device change null GraphicsConfiguration: "+this);
+ }
+ updateDeviceData();
+ }
+ return res;
+ }
+
+ public void setVisible(final boolean visible) {
+ runOnEDT(true, new Runnable() {
+ public void run() {
+ frame.setVisible(visible);
+ }
+ });
+
+ config = canvas.getAWTGraphicsConfiguration();
+
+ if (config == null) {
+ throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+ }
+
+ updateDeviceData();
+ }
+
+ private void updateDeviceData() {
+ // propagate new info ..
+ ((AWTScreen)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)config.getScreen());
+ ((AWTDisplay)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)config.getScreen().getDevice());
+
+ DisplayMode mode = ((AWTGraphicsDevice)config.getScreen().getDevice()).getGraphicsDevice().getDisplayMode();
+ int w = mode.getWidth();
+ int h = mode.getHeight();
+ ((AWTScreen)screen).setScreenSize(w, h);
+ }
+
+ public void setSize(final int width, final int height) {
+ this.width = width;
+ this.height = height;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ /** An AWT event on setSize() would bring us in a deadlock situation, hence invokeLater() */
+ runOnEDT(false, new Runnable() {
+ public void run() {
+ frame.setSize(width, height);
+ }
+ });
+ }
+
+ public void setPosition(final int x, final int y) {
+ this.x = x;
+ this.y = y;
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ runOnEDT(true, new Runnable() {
+ public void run() {
+ frame.setLocation(x, y);
+ }
+ });
+ }
+
+ public boolean setFullscreen(final boolean fullscreen) {
+ if(this.fullscreen!=fullscreen) {
+ final int x,y,w,h;
+ this.fullscreen=fullscreen;
+ if(fullscreen) {
+ x = 0; y = 0;
+ w = screen.getWidth();
+ h = screen.getHeight();
+ } else {
+ x = nfs_x;
+ y = nfs_y;
+ w = nfs_width;
+ h = nfs_height;
+ }
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ System.err.println("AWTWindow fs: "+fullscreen+" "+x+"/"+y+" "+w+"x"+h);
+ }
+ /** An AWT event on setSize() would bring us in a deadlock situation, hence invokeLater() */
+ runOnEDT(false, new Runnable() {
+ public void run() {
+ if(!frame.isDisplayable()) {
+ frame.setUndecorated(fullscreen);
+ } else {
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ System.err.println("AWTWindow can't undecorate already created frame");
+ }
+ }
+ frame.setLocation(x, y);
+ frame.setSize(w, h);
+ }
+ });
+ }
+ return true;
+ }
+
+ public Object getWrappedWindow() {
+ return canvas;
+ }
+
+ public void dispatchMessages(int eventMask) {
+ AWTEventWrapper w;
+ do {
+ synchronized(this) {
+ if (!events.isEmpty()) {
+ w = (AWTEventWrapper) events.removeFirst();
+ } else {
+ w = null;
+ }
+ }
+ if (w != null) {
+ switch (w.getType()) {
+ case com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_RESIZED:
+ case com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_MOVED:
+ case com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY:
+ if ((eventMask & com.sun.javafx.newt.EventListener.WINDOW) != 0) {
+ sendWindowEvent(w.getType());
+ }
+ break;
+
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_CLICKED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_ENTERED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_EXITED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_PRESSED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_RELEASED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_MOVED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_DRAGGED:
+ case com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_WHEEL_MOVED:
+ if ((eventMask & com.sun.javafx.newt.EventListener.MOUSE) != 0) {
+ MouseEvent e = (MouseEvent) w.getEvent();
+ int rotation = 0;
+ if (e instanceof MouseWheelEvent) {
+ rotation = ((MouseWheelEvent)e).getWheelRotation();
+ }
+ sendMouseEvent(w.getType(), convertModifiers(e),
+ e.getX(), e.getY(), convertButton(e),
+ rotation);
+ }
+ break;
+
+ case com.sun.javafx.newt.KeyEvent.EVENT_KEY_PRESSED:
+ case com.sun.javafx.newt.KeyEvent.EVENT_KEY_RELEASED:
+ case com.sun.javafx.newt.KeyEvent.EVENT_KEY_TYPED:
+ if ((eventMask & com.sun.javafx.newt.EventListener.KEY) != 0) {
+ KeyEvent e = (KeyEvent) w.getEvent();
+ sendKeyEvent(w.getType(), convertModifiers(e),
+ e.getKeyCode(), e.getKeyChar());
+ }
+ break;
+
+ default:
+ throw new NativeWindowException("Unknown event type " + w.getType());
+ }
+ if(Window.DEBUG_MOUSE_EVENT) {
+ System.out.println("dispatchMessages: in event:"+w.getEvent());
+ }
+ }
+ } while (w != null);
+ }
+
+ private static int convertModifiers(InputEvent e) {
+ int newtMods = 0;
+ int mods = e.getModifiers();
+ if ((mods & InputEvent.SHIFT_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.SHIFT_MASK;
+ if ((mods & InputEvent.CTRL_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.CTRL_MASK;
+ if ((mods & InputEvent.META_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.META_MASK;
+ if ((mods & InputEvent.ALT_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.ALT_MASK;
+ if ((mods & InputEvent.ALT_GRAPH_MASK) != 0) newtMods |= com.sun.javafx.newt.InputEvent.ALT_GRAPH_MASK;
+ return newtMods;
+ }
+
+ private static int convertButton(MouseEvent e) {
+ switch (e.getButton()) {
+ case MouseEvent.BUTTON1: return com.sun.javafx.newt.MouseEvent.BUTTON1;
+ case MouseEvent.BUTTON2: return com.sun.javafx.newt.MouseEvent.BUTTON2;
+ case MouseEvent.BUTTON3: return com.sun.javafx.newt.MouseEvent.BUTTON3;
+ }
+ return 0;
+ }
+
+ private static void runOnEDT(boolean wait, Runnable r) {
+ if (EventQueue.isDispatchThread()) {
+ r.run();
+ } else {
+ try {
+ if(wait) {
+ EventQueue.invokeAndWait(r);
+ } else {
+ EventQueue.invokeLater(r);
+ }
+ } catch (Exception e) {
+ throw new NativeWindowException(e);
+ }
+ }
+ }
+
+ private void enqueueEvent(int type, InputEvent e) {
+ AWTEventWrapper wrapper = new AWTEventWrapper(type, e);
+ synchronized(this) {
+ events.add(wrapper);
+ }
+ }
+
+ private static final int WINDOW_EVENT = 1;
+ private static final int KEY_EVENT = 2;
+ private static final int MOUSE_EVENT = 3;
+
+ static class AWTEventWrapper {
+ int type;
+ InputEvent e;
+
+ AWTEventWrapper(int type, InputEvent e) {
+ this.type = type;
+ this.e = e;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public InputEvent getEvent() {
+ return e;
+ }
+ }
+
+ class MoveListener implements ComponentListener {
+ public void componentResized(ComponentEvent e) {
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ x = frame.getX();
+ y = frame.getY();
+ enqueueEvent(com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_MOVED, null);
+ }
+
+ public void componentShown(ComponentEvent e) {
+ }
+
+ public void componentHidden(ComponentEvent e) {
+ }
+
+ }
+
+ class Listener implements ComponentListener, MouseListener, MouseMotionListener, KeyListener {
+ public void componentResized(ComponentEvent e) {
+ width = canvas.getWidth();
+ height = canvas.getHeight();
+ enqueueEvent(com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_RESIZED, null);
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ }
+
+ public void componentShown(ComponentEvent e) {
+ }
+
+ public void componentHidden(ComponentEvent e) {
+ }
+
+ public void mouseClicked(MouseEvent e) {
+ // We ignore these as we synthesize them ourselves out of
+ // mouse pressed and released events
+ }
+
+ public void mouseEntered(MouseEvent e) {
+ enqueueEvent(com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_ENTERED, e);
+ }
+
+ public void mouseExited(MouseEvent e) {
+ enqueueEvent(com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_EXITED, e);
+ }
+
+ public void mousePressed(MouseEvent e) {
+ enqueueEvent(com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_PRESSED, e);
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ enqueueEvent(com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_RELEASED, e);
+ }
+
+ public void mouseMoved(MouseEvent e) {
+ enqueueEvent(com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_MOVED, e);
+ }
+
+ public void mouseDragged(MouseEvent e) {
+ enqueueEvent(com.sun.javafx.newt.MouseEvent.EVENT_MOUSE_DRAGGED, e);
+ }
+
+ public void keyPressed(KeyEvent e) {
+ enqueueEvent(com.sun.javafx.newt.KeyEvent.EVENT_KEY_PRESSED, e);
+ }
+
+ public void keyReleased(KeyEvent e) {
+ enqueueEvent(com.sun.javafx.newt.KeyEvent.EVENT_KEY_RELEASED, e);
+ }
+
+ public void keyTyped(KeyEvent e) {
+ enqueueEvent(com.sun.javafx.newt.KeyEvent.EVENT_KEY_TYPED, e);
+ }
+ }
+
+ class WindowEventListener implements WindowListener {
+ public void windowActivated(WindowEvent e) {
+ }
+ public void windowClosed(WindowEvent e) {
+ }
+ public void windowClosing(WindowEvent e) {
+ enqueueEvent(com.sun.javafx.newt.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY, null);
+ }
+ public void windowDeactivated(WindowEvent e) {
+ }
+ public void windowDeiconified(WindowEvent e) {
+ }
+ public void windowIconified(WindowEvent e) {
+ }
+ public void windowOpened(WindowEvent e) {
+ }
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/impl/Debug.java b/src/newt/classes/com/sun/javafx/newt/impl/Debug.java
new file mode 100644
index 000000000..a901eafb1
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/impl/Debug.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.javafx.newt.impl;
+
+import java.security.*;
+
+/** Helper routines for logging and debugging. */
+
+public class Debug {
+ // Some common properties
+ private static boolean verbose;
+ private static boolean debugAll;
+
+ static {
+ verbose = isPropertyDefined("newt.verbose");
+ debugAll = isPropertyDefined("newt.debug");
+ if (verbose) {
+ Package p = Package.getPackage("com.sun.javafx.newt");
+ System.err.println("NEWT specification version " + p.getSpecificationVersion());
+ System.err.println("NEWT implementation version " + p.getImplementationVersion());
+ System.err.println("NEWT implementation vendor " + p.getImplementationVendor());
+ }
+ }
+
+ public static boolean getBooleanProperty(final String property) {
+ Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ boolean val = Boolean.getBoolean(property);
+ return (val ? Boolean.TRUE : Boolean.FALSE);
+ }
+ });
+ return b.booleanValue();
+ }
+
+ public static boolean isPropertyDefined(final String property) {
+ Boolean b = (Boolean) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String val = System.getProperty(property);
+ return (val != null ? Boolean.TRUE : Boolean.FALSE);
+ }
+ });
+ return b.booleanValue();
+ }
+
+ public static boolean verbose() {
+ return verbose;
+ }
+
+ public static boolean debugAll() {
+ return debugAll;
+ }
+
+ public static boolean debug(String subcomponent) {
+ return debugAll() || isPropertyDefined("newt.debug." + subcomponent);
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java b/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java
new file mode 100644
index 000000000..06d76b294
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/impl/NativeLibLoader.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package com.sun.javafx.newt.impl;
+
+// FIXME: refactor Java SE dependencies
+//import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import com.sun.nativewindow.impl.NativeLibLoaderBase;
+
+public class NativeLibLoader extends NativeLibLoaderBase {
+
+ public static void loadNEWT() {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String[] preload = { "nativewindow" };
+ loadLibrary("newt", preload, true);
+ return null;
+ }
+ });
+ }
+
+ //----------------------------------------------------------------------
+ // Support for the new JNLPAppletLauncher
+ //
+
+ private static class NEWTAction implements NativeLibLoaderBase.LoaderAction {
+ public void loadLibrary(String libname, String[] preload,
+ boolean preloadIgnoreError) {
+ if (null!=preload) {
+ for (int i=0; i<preload.length; i++) {
+ if(!isLoaded(preload[i])) {
+ try {
+ if(DEBUG) {
+ System.err.println("NEWT NativeLibLoader preload "+preload[i]);
+ }
+ loadLibraryInternal(preload[i]);
+ addLoaded(preload[i]);
+ }
+ catch (UnsatisfiedLinkError e) {
+ if (!preloadIgnoreError && e.getMessage().indexOf("already loaded") < 0) {
+ throw e;
+ }
+ }
+ }
+ }
+ }
+
+ if(DEBUG) {
+ System.err.println("NEWT NativeLibLoader load "+libname);
+ }
+ loadLibraryInternal(libname);
+ addLoaded(libname);
+ }
+ }
+
+ private static boolean usingJNLPAppletLauncher;
+ private static Method jnlpLoadLibraryMethod;
+
+ static {
+ NativeLibLoaderBase.setLoadingAction(new NEWTAction());
+ AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher");
+ usingJNLPAppletLauncher = Boolean.valueOf(sunAppletLauncher).booleanValue();
+ return null;
+ }
+ });
+ }
+
+ // I hate the amount of delegation currently in this class
+ private static void loadLibraryInternal(String libraryName) {
+ // Note: special-casing JAWT which is built in to the JDK
+ if (usingJNLPAppletLauncher && !libraryName.equals("jawt")) {
+ try {
+ if (jnlpLoadLibraryMethod == null) {
+ Class jnlpAppletLauncherClass = Class.forName("org.jdesktop.applet.util.JNLPAppletLauncher");
+ jnlpLoadLibraryMethod = jnlpAppletLauncherClass.getDeclaredMethod("loadLibrary", new Class[] { String.class });
+ }
+ jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName });
+ } catch (Exception e) {
+ Throwable t = e;
+ if (t instanceof InvocationTargetException) {
+ t = ((InvocationTargetException) t).getTargetException();
+ }
+ if (t instanceof Error)
+ throw (Error) t;
+ if (t instanceof RuntimeException) {
+ throw (RuntimeException) t;
+ }
+ // Throw UnsatisfiedLinkError for best compatibility with System.loadLibrary()
+ throw (UnsatisfiedLinkError) new UnsatisfiedLinkError().initCause(e);
+ }
+ } else {
+ // FIXME: remove
+ // System.out.println("sun.boot.library.path=" + System.getProperty("sun.boot.library.path"));
+ System.loadLibrary(libraryName);
+ if(DEBUG) {
+ System.err.println("NEWT NativeLibLoader loaded "+libraryName);
+ }
+ }
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java b/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java
new file mode 100755
index 000000000..29b7151f4
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/macosx/MacDisplay.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.macosx;
+
+import com.sun.javafx.newt.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.macosx.*;
+
+public class MacDisplay extends Display {
+ public MacDisplay() {
+ }
+
+ protected void createNative() {
+ aDevice = new MacOSXGraphicsDevice();
+ }
+
+ protected void closeNative() { }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java b/src/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java
new file mode 100755
index 000000000..06ef8aacd
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/macosx/MacScreen.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.macosx;
+
+import com.sun.javafx.newt.*;
+import javax.media.nativewindow.*;
+
+public class MacScreen extends Screen {
+ public MacScreen() {
+ MacWindow.initSingleton();
+ }
+
+ protected void createNative(int index) {
+ aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), index);
+ setScreenSize(MacWindow.getScreenWidth(getIndex()), MacWindow.getScreenHeight(getIndex()));
+ }
+
+ protected void closeNative() { }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java b/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java
new file mode 100755
index 000000000..2c1ca7c89
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java
@@ -0,0 +1,514 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.macosx;
+
+import javax.media.nativewindow.*;
+
+import com.sun.javafx.newt.util.MainThread;
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+
+public class MacWindow extends Window {
+
+ private static native boolean initIDs();
+
+ // Window styles
+ private static final int NSBorderlessWindowMask = 0;
+ private static final int NSTitledWindowMask = 1 << 0;
+ private static final int NSClosableWindowMask = 1 << 1;
+ private static final int NSMiniaturizableWindowMask = 1 << 2;
+ private static final int NSResizableWindowMask = 1 << 3;
+
+ // Window backing store types
+ private static final int NSBackingStoreRetained = 0;
+ private static final int NSBackingStoreNonretained = 1;
+ private static final int NSBackingStoreBuffered = 2;
+
+ // Key constants handled differently on Mac OS X than other platforms
+ private static final int NSUpArrowFunctionKey = 0xF700;
+ private static final int NSDownArrowFunctionKey = 0xF701;
+ private static final int NSLeftArrowFunctionKey = 0xF702;
+ private static final int NSRightArrowFunctionKey = 0xF703;
+ private static final int NSF1FunctionKey = 0xF704;
+ private static final int NSF2FunctionKey = 0xF705;
+ private static final int NSF3FunctionKey = 0xF706;
+ private static final int NSF4FunctionKey = 0xF707;
+ private static final int NSF5FunctionKey = 0xF708;
+ private static final int NSF6FunctionKey = 0xF709;
+ private static final int NSF7FunctionKey = 0xF70A;
+ private static final int NSF8FunctionKey = 0xF70B;
+ private static final int NSF9FunctionKey = 0xF70C;
+ private static final int NSF10FunctionKey = 0xF70D;
+ private static final int NSF11FunctionKey = 0xF70E;
+ private static final int NSF12FunctionKey = 0xF70F;
+ private static final int NSF13FunctionKey = 0xF710;
+ private static final int NSF14FunctionKey = 0xF711;
+ private static final int NSF15FunctionKey = 0xF712;
+ private static final int NSF16FunctionKey = 0xF713;
+ private static final int NSF17FunctionKey = 0xF714;
+ private static final int NSF18FunctionKey = 0xF715;
+ private static final int NSF19FunctionKey = 0xF716;
+ private static final int NSF20FunctionKey = 0xF717;
+ private static final int NSF21FunctionKey = 0xF718;
+ private static final int NSF22FunctionKey = 0xF719;
+ private static final int NSF23FunctionKey = 0xF71A;
+ private static final int NSF24FunctionKey = 0xF71B;
+ private static final int NSF25FunctionKey = 0xF71C;
+ private static final int NSF26FunctionKey = 0xF71D;
+ private static final int NSF27FunctionKey = 0xF71E;
+ private static final int NSF28FunctionKey = 0xF71F;
+ private static final int NSF29FunctionKey = 0xF720;
+ private static final int NSF30FunctionKey = 0xF721;
+ private static final int NSF31FunctionKey = 0xF722;
+ private static final int NSF32FunctionKey = 0xF723;
+ private static final int NSF33FunctionKey = 0xF724;
+ private static final int NSF34FunctionKey = 0xF725;
+ private static final int NSF35FunctionKey = 0xF726;
+ private static final int NSInsertFunctionKey = 0xF727;
+ private static final int NSDeleteFunctionKey = 0xF728;
+ private static final int NSHomeFunctionKey = 0xF729;
+ private static final int NSBeginFunctionKey = 0xF72A;
+ private static final int NSEndFunctionKey = 0xF72B;
+ private static final int NSPageUpFunctionKey = 0xF72C;
+ private static final int NSPageDownFunctionKey = 0xF72D;
+ private static final int NSPrintScreenFunctionKey = 0xF72E;
+ private static final int NSScrollLockFunctionKey = 0xF72F;
+ private static final int NSPauseFunctionKey = 0xF730;
+ private static final int NSSysReqFunctionKey = 0xF731;
+ private static final int NSBreakFunctionKey = 0xF732;
+ private static final int NSResetFunctionKey = 0xF733;
+ private static final int NSStopFunctionKey = 0xF734;
+ private static final int NSMenuFunctionKey = 0xF735;
+ private static final int NSUserFunctionKey = 0xF736;
+ private static final int NSSystemFunctionKey = 0xF737;
+ private static final int NSPrintFunctionKey = 0xF738;
+ private static final int NSClearLineFunctionKey = 0xF739;
+ private static final int NSClearDisplayFunctionKey = 0xF73A;
+ private static final int NSInsertLineFunctionKey = 0xF73B;
+ private static final int NSDeleteLineFunctionKey = 0xF73C;
+ private static final int NSInsertCharFunctionKey = 0xF73D;
+ private static final int NSDeleteCharFunctionKey = 0xF73E;
+ private static final int NSPrevFunctionKey = 0xF73F;
+ private static final int NSNextFunctionKey = 0xF740;
+ private static final int NSSelectFunctionKey = 0xF741;
+ private static final int NSExecuteFunctionKey = 0xF742;
+ private static final int NSUndoFunctionKey = 0xF743;
+ private static final int NSRedoFunctionKey = 0xF744;
+ private static final int NSFindFunctionKey = 0xF745;
+ private static final int NSHelpFunctionKey = 0xF746;
+ private static final int NSModeSwitchFunctionKey = 0xF747;
+
+ // sync the MacOSX resources .. NSView, ie toggle fullscreen, window create
+ private Object nsViewLock = new Object();
+
+ private volatile long surfaceHandle;
+ // non fullscreen dimensions ..
+ private int nfs_width, nfs_height, nfs_x, nfs_y;
+
+ static {
+ initSingleton();
+ }
+
+ private static volatile boolean isInit = false;
+
+ public static synchronized void initSingleton() {
+ if(isInit) return;
+ isInit=true;
+
+ NativeLibLoader.loadNEWT();
+
+ if(!initIDs()) {
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
+ }
+ if(DEBUG_IMPLEMENTATION) System.out.println("MacWindow.initIDs OK "+Thread.currentThread().getName());
+ }
+
+ public MacWindow() {
+ }
+
+ protected void createNative(Capabilities caps) {
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ if (config == null) {
+ throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+ }
+ }
+
+ class CloseAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if(DEBUG_IMPLEMENTATION) System.out.println("MacWindow.CloseAction "+Thread.currentThread().getName());
+ if (windowHandle != 0) {
+ close0(windowHandle);
+ windowHandle = 0;
+ }
+ }
+ }
+ }
+ private CloseAction closeAction = new CloseAction();
+
+ protected void closeNative() {
+ MainThread.invoke(true, closeAction);
+ }
+
+ public long getWindowHandle() {
+ synchronized(nsViewLock) {
+ return windowHandle;
+ }
+ }
+
+ public long getSurfaceHandle() {
+ synchronized(nsViewLock) {
+ return surfaceHandle;
+ }
+ }
+
+ class VisibleAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if(DEBUG_IMPLEMENTATION) System.out.println("MacWindow.VisibleAction "+visible+" "+Thread.currentThread().getName());
+ if (visible) {
+ createWindow(false);
+ } else {
+ if (windowHandle != 0) {
+ orderOut(windowHandle);
+ }
+ }
+ }
+ }
+ }
+ private VisibleAction visibleAction = new VisibleAction();
+
+ public void setVisible(boolean visible) {
+ this.visible = visible;
+ MainThread.invoke(true, visibleAction);
+ }
+
+ class TitleAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if (windowHandle != 0) {
+ setTitle0(windowHandle, title);
+ }
+ }
+ }
+ }
+ private TitleAction titleAction = new TitleAction();
+
+ public void setTitle(String title) {
+ super.setTitle(title);
+ MainThread.invoke(true, titleAction);
+ }
+
+ class FocusAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if (windowHandle != 0) {
+ makeKey(windowHandle);
+ }
+ }
+ }
+ }
+ private FocusAction focusAction = new FocusAction();
+
+ public void requestFocus() {
+ super.requestFocus();
+ MainThread.invoke(true, focusAction);
+ }
+
+ class SizeAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if (windowHandle != 0) {
+ setContentSize(windowHandle, width, height);
+ }
+ }
+ }
+ }
+ private SizeAction sizeAction = new SizeAction();
+
+ public void setSize(int width, int height) {
+ this.width=width;
+ this.height=height;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ MainThread.invoke(true, sizeAction);
+ }
+
+ class PositionAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if (windowHandle != 0) {
+ setFrameTopLeftPoint(windowHandle, x, y);
+ }
+ }
+ }
+ }
+ private PositionAction positionAction = new PositionAction();
+
+ public void setPosition(int x, int y) {
+ this.x=x;
+ this.y=y;
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ MainThread.invoke(true, positionAction);
+ }
+
+ class DispatchAction implements Runnable {
+ public void run() {
+ dispatchMessages0(windowHandle, eventMask);
+ }
+ }
+ private DispatchAction dispatchAction = new DispatchAction();
+ private int eventMask;
+
+ public void dispatchMessages(int eventMask) {
+ this.eventMask=eventMask;
+ MainThread.invoke(false, dispatchAction);
+ }
+
+ class FullscreenAction implements Runnable {
+ public void run() {
+ synchronized(nsViewLock) {
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ System.err.println("MacWindow fs: "+fullscreen+" "+x+"/"+y+" "+width+"x"+height);
+ }
+ createWindow(true);
+ }
+ }
+ }
+ private FullscreenAction fullscreenAction = new FullscreenAction();
+
+ public boolean setFullscreen(boolean fullscreen) {
+ if(this.fullscreen!=fullscreen) {
+ this.fullscreen=fullscreen;
+ if(fullscreen) {
+ x = 0;
+ y = 0;
+ width = screen.getWidth();
+ height = screen.getHeight();
+ } else {
+ x = nfs_x;
+ y = nfs_y;
+ width = nfs_width;
+ height = nfs_height;
+ }
+ MainThread.invoke(true, fullscreenAction);
+ }
+ return fullscreen;
+ }
+
+ private void sizeChanged(int newWidth, int newHeight) {
+ if (DEBUG_IMPLEMENTATION) {
+ System.out.println(Thread.currentThread().getName()+" Size changed to " + newWidth + ", " + newHeight);
+ }
+ width = newWidth;
+ height = newHeight;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ if (DEBUG_IMPLEMENTATION) {
+ System.out.println(" Posted WINDOW_RESIZED event");
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+ }
+
+ private void positionChanged(int newX, int newY) {
+ if (DEBUG_IMPLEMENTATION) {
+ System.out.println(Thread.currentThread().getName()+" Position changed to " + newX + ", " + newY);
+ }
+ x = newX;
+ y = newY;
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ if (DEBUG_IMPLEMENTATION) {
+ System.out.println(" Posted WINDOW_MOVED event");
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
+ }
+
+ private void focusChanged(boolean focusGained) {
+ if (focusGained) {
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
+ } else {
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_LOST_FOCUS);
+ }
+ }
+
+ private char convertKeyChar(char keyChar) {
+ if (keyChar == '\r') {
+ // Turn these into \n
+ return '\n';
+ }
+
+ if (keyChar >= NSUpArrowFunctionKey && keyChar <= NSModeSwitchFunctionKey) {
+ switch (keyChar) {
+ case NSUpArrowFunctionKey: return KeyEvent.VK_UP;
+ case NSDownArrowFunctionKey: return KeyEvent.VK_DOWN;
+ case NSLeftArrowFunctionKey: return KeyEvent.VK_LEFT;
+ case NSRightArrowFunctionKey: return KeyEvent.VK_RIGHT;
+ case NSF1FunctionKey: return KeyEvent.VK_F1;
+ case NSF2FunctionKey: return KeyEvent.VK_F2;
+ case NSF3FunctionKey: return KeyEvent.VK_F3;
+ case NSF4FunctionKey: return KeyEvent.VK_F4;
+ case NSF5FunctionKey: return KeyEvent.VK_F5;
+ case NSF6FunctionKey: return KeyEvent.VK_F6;
+ case NSF7FunctionKey: return KeyEvent.VK_F7;
+ case NSF8FunctionKey: return KeyEvent.VK_F8;
+ case NSF9FunctionKey: return KeyEvent.VK_F9;
+ case NSF10FunctionKey: return KeyEvent.VK_F10;
+ case NSF11FunctionKey: return KeyEvent.VK_F11;
+ case NSF12FunctionKey: return KeyEvent.VK_F12;
+ case NSF13FunctionKey: return KeyEvent.VK_F13;
+ case NSF14FunctionKey: return KeyEvent.VK_F14;
+ case NSF15FunctionKey: return KeyEvent.VK_F15;
+ case NSF16FunctionKey: return KeyEvent.VK_F16;
+ case NSF17FunctionKey: return KeyEvent.VK_F17;
+ case NSF18FunctionKey: return KeyEvent.VK_F18;
+ case NSF19FunctionKey: return KeyEvent.VK_F19;
+ case NSF20FunctionKey: return KeyEvent.VK_F20;
+ case NSF21FunctionKey: return KeyEvent.VK_F21;
+ case NSF22FunctionKey: return KeyEvent.VK_F22;
+ case NSF23FunctionKey: return KeyEvent.VK_F23;
+ case NSF24FunctionKey: return KeyEvent.VK_F24;
+ case NSInsertFunctionKey: return KeyEvent.VK_INSERT;
+ case NSDeleteFunctionKey: return KeyEvent.VK_DELETE;
+ case NSHomeFunctionKey: return KeyEvent.VK_HOME;
+ case NSBeginFunctionKey: return KeyEvent.VK_BEGIN;
+ case NSEndFunctionKey: return KeyEvent.VK_END;
+ case NSPageUpFunctionKey: return KeyEvent.VK_PAGE_UP;
+ case NSPageDownFunctionKey: return KeyEvent.VK_PAGE_DOWN;
+ case NSPrintScreenFunctionKey: return KeyEvent.VK_PRINTSCREEN;
+ case NSScrollLockFunctionKey: return KeyEvent.VK_SCROLL_LOCK;
+ case NSPauseFunctionKey: return KeyEvent.VK_PAUSE;
+ // Not handled:
+ // NSSysReqFunctionKey
+ // NSBreakFunctionKey
+ // NSResetFunctionKey
+ case NSStopFunctionKey: return KeyEvent.VK_STOP;
+ // Not handled:
+ // NSMenuFunctionKey
+ // NSUserFunctionKey
+ // NSSystemFunctionKey
+ // NSPrintFunctionKey
+ // NSClearLineFunctionKey
+ // NSClearDisplayFunctionKey
+ // NSInsertLineFunctionKey
+ // NSDeleteLineFunctionKey
+ // NSInsertCharFunctionKey
+ // NSDeleteCharFunctionKey
+ // NSPrevFunctionKey
+ // NSNextFunctionKey
+ // NSSelectFunctionKey
+ // NSExecuteFunctionKey
+ // NSUndoFunctionKey
+ // NSRedoFunctionKey
+ // NSFindFunctionKey
+ // NSHelpFunctionKey
+ // NSModeSwitchFunctionKey
+ default: break;
+ }
+ }
+
+ // NSEvent's charactersIgnoringModifiers doesn't ignore the shift key
+ if (keyChar >= 'a' && keyChar <= 'z') {
+ return Character.toUpperCase(keyChar);
+ }
+
+ return keyChar;
+ }
+
+ protected void sendKeyEvent(int eventType, int modifiers, int keyCode, char keyChar) {
+ int key = convertKeyChar(keyChar);
+ if(DEBUG_IMPLEMENTATION) System.out.println("MacWindow.sendKeyEvent "+Thread.currentThread().getName());
+ // Note that we send the key char for the key code on this
+ // platform -- we do not get any useful key codes out of the system
+ super.sendKeyEvent(eventType, modifiers, key, keyChar);
+ }
+
+ private void createWindow(boolean recreate) {
+ if(0!=windowHandle && !recreate) {
+ return;
+ }
+ if(0!=windowHandle) {
+ // save the view .. close the window
+ surfaceHandle = changeContentView(windowHandle, 0);
+ if(recreate && 0==surfaceHandle) {
+ throw new NativeWindowException("Internal Error - recreate, window but no view");
+ }
+ close0(windowHandle);
+ windowHandle=0;
+ } else {
+ surfaceHandle = 0;
+ }
+ windowHandle = createWindow0(getX(), getY(), getWidth(), getHeight(), fullscreen,
+ (isUndecorated() ?
+ NSBorderlessWindowMask :
+ NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask),
+ NSBackingStoreBuffered,
+ getScreen().getIndex(), surfaceHandle);
+ if (windowHandle == 0) {
+ throw new NativeWindowException("Could create native window "+Thread.currentThread().getName()+" "+this);
+ }
+ surfaceHandle = contentView(windowHandle);
+ setTitle0(windowHandle, getTitle());
+ makeKeyAndOrderFront(windowHandle);
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
+ }
+
+ private native long createWindow0(int x, int y, int w, int h,
+ boolean fullscreen, int windowStyle,
+ int backingStoreType,
+ int screen_idx, long view);
+ private native void makeKeyAndOrderFront(long window);
+ private native void makeKey(long window);
+ private native void orderOut(long window);
+ private native void close0(long window);
+ private native void setTitle0(long window, String title);
+ protected native void dispatchMessages0(long window, int eventMask);
+ private native long contentView(long window);
+ private native long changeContentView(long window, long view);
+ private native void setContentSize(long window, int w, int h);
+ private native void setFrameTopLeftPoint(long window, int x, int y);
+ protected static native int getScreenWidth(int scrn_idx);
+ protected static native int getScreenHeight(int scrn_idx);
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
new file mode 100644
index 000000000..5d50792db
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
@@ -0,0 +1,652 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.opengl;
+
+import com.sun.javafx.newt.*;
+import javax.media.nativewindow.*;
+import javax.media.opengl.*;
+import com.sun.opengl.impl.GLDrawableHelper;
+
+/**
+ * An implementation of {@link Window} which is customized for OpenGL
+ * use, and which implements the {@link
+ * javax.media.opengl.GLAutoDrawable} interface. For convenience, this
+ * window class guarantees that its OpenGL context is current inside
+ * the various EventListeners' callbacks (MouseListener, KeyListener,
+ * etc.).
+ */
+public class GLWindow extends Window implements GLAutoDrawable {
+ /**
+ * Event handling mode: EVENT_HANDLER_GL_NONE.
+ * No GL context is current, while calling the EventListener.
+ * This might be inconvenient, but don't impact the performance.
+ *
+ * @see com.sun.javafx.newt.GLWindow#setEventHandlerMode(int)
+ */
+ public static final int EVENT_HANDLER_GL_NONE = 0;
+
+ /**
+ * Event handling mode: EVENT_HANDLER_GL_CURRENT.
+ * The GL context is made current, while calling the EventListener.
+ * This might be convenient, but impacts the performance
+ * due to context switches.
+ *
+ * This is the default setting!
+ *
+ * @see com.sun.javafx.newt.GLWindow#setEventHandlerMode(int)
+ */
+ public static final int EVENT_HANDLER_GL_CURRENT = (1 << 0);
+
+ private Window window;
+
+ /** Constructor. Do not call this directly -- use {@link
+ create()} instead. */
+ protected GLWindow(Window window, boolean ownerOfDisplayAndScreen) {
+ this.ownerOfDisplayAndScreen = ownerOfDisplayAndScreen;
+ this.window = window;
+ this.window.setAutoDrawableClient(true);
+ window.addWindowListener(new WindowListener() {
+ public void windowResized(WindowEvent e) {
+ sendReshape = true;
+ }
+
+ public void windowMoved(WindowEvent e) {
+ }
+
+ public void windowGainedFocus(WindowEvent e) {
+ }
+
+ public void windowLostFocus(WindowEvent e) {
+ }
+
+ public void windowDestroyNotify(WindowEvent e) {
+ sendDestroy = true;
+ }
+ });
+ }
+
+ /** Creates a new GLWindow on the local display, screen 0, with a
+ dummy visual ID, and with the default GLCapabilities. */
+ public static GLWindow create() {
+ return create(null, null, false);
+ }
+
+ public static GLWindow create(boolean undecorated) {
+ return create(null, null, undecorated);
+ }
+
+ /** Creates a new GLWindow referring to the given window. */
+ public static GLWindow create(Window window) {
+ return create(window, null, false);
+ }
+ public static GLWindow create(GLCapabilities caps) {
+ return create(null, caps, false);
+ }
+
+ /** Creates a new GLWindow on the local display, screen 0, with a
+ dummy visual ID, and with the given GLCapabilities. */
+ public static GLWindow create(GLCapabilities caps, boolean undecorated) {
+ return create(null, caps, undecorated);
+ }
+
+ /** Creates a new GLWindow referring to the given window, and with the given GLCapabilities. */
+ public static GLWindow create(Window window, GLCapabilities caps) {
+ return create(window, caps, false);
+ }
+
+ public static GLWindow create(Window window,
+ GLCapabilities caps,
+ boolean undecorated) {
+ if (caps == null) {
+ caps = new GLCapabilities(null); // default ..
+ }
+
+ boolean ownerOfDisplayAndScreen=false;
+ if (window == null) {
+ ownerOfDisplayAndScreen = true;
+ Display display = NewtFactory.createDisplay(null); // local display
+ Screen screen = NewtFactory.createScreen(display, 0); // screen 0
+ window = NewtFactory.createWindow(screen, caps, undecorated);
+ }
+
+ return new GLWindow(window, ownerOfDisplayAndScreen);
+ }
+
+ protected void createNative(Capabilities caps) {
+ shouldNotCallThis();
+ }
+
+ protected void closeNative() {
+ shouldNotCallThis();
+ }
+
+ protected void dispose(boolean regenerate) {
+ if(Window.DEBUG_WINDOW_EVENT || window.DEBUG_IMPLEMENTATION) {
+ Exception e1 = new Exception("GLWindow.dispose("+regenerate+") "+Thread.currentThread().getName()+", 1: "+this);
+ e1.printStackTrace();
+ }
+
+ sendDisposeEvent();
+
+ if (context != null) {
+ context.destroy();
+ }
+ if (drawable != null) {
+ drawable.setRealized(false);
+ }
+
+ if(null!=window) {
+ window.disposeSurfaceHandle();
+ }
+
+ if(regenerate) {
+ if(null==window) {
+ throw new GLException("GLWindow.dispose(true): null window");
+ }
+
+ // recreate GLDrawable, to reflect the new graphics configurations
+ NativeWindow nw;
+ if (window.getWrappedWindow() != null) {
+ nw = NativeWindowFactory.getNativeWindow(window.getWrappedWindow(), window.getGraphicsConfiguration());
+ } else {
+ nw = window;
+ }
+ drawable = factory.createGLDrawable(nw);
+ drawable.setRealized(true);
+ if(getSurfaceHandle()==0) {
+ throw new GLException("SurfaceHandle==NULL after setRealize(true) "+this);
+ }
+ context = drawable.createContext(null);
+ sendReshape = true; // ensure a reshape event is send ..
+ }
+
+ if(Window.DEBUG_WINDOW_EVENT || window.DEBUG_IMPLEMENTATION) {
+ System.out.println("GLWindow.dispose("+regenerate+") "+Thread.currentThread().getName()+", fin: "+this);
+ }
+ }
+
+ public synchronized void destroy() {
+ if(Window.DEBUG_WINDOW_EVENT || window.DEBUG_IMPLEMENTATION) {
+ Exception e1 = new Exception("GLWindow.destroy "+Thread.currentThread().getName()+", 1: "+this);
+ e1.printStackTrace();
+ }
+
+ dispose(false);
+
+ Screen _screen = null;
+ Display _device = null;
+ if(null!=window) {
+ if(ownerOfDisplayAndScreen) {
+ _screen = getScreen();
+ if(null != _screen) {
+ _device = _screen.getDisplay();
+ }
+ }
+ window.destroy();
+ }
+
+ if(Window.DEBUG_WINDOW_EVENT || window.DEBUG_IMPLEMENTATION) {
+ System.out.println("GLWindow.destroy "+Thread.currentThread().getName()+", fin: "+this);
+ }
+
+ drawable = null;
+ context = null;
+
+ if(null != _screen) {
+ _screen.destroy();
+ }
+ if(null != _device) {
+ _device.destroy();
+ }
+ window = null;
+ }
+
+ public boolean getPerfLogEnabled() { return perfLog; }
+
+ public void enablePerfLog(boolean v) {
+ perfLog = v;
+ }
+
+ /**
+ * Sets the event handling mode.
+ *
+ * @see com.sun.javafx.newt.GLWindow#EVENT_HANDLER_GL_NONE
+ * @see com.sun.javafx.newt.GLWindow#EVENT_HANDLER_GL_CURRENT
+ */
+ public void setEventHandlerMode(int mode) {
+ eventHandlerMode = mode;
+ }
+
+ public int getEventHandlerMode() {
+ return eventHandlerMode;
+ }
+
+ public void pumpMessages(int eventMask) {
+ if( 0 == (eventHandlerMode & EVENT_HANDLER_GL_CURRENT) ) {
+ window.pumpMessages(eventMask);
+ } else {
+ pumpMessagesWithEventMaskAction.eventMask = eventMask;
+ pumpMessagesImpl(pumpMessagesWithEventMaskAction);
+ }
+ }
+
+ public void pumpMessages() {
+ if( 0 == (eventHandlerMode & EVENT_HANDLER_GL_CURRENT) ) {
+ window.pumpMessages();
+ } else {
+ pumpMessagesImpl(pumpMessagesAction);
+ }
+ }
+
+ class PumpMessagesWithEventMaskAction implements Runnable {
+ private int eventMask;
+
+ public void run() {
+ window.pumpMessages(eventMask);
+ }
+ }
+ private PumpMessagesWithEventMaskAction pumpMessagesWithEventMaskAction = new PumpMessagesWithEventMaskAction();
+
+ class PumpMessagesAction implements Runnable {
+ public void run() {
+ window.pumpMessages();
+ }
+ }
+ private PumpMessagesAction pumpMessagesAction = new PumpMessagesAction();
+
+ private void pumpMessagesImpl(Runnable pumpMessagesAction) {
+ // pumpMessagesAction.run();
+
+ boolean autoSwapBuffer = helper.getAutoSwapBufferMode();
+ helper.setAutoSwapBufferMode(false);
+ try {
+ helper.invokeGL(drawable, context, pumpMessagesAction, initAction);
+ } finally {
+ helper.setAutoSwapBufferMode(autoSwapBuffer);
+ }
+
+ }
+
+ protected void dispatchMessages(int eventMask) {
+ shouldNotCallThis();
+ }
+
+ public void setVisible(boolean visible) {
+ window.setVisible(visible);
+ if (visible && context == null) {
+ NativeWindow nw;
+ if (window.getWrappedWindow() != null) {
+ nw = NativeWindowFactory.getNativeWindow(window.getWrappedWindow(), window.getGraphicsConfiguration());
+ } else {
+ nw = window;
+ }
+ GLCapabilities glCaps = (GLCapabilities) nw.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+ factory = GLDrawableFactory.getFactory(glCaps.getGLProfile());
+ drawable = factory.createGLDrawable(nw);
+ drawable.setRealized(true);
+ if(getSurfaceHandle()==0) {
+ throw new GLException("SurfaceHandle==NULL after setRealize(true) "+this);
+ }
+ context = drawable.createContext(null);
+ sendReshape = true; // ensure a reshape event is send ..
+ }
+ }
+
+ public Screen getScreen() {
+ return window.getScreen();
+ }
+
+ public void setTitle(String title) {
+ window.setTitle(title);
+ }
+
+ public String getTitle() {
+ return window.getTitle();
+ }
+
+ public void setUndecorated(boolean value) {
+ window.setUndecorated(value);
+ }
+
+ public boolean isUndecorated() {
+ return window.isUndecorated();
+ }
+
+ public void setSize(int width, int height) {
+ window.setSize(width, height);
+ }
+
+ public void setPosition(int x, int y) {
+ window.setPosition(x, y);
+ }
+
+ public boolean setFullscreen(boolean fullscreen) {
+ return window.setFullscreen(fullscreen);
+ }
+
+ public boolean isVisible() {
+ return window.isVisible();
+ }
+
+ public int getX() {
+ return window.getX();
+ }
+
+ public int getY() {
+ return window.getY();
+ }
+
+ public int getWidth() {
+ return window.getWidth();
+ }
+
+ public int getHeight() {
+ return window.getHeight();
+ }
+
+ public boolean isFullscreen() {
+ return window.isFullscreen();
+ }
+
+ public void addMouseListener(MouseListener l) {
+ window.addMouseListener(l);
+ }
+
+ public void removeMouseListener(MouseListener l) {
+ window.removeMouseListener(l);
+ }
+
+ public MouseListener[] getMouseListeners() {
+ return window.getMouseListeners();
+ }
+
+ public void addKeyListener(KeyListener l) {
+ window.addKeyListener(l);
+ }
+
+ public void removeKeyListener(KeyListener l) {
+ window.removeKeyListener(l);
+ }
+
+ public KeyListener[] getKeyListeners() {
+ return window.getKeyListeners();
+ }
+
+ public void addWindowListener(WindowListener l) {
+ window.addWindowListener(l);
+ }
+
+ public void removeWindowListener(WindowListener l) {
+ window.removeWindowListener(l);
+ }
+
+ public WindowListener[] getWindowListeners() {
+ return window.getWindowListeners();
+ }
+
+ public String toString() {
+ return "NEWT-GLWindow[ "+drawable+", \n\t"+window+", \n\t"+helper+", \n\t"+factory+"]";
+ }
+
+ //----------------------------------------------------------------------
+ // OpenGL-related methods and state
+ //
+
+ private int eventHandlerMode = EVENT_HANDLER_GL_CURRENT;
+ private GLDrawableFactory factory;
+ private GLDrawable drawable;
+ private GLContext context;
+ private GLDrawableHelper helper = new GLDrawableHelper();
+ // To make reshape events be sent immediately before a display event
+ private boolean sendReshape=false;
+ private boolean sendDestroy=false;
+ private boolean perfLog = false;
+
+ public GLDrawableFactory getFactory() {
+ return factory;
+ }
+
+ public void setContext(GLContext newCtx) {
+ context = newCtx;
+ }
+
+ public GLContext getContext() {
+ return context;
+ }
+
+ public GL getGL() {
+ if (context == null) {
+ return null;
+ }
+ return context.getGL();
+ }
+
+ public void setGL(GL gl) {
+ if (context != null) {
+ context.setGL(gl);
+ }
+ }
+
+ public void addGLEventListener(GLEventListener listener) {
+ helper.addGLEventListener(listener);
+ }
+
+ public void removeGLEventListener(GLEventListener listener) {
+ helper.removeGLEventListener(listener);
+ }
+
+ public void display() {
+ if(getSurfaceHandle()!=0) {
+ pumpMessages();
+ if(window.hasDeviceChanged() && GLAutoDrawable.SCREEN_CHANGE_ACTION_ENABLED) {
+ dispose(true);
+ }
+ if (sendDestroy) {
+ destroy();
+ sendDestroy=false;
+ } else {
+ helper.invokeGL(drawable, context, displayAction, initAction);
+ }
+ }
+ }
+
+ private void sendDisposeEvent() {
+ if(disposeAction!=null && drawable!=null && context != null && window!=null && getSurfaceHandle()!=0) {
+ helper.invokeGL(drawable, context, disposeAction, null);
+ }
+ }
+
+ public void setAutoSwapBufferMode(boolean onOrOff) {
+ helper.setAutoSwapBufferMode(onOrOff);
+ }
+
+ public boolean getAutoSwapBufferMode() {
+ return helper.getAutoSwapBufferMode();
+ }
+
+ public void swapBuffers() {
+ if(getSurfaceHandle()!=0) {
+ if (context != null && context != GLContext.getCurrent()) {
+ // Assume we should try to make the context current before swapping the buffers
+ helper.invokeGL(drawable, context, swapBuffersAction, initAction);
+ } else {
+ drawable.swapBuffers();
+ }
+ }
+ }
+
+ class InitAction implements Runnable {
+ public void run() {
+ helper.init(GLWindow.this);
+ startTime = System.currentTimeMillis();
+ curTime = startTime;
+ if(perfLog) {
+ lastCheck = startTime;
+ totalFrames = 0; lastFrames = 0;
+ }
+ }
+ }
+ private InitAction initAction = new InitAction();
+
+ class DisposeAction implements Runnable {
+ public void run() {
+ helper.dispose(GLWindow.this);
+ }
+ }
+ private DisposeAction disposeAction = new DisposeAction();
+
+ class DisplayAction implements Runnable {
+ public void run() {
+ if (sendReshape) {
+ int width = getWidth();
+ int height = getHeight();
+ getGL().glViewport(0, 0, width, height);
+ helper.reshape(GLWindow.this, 0, 0, width, height);
+ sendReshape = false;
+ }
+
+ helper.display(GLWindow.this);
+
+ curTime = System.currentTimeMillis();
+ totalFrames++;
+
+ if(perfLog) {
+ long dt0, dt1;
+ lastFrames++;
+ dt0 = curTime-lastCheck;
+ if ( dt0 > 5000 ) {
+ dt1 = curTime-startTime;
+ System.out.println(dt0/1000 +"s: "+ lastFrames + "f, " + (lastFrames*1000)/dt0 + " fps, "+dt0/lastFrames+" ms/f; "+
+ "total: "+ dt1/1000+"s, "+(totalFrames*1000)/dt1 + " fps, "+dt1/totalFrames+" ms/f");
+ lastCheck=curTime;
+ lastFrames=0;
+ }
+ }
+ }
+ }
+
+ public long getStartTime() { return startTime; }
+ public long getCurrentTime() { return curTime; }
+ public long getDuration() { return curTime-startTime; }
+ public int getTotalFrames() { return totalFrames; }
+
+ private long startTime = 0;
+ private long curTime = 0;
+ private long lastCheck = 0;
+ private int totalFrames = 0, lastFrames = 0;
+ private boolean ownerOfDisplayAndScreen;
+
+ private DisplayAction displayAction = new DisplayAction();
+
+ class SwapBuffersAction implements Runnable {
+ public void run() {
+ drawable.swapBuffers();
+ }
+ }
+
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
+
+ //----------------------------------------------------------------------
+ // GLDrawable methods
+ //
+
+ public NativeWindow getNativeWindow() {
+ return null!=drawable ? drawable.getNativeWindow() : null;
+ }
+
+ public synchronized int lockSurface() throws NativeWindowException {
+ if(null!=drawable) return drawable.getNativeWindow().lockSurface();
+ return NativeWindow.LOCK_SURFACE_NOT_READY;
+ }
+
+ public synchronized void unlockSurface() {
+ if(null!=drawable) drawable.getNativeWindow().unlockSurface();
+ else throw new NativeWindowException("NEWT-GLWindow not locked");
+ }
+
+ public synchronized boolean isSurfaceLocked() {
+ if(null!=drawable) return drawable.getNativeWindow().isSurfaceLocked();
+ return false;
+ }
+
+ public synchronized Exception getLockedStack() {
+ if(null!=drawable) return drawable.getNativeWindow().getLockedStack();
+ return null;
+ }
+
+ public long getWindowHandle() {
+ if(null!=drawable) return drawable.getNativeWindow().getWindowHandle();
+ return super.getWindowHandle();
+ }
+
+ public long getSurfaceHandle() {
+ if(null!=drawable) return drawable.getNativeWindow().getSurfaceHandle();
+ return super.getSurfaceHandle();
+ }
+
+ //----------------------------------------------------------------------
+ // GLDrawable methods that are not really needed
+ //
+
+ public GLContext createContext(GLContext shareWith) {
+ return drawable.createContext(shareWith);
+ }
+
+ public void setRealized(boolean realized) {
+ }
+
+ public GLCapabilities getChosenGLCapabilities() {
+ if (drawable == null) {
+ throw new GLException("No drawable yet");
+ }
+
+ return drawable.getChosenGLCapabilities();
+ }
+
+ public GLProfile getGLProfile() {
+ if (drawable == null) {
+ throw new GLException("No drawable yet");
+ }
+
+ return drawable.getGLProfile();
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only below this point
+ //
+
+ private void shouldNotCallThis() {
+ throw new NativeWindowException("Should not call this");
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java
new file mode 100755
index 000000000..a13a95586
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDDisplay.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.opengl.kd;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import com.sun.opengl.impl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+
+public class KDDisplay extends Display {
+ static {
+ NativeLibLoader.loadNEWT();
+ }
+
+ public KDDisplay() {
+ }
+
+ protected void createNative() {
+ // FIXME: map name to EGL_*_DISPLAY
+ long handle = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
+ if (handle == EGL.EGL_NO_DISPLAY) {
+ throw new NativeWindowException("eglGetDisplay failed");
+ }
+ if (!EGL.eglInitialize(handle, null, null)) {
+ throw new NativeWindowException("eglInitialize failed");
+ }
+ aDevice = new EGLGraphicsDevice(handle);
+ }
+
+ protected void closeNative() {
+ if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
+ EGL.eglTerminate(aDevice.getHandle());
+ }
+ }
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java
new file mode 100755
index 000000000..752a55752
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDScreen.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.opengl.kd;
+
+import com.sun.javafx.newt.*;
+import javax.media.nativewindow.*;
+
+public class KDScreen extends Screen {
+ public KDScreen() {
+ }
+
+ protected void createNative(int index) {
+ aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), index);
+ }
+
+ protected void closeNative() { }
+
+ // elevate access to this package ..
+ protected void setScreenSize(int w, int h) {
+ super.setScreenSize(w, h);
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java
new file mode 100755
index 000000000..587bf185e
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/kd/KDWindow.java
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.opengl.kd;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import com.sun.opengl.impl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+import javax.media.nativewindow.NativeWindowException;
+
+public class KDWindow extends Window {
+ private static final String WINDOW_CLASS_NAME = "NewtWindow";
+ // non fullscreen dimensions ..
+ private int nfs_width, nfs_height, nfs_x, nfs_y;
+
+ static {
+ NativeLibLoader.loadNEWT();
+
+ if (!initIDs()) {
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
+ }
+ }
+
+ public KDWindow() {
+ }
+
+ protected void createNative(Capabilities caps) {
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ if (config == null) {
+ throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+ }
+
+ GLCapabilities eglCaps = (GLCapabilities)config.getChosenCapabilities();
+ int[] eglAttribs = EGLGraphicsConfiguration.GLCapabilities2AttribList(eglCaps, EGL.EGL_WINDOW_BIT);
+
+ windowHandle = 0;
+ windowID = ++_windowID;
+ eglWindowHandle = CreateWindow(windowID, getDisplayHandle(), eglAttribs);
+ if (eglWindowHandle == 0) {
+ throw new NativeWindowException("Error creating egl window: "+config);
+ }
+ setVisible0(eglWindowHandle, false);
+ windowHandleClose = eglWindowHandle;
+ }
+
+ protected void closeNative() {
+ if(0!=windowHandleClose) {
+ CloseWindow(windowHandleClose);
+ }
+ }
+
+ public void setVisible(boolean visible) {
+ if(this.visible!=visible) {
+ this.visible=visible;
+ setVisible0(eglWindowHandle, visible);
+ if ( 0==windowHandle ) {
+ windowHandle = RealizeWindow(eglWindowHandle);
+ if (0 == windowHandle) {
+ throw new NativeWindowException("Error native Window Handle is null");
+ }
+ }
+ clearEventMask();
+ }
+ }
+
+ public void setSize(int width, int height) {
+ setSize0(eglWindowHandle, width, height);
+ }
+
+ public void setPosition(int x, int y) {
+ // n/a in KD
+ System.err.println("setPosition n/a in KD");
+ }
+
+ public boolean setFullscreen(boolean fullscreen) {
+ if(this.fullscreen!=fullscreen) {
+ this.fullscreen=fullscreen;
+ if(this.fullscreen) {
+ setFullScreen0(eglWindowHandle, true);
+ } else {
+ setFullScreen0(eglWindowHandle, false);
+ setSize0(eglWindowHandle, nfs_width, nfs_height);
+ }
+ }
+ return true;
+ }
+
+ protected void dispatchMessages(int eventMask) {
+ DispatchMessages(windowID, eglWindowHandle, eventMask);
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only
+ //
+
+ private static native boolean initIDs();
+ private native long CreateWindow(int owner, long displayHandle, int[] attributes);
+ private native long RealizeWindow(long eglWindowHandle);
+ private native int CloseWindow(long eglWindowHandle);
+ private native void setVisible0(long eglWindowHandle, boolean visible);
+ private native void setSize0(long eglWindowHandle, int width, int height);
+ private native void setFullScreen0(long eglWindowHandle, boolean fullscreen);
+ private native void DispatchMessages(int owner, long eglWindowHandle, int eventMask);
+
+ private void sizeChanged(int newWidth, int newHeight) {
+ width = newWidth;
+ height = newHeight;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ } else {
+ ((KDScreen)screen).setScreenSize(width, height);
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+ }
+
+ private long eglWindowHandle;
+ private long windowHandleClose;
+ private int windowID;
+ private static int _windowID = 0;
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/util/MainThread.java b/src/newt/classes/com/sun/javafx/newt/util/MainThread.java
new file mode 100644
index 000000000..01604476d
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/util/MainThread.java
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ */
+
+package com.sun.javafx.newt.util;
+
+import java.util.*;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.media.nativewindow.*;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import com.sun.javafx.newt.macosx.MacWindow;
+import com.sun.nativewindow.impl.NWReflection;
+
+/**
+ * NEWT Utility class MainThread<P>
+ *
+ * This class provides a startup singleton <i>main thread</i>,
+ * from which a new thread with the users main class is launched.<br>
+ *
+ * Such behavior is necessary for native windowing toolkits,
+ * where the windowing management must happen on the so called
+ * <i>main thread</i> e.g. for Mac OS X !<br>
+ *
+ * Utilizing this class as a launchpad, now you are able to
+ * use a NEWT multithreaded application with window handling within the different threads,
+ * even on these restricted platforms.<br>
+ *
+ * To support your NEWT Window platform,
+ * you have to pass your <i>main thread</i> actions to {@link #invoke invoke(..)},
+ * have a look at the {@link com.sun.javafx.newt.macosx.MacWindow MacWindow} implementation.<br>
+ * <i>TODO</i>: Some hardcoded dependencies exist in this implementation,
+ * where you have to patch this code or factor it out. <P>
+ *
+ * If your platform is not Mac OS X, but you want to test your code without modifying
+ * this class, you have to set the system property <code>newt.MainThread.force</code> to <code>true</code>.<P>
+ *
+ * The code is compatible with all other platform, which support multithreaded windowing handling.
+ * Since those platforms won't trigger the <i>main thread</i> serialization, the main method
+ * will be simply executed, in case you haven't set <code>newt.MainThread.force</code> to <code>true</code>.<P>
+ *
+ * Test case on Mac OS X (or any other platform):
+ <PRE>
+ java -XstartOnFirstThread com.sun.javafx.newt.util.MainThread demos.es1.RedSquare -GL2 -GL2 -GL2 -GL2
+ </PRE>
+ * Which starts 4 threads, each with a window and OpenGL rendering.<br>
+ */
+public class MainThread {
+ public static final boolean USE_MAIN_THREAD = NativeWindowFactory.getNativeWindowType(false)==NativeWindowFactory.TYPE_MACOSX ||
+ Boolean.getBoolean("newt.MainThread.force");
+
+ protected static final boolean DEBUG = Debug.debug("MainThread");
+
+ private static boolean isExit=false;
+ private static volatile boolean isRunning=false;
+ private static Object taskWorkerLock=new Object();
+ private static boolean shouldStop;
+ private static ArrayList tasks;
+ private static ArrayList tasksBlock;
+ private static Thread mainThread;
+
+ static class MainAction extends Thread {
+ private String mainClassName;
+ private String[] mainClassArgs;
+
+ private Class mainClass;
+ private Method mainClassMain;
+
+ public MainAction(String mainClassName, String[] mainClassArgs) {
+ this.mainClassName=mainClassName;
+ this.mainClassArgs=mainClassArgs;
+ }
+
+ public void run() {
+ if ( USE_MAIN_THREAD ) {
+ // we have to start first to provide the service ..
+ MainThread.waitUntilRunning();
+ }
+
+ // start user app ..
+ try {
+ Class mainClass = NWReflection.getClass(mainClassName, true);
+ if(null==mainClass) {
+ throw new RuntimeException(new ClassNotFoundException("MainThread couldn't find main class "+mainClassName));
+ }
+ try {
+ mainClassMain = mainClass.getDeclaredMethod("main", new Class[] { String[].class });
+ mainClassMain.setAccessible(true);
+ } catch (Throwable t) {
+ throw new RuntimeException(t);
+ }
+ if(DEBUG) System.err.println("MainAction.run(): "+Thread.currentThread().getName()+" invoke "+mainClassName);
+ mainClassMain.invoke(null, new Object[] { mainClassArgs } );
+ } catch (InvocationTargetException ite) {
+ ite.getTargetException().printStackTrace();
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+
+ if(DEBUG) System.err.println("MainAction.run(): "+Thread.currentThread().getName()+" user app fin");
+
+ if ( USE_MAIN_THREAD ) {
+ MainThread.exit();
+ if(DEBUG) System.err.println("MainAction.run(): "+Thread.currentThread().getName()+" MainThread fin - exit");
+ System.exit(0);
+ }
+ }
+ }
+ private static MainAction mainAction;
+
+ /** Your new java application main entry, which pipelines your application */
+ public static void main(String[] args) {
+ if(DEBUG) System.err.println("MainThread.main(): "+Thread.currentThread().getName()+" USE_MAIN_THREAD "+ USE_MAIN_THREAD );
+
+ if(args.length==0) {
+ return;
+ }
+
+ String mainClassName=args[0];
+ String[] mainClassArgs=new String[args.length-1];
+ if(args.length>1) {
+ System.arraycopy(args, 1, mainClassArgs, 0, args.length-1);
+ }
+
+ NativeLibLoader.loadNEWT();
+
+ shouldStop = false;
+ tasks = new ArrayList();
+ tasksBlock = new ArrayList();
+ mainThread = Thread.currentThread();
+
+ mainAction = new MainAction(mainClassName, mainClassArgs);
+
+ if(NativeWindowFactory.getNativeWindowType(false)==NativeWindowFactory.TYPE_MACOSX) {
+ MacWindow.initSingleton();
+ }
+
+ if ( USE_MAIN_THREAD ) {
+ // dispatch user's main thread ..
+ mainAction.start();
+
+ // do our main thread task scheduling
+ run();
+ } else {
+ // run user's main in this thread
+ mainAction.run();
+ }
+ }
+
+ /** invokes the given Runnable */
+ public static void invoke(boolean wait, Runnable r) {
+ if(r == null) {
+ return;
+ }
+
+ // if this main thread is not being used or
+ // if this is already the main thread .. just execute.
+ if( !isRunning() || mainThread == Thread.currentThread() ) {
+ r.run();
+ return;
+ }
+
+ synchronized(taskWorkerLock) {
+ tasks.add(r);
+ if(wait) {
+ tasksBlock.add(r);
+ }
+ taskWorkerLock.notifyAll();
+ if(wait) {
+ while(tasksBlock.size()>0) {
+ try {
+ taskWorkerLock.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+
+ public static void exit() {
+ if(DEBUG) System.err.println("MainThread.exit(): "+Thread.currentThread().getName()+" start");
+ synchronized(taskWorkerLock) {
+ if(isRunning) {
+ shouldStop = true;
+ }
+ taskWorkerLock.notifyAll();
+ }
+ if(DEBUG) System.err.println("MainThread.exit(): "+Thread.currentThread().getName()+" end");
+ }
+
+ public static boolean isRunning() {
+ synchronized(taskWorkerLock) {
+ return isRunning;
+ }
+ }
+
+ private static void waitUntilRunning() {
+ synchronized(taskWorkerLock) {
+ if(isExit) return;
+
+ while(!isRunning) {
+ try {
+ taskWorkerLock.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public static void run() {
+ if(DEBUG) System.err.println("MainThread.run(): "+Thread.currentThread().getName());
+ synchronized(taskWorkerLock) {
+ isRunning = true;
+ taskWorkerLock.notifyAll();
+ }
+ while(!shouldStop) {
+ try {
+ ArrayList localTasks=null;
+
+ // wait for something todo ..
+ synchronized(taskWorkerLock) {
+ while(!shouldStop && tasks.size()==0) {
+ try {
+ taskWorkerLock.wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ // seq. process all tasks until no blocking one exists in the list
+ for(Iterator i = tasks.iterator(); tasksBlock.size()>0 && i.hasNext(); ) {
+ Runnable task = (Runnable) i.next();
+ task.run();
+ i.remove();
+ tasksBlock.remove(task);
+ }
+
+ // take over the tasks ..
+ if(tasks.size()>0) {
+ localTasks = tasks;
+ tasks = new ArrayList();
+ }
+ taskWorkerLock.notifyAll();
+ }
+
+ // seq. process all unblocking tasks ..
+ if(null!=localTasks) {
+ for(Iterator i = localTasks.iterator(); i.hasNext(); ) {
+ Runnable task = (Runnable) i.next();
+ task.run();
+ }
+ }
+ } catch (Throwable t) {
+ // handle errors ..
+ t.printStackTrace();
+ } finally {
+ // epilog - unlock locked stuff
+ }
+ }
+ if(DEBUG) System.err.println("MainThread.run(): "+Thread.currentThread().getName()+" fin");
+ synchronized(taskWorkerLock) {
+ isRunning = false;
+ isExit = true;
+ taskWorkerLock.notifyAll();
+ }
+ }
+}
+
+
diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java b/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java
new file mode 100755
index 000000000..436101a35
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/windows/WindowsDisplay.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.windows;
+
+import com.sun.javafx.newt.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.windows.*;
+
+public class WindowsDisplay extends Display {
+ public WindowsDisplay() {
+ }
+
+ protected void createNative() {
+ aDevice = new WindowsGraphicsDevice();
+ }
+
+ protected void closeNative() { }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java b/src/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java
new file mode 100755
index 000000000..828cf4ca0
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/windows/WindowsScreen.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.windows;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import javax.media.nativewindow.*;
+
+public class WindowsScreen extends Screen {
+ static {
+ NativeLibLoader.loadNEWT();
+ }
+
+ public WindowsScreen() {
+ }
+
+ protected void createNative(int index) {
+ aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), index);
+ setScreenSize(getScreenWidth(getIndex()), getScreenHeight(getIndex()));
+ }
+
+ protected void closeNative() { }
+
+ private native int getScreenWidth(int scrn_idx);
+ private native int getScreenHeight(int scrn_idx);
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java b/src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java
new file mode 100755
index 000000000..273be6653
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/windows/WindowsWindow.java
@@ -0,0 +1,286 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.windows;
+
+import javax.media.nativewindow.*;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+
+public class WindowsWindow extends Window {
+
+ private long hmon;
+ private long hdc;
+ private long windowHandleClose;
+ // non fullscreen dimensions ..
+ private int nfs_width, nfs_height, nfs_x, nfs_y;
+
+ static {
+ NativeLibLoader.loadNEWT();
+
+ if (!initIDs()) {
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
+ }
+ }
+
+ public WindowsWindow() {
+ }
+
+ public long getSurfaceHandle() {
+ if (hdc == 0) {
+ hdc = GetDC(windowHandle);
+ hmon = MonitorFromWindow(windowHandle);
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ Exception e = new Exception("!!! Window new surface handle "+Thread.currentThread().getName()+
+ ",HDC 0x"+Long.toHexString(hdc)+", HMON 0x"+Long.toHexString(hmon));
+ e.printStackTrace();
+ }
+ }
+ return hdc;
+ }
+
+ public boolean hasDeviceChanged() {
+ long _hmon = MonitorFromWindow(windowHandle);
+ if (hmon != _hmon) {
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ Exception e = new Exception("!!! Window Device Changed "+Thread.currentThread().getName()+
+ ", HMON 0x"+Long.toHexString(hmon)+" -> 0x"+Long.toHexString(_hmon));
+ e.printStackTrace();
+ }
+ hmon = _hmon;
+ return true;
+ }
+ return false;
+ }
+
+ public void disposeSurfaceHandle() {
+ if (hdc != 0) {
+ ReleaseDC(windowHandle, hdc);
+ hdc=0;
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ Exception e = new Exception("!!! Window surface handle disposed "+Thread.currentThread().getName());
+ e.printStackTrace();
+ }
+ }
+ }
+
+ protected void createNative(Capabilities caps) {
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ if (config == null) {
+ throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+ }
+ windowHandle = CreateWindow(getWindowClassAtom(), WINDOW_CLASS_NAME, getHInstance(), 0, undecorated, x, y, width, height);
+ if (windowHandle == 0) {
+ throw new NativeWindowException("Error creating window");
+ }
+ windowHandleClose = windowHandle;
+ }
+
+ protected void closeNative() {
+ if (hdc != 0) {
+ if(windowHandleClose != 0) {
+ ReleaseDC(windowHandleClose, hdc);
+ }
+ hdc = 0;
+ }
+ if(windowHandleClose != 0) {
+ DestroyWindow(windowHandleClose);
+ windowHandleClose = 0;
+ }
+ }
+
+ protected void windowDestroyed() {
+ // singleton ATOM CleanupWindowResources(getWindowClassAtom(), getHInstance());
+ windowHandleClose = 0;
+ super.windowDestroyed();
+ }
+
+ public void setVisible(boolean visible) {
+ if(this.visible!=visible) {
+ this.visible=visible;
+ setVisible0(windowHandle, visible);
+ }
+ }
+
+ // @Override
+ public void setSize(int width, int height) {
+ if (width != this.width || this.height != height) {
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ this.width = width;
+ this.height = height;
+ setSize0(windowHandle, width, height);
+ }
+ }
+
+ //@Override
+ public void setPosition(int x, int y) {
+ if (this.x != x || this.y != y) {
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ this.x = x;
+ this.y = y;
+ setPosition(windowHandle, x , y);
+ }
+ }
+
+ public boolean setFullscreen(boolean fullscreen) {
+ if(this.fullscreen!=fullscreen) {
+ int x,y,w,h;
+ this.fullscreen=fullscreen;
+ if(fullscreen) {
+ x = 0; y = 0;
+ w = screen.getWidth();
+ h = screen.getHeight();
+ } else {
+ x = nfs_x;
+ y = nfs_y;
+ w = nfs_width;
+ h = nfs_height;
+ }
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ System.err.println("WindowsWindow fs: "+fullscreen+" "+x+"/"+y+" "+w+"x"+h);
+ }
+ setFullscreen0(windowHandle, x, y, w, h, undecorated, fullscreen);
+ }
+ return fullscreen;
+ }
+
+ // @Override
+ public void requestFocus() {
+ super.requestFocus();
+ if (windowHandle != 0L) {
+ requestFocus(windowHandle);
+ }
+ }
+
+ // @Override
+ public void setTitle(String title) {
+ if (title == null) {
+ title = "";
+ }
+ if (!title.equals(getTitle())) {
+ super.setTitle(title);
+ setTitle(windowHandle, title);
+ }
+ }
+
+ protected void dispatchMessages(int eventMask) {
+ DispatchMessages(windowHandle, eventMask);
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only
+ //
+ private static final String WINDOW_CLASS_NAME = "NewtWindowClass";
+
+ private static int windowClassAtom = 0;
+ private static synchronized int getWindowClassAtom() {
+ if(0 == windowClassAtom) {
+ windowClassAtom = RegisterWindowClass(WINDOW_CLASS_NAME, getHInstance());
+ if (windowClassAtom == 0) {
+ throw new NativeWindowException("Error while registering window class");
+ }
+ }
+ return windowClassAtom;
+ }
+ private static long hInstance;
+ private static synchronized long getHInstance() {
+ if (hInstance == 0) {
+ hInstance = LoadLibraryW("newt");
+ if (hInstance == 0) {
+ throw new NativeWindowException("Error finding HINSTANCE for \"newt\"");
+ }
+ }
+ return hInstance;
+ }
+
+ private static native boolean initIDs();
+ private static native long LoadLibraryW(String libraryName);
+ private static native int RegisterWindowClass(String windowClassName, long hInstance);
+ private native long CreateWindow(int wndClassAtom, String wndName,
+ long hInstance, long visualID,
+ boolean isUndecorated,
+ int x, int y, int width, int height);
+ private native void CleanupWindowResources(int wndClassAtom, long hInstance);
+ private native void DestroyWindow(long windowHandle);
+ private native long GetDC(long windowHandle);
+ private native void ReleaseDC(long windowHandle, long hdc);
+ private native long MonitorFromWindow(long windowHandle);
+ private static native void setVisible0(long windowHandle, boolean visible);
+ private static native void DispatchMessages(long windowHandle, int eventMask);
+ private native void setSize0(long windowHandle, int width, int height);
+ private native void setPosition(long windowHandle, int x, int y);
+ private native void setFullscreen0(long windowHandle, int x, int y, int width, int height, boolean isUndecorated, boolean on);
+ private static native void setTitle(long windowHandle, String title);
+ private static native void requestFocus(long windowHandle);
+
+ private void sizeChanged(int newWidth, int newHeight) {
+ width = newWidth;
+ height = newHeight;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+ }
+
+ private void positionChanged(int newX, int newY) {
+ x = newX;
+ y = newY;
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
+ }
+
+ /**
+ *
+ * @param focusOwner if focusGained is true, focusOwner is the previous
+ * focus owner, if focusGained is false, focusOwner is the new focus owner
+ * @param focusGained
+ */
+ private void focusChanged(long focusOwner, boolean focusGained) {
+ if (focusGained) {
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_GAINED_FOCUS);
+ } else {
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_LOST_FOCUS);
+ }
+ }
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java b/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java
new file mode 100755
index 000000000..2371b20e8
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/x11/X11Display.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.x11;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+
+public class X11Display extends Display {
+ static {
+ NativeLibLoader.loadNEWT();
+ }
+
+ public X11Display() {
+ }
+
+ protected void createNative() {
+ long handle = CreateDisplay(name);
+ if (handle == 0 ) {
+ throw new RuntimeException("Error creating display: "+name);
+ }
+ aDevice = new X11GraphicsDevice(handle);
+ }
+
+ protected void closeNative() { }
+
+ //----------------------------------------------------------------------
+ // Internals only
+ //
+
+ private native long CreateDisplay(String name);
+}
diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Screen.java b/src/newt/classes/com/sun/javafx/newt/x11/X11Screen.java
new file mode 100755
index 000000000..36d9d8baf
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/x11/X11Screen.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.x11;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+
+public class X11Screen extends Screen {
+ static {
+ NativeLibLoader.loadNEWT();
+ }
+
+ public X11Screen() {
+ }
+
+ protected void createNative(int index) {
+ long handle = GetScreen(display.getHandle(), index);
+ if (handle == 0 ) {
+ throw new RuntimeException("Error creating screen: "+index);
+ }
+ aScreen = new X11GraphicsScreen((X11GraphicsDevice)getDisplay().getGraphicsDevice(), index);
+ setScreenSize(getWidth0(display.getHandle(), index),
+ getHeight0(display.getHandle(), index));
+ }
+
+ protected void closeNative() { }
+
+ //----------------------------------------------------------------------
+ // Internals only
+ //
+
+ private native long GetScreen(long dpy, int scrn_idx);
+ private native int getWidth0(long display, int scrn_idx);
+ private native int getHeight0(long display, int scrn_idx);
+}
+
diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java b/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
new file mode 100755
index 000000000..3badcce16
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.x11;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.x11.*;
+
+public class X11Window extends Window {
+ private static final String WINDOW_CLASS_NAME = "NewtWindow";
+ // non fullscreen dimensions ..
+ private int nfs_width, nfs_height, nfs_x, nfs_y;
+
+ static {
+ NativeLibLoader.loadNEWT();
+
+ if (!initIDs()) {
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
+ }
+ }
+
+ public X11Window() {
+ }
+
+ protected void createNative(Capabilities caps) {
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ if (config == null) {
+ throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
+ }
+ X11GraphicsConfiguration x11config = (X11GraphicsConfiguration) config;
+ long visualID = x11config.getVisualID();
+ long w = CreateWindow(getDisplayHandle(), getScreenIndex(), visualID, x, y, width, height);
+ if (w == 0 || w!=windowHandle) {
+ throw new NativeWindowException("Error creating window: "+w);
+ }
+ windowHandleClose = windowHandle;
+ displayHandleClose = getDisplayHandle();
+ }
+
+ protected void closeNative() {
+ if(0!=displayHandleClose && 0!=windowHandleClose) {
+ CloseWindow(displayHandleClose, windowHandleClose);
+ windowHandleClose = 0;
+ displayHandleClose = 0;
+ }
+ }
+
+ protected void windowDestroyed() {
+ windowHandleClose = 0;
+ displayHandleClose = 0;
+ super.windowDestroyed();
+ }
+
+ public void setVisible(boolean visible) {
+ if(this.visible!=visible) {
+ this.visible=visible;
+ setVisible0(getDisplayHandle(), windowHandle, visible);
+ clearEventMask();
+ }
+ }
+
+ public void setSize(int width, int height) {
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ setSize0(getDisplayHandle(), getScreenIndex(), windowHandle, x, y, width, height, 0, visible);
+ }
+
+ public void setPosition(int x, int y) {
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ setPosition0(getDisplayHandle(), windowHandle, x, y);
+ }
+
+ public boolean setFullscreen(boolean fullscreen) {
+ if(this.fullscreen!=fullscreen) {
+ int x,y,w,h;
+ this.fullscreen=fullscreen;
+ if(fullscreen) {
+ x = 0; y = 0;
+ w = screen.getWidth();
+ h = screen.getHeight();
+ } else {
+ x = nfs_x;
+ y = nfs_y;
+ w = nfs_width;
+ h = nfs_height;
+ }
+ if(DEBUG_IMPLEMENTATION || DEBUG_WINDOW_EVENT) {
+ System.err.println("X11Window fs: "+fullscreen+" "+x+"/"+y+" "+w+"x"+h);
+ }
+ setSize0(getDisplayHandle(), getScreenIndex(), windowHandle, x, y, w, h, fullscreen?-1:1, visible);
+ }
+ return fullscreen;
+ }
+
+ protected void dispatchMessages(int eventMask) {
+ DispatchMessages(getDisplayHandle(), windowHandle, eventMask, windowDeleteAtom);
+ }
+
+ //----------------------------------------------------------------------
+ // Internals only
+ //
+
+ private static native boolean initIDs();
+ private native long CreateWindow(long display, int screen_index,
+ long visualID, int x, int y, int width, int height);
+ private native void CloseWindow(long display, long windowHandle);
+ private native void setVisible0(long display, long windowHandle, boolean visible);
+ private native void DispatchMessages(long display, long windowHandle, int eventMask, long windowDeleteAtom);
+ private native void setSize0(long display, int screen_index, long windowHandle,
+ int x, int y, int width, int height, int decorationToggle, boolean isVisible);
+ private native void setPosition0(long display, long windowHandle, int x, int y);
+
+ private void sizeChanged(int newWidth, int newHeight) {
+ width = newWidth;
+ height = newHeight;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
+ }
+
+ private void positionChanged(int newX, int newY) {
+ x = newX;
+ y = newY;
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
+ }
+
+ private void windowCreated(long windowHandle, long windowDeleteAtom) {
+ this.windowHandle = windowHandle;
+ this.windowDeleteAtom=windowDeleteAtom;
+ }
+
+ private long windowHandleClose;
+ private long displayHandleClose;
+ private long windowDeleteAtom;
+}
diff --git a/src/newt/native/EventListener.h b/src/newt/native/EventListener.h
new file mode 100644
index 000000000..2e0e92323
--- /dev/null
+++ b/src/newt/native/EventListener.h
@@ -0,0 +1,9 @@
+
+#ifndef _EVENT_LISTSENER_H
+#define _EVENT_LISTSENER_H
+
+#define EVENT_WINDOW (1 << 0)
+#define EVENT_MOUSE (1 << 1)
+#define EVENT_KEY (1 << 2)
+
+#endif
diff --git a/src/newt/native/InputEvent.h b/src/newt/native/InputEvent.h
new file mode 100644
index 000000000..b42c06d21
--- /dev/null
+++ b/src/newt/native/InputEvent.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009 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.
+ *
+ */
+
+#ifndef _INPUT_EVENT_H_
+#define _INPUT_EVENT_H_
+
+#define EVENT_SHIFT_MASK 1
+#define EVENT_CTRL_MASK 2
+#define EVENT_META_MASK 4
+#define EVENT_ALT_MASK 8
+#define EVENT_ALT_GRAPH_MASK 32
+#define EVENT_BUTTON1_MASK (1<<6)
+#define EVENT_BUTTON2_MASK (1<<7)
+#define EVENT_BUTTON3_MASK (1<<8)
+
+#endif
diff --git a/src/newt/native/KDWindow.c b/src/newt/native/KDWindow.c
new file mode 100755
index 000000000..d08d5411c
--- /dev/null
+++ b/src/newt/native/KDWindow.c
@@ -0,0 +1,334 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+#ifdef _WIN32
+ #include <windows.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* This typedef is apparently needed for Microsoft compilers before VC8,
+ and on Windows CE */
+#if (_MSC_VER < 1400) || defined(UNDER_CE)
+ #ifdef _WIN64
+ typedef long long intptr_t;
+ #else
+ typedef int intptr_t;
+ #endif
+#elif _MSC_VER <= 1500
+ #ifdef _WIN64 // [
+ typedef __int64 intptr_t;
+ #else // _WIN64 ][
+ typedef int intptr_t;
+ #endif // _WIN64 ]
+#else
+ #include <inttypes.h>
+#endif
+
+#include <KD/kd.h>
+#include <KD/NV_extwindowprops.h>
+
+#include "com_sun_javafx_newt_opengl_kd_KDWindow.h"
+
+#include "EventListener.h"
+#include "MouseEvent.h"
+#include "KeyEvent.h"
+
+// #define VERBOSE_ON 1
+
+#ifdef VERBOSE_ON
+ #define DBG_PRINT(...) fprintf(stdout, __VA_ARGS__)
+#else
+ #define DBG_PRINT(...)
+#endif
+
+#ifdef VERBOSE_ON
+ #ifdef _WIN32_WCE
+ #define STDOUT_FILE "\\Storage Card\\stdout.txt"
+ #define STDERR_FILE "\\Storage Card\\stderr.txt"
+ #endif
+#endif
+
+/**
+ * Window
+ */
+
+static jmethodID sizeChangedID = NULL;
+static jmethodID windowDestroyNotifyID = NULL;
+static jmethodID windowDestroyedID = NULL;
+static jmethodID sendMouseEventID = NULL;
+static jmethodID sendKeyEventID = NULL;
+
+JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_kd_KDWindow_initIDs
+ (JNIEnv *env, jclass clazz)
+{
+#ifdef VERBOSE_ON
+ #ifdef _WIN32_WCE
+ _wfreopen(TEXT(STDOUT_FILE),L"w",stdout);
+ _wfreopen(TEXT(STDERR_FILE),L"w",stderr);
+ #endif
+#endif
+ sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(II)V");
+ windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
+ windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
+ sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
+ sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
+ if (sizeChangedID == NULL ||
+ windowDestroyNotifyID == NULL ||
+ windowDestroyedID == NULL ||
+ sendMouseEventID == NULL ||
+ sendKeyEventID == NULL) {
+ DBG_PRINT( "initIDs failed\n" );
+ return JNI_FALSE;
+ }
+ DBG_PRINT( "initIDs ok\n" );
+ return JNI_TRUE;
+}
+
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_kd_KDWindow_CreateWindow
+ (JNIEnv *env, jobject obj, jint owner, jlong display, jintArray jAttrs)
+{
+ jint * attrs = NULL;
+ jsize attrsLen;
+ EGLDisplay dpy = (EGLDisplay)(intptr_t)display;
+ KDWindow *window = 0;
+
+ DBG_PRINT( "[CreateWindow]: owner %d\n", owner);
+
+ if(dpy==NULL) {
+ fprintf(stderr, "[CreateWindow] invalid display connection..\n");
+ return 0;
+ }
+
+ attrsLen = (*env)->GetArrayLength(env, jAttrs);
+ if(0==attrsLen) {
+ fprintf(stderr, "[CreateWindow] attribute array size 0..\n");
+ return 0;
+ }
+ attrs = (*env)->GetIntArrayElements(env, jAttrs, 0);
+ if(NULL==attrs) {
+ fprintf(stderr, "[CreateWindow] attribute array NULL..\n");
+ return 0;
+ }
+
+ /* passing the KDWindow instance for the eventuserptr */
+ window = kdCreateWindow(dpy, attrs, (void *)(intptr_t)owner);
+
+ (*env)->ReleaseIntArrayElements(env, jAttrs, attrs, 0);
+
+ if(NULL==window) {
+ fprintf(stderr, "[CreateWindow] failed: 0x%X\n", kdGetError());
+ }
+ DBG_PRINT( "[CreateWindow] ok: %p, owner %d\n", window, (void *)(intptr_t)owner);
+ return (jlong) (intptr_t) window;
+}
+
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_kd_KDWindow_RealizeWindow
+ (JNIEnv *env, jobject obj, jlong window)
+{
+ KDWindow *w = (KDWindow*) (intptr_t) window;
+ EGLNativeWindowType nativeWindow=0;
+
+ jint res = kdRealizeWindow(w, &nativeWindow);
+ if(res) {
+ fprintf(stderr, "[RealizeWindow] failed: 0x%X, 0x%X\n", res, kdGetError());
+ nativeWindow = NULL;
+ }
+ DBG_PRINT( "[RealizeWindow] ok: %p\n", nativeWindow);
+ return (jlong) (intptr_t) nativeWindow;
+}
+
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_kd_KDWindow_CloseWindow
+ (JNIEnv *env, jobject obj, jlong window)
+{
+ KDWindow *w = (KDWindow*) (intptr_t) window;
+ int res = kdDestroyWindow(w);
+
+ DBG_PRINT( "[CloseWindow] res: %d\n", res);
+ return res;
+}
+
+/*
+ * Class: com_sun_javafx_newt_kd_KDWindow
+ * Method: setVisible0
+ * Signature: (JJZ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_kd_KDWindow_setVisible0
+ (JNIEnv *env, jobject obj, jlong window, jboolean visible)
+{
+ KDWindow *w = (KDWindow*) (intptr_t) window;
+ KDboolean v = (visible==JNI_TRUE)?KD_TRUE:KD_FALSE;
+ kdSetWindowPropertybv(w, KD_WINDOWPROPERTY_VISIBILITY, &v);
+ DBG_PRINT( "[setVisible] v=%d\n", visible);
+}
+
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_kd_KDWindow_DispatchMessages
+ (JNIEnv *env, jobject obj, jint owner, jlong window, jint eventMask)
+{
+ KDWindow *w = (KDWindow*) (intptr_t) window;
+ const KDEvent * evt;
+
+ // Periodically take a break
+ while( NULL!=(evt=kdWaitEvent(0)) ) {
+ jint src_owner = (jint)(intptr_t)evt->userptr;
+ if(src_owner != owner) {
+ DBG_PRINT( "event unrelated: src: %d, caller: %d, evt type: 0x%X\n", src_owner, owner, evt->type);
+ continue;
+ }
+ DBG_PRINT( "[DispatchMessages]: caller %d, evt type: 0x%X\n", owner, evt->type);
+
+ switch(evt->type) {
+ case KD_EVENT_INPUT_POINTER:
+ if( ! ( eventMask & EVENT_MOUSE ) ) {
+ DBG_PRINT( "event mouse ignored: src: %d\n", owner);
+ continue;
+ }
+ break;
+ /*
+ case KeyPress:
+ case KeyRelease:
+ if( ! ( eventMask & EVENT_KEY ) ) {
+ DBG_PRINT( "event key ignored: src: %d\n", owner);
+ continue;
+ }
+ break;
+ */
+ case KD_EVENT_WINDOW_FOCUS:
+ case KD_EVENT_WINDOW_CLOSE:
+ case KD_EVENT_WINDOWPROPERTY_CHANGE:
+ case KD_EVENT_WINDOW_REDRAW:
+ if( ! ( eventMask & EVENT_WINDOW ) ) {
+ DBG_PRINT( "event window ignored: src: %d\n", owner);
+ continue;
+ }
+ break;
+ }
+
+ // FIXME: support resize and window re-positioning events
+
+ switch(evt->type) {
+ case KD_EVENT_WINDOW_FOCUS:
+ {
+ KDboolean hasFocus;
+ kdGetWindowPropertybv(w, KD_WINDOWPROPERTY_FOCUS, &hasFocus);
+ DBG_PRINT( "event window focus : src: %d\n", owner);
+ }
+ break;
+ case KD_EVENT_WINDOW_CLOSE:
+ {
+ DBG_PRINT( "event window close : src: %d\n", owner);
+ (*env)->CallVoidMethod(env, obj, windowDestroyNotifyID);
+ // Called by Window.java: DestroyWindow(wnd);
+ // (*env)->CallVoidMethod(env, obj, windowDestroyedID);
+ }
+ break;
+ case KD_EVENT_WINDOWPROPERTY_CHANGE:
+ {
+ const KDEventWindowProperty* prop = &evt->data.windowproperty;
+ switch (prop->pname) {
+ case KD_WINDOWPROPERTY_SIZE:
+ {
+ KDint32 v[2];
+ if(!kdGetWindowPropertyiv(w, KD_WINDOWPROPERTY_SIZE, v)) {
+ DBG_PRINT( "event window size change : src: %d %dx%d\n", owner, v[0], v[1]);
+ (*env)->CallVoidMethod(env, obj, sizeChangedID, (jint) v[0], (jint) v[1]);
+ } else {
+ DBG_PRINT( "event window size change error: src: %d %dx%d\n", owner, v[0], v[1]);
+ }
+ }
+ break;
+ case KD_WINDOWPROPERTY_FOCUS:
+ DBG_PRINT( "event window focus: src: %d\n", owner);
+ break;
+ case KD_WINDOWPROPERTY_VISIBILITY:
+ {
+ KDboolean visible;
+ kdGetWindowPropertybv(w, KD_WINDOWPROPERTY_VISIBILITY, &visible);
+ DBG_PRINT( "event window visibility: src: %d, v:%d\n", owner, visible);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case KD_EVENT_INPUT_POINTER:
+ {
+ const KDEventInputPointer* ptr = &(evt->data.inputpointer);
+ // button idx: evt->data.input.index
+ // pressed = ev->data.input.value.i
+ // time = ev->timestamp
+ if(KD_INPUT_POINTER_SELECT==ptr->index) {
+ DBG_PRINT( "event mouse click: src: %d, s:%d, (%d,%d)\n", owner, ptr->select, ptr->x, ptr->y);
+ (*env)->CallVoidMethod(env, obj, sendMouseEventID,
+ (ptr->select==0) ? (jint) EVENT_MOUSE_RELEASED : (jint) EVENT_MOUSE_PRESSED,
+ (jint) 0,
+ (jint) ptr->x, (jint) ptr->y, 1, 0);
+ } else {
+ DBG_PRINT( "event mouse: src: %d, s:%d, i:0x%X (%d,%d)\n", owner, ptr->select, ptr->index, ptr->x, ptr->y);
+ (*env)->CallVoidMethod(env, obj, sendMouseEventID, (jint) EVENT_MOUSE_MOVED,
+ 0,
+ (jint) ptr->x, (jint) ptr->y, 0, 0);
+ }
+ }
+ break;
+ }
+ }
+}
+
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_kd_KDWindow_setFullScreen0
+ (JNIEnv *env, jobject obj, jlong window, jboolean fullscreen)
+{
+ KDWindow *w = (KDWindow*) (intptr_t) window;
+ KDboolean v = fullscreen;
+
+ int res = kdSetWindowPropertybv(w, KD_WINDOWPROPERTY_FULLSCREEN_NV, &v);
+ DBG_PRINT( "[setFullScreen] v=%d, res=%d\n", fullscreen, res);
+ (void)res;
+}
+
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_kd_KDWindow_setSize0
+ (JNIEnv *env, jobject obj, jlong window, jint width, jint height)
+{
+ KDWindow *w = (KDWindow*) (intptr_t) window;
+ KDint32 v[] = { width, height };
+
+ int res = kdSetWindowPropertyiv(w, KD_WINDOWPROPERTY_SIZE, v);
+ DBG_PRINT( "[setSize] v=%dx%d, res=%d\n", width, height, res);
+ (void)res;
+
+ (*env)->CallVoidMethod(env, obj, sizeChangedID, (jint) width, (jint) height);
+}
+
diff --git a/src/newt/native/KeyEvent.h b/src/newt/native/KeyEvent.h
new file mode 100644
index 000000000..1ead0f5e8
--- /dev/null
+++ b/src/newt/native/KeyEvent.h
@@ -0,0 +1,200 @@
+
+#ifndef _KEY_EVENT_H_
+#define _KEY_EVENT_H_
+
+#define EVENT_KEY_PRESSED 300
+#define EVENT_KEY_RELEASED 301
+#define EVENT_KEY_TYPED 302
+
+#define J_CHAR_UNDEFINED 0xFFFF;
+#define J_VK_ENTER '\n'
+#define J_VK_BACK_SPACE '\b'
+#define J_VK_TAB '\t'
+#define J_VK_CANCEL 0x03
+#define J_VK_CLEAR 0x0C
+#define J_VK_SHIFT 0x10
+#define J_VK_CONTROL 0x11
+#define J_VK_ALT 0x12
+#define J_VK_PAUSE 0x13
+#define J_VK_CAPS_LOCK 0x14
+#define J_VK_ESCAPE 0x1B
+#define J_VK_SPACE 0x20
+#define J_VK_PAGE_UP 0x21
+#define J_VK_PAGE_DOWN 0x22
+#define J_VK_END 0x23
+#define J_VK_HOME 0x24
+#define J_VK_LEFT 0x25
+#define J_VK_UP 0x26
+#define J_VK_RIGHT 0x27
+#define J_VK_DOWN 0x28
+#define J_VK_COMMA 0x2C
+#define J_VK_MINUS 0x2D
+#define J_VK_PERIOD 0x2E
+#define J_VK_SLASH 0x2F
+#define J_VK_0 0x30
+#define J_VK_1 0x31
+#define J_VK_2 0x32
+#define J_VK_3 0x33
+#define J_VK_4 0x34
+#define J_VK_5 0x35
+#define J_VK_6 0x36
+#define J_VK_7 0x37
+#define J_VK_8 0x38
+#define J_VK_9 0x39
+#define J_VK_SEMICOLON 0x3B
+#define J_VK_EQUALS 0x3D
+#define J_VK_A 0x41
+#define J_VK_B 0x42
+#define J_VK_C 0x43
+#define J_VK_D 0x44
+#define J_VK_E 0x45
+#define J_VK_F 0x46
+#define J_VK_G 0x47
+#define J_VK_H 0x48
+#define J_VK_I 0x49
+#define J_VK_J 0x4A
+#define J_VK_K 0x4B
+#define J_VK_L 0x4C
+#define J_VK_M 0x4D
+#define J_VK_N 0x4E
+#define J_VK_O 0x4F
+#define J_VK_P 0x50
+#define J_VK_Q 0x51
+#define J_VK_R 0x52
+#define J_VK_S 0x53
+#define J_VK_T 0x54
+#define J_VK_U 0x55
+#define J_VK_V 0x56
+#define J_VK_W 0x57
+#define J_VK_X 0x58
+#define J_VK_Y 0x59
+#define J_VK_Z 0x5A
+#define J_VK_OPEN_BRACKET 0x5B
+#define J_VK_BACK_SLASH 0x5C
+#define J_VK_CLOSE_BRACKET 0x5D
+#define J_VK_NUMPAD0 0x60
+#define J_VK_NUMPAD1 0x61
+#define J_VK_NUMPAD2 0x62
+#define J_VK_NUMPAD3 0x63
+#define J_VK_NUMPAD4 0x64
+#define J_VK_NUMPAD5 0x65
+#define J_VK_NUMPAD6 0x66
+#define J_VK_NUMPAD7 0x67
+#define J_VK_NUMPAD8 0x68
+#define J_VK_NUMPAD9 0x69
+#define J_VK_MULTIPLY 0x6A
+#define J_VK_ADD 0x6B
+#define J_VK_SEPARATOR 0x6C
+#define J_VK_SUBTRACT 0x6D
+#define J_VK_DECIMAL 0x6E
+#define J_VK_DIVIDE 0x6F
+#define J_VK_DELETE 0x7F /* ASCII DEL */
+#define J_VK_NUM_LOCK 0x90
+#define J_VK_SCROLL_LOCK 0x91
+#define J_VK_F1 0x70
+#define J_VK_F2 0x71
+#define J_VK_F3 0x72
+#define J_VK_F4 0x73
+#define J_VK_F5 0x74
+#define J_VK_F6 0x75
+#define J_VK_F7 0x76
+#define J_VK_F8 0x77
+#define J_VK_F9 0x78
+#define J_VK_F10 0x79
+#define J_VK_F11 0x7A
+#define J_VK_F12 0x7B
+#define J_VK_F13 0xF000
+#define J_VK_F14 0xF001
+#define J_VK_F15 0xF002
+#define J_VK_F16 0xF003
+#define J_VK_F17 0xF004
+#define J_VK_F18 0xF005
+#define J_VK_F19 0xF006
+#define J_VK_F20 0xF007
+#define J_VK_F21 0xF008
+#define J_VK_F22 0xF009
+#define J_VK_F23 0xF00A
+#define J_VK_F24 0xF00B
+#define J_VK_PRINTSCREEN 0x9A
+#define J_VK_INSERT 0x9B
+#define J_VK_HELP 0x9C
+#define J_VK_META 0x9D
+#define J_VK_BACK_QUOTE 0xC0
+#define J_VK_QUOTE 0xDE
+#define J_VK_KP_UP 0xE0
+#define J_VK_KP_DOWN 0xE1
+#define J_VK_KP_LEFT 0xE2
+#define J_VK_KP_RIGHT 0xE3
+#define J_VK_DEAD_GRAVE 0x80
+#define J_VK_DEAD_ACUTE 0x81
+#define J_VK_DEAD_CIRCUMFLEX 0x82
+#define J_VK_DEAD_TILDE 0x83
+#define J_VK_DEAD_MACRON 0x84
+#define J_VK_DEAD_BREVE 0x85
+#define J_VK_DEAD_ABOVEDOT 0x86
+#define J_VK_DEAD_DIAERESIS 0x87
+#define J_VK_DEAD_ABOVERING 0x88
+#define J_VK_DEAD_DOUBLEACUTE 0x89
+#define J_VK_DEAD_CARON 0x8a
+#define J_VK_DEAD_CEDILLA 0x8b
+#define J_VK_DEAD_OGONEK 0x8c
+#define J_VK_DEAD_IOTA 0x8d
+#define J_VK_DEAD_VOICED_SOUND 0x8e
+#define J_VK_DEAD_SEMIVOICED_SOUND 0x8f
+#define J_VK_AMPERSAND 0x96
+#define J_VK_ASTERISK 0x97
+#define J_VK_QUOTEDBL 0x98
+#define J_VK_LESS 0x99
+#define J_VK_GREATER 0xa0
+#define J_VK_BRACELEFT 0xa1
+#define J_VK_BRACERIGHT 0xa2
+#define J_VK_AT 0x0200
+#define J_VK_COLON 0x0201
+#define J_VK_CIRCUMFLEX 0x0202
+#define J_VK_DOLLAR 0x0203
+#define J_VK_EURO_SIGN 0x0204
+#define J_VK_EXCLAMATION_MARK 0x0205
+#define J_VK_INVERTED_EXCLAMATION_MARK 0x0206
+#define J_VK_LEFT_PARENTHESIS 0x0207
+#define J_VK_NUMBER_SIGN 0x0208
+#define J_VK_PLUS 0x0209
+#define J_VK_RIGHT_PARENTHESIS 0x020A
+#define J_VK_UNDERSCORE 0x020B
+#define J_VK_WINDOWS 0x020C
+#define J_VK_CONTEXT_MENU 0x020D
+#define J_VK_FINAL 0x0018
+#define J_VK_CONVERT 0x001C
+#define J_VK_NONCONVERT 0x001D
+#define J_VK_ACCEPT 0x001E
+#define J_VK_MODECHANGE 0x001F
+#define J_VK_KANA 0x0015
+#define J_VK_KANJI 0x0019
+#define J_VK_ALPHANUMERIC 0x00F0
+#define J_VK_KATAKANA 0x00F1
+#define J_VK_HIRAGANA 0x00F2
+#define J_VK_FULL_WIDTH 0x00F3
+#define J_VK_HALF_WIDTH 0x00F4
+#define J_VK_ROMAN_CHARACTERS 0x00F5
+#define J_VK_ALL_CANDIDATES 0x0100
+#define J_VK_PREVIOUS_CANDIDATE 0x0101
+#define J_VK_CODE_INPUT 0x0102
+#define J_VK_JAPANESE_KATAKANA 0x0103
+#define J_VK_JAPANESE_HIRAGANA 0x0104
+#define J_VK_JAPANESE_ROMAN 0x0105
+#define J_VK_KANA_LOCK 0x0106
+#define J_VK_INPUT_METHOD_ON_OFF 0x0107
+#define J_VK_CUT 0xFFD1
+#define J_VK_COPY 0xFFCD
+#define J_VK_PASTE 0xFFCF
+#define J_VK_UNDO 0xFFCB
+#define J_VK_AGAIN 0xFFC9
+#define J_VK_FIND 0xFFD0
+#define J_VK_PROPS 0xFFCA
+#define J_VK_STOP 0xFFC8
+#define J_VK_COMPOSE 0xFF20
+#define J_VK_ALT_GRAPH 0xFF7E
+#define J_VK_BEGIN 0xFF58
+#define J_VK_UNDEFINED 0x0
+
+#endif
+
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
new file mode 100644
index 000000000..f39a9f401
--- /dev/null
+++ b/src/newt/native/MacWindow.m
@@ -0,0 +1,430 @@
+/*
+ * Copyright (c) 2009 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.
+ *
+ */
+
+#import <inttypes.h>
+
+#import "com_sun_javafx_newt_macosx_MacWindow.h"
+#import "NewtMacWindow.h"
+
+#import "EventListener.h"
+#import "MouseEvent.h"
+#import "KeyEvent.h"
+
+#import <ApplicationServices/ApplicationServices.h>
+
+#import <stdio.h>
+
+NSString* jstringToNSString(JNIEnv* env, jstring jstr)
+{
+ const jchar* jstrChars = (*env)->GetStringChars(env, jstr, NULL);
+ NSString* str = [[NSString alloc] initWithCharacters: jstrChars length: (*env)->GetStringLength(env, jstr)];
+ (*env)->ReleaseStringChars(env, jstr, jstrChars);
+ return str;
+}
+
+void setFrameTopLeftPoint(NSWindow* win, jint x, jint y)
+{
+ NSScreen* screen = [NSScreen mainScreen];
+ NSRect visibleScreenRect = [screen visibleFrame];
+ NSPoint pt;
+
+ pt = NSMakePoint(x, visibleScreenRect.origin.y + visibleScreenRect.size.height - y);
+ [win setFrameTopLeftPoint: pt];
+}
+
+static NewtView * changeContentView(JNIEnv *env, jobject javaWindowObject, NSWindow *win, NewtView *newView) {
+ NSView* oldNSView = [win contentView];
+ NewtView* oldView = NULL;
+
+ if(NULL!=oldNSView) {
+NS_DURING
+ // Available >= 10.5 - Makes the menubar disapear
+ if([oldNSView isInFullScreenMode]) {
+ [oldNSView exitFullScreenModeWithOptions: NULL];
+ }
+NS_HANDLER
+NS_ENDHANDLER
+ if( [oldNSView isMemberOfClass:[NewtView class]] ) {
+ oldView = (NewtView *) oldNSView;
+
+ jobject globJavaWindowObject = [oldView getJavaWindowObject];
+ (*env)->DeleteGlobalRef(env, globJavaWindowObject);
+ [oldView setJavaWindowObject: NULL];
+ }
+ }
+ if(NULL!=newView) {
+ jobject globJavaWindowObject = (*env)->NewGlobalRef(env, javaWindowObject);
+ [newView setJavaWindowObject: globJavaWindowObject];
+ }
+ [win setContentView: newView];
+
+ return oldView;
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: initIDs
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_initIDs
+ (JNIEnv *env, jclass clazz)
+{
+ static int initialized = 0;
+
+ if(initialized) return JNI_TRUE;
+ initialized = 1;
+
+ // This little bit of magic is needed in order to receive mouse
+ // motion events and allow key focus to be properly transferred.
+ // FIXME: are these Carbon APIs? They come from the
+ // ApplicationServices.framework.
+ ProcessSerialNumber psn;
+ if (GetCurrentProcess(&psn) == noErr) {
+ TransformProcessType(&psn, kProcessTransformToForegroundApplication);
+ SetFrontProcess(&psn);
+ }
+
+ // Initialize the shared NSApplication instance
+ [NSApplication sharedApplication];
+
+ // Need this when debugging, as it is necessary to attach gdb to
+ // the running java process -- "gdb java" doesn't work
+ // printf("Going to sleep for 10 seconds\n");
+ // sleep(10);
+
+ return (jboolean) [NewtMacWindow initNatives: env forClass: clazz];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: createWindow0
+ * Signature: (IIIIZIIIJ)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow0
+ (JNIEnv *env, jobject jthis, jint x, jint y, jint w, jint h, jboolean fullscreen, jint styleMask,
+ jint bufferingType, jint screen_idx, jlong jview)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSRect rect = NSMakeRect(x, y, w, h);
+
+ NSArray *screens = [NSScreen screens];
+ if(screen_idx<0) screen_idx=0;
+ if(screen_idx>=[screens count]) screen_idx=0;
+ NSScreen *screen = (NSScreen *) [screens objectAtIndex: screen_idx];
+
+ if (fullscreen) {
+ styleMask = NSBorderlessWindowMask;
+ NSRect rect = [screen frame];
+ w = (jint) (rect.size.width);
+ h = (jint) (rect.size.height);
+ }
+
+ // Allocate the window
+ NSWindow* window = [[[NewtMacWindow alloc] initWithContentRect: rect
+ styleMask: (NSUInteger) styleMask
+ backing: (NSBackingStoreType) bufferingType
+ screen: screen] retain];
+
+ if (fullscreen) {
+ [window setOpaque: YES];
+ } else {
+ // If the window is undecorated, assume we want the possibility of
+ // a shaped window, so make it non-opaque and the background color clear
+ if ((styleMask & NSTitledWindowMask) == 0) {
+ [window setOpaque: NO];
+ [window setBackgroundColor: [NSColor clearColor]];
+ }
+ }
+
+ // Immediately re-position the window based on an upper-left coordinate system
+ setFrameTopLeftPoint(window, x, y);
+
+ // specify we want mouse-moved events
+ [window setAcceptsMouseMovedEvents:YES];
+
+ // Use given NewtView or allocate an NewtView if NULL
+ NewtView* view = (0==jview)? [[NewtView alloc] initWithFrame: rect] : (NewtView*) ((intptr_t) jview) ;
+
+ // Set the content view
+ (void) changeContentView(env, jthis, window, view);
+
+NS_DURING
+ // Available >= 10.5 - Makes the menubar disapear
+ if(fullscreen) {
+ [view enterFullScreenMode: screen withOptions:NULL];
+ }
+NS_HANDLER
+NS_ENDHANDLER
+
+ // Set the next responder to be the window so that we can forward
+ // right mouse button down events
+ [view setNextResponder: window];
+
+ [pool release];
+
+ return (jlong) ((intptr_t) window);
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: makeKeyAndOrderFront
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKeyAndOrderFront
+ (JNIEnv *env, jobject unused, jlong window)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ [win makeKeyAndOrderFront: win];
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: makeKey
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKey
+ (JNIEnv *env, jobject unused, jlong window)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ [win makeKeyWindow];
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: orderOut
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_orderOut
+ (JNIEnv *env, jobject unused, jlong window)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ [win orderOut: win];
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: close0
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_close0
+ (JNIEnv *env, jobject unused, jlong window)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ NSView* view = [win contentView];
+ [win orderOut: win];
+NS_DURING
+ if(NULL!=view) {
+ // Available >= 10.5 - Makes the menubar disapear
+ if([view isInFullScreenMode]) {
+ [view exitFullScreenModeWithOptions: NULL];
+ }
+ }
+NS_HANDLER
+NS_ENDHANDLER
+ [win close];
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: setTitle0
+ * Signature: (JLjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setTitle0
+ (JNIEnv *env, jobject unused, jlong window, jstring title)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ NSString* str = jstringToNSString(env, title);
+ [str autorelease];
+ [win setTitle: str];
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: dispatchMessages0
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_dispatchMessages0
+ (JNIEnv *env, jobject unused, jlong window, jint eventMask)
+{
+ NSEvent* event = NULL;
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+NS_DURING
+
+ NSWindow* win = (NSWindow *) ((intptr_t) window);
+
+ if(NULL != win) {
+ NewtView* view = (NewtView *) [win contentView];
+ [view setJNIEnv: env];
+
+ do {
+ // FIXME: ignoring event mask for the time being
+ event = [NSApp nextEventMatchingMask: NSAnyEventMask
+ untilDate: [NSDate distantPast]
+ inMode: NSDefaultRunLoopMode
+ dequeue: YES];
+ if (event != NULL) {
+ win = (NSWindow*) [event window];
+ view = (NewtView *) [win contentView];
+ [view setJNIEnv: env];
+
+ [NSApp sendEvent: event];
+ }
+ } while (event != NULL);
+ }
+
+NS_HANDLER
+
+ // just ignore it ..
+
+NS_ENDHANDLER
+
+
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: contentView
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_contentView
+ (JNIEnv *env, jobject unused, jlong window)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ jlong res = (jlong) ((intptr_t) [win contentView]);
+ [pool release];
+ return res;
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: changeContentView
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_changeContentView
+ (JNIEnv *env, jobject jthis, jlong window, jlong jview)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NewtMacWindow*) ((intptr_t) window);
+ NewtView* newView = (NewtView *) ((intptr_t) jview);
+
+ NewtView* oldView = changeContentView(env, jthis, win, newView);
+
+ [pool release];
+
+ return oldView;
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: setContentSize
+ * Signature: (JII)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setContentSize
+ (JNIEnv *env, jobject unused, jlong window, jint w, jint h)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ NSSize sz = NSMakeSize(w, h);
+ [win setContentSize: sz];
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: setFrameTopLeftPoint
+ * Signature: (JII)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setFrameTopLeftPoint
+ (JNIEnv *env, jobject unused, jlong window, jint x, jint y)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ NSWindow* win = (NSWindow*) ((intptr_t) window);
+ setFrameTopLeftPoint(win, x, y);
+ [pool release];
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: getScreenWidth
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_getScreenWidth
+ (JNIEnv *env, jclass clazz, jint screen_idx)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ NSArray *screens = [NSScreen screens];
+ if(screen_idx<0) screen_idx=0;
+ if(screen_idx>=[screens count]) screen_idx=0;
+ NSScreen *screen = (NSScreen *) [screens objectAtIndex: screen_idx];
+ NSRect rect = [screen frame];
+
+ [pool release];
+
+ return (jint) (rect.size.width);
+}
+
+/*
+ * Class: com_sun_javafx_newt_macosx_MacWindow
+ * Method: getScreenHeight
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_getScreenHeight
+ (JNIEnv *env, jclass clazz, jint screen_idx)
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ NSArray *screens = [NSScreen screens];
+ if(screen_idx<0) screen_idx=0;
+ if(screen_idx>=[screens count]) screen_idx=0;
+ NSScreen *screen = (NSScreen *) [screens objectAtIndex: screen_idx];
+ NSRect rect = [screen frame];
+
+ [pool release];
+
+ return (jint) (rect.size.height);
+}
+
diff --git a/src/newt/native/MouseEvent.h b/src/newt/native/MouseEvent.h
new file mode 100644
index 000000000..e9c0476ef
--- /dev/null
+++ b/src/newt/native/MouseEvent.h
@@ -0,0 +1,15 @@
+
+#ifndef _MOUSE_EVENT_H_
+#define _MOUSE_EVENT_H_
+
+// Generated by Java: EVENT_MOUSE_CLICKED = 200;
+#define EVENT_MOUSE_ENTERED 201
+#define EVENT_MOUSE_EXITED 202
+#define EVENT_MOUSE_PRESSED 203
+#define EVENT_MOUSE_RELEASED 204
+#define EVENT_MOUSE_MOVED 205
+// can't find how to regenerate this file, adding manually
+#define EVENT_MOUSE_WHEEL_MOVED 207
+// Generated by Java: EVENT_MOUSE_DRAGGED = 206;
+
+#endif
diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h
new file mode 100644
index 000000000..09f9ffbd2
--- /dev/null
+++ b/src/newt/native/NewtMacWindow.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2009 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.
+ *
+ */
+
+#import <AppKit/AppKit.h>
+#import "jni.h"
+
+@interface NewtView : NSView
+{
+ jobject javaWindowObject;
+
+ // This is set while messages are being dispatched and cleared afterward
+ JNIEnv* env;
+}
+
+/* Set during event dispatching cycle */
+- (void) setJNIEnv: (JNIEnv*) env;
+- (JNIEnv*) getJNIEnv;
+
+/* Register or deregister (NULL) the java Window object,
+ ie, if NULL, no events are send */
+- (void) setJavaWindowObject: (jobject) javaWindowObj;
+- (jobject) getJavaWindowObject;
+
+- (void) rightMouseDown: (NSEvent*) theEvent;
+
+@end
+
+@interface NewtMacWindow : NSWindow
+{
+}
+
++ (BOOL) initNatives: (JNIEnv*) env forClass: (jobject) clazz;
+
+- (id) initWithContentRect: (NSRect) contentRect
+ styleMask: (NSUInteger) windowStyle
+ backing: (NSBackingStoreType) bufferingType
+ screen:(NSScreen *)screen;
+
+@end
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m
new file mode 100644
index 000000000..62c6a6e25
--- /dev/null
+++ b/src/newt/native/NewtMacWindow.m
@@ -0,0 +1,391 @@
+/*
+ * Copyright (c) 2009 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.
+ *
+ */
+
+#import "NewtMacWindow.h"
+#import "InputEvent.h"
+#import "KeyEvent.h"
+#import "MouseEvent.h"
+
+@implementation NewtView
+- (void) setJNIEnv: (JNIEnv*) theEnv
+{
+ env = theEnv;
+}
+- (JNIEnv*) getJNIEnv
+{
+ return env;
+}
+
+- (void) setJavaWindowObject: (jobject) javaWindowObj
+{
+ javaWindowObject = javaWindowObj;
+}
+
+- (jobject) getJavaWindowObject
+{
+ return javaWindowObject;
+}
+
+- (void) rightMouseDown: (NSEvent*) theEvent
+{
+ NSResponder* next = [self nextResponder];
+ if (next != nil) {
+ [next rightMouseDown: theEvent];
+ }
+}
+@end
+
+static jmethodID sendMouseEventID = NULL;
+static jmethodID sendKeyEventID = NULL;
+static jmethodID sizeChangedID = NULL;
+static jmethodID positionChangedID = NULL;
+static jmethodID focusChangedID = NULL;
+static jmethodID windowDestroyNotifyID = NULL;
+static jmethodID windowDestroyedID = NULL;
+
+@implementation NewtMacWindow
+
++ (BOOL) initNatives: (JNIEnv*) env forClass: (jclass) clazz
+{
+ sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
+ sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
+ sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(II)V");
+ positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V");
+ focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(Z)V");
+ windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
+ windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
+ if (sendMouseEventID && sendKeyEventID && sizeChangedID && positionChangedID && focusChangedID && windowDestroyedID && windowDestroyNotifyID) {
+ return YES;
+ }
+ return NO;
+}
+
+- (id) initWithContentRect: (NSRect) contentRect
+ styleMask: (NSUInteger) windowStyle
+ backing: (NSBackingStoreType) bufferingType
+ screen:(NSScreen *)screen
+{
+ id res = [super initWithContentRect: contentRect
+ styleMask: windowStyle
+ backing: bufferingType
+ defer: YES
+ screen: screen];
+ // Why is this necessary? Without it we don't get any of the
+ // delegate methods like resizing and window movement.
+ [self setDelegate: self];
+ return res;
+}
+
+- (BOOL) canBecomeKeyWindow
+{
+ // Even if the window is borderless, we still want it to be able
+ // to become the key window to receive keyboard events
+ return YES;
+}
+
+static jint mods2JavaMods(NSUInteger mods)
+{
+ int javaMods = 0;
+ if (mods & NSShiftKeyMask) {
+ javaMods |= EVENT_SHIFT_MASK;
+ }
+ if (mods & NSControlKeyMask) {
+ javaMods |= EVENT_CTRL_MASK;
+ }
+ if (mods & NSCommandKeyMask) {
+ javaMods |= EVENT_META_MASK;
+ }
+ if (mods & NSAlternateKeyMask) {
+ javaMods |= EVENT_ALT_MASK;
+ }
+ return javaMods;
+}
+
+- (void) sendKeyEvent: (NSEvent*) event eventType: (jint) evType
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ int i;
+ jint keyCode = (jint) [event keyCode];
+ NSString* chars = [event charactersIgnoringModifiers];
+ int len = [chars length];
+ jint javaMods = mods2JavaMods([event modifierFlags]);
+
+ for (i = 0; i < len; i++) {
+ // Note: the key code in the NSEvent does not map to anything we can use
+ jchar keyChar = (jchar) [chars characterAtIndex: i];
+
+ (*env)->CallVoidMethod(env, javaWindowObject, sendKeyEventID,
+ evType, javaMods, keyCode, keyChar);
+ }
+}
+
+- (void) keyDown: (NSEvent*) theEvent
+{
+ [self sendKeyEvent: theEvent eventType: EVENT_KEY_PRESSED];
+}
+
+- (void) keyUp: (NSEvent*) theEvent
+{
+ [self sendKeyEvent: theEvent eventType: EVENT_KEY_RELEASED];
+}
+
+- (void) sendMouseEvent: (NSEvent*) event eventType: (jint) evType
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ jint javaMods = mods2JavaMods([event modifierFlags]);
+ NSRect frameRect = [self frame];
+ NSRect contentRect = [self contentRectForFrameRect: frameRect];
+ // NSPoint location = [event locationInWindow];
+ // The following computation improves the behavior of mouse drag
+ // events when they also affect the location of the window, but it
+ // still isn't perfect
+ NSPoint curLocation = [NSEvent mouseLocation];
+ NSPoint location = NSMakePoint(curLocation.x - frameRect.origin.x,
+ curLocation.y - frameRect.origin.y);
+
+ // convert to 1-based button number (or use zero if no button is involved)
+ jint javaButtonNum;
+ switch ([event type]) {
+ case NSLeftMouseDown:
+ case NSLeftMouseUp:
+ case NSLeftMouseDragged:
+ javaButtonNum = 1;
+ break;
+ case NSRightMouseDown:
+ case NSRightMouseUp:
+ case NSRightMouseDragged:
+ javaButtonNum = 3;
+ break;
+ case NSOtherMouseDown:
+ case NSOtherMouseUp:
+ case NSOtherMouseDragged:
+ javaButtonNum = 2;
+ break;
+ default:
+ javaButtonNum = 0;
+ break;
+ }
+
+ (*env)->CallVoidMethod(env, javaWindowObject, sendMouseEventID,
+ evType, javaMods,
+ (jint) location.x,
+ (jint) (contentRect.size.height - location.y),
+ javaButtonNum, 0);
+}
+
+- (void) mouseEntered: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_ENTERED];
+}
+
+- (void) mouseExited: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_EXITED];
+}
+
+- (void) mouseMoved: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_MOVED];
+}
+
+- (void) mouseDown: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_PRESSED];
+}
+
+- (void) mouseDragged: (NSEvent*) theEvent
+{
+ // Note use of MOUSE_MOVED event type because mouse dragged events are synthesized by Java
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_MOVED];
+}
+
+- (void) mouseUp: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_RELEASED];
+}
+
+- (void) rightMouseDown: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_PRESSED];
+}
+
+- (void) rightMouseDragged: (NSEvent*) theEvent
+{
+ // Note use of MOUSE_MOVED event type because mouse dragged events are synthesized by Java
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_MOVED];
+}
+
+- (void) rightMouseUp: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_RELEASED];
+}
+
+- (void) otherMouseDown: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_PRESSED];
+}
+
+- (void) otherMouseDragged: (NSEvent*) theEvent
+{
+ // Note use of MOUSE_MOVED event type because mouse dragged events are synthesized by Java
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_MOVED];
+}
+
+- (void) otherMouseUp: (NSEvent*) theEvent
+{
+ [self sendMouseEvent: theEvent eventType: EVENT_MOUSE_RELEASED];
+}
+
+- (void)windowDidResize: (NSNotification*) notification
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ NSRect frameRect = [self frame];
+ NSRect contentRect = [self contentRectForFrameRect: frameRect];
+
+ (*env)->CallVoidMethod(env, javaWindowObject, sizeChangedID,
+ (jint) contentRect.size.width,
+ (jint) contentRect.size.height);
+}
+
+- (void)windowDidMove: (NSNotification*) notification
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ NSRect rect = [self frame];
+ NSScreen* menuBarScreen = NULL;
+ NSScreen* screen = NULL;
+ NSRect screenRect;
+ NSPoint pt;
+
+ // FIXME: unclear whether this works correctly in multiple monitor situations
+ screen = [self screen];
+ screenRect = [screen visibleFrame];
+ pt = NSMakePoint(rect.origin.x, screenRect.origin.y + screenRect.size.height - rect.origin.y - rect.size.height);
+
+ (*env)->CallVoidMethod(env, javaWindowObject, positionChangedID,
+ (jint) pt.x, (jint) pt.y);
+}
+
+- (void)windowWillClose: (NSNotification*) notification
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyNotifyID);
+ // Will be called by Window.java (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyedID);
+
+ // EOL ..
+ (*env)->DeleteGlobalRef(env, javaWindowObject);
+ [view setJavaWindowObject: NULL];
+}
+
+- (void) windowDidBecomeKey: (NSNotification *) notification
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ (*env)->CallVoidMethod(env, javaWindowObject, focusChangedID, JNI_TRUE);
+}
+
+- (void) windowDidResignKey: (NSNotification *) notification
+{
+ NSView* nsview = [self contentView];
+ if( ! [nsview isMemberOfClass:[NewtView class]] ) {
+ return;
+ }
+ NewtView* view = (NewtView *) nsview;
+ jobject javaWindowObject = [view getJavaWindowObject];
+ JNIEnv* env = [view getJNIEnv];
+ if (env==NULL || javaWindowObject == NULL) {
+ return;
+ }
+
+ (*env)->CallVoidMethod(env, javaWindowObject, focusChangedID, JNI_FALSE);
+}
+
+@end
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
new file mode 100755
index 000000000..f609de08d
--- /dev/null
+++ b/src/newt/native/WindowsWindow.c
@@ -0,0 +1,1197 @@
+/*
+ * 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.
+ *
+ */
+
+#include <Windows.h>
+#include <Windowsx.h>
+#include <tchar.h>
+#include <stdlib.h>
+// NOTE: it looks like SHFullScreen and/or aygshell.dll is not available on the APX 2500 any more
+// #ifdef UNDER_CE
+// #include "aygshell.h"
+// #endif
+
+/* This typedef is apparently needed for Microsoft compilers before VC8,
+ and on Windows CE */
+#if (_MSC_VER < 1400) || defined(UNDER_CE)
+ #ifdef _WIN64
+ typedef long long intptr_t;
+ #else
+ typedef int intptr_t;
+ #endif
+#elif _MSC_VER <= 1500
+ #ifdef _WIN64 // [
+ typedef __int64 intptr_t;
+ #else // _WIN64 ][
+ typedef int intptr_t;
+ #endif // _WIN64 ]
+#else
+ #include <inttypes.h>
+#endif
+
+#if _MSC_VER <= 1500
+ // FIXME: Determine for which MSVC versions ..
+ #define strdup(s) _strdup(s)
+#endif
+
+#ifndef WM_MOUSEWHEEL
+#define WM_MOUSEWHEEL 0x020A
+#endif //WM_MOUSEWHEEL
+
+#ifndef WHEEL_DELTA
+#define WHEEL_DELTA 120
+#endif //WHEEL_DELTA
+
+#ifndef WHEEL_PAGESCROLL
+#define WHEEL_PAGESCROLL (UINT_MAX)
+#endif //WHEEL_PAGESCROLL
+
+#ifndef GET_WHEEL_DELTA_WPARAM // defined for (_WIN32_WINNT >= 0x0500)
+#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
+#endif
+
+#ifndef MONITOR_DEFAULTTONULL
+#define MONITOR_DEFAULTTONULL 0
+#endif
+#ifndef MONITOR_DEFAULTTOPRIMARY
+#define MONITOR_DEFAULTTOPRIMARY 1
+#endif
+#ifndef MONITOR_DEFAULTTONEAREST
+#define MONITOR_DEFAULTTONEAREST 2
+#endif
+
+#include "com_sun_javafx_newt_windows_WindowsWindow.h"
+
+#include "EventListener.h"
+#include "MouseEvent.h"
+#include "InputEvent.h"
+#include "KeyEvent.h"
+
+static jmethodID sizeChangedID = NULL;
+static jmethodID positionChangedID = NULL;
+static jmethodID focusChangedID = NULL;
+static jmethodID windowDestroyNotifyID = NULL;
+static jmethodID windowDestroyedID = NULL;
+static jmethodID sendMouseEventID = NULL;
+static jmethodID sendKeyEventID = NULL;
+
+typedef struct {
+ JNIEnv* jenv;
+ jobject jinstance;
+} WindowUserData;
+
+typedef struct {
+ UINT javaKey;
+ UINT windowsKey;
+} KeyMapEntry;
+
+// Static table, arranged more or less spatially.
+static KeyMapEntry keyMapTable[] = {
+ // Modifier keys
+ {J_VK_CAPS_LOCK, VK_CAPITAL},
+ {J_VK_SHIFT, VK_SHIFT},
+ {J_VK_CONTROL, VK_CONTROL},
+ {J_VK_ALT, VK_MENU},
+ {J_VK_NUM_LOCK, VK_NUMLOCK},
+
+ // Miscellaneous Windows keys
+ {J_VK_WINDOWS, VK_LWIN},
+ {J_VK_WINDOWS, VK_RWIN},
+ {J_VK_CONTEXT_MENU, VK_APPS},
+
+ // Alphabet
+ {J_VK_A, 'A'},
+ {J_VK_B, 'B'},
+ {J_VK_C, 'C'},
+ {J_VK_D, 'D'},
+ {J_VK_E, 'E'},
+ {J_VK_F, 'F'},
+ {J_VK_G, 'G'},
+ {J_VK_H, 'H'},
+ {J_VK_I, 'I'},
+ {J_VK_J, 'J'},
+ {J_VK_K, 'K'},
+ {J_VK_L, 'L'},
+ {J_VK_M, 'M'},
+ {J_VK_N, 'N'},
+ {J_VK_O, 'O'},
+ {J_VK_P, 'P'},
+ {J_VK_Q, 'Q'},
+ {J_VK_R, 'R'},
+ {J_VK_S, 'S'},
+ {J_VK_T, 'T'},
+ {J_VK_U, 'U'},
+ {J_VK_V, 'V'},
+ {J_VK_W, 'W'},
+ {J_VK_X, 'X'},
+ {J_VK_Y, 'Y'},
+ {J_VK_Z, 'Z'},
+ {J_VK_0, '0'},
+ {J_VK_1, '1'},
+ {J_VK_2, '2'},
+ {J_VK_3, '3'},
+ {J_VK_4, '4'},
+ {J_VK_5, '5'},
+ {J_VK_6, '6'},
+ {J_VK_7, '7'},
+ {J_VK_8, '8'},
+ {J_VK_9, '9'},
+ {J_VK_ENTER, VK_RETURN},
+ {J_VK_SPACE, VK_SPACE},
+ {J_VK_BACK_SPACE, VK_BACK},
+ {J_VK_TAB, VK_TAB},
+ {J_VK_ESCAPE, VK_ESCAPE},
+ {J_VK_INSERT, VK_INSERT},
+ {J_VK_DELETE, VK_DELETE},
+ {J_VK_HOME, VK_HOME},
+ {J_VK_END, VK_END},
+ {J_VK_PAGE_UP, VK_PRIOR},
+ {J_VK_PAGE_DOWN, VK_NEXT},
+ {J_VK_CLEAR, VK_CLEAR}, // NumPad 5
+
+ // NumPad with NumLock off & extended arrows block (triangular)
+ {J_VK_LEFT, VK_LEFT},
+ {J_VK_RIGHT, VK_RIGHT},
+ {J_VK_UP, VK_UP},
+ {J_VK_DOWN, VK_DOWN},
+
+ // NumPad with NumLock on: numbers
+ {J_VK_NUMPAD0, VK_NUMPAD0},
+ {J_VK_NUMPAD1, VK_NUMPAD1},
+ {J_VK_NUMPAD2, VK_NUMPAD2},
+ {J_VK_NUMPAD3, VK_NUMPAD3},
+ {J_VK_NUMPAD4, VK_NUMPAD4},
+ {J_VK_NUMPAD5, VK_NUMPAD5},
+ {J_VK_NUMPAD6, VK_NUMPAD6},
+ {J_VK_NUMPAD7, VK_NUMPAD7},
+ {J_VK_NUMPAD8, VK_NUMPAD8},
+ {J_VK_NUMPAD9, VK_NUMPAD9},
+
+ // NumPad with NumLock on
+ {J_VK_MULTIPLY, VK_MULTIPLY},
+ {J_VK_ADD, VK_ADD},
+ {J_VK_SEPARATOR, VK_SEPARATOR},
+ {J_VK_SUBTRACT, VK_SUBTRACT},
+ {J_VK_DECIMAL, VK_DECIMAL},
+ {J_VK_DIVIDE, VK_DIVIDE},
+
+ // Functional keys
+ {J_VK_F1, VK_F1},
+ {J_VK_F2, VK_F2},
+ {J_VK_F3, VK_F3},
+ {J_VK_F4, VK_F4},
+ {J_VK_F5, VK_F5},
+ {J_VK_F6, VK_F6},
+ {J_VK_F7, VK_F7},
+ {J_VK_F8, VK_F8},
+ {J_VK_F9, VK_F9},
+ {J_VK_F10, VK_F10},
+ {J_VK_F11, VK_F11},
+ {J_VK_F12, VK_F12},
+ {J_VK_F13, VK_F13},
+ {J_VK_F14, VK_F14},
+ {J_VK_F15, VK_F15},
+ {J_VK_F16, VK_F16},
+ {J_VK_F17, VK_F17},
+ {J_VK_F18, VK_F18},
+ {J_VK_F19, VK_F19},
+ {J_VK_F20, VK_F20},
+ {J_VK_F21, VK_F21},
+ {J_VK_F22, VK_F22},
+ {J_VK_F23, VK_F23},
+ {J_VK_F24, VK_F24},
+
+ {J_VK_PRINTSCREEN, VK_SNAPSHOT},
+ {J_VK_SCROLL_LOCK, VK_SCROLL},
+ {J_VK_PAUSE, VK_PAUSE},
+ {J_VK_CANCEL, VK_CANCEL},
+ {J_VK_HELP, VK_HELP},
+
+ // Japanese
+/*
+ {J_VK_CONVERT, VK_CONVERT},
+ {J_VK_NONCONVERT, VK_NONCONVERT},
+ {J_VK_INPUT_METHOD_ON_OFF, VK_KANJI},
+ {J_VK_ALPHANUMERIC, VK_DBE_ALPHANUMERIC},
+ {J_VK_KATAKANA, VK_DBE_KATAKANA},
+ {J_VK_HIRAGANA, VK_DBE_HIRAGANA},
+ {J_VK_FULL_WIDTH, VK_DBE_DBCSCHAR},
+ {J_VK_HALF_WIDTH, VK_DBE_SBCSCHAR},
+ {J_VK_ROMAN_CHARACTERS, VK_DBE_ROMAN},
+*/
+
+ {J_VK_UNDEFINED, 0}
+};
+
+/*
+Dynamic mapping table for OEM VK codes. This table is refilled
+by BuildDynamicKeyMapTable when keyboard layout is switched.
+(see NT4 DDK src/input/inc/vkoem.h for OEM VK_ values).
+*/
+typedef struct {
+ // OEM VK codes known in advance
+ UINT windowsKey;
+ // depends on input langauge (kbd layout)
+ UINT javaKey;
+} DynamicKeyMapEntry;
+
+static DynamicKeyMapEntry dynamicKeyMapTable[] = {
+ {0x00BA, J_VK_UNDEFINED}, // VK_OEM_1
+ {0x00BB, J_VK_UNDEFINED}, // VK_OEM_PLUS
+ {0x00BC, J_VK_UNDEFINED}, // VK_OEM_COMMA
+ {0x00BD, J_VK_UNDEFINED}, // VK_OEM_MINUS
+ {0x00BE, J_VK_UNDEFINED}, // VK_OEM_PERIOD
+ {0x00BF, J_VK_UNDEFINED}, // VK_OEM_2
+ {0x00C0, J_VK_UNDEFINED}, // VK_OEM_3
+ {0x00DB, J_VK_UNDEFINED}, // VK_OEM_4
+ {0x00DC, J_VK_UNDEFINED}, // VK_OEM_5
+ {0x00DD, J_VK_UNDEFINED}, // VK_OEM_6
+ {0x00DE, J_VK_UNDEFINED}, // VK_OEM_7
+ {0x00DF, J_VK_UNDEFINED}, // VK_OEM_8
+ {0x00E2, J_VK_UNDEFINED}, // VK_OEM_102
+ {0, 0}
+};
+
+// Auxiliary tables used to fill the above dynamic table. We first
+// find the character for the OEM VK code using ::MapVirtualKey and
+// then go through these auxiliary tables to map it to Java VK code.
+
+typedef struct {
+ WCHAR c;
+ UINT javaKey;
+} CharToVKEntry;
+
+static const CharToVKEntry charToVKTable[] = {
+ {L'!', J_VK_EXCLAMATION_MARK},
+ {L'"', J_VK_QUOTEDBL},
+ {L'#', J_VK_NUMBER_SIGN},
+ {L'$', J_VK_DOLLAR},
+ {L'&', J_VK_AMPERSAND},
+ {L'\'', J_VK_QUOTE},
+ {L'(', J_VK_LEFT_PARENTHESIS},
+ {L')', J_VK_RIGHT_PARENTHESIS},
+ {L'*', J_VK_ASTERISK},
+ {L'+', J_VK_PLUS},
+ {L',', J_VK_COMMA},
+ {L'-', J_VK_MINUS},
+ {L'.', J_VK_PERIOD},
+ {L'/', J_VK_SLASH},
+ {L':', J_VK_COLON},
+ {L';', J_VK_SEMICOLON},
+ {L'<', J_VK_LESS},
+ {L'=', J_VK_EQUALS},
+ {L'>', J_VK_GREATER},
+ {L'@', J_VK_AT},
+ {L'[', J_VK_OPEN_BRACKET},
+ {L'\\', J_VK_BACK_SLASH},
+ {L']', J_VK_CLOSE_BRACKET},
+ {L'^', J_VK_CIRCUMFLEX},
+ {L'_', J_VK_UNDERSCORE},
+ {L'`', J_VK_BACK_QUOTE},
+ {L'{', J_VK_BRACELEFT},
+ {L'}', J_VK_BRACERIGHT},
+ {0x00A1, J_VK_INVERTED_EXCLAMATION_MARK},
+ {0x20A0, J_VK_EURO_SIGN}, // ????
+ {0,0}
+};
+
+// For dead accents some layouts return ASCII punctuation, while some
+// return spacing accent chars, so both should be listed. NB: MS docs
+// say that conversion routings return spacing accent character, not
+// combining.
+static const CharToVKEntry charToDeadVKTable[] = {
+ {L'`', J_VK_DEAD_GRAVE},
+ {L'\'', J_VK_DEAD_ACUTE},
+ {0x00B4, J_VK_DEAD_ACUTE},
+ {L'^', J_VK_DEAD_CIRCUMFLEX},
+ {L'~', J_VK_DEAD_TILDE},
+ {0x02DC, J_VK_DEAD_TILDE},
+ {0x00AF, J_VK_DEAD_MACRON},
+ {0x02D8, J_VK_DEAD_BREVE},
+ {0x02D9, J_VK_DEAD_ABOVEDOT},
+ {L'"', J_VK_DEAD_DIAERESIS},
+ {0x00A8, J_VK_DEAD_DIAERESIS},
+ {0x02DA, J_VK_DEAD_ABOVERING},
+ {0x02DD, J_VK_DEAD_DOUBLEACUTE},
+ {0x02C7, J_VK_DEAD_CARON}, // aka hacek
+ {L',', J_VK_DEAD_CEDILLA},
+ {0x00B8, J_VK_DEAD_CEDILLA},
+ {0x02DB, J_VK_DEAD_OGONEK},
+ {0x037A, J_VK_DEAD_IOTA}, // ASCII ???
+ {0x309B, J_VK_DEAD_VOICED_SOUND},
+ {0x309C, J_VK_DEAD_SEMIVOICED_SOUND},
+ {0,0}
+};
+
+// ANSI CP identifiers are no longer than this
+#define MAX_ACP_STR_LEN 7
+
+static void BuildDynamicKeyMapTable()
+{
+ HKL hkl = GetKeyboardLayout(0);
+ // Will need this to reset layout after dead keys.
+ UINT spaceScanCode = MapVirtualKeyEx(VK_SPACE, 0, hkl);
+ DynamicKeyMapEntry *dynamic;
+
+ LANGID idLang = LOWORD(GetKeyboardLayout(0));
+ UINT codePage;
+ TCHAR strCodePage[MAX_ACP_STR_LEN];
+ // use the LANGID to create a LCID
+ LCID idLocale = MAKELCID(idLang, SORT_DEFAULT);
+ // get the ANSI code page associated with this locale
+ if (GetLocaleInfo(idLocale, LOCALE_IDEFAULTANSICODEPAGE,
+ strCodePage, sizeof(strCodePage)/sizeof(TCHAR)) > 0 )
+ {
+ codePage = _ttoi(strCodePage);
+ } else {
+ codePage = GetACP();
+ }
+
+ // Entries in dynamic table that maps between Java VK and Windows
+ // VK are built in three steps:
+ // 1. Map windows VK to ANSI character (cannot map to unicode
+ // directly, since ::ToUnicode is not implemented on win9x)
+ // 2. Convert ANSI char to Unicode char
+ // 3. Map Unicode char to Java VK via two auxilary tables.
+
+ for (dynamic = dynamicKeyMapTable; dynamic->windowsKey != 0; ++dynamic)
+ {
+ char cbuf[2] = { '\0', '\0'};
+ WCHAR ucbuf[2] = { L'\0', L'\0' };
+ int nchars;
+ UINT scancode;
+ const CharToVKEntry *charMap;
+ int nconverted;
+ WCHAR uc;
+ BYTE kbdState[256];
+
+ // Defaults to J_VK_UNDEFINED
+ dynamic->javaKey = J_VK_UNDEFINED;
+
+ GetKeyboardState(kbdState);
+
+ kbdState[dynamic->windowsKey] |= 0x80; // Press the key.
+
+ // Unpress modifiers, since they are most likely pressed as
+ // part of the keyboard switching shortcut.
+ kbdState[VK_CONTROL] &= ~0x80;
+ kbdState[VK_SHIFT] &= ~0x80;
+ kbdState[VK_MENU] &= ~0x80;
+
+ scancode = MapVirtualKeyEx(dynamic->windowsKey, 0, hkl);
+ nchars = ToAsciiEx(dynamic->windowsKey, scancode, kbdState,
+ (WORD*)cbuf, 0, hkl);
+
+ // Auxiliary table used to map Unicode character to Java VK.
+ // Will assign a different table for dead keys (below).
+ charMap = charToVKTable;
+
+ if (nchars < 0) { // Dead key
+ char junkbuf[2] = { '\0', '\0'};
+ // Use a different table for dead chars since different layouts
+ // return different characters for the same dead key.
+ charMap = charToDeadVKTable;
+
+ // We also need to reset layout so that next translation
+ // is unaffected by the dead status. We do this by
+ // translating <SPACE> key.
+ kbdState[dynamic->windowsKey] &= ~0x80;
+ kbdState[VK_SPACE] |= 0x80;
+
+ ToAsciiEx(VK_SPACE, spaceScanCode, kbdState,
+ (WORD*)junkbuf, 0, hkl);
+ }
+
+ nconverted = MultiByteToWideChar(codePage, 0,
+ cbuf, 1, ucbuf, 2);
+
+ uc = ucbuf[0];
+ {
+ const CharToVKEntry *map;
+ for (map = charMap; map->c != 0; ++map) {
+ if (uc == map->c) {
+ dynamic->javaKey = map->javaKey;
+ break;
+ }
+ }
+ }
+
+ } // for each VK_OEM_*
+}
+
+// Really need to factor this out in to a separate run-time file
+static jchar* GetNullTerminatedStringChars(JNIEnv* env, jstring str)
+{
+ jchar* strChars = NULL;
+ strChars = calloc((*env)->GetStringLength(env, str) + 1, sizeof(jchar));
+ if (strChars != NULL) {
+ (*env)->GetStringRegion(env, str, 0, (*env)->GetStringLength(env, str), strChars);
+ }
+ return strChars;
+}
+
+static jint GetModifiers() {
+ jint modifiers = 0;
+ if (HIBYTE(GetKeyState(VK_CONTROL)) != 0) {
+ modifiers |= EVENT_CTRL_MASK;
+ }
+ if (HIBYTE(GetKeyState(VK_SHIFT)) != 0) {
+ modifiers |= EVENT_SHIFT_MASK;
+ }
+ if (HIBYTE(GetKeyState(VK_MENU)) != 0) {
+ modifiers |= EVENT_ALT_MASK;
+ }
+ if (HIBYTE(GetKeyState(VK_LBUTTON)) != 0) {
+ modifiers |= EVENT_BUTTON1_MASK;
+ }
+ if (HIBYTE(GetKeyState(VK_MBUTTON)) != 0) {
+ modifiers |= EVENT_BUTTON2_MASK;
+ }
+ if (HIBYTE(GetKeyState(VK_RBUTTON)) != 0) {
+ modifiers |= EVENT_BUTTON3_MASK;
+ }
+
+ return modifiers;
+}
+
+static int WmChar(JNIEnv *env, jobject window, UINT character, UINT repCnt,
+ UINT flags, BOOL system)
+{
+ // The Alt modifier is reported in the 29th bit of the lParam,
+ // i.e., it is the 13th bit of `flags' (which is HIWORD(lParam)).
+ BOOL alt_is_down = (flags & (1<<13)) != 0;
+ if (system && alt_is_down) {
+ if (character == VK_SPACE) {
+ return 1;
+ }
+ }
+
+ if (character == VK_RETURN) {
+ character = J_VK_ENTER;
+ }
+ (*env)->CallVoidMethod(env, window, sendKeyEventID,
+ (jint) EVENT_KEY_TYPED,
+ GetModifiers(),
+ (jint) -1,
+ (jchar) character);
+ return 1;
+}
+
+UINT WindowsKeyToJavaKey(UINT windowsKey, UINT modifiers)
+{
+ int i, j;
+ // for the general case, use a bi-directional table
+ for (i = 0; keyMapTable[i].windowsKey != 0; i++) {
+ if (keyMapTable[i].windowsKey == windowsKey) {
+ return keyMapTable[i].javaKey;
+ }
+ }
+ for (j = 0; dynamicKeyMapTable[j].windowsKey != 0; j++) {
+ if (dynamicKeyMapTable[j].windowsKey == windowsKey) {
+ if (dynamicKeyMapTable[j].javaKey != J_VK_UNDEFINED) {
+ return dynamicKeyMapTable[j].javaKey;
+ } else {
+ break;
+ }
+ }
+ }
+
+ return J_VK_UNDEFINED;
+}
+
+static int WmKeyDown(JNIEnv *env, jobject window, UINT wkey, UINT repCnt,
+ UINT flags, BOOL system)
+{
+ UINT modifiers = 0, jkey = 0, character = -1;
+ if (wkey == VK_PROCESSKEY) {
+ return 1;
+ }
+
+ modifiers = GetModifiers();
+ jkey = WindowsKeyToJavaKey(wkey, modifiers);
+
+/*
+ character = WindowsKeyToJavaChar(wkey, modifiers, SAVE);
+*/
+
+ (*env)->CallVoidMethod(env, window, sendKeyEventID,
+ (jint) EVENT_KEY_PRESSED,
+ modifiers,
+ (jint) jkey,
+ (jchar) character);
+
+ /* windows does not create a WM_CHAR for the Del key
+ for some reason, so we need to create the KEY_TYPED event on the
+ WM_KEYDOWN.
+ */
+ if (jkey == J_VK_DELETE) {
+ (*env)->CallVoidMethod(env, window, sendKeyEventID,
+ (jint) EVENT_KEY_TYPED,
+ GetModifiers(),
+ (jint) -1,
+ (jchar) '\177');
+ }
+
+ return 0;
+}
+
+static int WmKeyUp(JNIEnv *env, jobject window, UINT wkey, UINT repCnt,
+ UINT flags, BOOL system)
+{
+ UINT modifiers = 0, jkey = 0, character = -1;
+ if (wkey == VK_PROCESSKEY) {
+ return 1;
+ }
+
+ modifiers = GetModifiers();
+ jkey = WindowsKeyToJavaKey(wkey, modifiers);
+/*
+ character = WindowsKeyToJavaChar(wkey, modifiers, SAVE);
+*/
+
+ (*env)->CallVoidMethod(env, window, sendKeyEventID,
+ (jint) EVENT_KEY_RELEASED,
+ modifiers,
+ (jint) jkey,
+ (jchar) character);
+
+ return 0;
+}
+
+static LRESULT CALLBACK wndProc(HWND wnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ RECT rc;
+ int useDefWindowProc = 0;
+ JNIEnv *env = NULL;
+ jobject window = NULL;
+ BOOL isKeyDown = FALSE;
+ WindowUserData * wud;
+
+#if defined(UNDER_CE) || _MSC_VER <= 1200
+ wud = (WindowUserData *) GetWindowLong(wnd, GWL_USERDATA);
+#else
+ wud = (WindowUserData *) GetWindowLongPtr(wnd, GWLP_USERDATA);
+#endif
+ if(NULL==wud) {
+ return DefWindowProc(wnd, message, wParam, lParam);
+ }
+ env = wud->jenv;
+ window = wud->jinstance;
+
+ if (NULL==window || NULL==env) {
+ return DefWindowProc(wnd, message, wParam, lParam);
+ }
+
+ switch (message) {
+
+ //
+ // The signal pipeline for destruction is:
+ // Java::DestroyWindow(wnd) _or_ window-close-button ->
+ // WM_CLOSE -> Java::windowDestroyNotify -> W_DESTROY -> Java::windowDestroyed ->
+ // Java::CleanupWindowResources()
+ case WM_CLOSE:
+ (*env)->CallVoidMethod(env, window, windowDestroyNotifyID);
+ break;
+
+ case WM_DESTROY:
+ {
+#if defined(UNDER_CE) || _MSC_VER <= 1200
+ SetWindowLong(wnd, GWL_USERDATA, NULL);
+#else
+ SetWindowLongPtr(wnd, GWLP_USERDATA, NULL);
+#endif
+ free(wud); wud=NULL;
+ (*env)->CallVoidMethod(env, window, windowDestroyedID);
+ (*env)->DeleteGlobalRef(env, window);
+ }
+ break;
+
+ case WM_SYSCHAR:
+ useDefWindowProc = WmChar(env, window, wParam,
+ LOWORD(lParam), HIWORD(lParam), FALSE);
+ break;
+
+ case WM_CHAR:
+ useDefWindowProc = WmChar(env, window, wParam,
+ LOWORD(lParam), HIWORD(lParam), TRUE);
+ break;
+
+ case WM_KEYDOWN:
+ useDefWindowProc = WmKeyDown(env, window, wParam,
+ LOWORD(lParam), HIWORD(lParam), FALSE);
+ break;
+
+ case WM_KEYUP:
+ useDefWindowProc = WmKeyUp(env, window, wParam,
+ LOWORD(lParam), HIWORD(lParam), FALSE);
+ break;
+
+ case WM_SIZE:
+ GetClientRect(wnd, &rc);
+ (*env)->CallVoidMethod(env, window, sizeChangedID, (jint) rc.right, (jint) rc.bottom);
+ break;
+
+ case WM_LBUTTONDOWN:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_PRESSED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 1, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_LBUTTONUP:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_RELEASED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 1, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_MBUTTONDOWN:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_PRESSED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 2, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_MBUTTONUP:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_RELEASED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 2, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_RBUTTONDOWN:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_PRESSED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 3, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_RBUTTONUP:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_RELEASED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 3, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_MOUSEMOVE:
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_MOVED,
+ GetModifiers(),
+ (jint) LOWORD(lParam), (jint) HIWORD(lParam),
+ (jint) 0, (jint) 0);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_MOUSEWHEEL: {
+ // need to convert the coordinates to component-relative
+ int x = GET_X_LPARAM(lParam);
+ int y = GET_Y_LPARAM(lParam);
+ POINT eventPt;
+ eventPt.x = x;
+ eventPt.y = y;
+ ScreenToClient(wnd, &eventPt);
+ (*env)->CallVoidMethod(env, window, sendMouseEventID,
+ (jint) EVENT_MOUSE_WHEEL_MOVED,
+ GetModifiers(),
+ (jint) eventPt.x, (jint) eventPt.y,
+ (jint) 0, (jint) GET_WHEEL_DELTA_WPARAM(wParam));
+ useDefWindowProc = 1;
+ break;
+ }
+
+ case WM_SETFOCUS:
+ (*env)->CallVoidMethod(env, window, focusChangedID,
+ (jlong)wParam, JNI_TRUE);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_KILLFOCUS:
+ (*env)->CallVoidMethod(env, window, focusChangedID,
+ (jlong)wParam, JNI_FALSE);
+ useDefWindowProc = 1;
+ break;
+
+ case WM_MOVE:
+ (*env)->CallVoidMethod(env, window, positionChangedID,
+ (jint)LOWORD(lParam), (jint)HIWORD(lParam));
+ useDefWindowProc = 1;
+ break;
+
+ case WM_ERASEBKGND:
+ // ignore erase background
+ useDefWindowProc = 0;
+ break;
+
+
+ // FIXME: generate EVENT_MOUSE_ENTERED, EVENT_MOUSE_EXITED
+ default:
+ useDefWindowProc = 1;
+ }
+
+ if (useDefWindowProc)
+ return DefWindowProc(wnd, message, wParam, lParam);
+ return 0;
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsScreen
+ * Method: getScreenWidth
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsScreen_getScreenWidth
+ (JNIEnv *env, jobject obj, jint scrn_idx)
+{
+ return (jint)GetSystemMetrics(SM_CXSCREEN);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsScreen
+ * Method: getScreenWidth
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsScreen_getScreenHeight
+ (JNIEnv *env, jobject obj, jint scrn_idx)
+{
+ return (jint)GetSystemMetrics(SM_CYSCREEN);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: initIDs
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_initIDs
+ (JNIEnv *env, jclass clazz)
+{
+ sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(II)V");
+ positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V");
+ focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(JZ)V");
+ windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
+ windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
+ sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
+ sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
+ if (sizeChangedID == NULL ||
+ positionChangedID == NULL ||
+ focusChangedID == NULL ||
+ windowDestroyNotifyID == NULL ||
+ windowDestroyedID == NULL ||
+ sendMouseEventID == NULL ||
+ sendKeyEventID == NULL) {
+ return JNI_FALSE;
+ }
+ BuildDynamicKeyMapTable();
+ return JNI_TRUE;
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: LoadLibraryW
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_LoadLibraryW
+ (JNIEnv *env, jclass clazz, jstring dllName)
+{
+ jchar* _dllName = GetNullTerminatedStringChars(env, dllName);
+ HMODULE lib = LoadLibraryW(_dllName);
+ free(_dllName);
+ return (jlong) (intptr_t) lib;
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: RegisterWindowClass
+ * Signature: (Ljava/lang/String;J)I
+ */
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_RegisterWindowClass
+ (JNIEnv *env, jclass clazz, jstring wndClassName, jlong hInstance)
+{
+ ATOM res;
+ WNDCLASS wc;
+#ifndef UNICODE
+ const char* _wndClassName = NULL;
+#endif
+
+ /* register class */
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.lpfnWndProc = (WNDPROC)wndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ /* This cast is legal because the HMODULE for a DLL is the same as
+ its HINSTANCE -- see MSDN docs for DllMain */
+ wc.hInstance = (HINSTANCE) hInstance;
+ wc.hIcon = NULL;
+ wc.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
+ wc.hbrBackground = GetStockObject(BLACK_BRUSH);
+ wc.lpszMenuName = NULL;
+#ifdef UNICODE
+ wc.lpszClassName = GetNullTerminatedStringChars(env, wndClassName);
+#else
+ _wndClassName = (*env)->GetStringUTFChars(env, wndClassName, NULL);
+ wc.lpszClassName = strdup(_wndClassName);
+ (*env)->ReleaseStringUTFChars(env, wndClassName, _wndClassName);
+#endif
+ res = RegisterClass(&wc);
+
+ free((void *)wc.lpszClassName);
+
+ return (jint)res;
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: CleanupWindowResources
+ * Signature: (java/lang/String;J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CleanupWindowResources
+ (JNIEnv *env, jobject obj, jint wndClassAtom, jlong hInstance)
+{
+ UnregisterClass(MAKEINTATOM(wndClassAtom), (HINSTANCE) hInstance);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: CreateWindow
+ * Signature: (ILjava/lang/String;JJZIIII)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CreateWindow
+ (JNIEnv *env, jobject obj, jint wndClassAtom, jstring jWndName, jlong hInstance, jlong visualID,
+ jboolean bIsUndecorated,
+ jint jx, jint jy, jint defaultWidth, jint defaultHeight)
+{
+ const TCHAR* wndName = NULL;
+ DWORD windowStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
+ int x=(int)jx, y=(int)jy;
+ int width=(int)defaultWidth, height=(int)defaultHeight;
+ HWND window = NULL;
+
+#ifdef UNICODE
+ wndName = GetNullTerminatedStringChars(env, jWndName);
+#else
+ wndName = (*env)->GetStringUTFChars(env, jWndName, NULL);
+#endif
+
+ x = CW_USEDEFAULT;
+ y = 0;
+ if (bIsUndecorated) {
+ windowStyle |= WS_POPUP | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX;
+ } else {
+ windowStyle |= WS_OVERLAPPEDWINDOW;
+ }
+
+ (void) visualID; // FIXME: use the visualID ..
+
+ window = CreateWindow(MAKEINTATOM(wndClassAtom), wndName, windowStyle,
+ x, y, width, height,
+ NULL, NULL,
+ (HINSTANCE) hInstance,
+ NULL);
+
+ if (window != NULL) {
+ WindowUserData * wud = (WindowUserData *) malloc(sizeof(WindowUserData));
+ wud->jinstance = (*env)->NewGlobalRef(env, obj);
+ wud->jenv = env;
+#if defined(UNDER_CE) || _MSC_VER <= 1200
+ SetWindowLong(window, GWL_USERDATA, (intptr_t) wud);
+#else
+ SetWindowLongPtr(window, GWLP_USERDATA, (intptr_t) wud);
+#endif
+ ShowWindow(window, SW_SHOWNORMAL);
+ }
+
+#ifdef UNICODE
+ free((void*) wndName);
+#else
+ (*env)->ReleaseStringUTFChars(env, jWndName, wndName);
+#endif
+
+ return (jlong) (intptr_t) window;
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: DestroyWindow
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_DestroyWindow
+ (JNIEnv *env, jobject obj, jlong window)
+{
+ DestroyWindow((HWND) window);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: GetDC
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_GetDC
+ (JNIEnv *env, jobject obj, jlong window)
+{
+ return (jlong) GetDC((HWND) window);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: ReleaseDC
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_ReleaseDC
+ (JNIEnv *env, jobject obj, jlong window, jlong dc)
+{
+ ReleaseDC((HWND) window, (HDC) dc);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: MonitorFromWindow
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_MonitorFromWindow
+ (JNIEnv *env, jobject obj, jlong window)
+{
+ #if (_WIN32_WINNT >= 0x0500 || _WIN32_WINDOWS >= 0x0410 || WINVER >= 0x0500) && !defined(_WIN32_WCE)
+ return (jlong)MonitorFromWindow((HWND)window, MONITOR_DEFAULTTOPRIMARY);
+ #else
+ #warning NO MULTI MONITOR SUPPORT
+ return 0;
+ #endif
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: setVisible0
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setVisible0
+ (JNIEnv *_env, jclass clazz, jlong window, jboolean visible)
+{
+ HWND hWnd = (HWND) (intptr_t) window;
+ if (visible) {
+ ShowWindow(hWnd, SW_SHOW);
+ } else {
+ ShowWindow(hWnd, SW_HIDE);
+ }
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: DispatchMessages
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_DispatchMessages
+ (JNIEnv *env, jclass clazz, jlong window, jint eventMask)
+{
+ int i = 0;
+ MSG msg;
+ BOOL gotOne;
+ WindowUserData * wud;
+
+#if defined(UNDER_CE) || _MSC_VER <= 1200
+ wud = (WindowUserData *) GetWindowLong((HWND)window, GWL_USERDATA);
+#else
+ wud = (WindowUserData *) GetWindowLongPtr((HWND)window, GWLP_USERDATA);
+#endif
+ if(NULL==wud) {
+ fprintf(stderr, "INTERNAL ERROR in WindowsWindow::DispatchMessages window userdata NULL\n");
+ exit(1);
+ }
+
+ wud->jenv = env;
+
+ if(eventMask<0) {
+ eventMask *= -1;
+ /* FIXME: re-select input mask
+ long xevent_mask_key = 0;
+ long xevent_mask_ptr = 0;
+ long xevent_mask_win = 0;
+ if( 0 != ( eventMask & EVENT_MOUSE ) ) {
+ xevent_mask_ptr |= ButtonPressMask|ButtonReleaseMask|PointerMotionMask;
+ }
+ if( 0 != ( eventMask & EVENT_KEY ) ) {
+ xevent_mask_key |= KeyPressMask|KeyReleaseMask;
+ }
+ if( 0 != ( eventMask & EVENT_WINDOW ) ) {
+ xevent_mask_win |= ExposureMask;
+ }
+
+ XSelectInput(dpy, w, xevent_mask_win|xevent_mask_key|xevent_mask_ptr);
+ */
+ }
+
+ // Periodically take a break
+ do {
+ gotOne = PeekMessage(&msg, (HWND) window, 0, 0, PM_REMOVE);
+ if (gotOne) {
+ ++i;
+ switch (msg.message) {
+ case WM_CLOSE:
+ case WM_DESTROY:
+ case WM_SIZE:
+ if( ! ( eventMask & EVENT_WINDOW ) ) {
+ continue;
+ }
+ break;
+
+ case WM_CHAR:
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ if( ! ( eventMask & EVENT_KEY ) ) {
+ continue;
+ }
+ break;
+
+ case WM_LBUTTONDOWN:
+ case WM_LBUTTONUP:
+ case WM_MBUTTONDOWN:
+ case WM_MBUTTONUP:
+ case WM_RBUTTONDOWN:
+ case WM_RBUTTONUP:
+ case WM_MOUSEMOVE:
+ if( ! ( eventMask & EVENT_MOUSE ) ) {
+ continue;
+ }
+ break;
+ }
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ } while (gotOne && i < 100);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: setSize0
+ * Signature: (JII)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setSize0
+ (JNIEnv *env, jobject obj, jlong window, jint width, jint height)
+{
+ RECT r;
+ HWND w = (HWND) window;
+ GetWindowRect(w, &r);
+ MoveWindow(w, r.left, r.top, width, height, TRUE);
+ (*env)->CallVoidMethod(env, obj, sizeChangedID, (jint) width, (jint) height);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: setPosition
+ * Signature: (JII)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setPosition
+ (JNIEnv *env, jobject obj, jlong window, jint x, jint y)
+{
+ UINT flags = SWP_NOACTIVATE | SWP_NOZORDER;
+ HWND hwnd = (HWND)window;
+ RECT r;
+
+ GetWindowRect(hwnd, &r);
+ SetWindowPos(hwnd, 0, x, y, (r.right-r.left), (r.bottom-r.top), flags);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: setFullscreen
+ * Signature: (JIIIIZZ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setFullscreen0
+ (JNIEnv *env, jobject obj, jlong window, jint x, jint y, jint width, jint height, jboolean bIsUndecorated, jboolean on)
+{
+ UINT flags;
+ HWND hwnd = (HWND)window;
+ HWND hWndInsertAfter;
+ DWORD windowStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
+
+ if (bIsUndecorated || on) {
+ windowStyle |= WS_POPUP | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX;
+ } else {
+ windowStyle |= WS_OVERLAPPEDWINDOW;
+ }
+ SetWindowLong(hwnd, GWL_STYLE, windowStyle);
+
+ if(on==JNI_TRUE) {
+ flags = SWP_SHOWWINDOW;
+ hWndInsertAfter = HWND_TOPMOST;
+ } else {
+ flags = SWP_NOACTIVATE | SWP_NOZORDER;
+ hWndInsertAfter = 0;
+ }
+
+ SetWindowPos(hwnd, hWndInsertAfter, x, y, width, height, flags);
+
+ (*env)->CallVoidMethod(env, obj, sizeChangedID, (jint) width, (jint) height);
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: setTitle
+ * Signature: (JLjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_setTitle
+ (JNIEnv *env, jclass clazz, jlong window, jstring title)
+{
+ HWND hwnd = (HWND)window;
+ if (title != NULL) {
+ jchar *titleString = GetNullTerminatedStringChars(env, title);
+ if (titleString != NULL) {
+ SetWindowTextW(hwnd, titleString);
+ free(titleString);
+ }
+ }
+}
+
+/*
+ * Class: com_sun_javafx_newt_windows_WindowsWindow
+ * Method: requestFocus
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_requestFocus
+ (JNIEnv *env, jclass clazz, jlong window)
+{
+ HWND hwnd = (HWND)window;
+
+ if (IsWindow(hwnd)) {
+ SetFocus(hwnd);
+ }
+}
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
new file mode 100755
index 000000000..c3d446f09
--- /dev/null
+++ b/src/newt/native/X11Window.c
@@ -0,0 +1,642 @@
+/*
+ * 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.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+
+#include "com_sun_javafx_newt_x11_X11Window.h"
+
+#include "EventListener.h"
+#include "MouseEvent.h"
+#include "KeyEvent.h"
+
+// #define VERBOSE_ON 1
+
+#ifdef VERBOSE_ON
+ #define DBG_PRINT(args...) fprintf(stderr, args)
+
+ #define DUMP_VISUAL_INFO(a,b) _dumpVisualInfo((a),(b))
+
+ static void _dumpVisualInfo(const char * msg, XVisualInfo *pVisualQuery) {
+ if(pVisualQuery!=NULL) {
+ fprintf(stderr, "%s: screen %d, visual: %p, visual-id: 0x%X, depth: %d, class %d, cmap sz: %d, bpp: 3x%d, rgb 0x%X 0x%X 0x%X\n",
+ msg,
+ pVisualQuery->screen,
+ pVisualQuery->visual,
+ (int)pVisualQuery->visualid,
+ pVisualQuery->depth,
+ pVisualQuery->class,
+ pVisualQuery->colormap_size,
+ pVisualQuery->bits_per_rgb,
+ (int)pVisualQuery->red_mask,
+ (int)pVisualQuery->green_mask,
+ (int)pVisualQuery->blue_mask
+ );
+ } else {
+ fprintf(stderr, "%s: NULL XVisualInfo\n", msg);
+ }
+ }
+
+#else
+
+ #define DBG_PRINT(args...)
+
+ #define DUMP_VISUAL_INFO(a,b)
+
+#endif
+
+/**
+ * Keycode
+ */
+
+#define IS_WITHIN(k,a,b) ((a)<=(k)&&(k)<=(b))
+
+static jint X11KeySym2NewtVKey(KeySym keySym) {
+ if(IS_WITHIN(keySym,XK_F1,XK_F12))
+ return (keySym-XK_F1)+J_VK_F1;
+
+ switch(keySym) {
+ case XK_Alt_L:
+ case XK_Alt_R:
+ return J_VK_ALT;
+
+ case XK_Left:
+ return J_VK_LEFT;
+ case XK_Right:
+ return J_VK_RIGHT;
+ case XK_Up:
+ return J_VK_UP;
+ case XK_Down:
+ return J_VK_DOWN;
+ case XK_Page_Up:
+ return J_VK_PAGE_UP;
+ case XK_Page_Down:
+ return J_VK_PAGE_DOWN;
+ case XK_Shift_L:
+ case XK_Shift_R:
+ return J_VK_SHIFT;
+ case XK_Control_L:
+ case XK_Control_R:
+ return J_VK_CONTROL;
+ case XK_Escape:
+ return J_VK_ESCAPE;
+ case XK_Delete:
+ return J_VK_DELETE;
+ }
+ return keySym;
+}
+
+/**
+ * Display
+ */
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Display
+ * Method: CreateDisplay
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Display_CreateDisplay
+ (JNIEnv *env, jobject obj, jstring displayName)
+{
+ Display * dpy = NULL;
+ const char * _displayName = NULL;
+ if(displayName!=0) {
+ _displayName = (*env)->GetStringUTFChars(env, displayName, 0);
+ }
+ dpy = XOpenDisplay(_displayName);
+ if(_displayName!=0) {
+ (*env)->ReleaseStringChars(env, displayName, (const jchar *)_displayName);
+ }
+ if(dpy==NULL) {
+ fprintf(stderr, "couldn't open display connection..\n");
+ }
+ return (jlong) (intptr_t) dpy;
+}
+
+/**
+ * Screen
+ */
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Screen
+ * Method: GetScreen
+ * Signature: (JI)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Screen_GetScreen
+ (JNIEnv *env, jobject obj, jlong display, jint screen_index)
+{
+ Display * dpy = (Display *)(intptr_t)display;
+ Screen * scrn= NULL;
+ if(dpy==NULL) {
+ fprintf(stderr, "[GetScreen] invalid display connection..\n");
+ return 0;
+ }
+ scrn = ScreenOfDisplay(dpy,screen_index);
+ if(scrn==NULL) {
+ scrn=DefaultScreenOfDisplay(dpy);
+ }
+ if(scrn==NULL) {
+ fprintf(stderr, "couldn't get screen ..\n");
+ }
+ return (jlong) (intptr_t) scrn;
+}
+
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_x11_X11Screen_getWidth0
+ (JNIEnv *env, jobject obj, jlong display, jint scrn_idx)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ return (jint) XDisplayWidth( dpy, scrn_idx);
+}
+
+JNIEXPORT jint JNICALL Java_com_sun_javafx_newt_x11_X11Screen_getHeight0
+ (JNIEnv *env, jobject obj, jlong display, jint scrn_idx)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ return (jint) XDisplayHeight( dpy, scrn_idx);
+}
+
+
+/**
+ * Window
+ */
+
+static jmethodID sizeChangedID = NULL;
+static jmethodID positionChangedID = NULL;
+static jmethodID windowDestroyNotifyID = NULL;
+static jmethodID windowDestroyedID = NULL;
+static jmethodID windowCreatedID = NULL;
+static jmethodID sendMouseEventID = NULL;
+static jmethodID sendKeyEventID = NULL;
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: initIDs
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Window_initIDs
+ (JNIEnv *env, jclass clazz)
+{
+ sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(II)V");
+ positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V");
+ windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
+ windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
+ windowCreatedID = (*env)->GetMethodID(env, clazz, "windowCreated", "(JJ)V");
+ sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
+ sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
+ if (sizeChangedID == NULL ||
+ positionChangedID == NULL ||
+ windowDestroyNotifyID == NULL ||
+ windowDestroyedID == NULL ||
+ windowCreatedID == NULL ||
+ sendMouseEventID == NULL ||
+ sendKeyEventID == NULL) {
+ return JNI_FALSE;
+ }
+ return JNI_TRUE;
+}
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: CreateWindow
+ * Signature: (JIJIIII)J
+ */
+JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow
+ (JNIEnv *env, jobject obj, jlong display, jint screen_index,
+ jlong visualID,
+ jint x, jint y, jint width, jint height)
+{
+ Display * dpy = (Display *)(intptr_t)display;
+ int scrn_idx = (int)screen_index;
+ Window windowParent = 0;
+ Window window = 0;
+
+ XVisualInfo visualTemplate;
+ XVisualInfo *pVisualQuery = NULL;
+ Visual *visual = NULL;
+ int depth;
+
+ XSetWindowAttributes xswa;
+ unsigned long attrMask;
+ int n;
+
+ DBG_PRINT( "CreateWindow %x/%d %dx%d\n", x, y, width, height);
+
+ if(dpy==NULL) {
+ fprintf(stderr, "[CreateWindow] invalid display connection..\n");
+ return 0;
+ }
+
+ if(visualID<0) {
+ fprintf(stderr, "[CreateWindow] invalid VisualID ..\n");
+ return 0;
+ }
+
+ XSync(dpy, False);
+
+ Screen * scrn = ScreenOfDisplay(dpy, screen_index);
+
+ // try given VisualID on screen
+ memset(&visualTemplate, 0, sizeof(XVisualInfo));
+ visualTemplate.screen = scrn_idx;
+ visualTemplate.visualid = (VisualID)visualID;
+ pVisualQuery = XGetVisualInfo(dpy, VisualIDMask|VisualScreenMask, &visualTemplate,&n);
+ DUMP_VISUAL_INFO("Given VisualID,ScreenIdx", pVisualQuery);
+ if(pVisualQuery!=NULL) {
+ visual = pVisualQuery->visual;
+ depth = pVisualQuery->depth;
+ visualID = (jlong)pVisualQuery->visualid;
+ XFree(pVisualQuery);
+ pVisualQuery=NULL;
+ }
+ DBG_PRINT( "trying given (screen %d, visualID: %d) found: %p\n", scrn_idx, (int)visualID, visual);
+
+ if (visual==NULL)
+ {
+ fprintf(stderr, "could not query Visual by given VisualID, bail out!\n");
+ return 0;
+ }
+
+ if(pVisualQuery!=NULL) {
+ XFree(pVisualQuery);
+ pVisualQuery=NULL;
+ }
+
+ windowParent = XRootWindowOfScreen(scrn);
+
+ attrMask = (CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect) ;
+
+ memset(&xswa, 0, sizeof(xswa));
+ xswa.override_redirect = False; // decorated
+ xswa.border_pixel = 0;
+ xswa.background_pixel = 0;
+ xswa.event_mask = ExposureMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask;
+ xswa.colormap = XCreateColormap(dpy,
+ XRootWindow(dpy, scrn_idx),
+ visual,
+ AllocNone);
+
+ window = XCreateWindow(dpy,
+ windowParent,
+ x, y,
+ width, height,
+ 0, // border width
+ depth,
+ InputOutput,
+ visual,
+ attrMask,
+ &xswa);
+ Atom wm_delete_window = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+ XSetWMProtocols(dpy, window, &wm_delete_window, 1);
+ XClearWindow(dpy, window);
+ XSync(dpy, False);
+
+ (*env)->CallVoidMethod(env, obj, windowCreatedID, (jlong) window, (jlong)wm_delete_window);
+
+ return (jlong) window;
+}
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: CloseWindow
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_CloseWindow
+ (JNIEnv *env, jobject obj, jlong display, jlong window)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ Window w = (Window)window;
+
+ XSync(dpy, False);
+ /**
+ XUngrabPointer(dpy, CurrentTime);
+ XUngrabKeyboard(dpy, CurrentTime);
+ */
+ XSelectInput(dpy, w, 0);
+ XUnmapWindow(dpy, w);
+ XSync(dpy, False);
+ XDestroyWindow(dpy, w);
+ XSync(dpy, False);
+ (*env)->CallVoidMethod(env, obj, windowDestroyedID);
+}
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: setVisible0
+ * Signature: (JJZ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setVisible0
+ (JNIEnv *env, jobject obj, jlong display, jlong window, jboolean visible)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ Window w = (Window)window;
+ DBG_PRINT( "setVisible0 vis %d\n", visible);
+ XSync(dpy, False);
+ if(visible==JNI_TRUE) {
+ XMapRaised(dpy, w);
+ XSync(dpy, False);
+
+ // XSetInputFocus(dpy, w, RevertToParent, CurrentTime);
+ // XSync(dpy, False);
+
+ } else {
+ /**
+ XUngrabPointer(dpy, CurrentTime);
+ XUngrabKeyboard(dpy, CurrentTime);
+ */
+ XUnmapWindow(dpy, w);
+ XSync(dpy, False);
+ }
+}
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: DispatchMessages
+ * Signature: (JJI)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_DispatchMessages
+ (JNIEnv *env, jobject obj, jlong display, jlong window, jint eventMask, jlong wmDeleteAtom)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ Window w = (Window)window;
+ Atom wm_delete_window = (Atom)wmDeleteAtom;
+
+ if(eventMask<0) {
+ long xevent_mask_key = 0;
+ long xevent_mask_ptr = 0;
+ long xevent_mask_win = 0;
+ eventMask *= -1;
+ if( 0 != ( eventMask & EVENT_MOUSE ) ) {
+ xevent_mask_ptr |= ButtonPressMask|ButtonReleaseMask|PointerMotionMask;
+ }
+ if( 0 != ( eventMask & EVENT_KEY ) ) {
+ xevent_mask_key |= KeyPressMask|KeyReleaseMask;
+ }
+ if( 0 != ( eventMask & EVENT_WINDOW ) ) {
+ xevent_mask_win |= ExposureMask | StructureNotifyMask | SubstructureNotifyMask | VisibilityNotify ;
+ }
+
+ XSelectInput(dpy, w, xevent_mask_win|xevent_mask_key|xevent_mask_ptr);
+
+ /**
+ if(0!=xevent_mask_ptr) {
+ XGrabPointer(dpy, w, True, xevent_mask_ptr,
+ GrabModeAsync, GrabModeAsync, w, None, CurrentTime);
+ }
+ if(0!=xevent_mask_key) {
+ XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime);
+ } */
+
+ }
+
+ // Periodically take a break
+ while( XPending(dpy)>0 ) {
+ XEvent evt;
+ KeySym keySym;
+ char keyChar;
+ char text[255];
+
+ XNextEvent(dpy, &evt);
+
+ switch(evt.type) {
+ case ButtonPress:
+ case ButtonRelease:
+ case MotionNotify:
+ if( ! ( eventMask & EVENT_MOUSE ) ) {
+ continue;
+ }
+ break;
+ case KeyPress:
+ case KeyRelease:
+ if( ! ( eventMask & EVENT_KEY ) ) {
+ continue;
+ }
+ break;
+ case FocusIn:
+ case FocusOut:
+ break;
+ case DestroyNotify:
+ case CreateNotify:
+ case VisibilityNotify:
+ case Expose:
+ case UnmapNotify:
+ if( ! ( eventMask & EVENT_WINDOW ) ) {
+ continue;
+ }
+ break;
+ }
+
+ // FIXME: support resize and window re-positioning events
+
+ switch(evt.type) {
+ case ButtonPress:
+ if(evt.xbutton.window==w) {
+ (*env)->CallVoidMethod(env, obj, sendMouseEventID, (jint) EVENT_MOUSE_PRESSED,
+ (jint) evt.xbutton.state,
+ (jint) evt.xbutton.x, (jint) evt.xbutton.y, (jint) evt.xbutton.button, 0 /*rotation*/);
+ }
+ break;
+ case ButtonRelease:
+ if(evt.xbutton.window==w) {
+ (*env)->CallVoidMethod(env, obj, sendMouseEventID, (jint) EVENT_MOUSE_RELEASED,
+ (jint) evt.xbutton.state,
+ (jint) evt.xbutton.x, (jint) evt.xbutton.y, (jint) evt.xbutton.button, 0 /*rotation*/);
+ }
+ break;
+ case MotionNotify:
+ if(evt.xmotion.window==w) {
+ (*env)->CallVoidMethod(env, obj, sendMouseEventID, (jint) EVENT_MOUSE_MOVED,
+ (jint) evt.xmotion.state,
+ (jint) evt.xmotion.x, (jint) evt.xmotion.y, (jint) 0, 0 /*rotation*/);
+ }
+ break;
+ case KeyPress:
+ if(evt.xkey.window==w) {
+ if(XLookupString(&evt.xkey,text,255,&keySym,0)==1) {
+ keyChar=text[0];
+ } else {
+ keyChar=0;
+ }
+ (*env)->CallVoidMethod(env, obj, sendKeyEventID, (jint) EVENT_KEY_PRESSED,
+ (jint) evt.xkey.state,
+ X11KeySym2NewtVKey(keySym), (jchar) keyChar);
+ }
+ break;
+ case KeyRelease:
+ if(evt.xkey.window==w) {
+ if(XLookupString(&evt.xkey,text,255,&keySym,0)==1) {
+ keyChar=text[0];
+ } else {
+ keyChar=0;
+ }
+ (*env)->CallVoidMethod(env, obj, sendKeyEventID, (jint) EVENT_KEY_RELEASED,
+ (jint) evt.xkey.state,
+ X11KeySym2NewtVKey(keySym), (jchar) keyChar);
+ }
+ break;
+ case FocusIn:
+ case FocusOut:
+ if(evt.xfocus.window==w) {
+ }
+ break;
+ case DestroyNotify:
+ if(evt.xdestroywindow.window==w) {
+ DBG_PRINT( "event . DestroyNotify call 0x%X\n", evt.xdestroywindow.window);
+ (*env)->CallVoidMethod(env, obj, windowDestroyedID);
+ }
+ break;
+ case CreateNotify:
+ if(evt.xcreatewindow.window==w) {
+ DBG_PRINT( "event . DestroyNotify call 0x%X\n", evt.xcreatewindow.window);
+ (*env)->CallVoidMethod(env, obj, windowCreatedID);
+ }
+ break;
+ case VisibilityNotify:
+ if(evt.xvisibility.window==w) {
+ DBG_PRINT( "event . VisibilityNotify call 0x%X\n", evt.xvisibility.window);
+ }
+ break;
+ case Expose:
+ if(evt.xexpose.window==w) {
+ DBG_PRINT( "event . Expose call 0x%X\n", evt.xexpose.window);
+ /* FIXME: Might want to send a repaint event .. */
+ }
+ break;
+ case UnmapNotify:
+ if(evt.xunmap.window==w) {
+ DBG_PRINT( "event . UnmapNotify call 0x%X\n", evt.xunmap.window);
+ }
+ break;
+ case ClientMessage:
+ if (evt.xclient.window==w && evt.xclient.send_event==True && evt.xclient.data.l[0]==wm_delete_window) {
+ DBG_PRINT( "event . ClientMessage call 0x%X type 0x%X !!!\n", evt.xclient.window, evt.xclient.message_type);
+ (*env)->CallVoidMethod(env, obj, windowDestroyNotifyID);
+ // Called by Window.java: CloseWindow();
+ }
+ break;
+
+ }
+ }
+}
+
+#define MWM_FULLSCREEN 1
+
+#ifdef MWM_FULLSCREEN
+ #define MWM_HINTS_DECORATIONS (1L << 1)
+ #define PROP_MWM_HINTS_ELEMENTS 5
+#endif
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: setSize0
+ * Signature: (JIJIIIIIZ)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setSize0
+ (JNIEnv *env, jobject obj, jlong display, jint screen_index, jlong window, jint x, jint y, jint width, jint height, jint decorationToggle, jboolean isVisible)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ Window w = (Window)window;
+ Screen * scrn = ScreenOfDisplay(dpy, (int)screen_index);
+ Window parent = XRootWindowOfScreen(scrn);
+
+ DBG_PRINT( "setSize0 %dx%d, dec %d, vis %d\n", width, height, decorationToggle, isVisible);
+
+ XSync(dpy, False);
+
+ if(0!=decorationToggle) {
+#ifdef MWM_FULLSCREEN
+ unsigned long mwmhints[PROP_MWM_HINTS_ELEMENTS] = { 0, 0, 0, 0, 0 }; // flags, functions, decorations, input_mode, status
+ Atom prop;
+
+ mwmhints[0] = MWM_HINTS_DECORATIONS;
+ mwmhints[2] = (decorationToggle<0)?False:True;
+ prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", False );
+ XChangeProperty( dpy, w, prop, prop, 32, PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS);
+#else
+ XSetWindowAttributes xswa;
+ unsigned long attrMask=CWOverrideRedirect;
+
+ if(decorationToggle<0) {
+ /* undecorated */
+ xswa.override_redirect = True;
+ } else {
+ /* decorated */
+ xswa.override_redirect = False;
+ }
+ XChangeWindowAttributes(dpy, w, attrMask, &xswa);
+ XReparentWindow( dpy, w, parent, x, y );
+#endif
+ }
+ XSync(dpy, False);
+ DBG_PRINT( "setSize0 . XConfigureWindow\n");
+ XWindowChanges xwc;
+ xwc.width=width;
+ xwc.height=height;
+ XConfigureWindow(dpy, w, CWWidth|CWHeight, &xwc);
+ XReparentWindow( dpy, w, parent, x, y );
+
+ XSync(dpy, False);
+
+ /** if(isVisible==JNI_TRUE) {
+ XSetInputFocus(dpy, w, RevertToNone, CurrentTime);
+ } */
+
+ DBG_PRINT( "setSize0 . sizeChangedID call\n");
+ (*env)->CallVoidMethod(env, obj, sizeChangedID, (jint) width, (jint) height);
+}
+
+/*
+ * Class: com_sun_javafx_newt_x11_X11Window
+ * Method: setPosition0
+ * Signature: (JJII)V
+ */
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_setPosition0
+ (JNIEnv *env, jobject obj, jlong display, jlong window, jint x, jint y)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ Window w = (Window)window;
+
+ DBG_PRINT( "setPos0 . XConfigureWindow\n");
+ XWindowChanges xwc;
+ xwc.x=x;
+ xwc.y=y;
+ XConfigureWindow(dpy, w, CWX|CWY, &xwc);
+ XSync(dpy, False);
+
+ // (*env)->CallVoidMethod(env, obj, positionChangedID, (jint) width, (jint) height);
+}
+
diff --git a/test/Issue326Test1.java b/test/Issue326Test1.java
new file mode 100755
index 000000000..42b6ec0c7
--- /dev/null
+++ b/test/Issue326Test1.java
@@ -0,0 +1,91 @@
+import java.awt.Frame;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.Random;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCanvas;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.glu.GLU;
+
+import com.sun.opengl.util.Animator;
+import com.sun.opengl.util.j2d.TextRenderer;
+
+/**
+ * Demonstrates corruption with older versions of TextRenderer. Two
+ * problems: errors when punting from glyph-based renderer to
+ * string-by-string renderer, and failure of glyph-based renderer when
+ * backing store was NPOT using GL_ARB_texture_rectangle.
+ *
+ * @author emzic
+ */
+
+public class Issue326Test1 extends Frame implements GLEventListener {
+
+ int width, height;
+
+ public static void main(String[] args) {
+ new Issue326Test1();
+ }
+
+ GLCanvas canvas;
+ TextRenderer tr ;
+
+ public Issue326Test1() {
+ super("TextTest");
+ this.setSize(800, 800);
+ canvas = new GLCanvas();
+ canvas.addGLEventListener(this);
+ add(canvas);
+
+ setVisible(true);
+ addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ System.exit(0);
+ }
+ });
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ GL gl = drawable.getGL();
+ gl.glClearColor(0, 0, 0, 0);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+
+
+ gl.glMatrixMode(GL.GL_PROJECTION);
+ gl.glLoadIdentity();
+ //new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
+ gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
+ gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glLoadIdentity();
+
+ tr.beginRendering(800,800);
+ tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32);
+ tr.draw( "Hello World! This text is scrambled", 16, 16);
+ tr.endRendering();
+
+ }
+
+ public void init(GLAutoDrawable arg0) {
+ tr = new TextRenderer(new java.awt.Font("Verdana", java.awt.Font.PLAIN, 12), true, false, null, false);
+ tr.setColor(1, 1, 1 ,1);
+ }
+
+ public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
+ width = arg3;
+ height = arg4;
+ GL gl = arg0.getGL();
+ gl.glViewport(0, 0, width, height);
+ gl.glMatrixMode(GL.GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glOrtho(0.0, 800, 0.0, 200, -100.0, 100.0);
+ gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+ public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}
+}
diff --git a/test/Issue326Test2.java b/test/Issue326Test2.java
new file mode 100755
index 000000000..f2258c858
--- /dev/null
+++ b/test/Issue326Test2.java
@@ -0,0 +1,66 @@
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.event.*;
+import javax.media.opengl.*;
+import com.sun.opengl.util.j2d.*;
+
+/**
+ * Another test case demonstrating corruption with older version of
+ * TextRenderer when glyphs were too big for backing store. Font and
+ * text courtesy of Patrick Murris. Adapted from Issue326Test1.
+ */
+
+public class Issue326Test2 extends Frame implements GLEventListener {
+
+ int width, height;
+
+ public static void main(String[] args) {
+ new Issue326Test2();
+ }
+
+ GLCanvas canvas;
+ TextRenderer tr;
+
+ public Issue326Test2() {
+ super("");
+ this.setSize(800, 800);
+ canvas = new GLCanvas();
+ canvas.addGLEventListener(this);
+ add(canvas);
+
+ setVisible(true);
+ addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ System.exit(0);
+ }
+ });
+ }
+
+ public void display(GLAutoDrawable drawable) {
+ GL gl = drawable.getGL();
+ gl.glClearColor(0, 0, 0, 0);
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+
+ tr.beginRendering(drawable.getWidth(), drawable.getHeight());
+ tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80);
+ tr.draw("dans la haute Tin\u00e9e, sur un flanc du Parc du Mercantour.", 16, 16);
+ tr.endRendering();
+
+ }
+
+ public void init(GLAutoDrawable arg0) {
+ tr = new TextRenderer(Font.decode("Arial-BOLD-64"));
+ tr.setColor(1, 1, 1 ,1);
+ }
+
+ public void reshape(GLAutoDrawable arg0, int x, int y, int w, int h) {
+ GL gl = arg0.getGL();
+ gl.glMatrixMode(GL.GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glOrtho(0.0, w, 0.0, h, -1, 1);
+ gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glLoadIdentity();
+ }
+ public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}
+}
+
diff --git a/test/Issue344Base.java b/test/Issue344Base.java
new file mode 100755
index 000000000..548e3ec21
--- /dev/null
+++ b/test/Issue344Base.java
@@ -0,0 +1,107 @@
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.event.*;
+import java.awt.geom.*;
+
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+import com.sun.opengl.util.*;
+import com.sun.opengl.util.j2d.*;
+
+/** Test Code adapted from TextCube.java (in JOGL demos)
+ *
+ * @author spiraljetty
+ * @author kbr
+ */
+
+public abstract class Issue344Base implements GLEventListener
+{
+ GLU glu = new GLU();
+ TextRenderer renderer;
+
+ float textScaleFactor;
+ Font font;
+ boolean useMipMaps;
+
+ protected Issue344Base() {
+ font = new Font("default", Font.PLAIN, 200);
+ useMipMaps = true; //false
+ }
+
+ protected abstract String getText();
+
+ protected void run(String[] args) {
+ Frame frame = new Frame(getClass().getName());
+ frame.setLayout(new BorderLayout());
+
+ GLCanvas canvas = new GLCanvas();
+ canvas.addGLEventListener(this);
+ frame.add(canvas, BorderLayout.CENTER);
+
+ frame.setSize(512, 512);
+ frame.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {
+ new Thread(new Runnable() {
+ public void run() {
+ System.exit(0);
+ }
+ }).start();
+ }
+ });
+ frame.show();
+ }
+
+ public void init(GLAutoDrawable drawable)
+ {
+ GL gl = drawable.getGL();
+
+ gl.glEnable(GL.GL_DEPTH_TEST);
+
+ renderer = new TextRenderer(font, useMipMaps);
+
+ Rectangle2D bounds = renderer.getBounds(getText());
+ float w = (float) bounds.getWidth();
+ float h = (float) bounds.getHeight();
+ textScaleFactor = 2.0f / (w * 1.1f);
+ gl.setSwapInterval(0);
+ }
+
+ public void display(GLAutoDrawable drawable)
+ {
+ GL gl = drawable.getGL();
+ gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+ gl.glMatrixMode(GL.GL_MODELVIEW);
+ gl.glLoadIdentity();
+ glu.gluLookAt(0, 0, 10,
+ 0, 0, 0,
+ 0, 1, 0);
+
+ renderer.begin3DRendering();
+ Rectangle2D bounds = renderer.getBounds(getText());
+ float w = (float) bounds.getWidth();
+ float h = (float) bounds.getHeight();
+ renderer.draw3D(getText(),
+ w / -2.0f * textScaleFactor,
+ h / -2.0f * textScaleFactor,
+ 3f,
+ textScaleFactor);
+
+ renderer.end3DRendering();
+ }
+
+ public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
+ {
+ GL gl = drawable.getGL();
+ gl.glMatrixMode(GL.GL_PROJECTION);
+ gl.glLoadIdentity();
+ glu.gluPerspective(15, (float) width / (float) height, 5, 15);
+ }
+
+ public void displayChanged(GLAutoDrawable drawable, boolean modeChanged,
+ boolean deviceChanged)
+ {
+ }
+}
diff --git a/test/Issue344Test1.java b/test/Issue344Test1.java
new file mode 100755
index 000000000..c0608ed6e
--- /dev/null
+++ b/test/Issue344Test1.java
@@ -0,0 +1,10 @@
+public class Issue344Test1 extends Issue344Base {
+ protected String getText() {
+ // test 1 - weird artifacts appear with a large font & long string
+ return "abcdefghijklmnopqrstuvwxyz1234567890";
+ }
+
+ public static void main(String[] args) {
+ new Issue344Test1().run(args);
+ }
+}
diff --git a/test/Issue344Test2.java b/test/Issue344Test2.java
new file mode 100755
index 000000000..b0900438c
--- /dev/null
+++ b/test/Issue344Test2.java
@@ -0,0 +1,10 @@
+public class Issue344Test2 extends Issue344Base {
+ protected String getText() {
+ // test 2 - unicode hangs program with a large font & long string
+ return "\u201Cabcdefghijklmnopqrstuvwxyz\u201D";
+ }
+
+ public static void main(String[] args) {
+ new Issue344Test2().run(args);
+ }
+}
diff --git a/test/Issue344Test3.java b/test/Issue344Test3.java
new file mode 100755
index 000000000..381bf0a1c
--- /dev/null
+++ b/test/Issue344Test3.java
@@ -0,0 +1,10 @@
+public class Issue344Test3 extends Issue344Base {
+ protected String getText() {
+ // test 3 - slight rendering artifacts around very large letters
+ return "abcde";
+ }
+
+ public static void main(String[] args) {
+ new Issue344Test3().run(args);
+ }
+}
diff --git a/test/Issue344Test4.java b/test/Issue344Test4.java
new file mode 100755
index 000000000..1e077d2fd
--- /dev/null
+++ b/test/Issue344Test4.java
@@ -0,0 +1,10 @@
+public class Issue344Test4 extends Issue344Base {
+ protected String getText() {
+ // test 4 - unicode letter as second-to-last is rendered incorrectly
+ return "\u201CGreetings\u201D!";
+ }
+
+ public static void main(String[] args) {
+ new Issue344Test4().run(args);
+ }
+}